| Message |
The first part is pretty easy, working out the current amounts and putting into a variable, something like this:
Trigger: You have * total xp, with * to next level and * to level.
Label: Experience
Script: Experience
The script below would collect that data, strip the commas from the numbers, convert into doubles (which will hold a large number) and put into variables.
However knowing how many you go "in the last hour" is a bit trickier. I don't think a timer would help, however you could investigate using the "Now" function to find the current time, and the "DateDiff" function to find how many hours have elapsed.
I don't know how to easily do all that without maintaining a list of how many XP you had, say, every hour, and comparing your current one to the one in that list.
I hope that gives you something to go on with ...
Sub Experience (strTriggerName, trig_line, arrWildCards)
dim TotXp, XpTNL, XPToSp
' get rid of commas and convert to a double (floating point number)
TotXp = CDbl (world.Replace (arrWildcards (1), ",", "", true))
XpTNL = CDbl (world.Replace (arrWildcards (2), ",", "", true))
XPToSp = CDbl (world.Replace (arrWildcards (3), ",", "", true))
world.SetVariable "TotXp", TotXp
world.SetVariable "XpTNL", XpTNL
world.SetVariable "XPToSp", XPToSp
End Sub
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|