[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  VBscript
. . -> [Subject]  XP Counter

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: XP Counter
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please)
Maximum of 6000 characters. Text only please, no HTML.
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Posted by Nick Gammon   Australia  (18,772 posts)  [Biography] bio   Forum Administrator
Date Sun 26 Aug 2001 10:09 PM (UTC)  quote  ]

Amended on Sun 26 Aug 2001 10:10 PM (UTC) by Nick Gammon

Message
Sure, you have the following options:


  • yyyy - Year
  • q - Quarter
  • m - Month
  • y - Day of year
  • d - Day
  • w - Weekday
  • ww - Week of year
  • h - Hour
  • n - Minute
  • s - Second

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Simon   Sweden  (39 posts)  [Biography] bio
Date Sun 26 Aug 2001 10:56 AM (UTC)  quote  ]
Message
hmm ok... I worked a bit on it and got most of it working.. just one problem, is there any way to get a different formatting on the date diff than just the one that shows the amount of seconds that has passed? (using the "s" in it)

Thanx for the help :)

/Simon

- "Where do you live, Simon?"
- "I live in the sick and wounded, doc."
Session 9
[Go to top] top

Posted by Nick Gammon   Australia  (18,772 posts)  [Biography] bio   Forum Administrator
Date Sun 19 Aug 2001 06:58 AM (UTC)  quote  ]
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
[Go to top] top

Posted by Simon   Sweden  (39 posts)  [Biography] bio
Date Sat 18 Aug 2001 07:38 AM (UTC)  quote  ]
Message
Hey, I am working on an xp counter but I'm not really getting it working :(
This is what I am triggering on:

You have 496,903,292 total xp, with 6,786,388 to next level and 24,325,293 to level.

I set those to 3 different variables, TotXp, XpTNL and XPToSp.

Then I want it to count over how much xp I made the last hour, and how much I've made the last 10 hours. So I figure I'd have to add some variables and a timer! I've never worked with timers before so I have no idea how to do that :(

- "Where do you live, Simon?"
- "I live in the sick and wounded, doc."
Session 9
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


2,304 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]