Script:
if runXP == nil then
runXP = 0
end
if runKills == nil then
runKills = 0
end
xpStopWatch = createStopWatch()
Trigger:
You receive (.*) experience points.
runXP = runXP + matches[2]
runKills = runKills + 1
Aliases:
Start it -
startStopWatch(xpStopWatch)
runXp = 0
runKills = 0
Report -
send("em reports: " .. runXP .. " xp received over " .. runKills .. " mobs, taking " .. getStopWatchTime(xpStopWatch) / 60 .. " minutes for an average of " .. runXP / runKills .. " XP per mob at a rate of " .. runXP / (getStopWatchTime(xpStopWatch) / 60) .. " XP per minute.")
-------------
My question is why isn't it working at all, I have tried to find what went wrong. Anyone can figure it out, would appreciate help here. Thanks
Kill counter - help needed
Re: Kill counter - help needed
Couple of things, really. First of all, rather than those initial if statements, try something like:
Where you have: is causing a problem. Because you are matching this against (.*), you are trying to math a string to a number. The error console will be telling you this
Simply change to:
Try with those changes. I suspect that might resolve your issue.
Code: Select all
runXP = runXP or 0
Code: Select all
runXP = runXP + matches[2]
Simply change to:
Code: Select all
runXP = runXP + tonumber(matches[2])
-
- Posts: 154
- Joined: Sun Jul 29, 2012 6:50 am
Re: Kill counter - help needed
Made the changes, wont work at all, could I import files so u can take a look at it? Let me know.
-
- Posts: 154
- Joined: Sun Jul 29, 2012 6:50 am
Re: Kill counter - help needed
Still getting this after changes:
Mocci reports: 0 xp received over 0 mobs, taking 0.27493333333333 minutes for an
average of nan XP per mob at a rate of 0 XP per minute.
Mocci reports: 0 xp received over 0 mobs, taking 0.27493333333333 minutes for an
average of nan XP per mob at a rate of 0 XP per minute.
-
- Posts: 154
- Joined: Sun Jul 29, 2012 6:50 am
Re: Kill counter - help needed
Aye, took a look. On your trigger, rather than using a 'substring' type, try setting it to 'perl regex'
Let me know how that works out
Let me know how that works out
-
- Posts: 154
- Joined: Sun Jul 29, 2012 6:50 am
Re: Kill counter - help needed
it is now working!
Thanks so much, and am wondering what alias or script shall i add to set reset the counter - i suspect alias.
Thanks again!
Thanks so much, and am wondering what alias or script shall i add to set reset the counter - i suspect alias.
Thanks again!
-
- Posts: 154
- Joined: Sun Jul 29, 2012 6:50 am
Re: Kill counter - help needed
Wondering how to fix the decimals, need it to be round off.
the report is 186014 XP of 286 monsters which took 96.433333333333
minutes with an average of 650.3986013986 XP per monster at a rate of
1928.9388178362 XP per minute.
Thanks
the report is 186014 XP of 286 monsters which took 96.433333333333
minutes with an average of 650.3986013986 XP per monster at a rate of
1928.9388178362 XP per minute.
Thanks
Re: Kill counter - help needed
math.floor() should help with that.