Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ Tips and tricks ➜ XP Calculator and Spell Timer

XP Calculator and Spell Timer

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Aheram   (23 posts)  Bio
Date Mon 27 Dec 2004 03:35 PM (UTC)
Message
I have been searching vainly for something that will calculate how much XP I have gained for a kill. I could not figure out what commands/scripting code to use.

Basically, I will manually type an alias "startxp" that will first enable a COUNTXP1 trigger and then world.send "xp" to the MUD.

CountXP1 trigger is:

^Spare XP: (numbers I want remembered!) (white space!) Experience: (random gibberish!)

Once this matches, I want the client to remember the first wildcard (I will call it XP1) and then turn on a second trigger, called CountXP2, and then turn itself off.

CountXP2 trigger is:

^(You|> You|> > You) killed (.*)\.$

CountXP trigger will world.send "xp" to the MUD, turn on a trigger called CountXP3, and then turn itself off.

CountXP3 trigger is:

^Spare XP: (numbers I want remembered, XP2) (white space!) Experience: (random gibberish!)

Once this matches, the client will take the first wildcard (XP2) and subtract XP1 from it. And then I want the results of XP2-XP1 to be sent into a variable called ExperienceFromKill. It will then do: ansi & "You received @ExperienceFromKill points from @Target." Then finally, it will turn itself off.

So, I know how to do everything else but what to write to calculate the damage.
Top

Posted by Aheram   (23 posts)  Bio
Date Reply #1 on Mon 27 Dec 2004 04:06 PM (UTC)
Message
I just realized I forgot to add questions about Spell Timer in it, too.

Basically, I am planning two different groups of triggers or aliases that related to duration of spells. One will calculate how long a spell lasted (to be able to find the duration) and another will tell me how long the spell will last.

Example:

Alias: starttimer

...will turn on this trigger called StartTimer and turn off a group of triggers/variables called "Spell-Duration."

StartTimer is:
^(You|> You|> > You) are surrounded by a burning shield of fire\.$

Once it matches, it will begin counting seconds. It will also enable triggers called "StopTimer(Fireshield)". It will then turns itself off.

StopTimer(Fireshield) is:

^(The|> The|> > The) fireshield ebbs away\.$

Once that matches, it will stop counting. It will then send the seconds/minutes into a variable called FireshieldDuration. It will then turn itself off.


Spell-Duration Triggers/Variables/Whatever

Once the duration is calculated, I can turn off the triggers above and start using these.

When this trigger is matched:
^(You|> You|> > You) are surrounded by a burning shield of fire\.$

...a timer will start counting that will be subtracted from @FireshieldDuration. That way, it will tell me how much time I have left before the spell ends. It will also turn on the trigger FireshieldEnd.

When I type: aff, it will send these to script.

AnsiNote ANSI (37) & "Fireshield: @SpellFireshield\. Time left: (Results of @FireshieldDuration - Timer count)."


FireshieldEnd is:

^(The|> The|> > The) fireshield ebbs away\.$

Which will reset/stop the timer.
Top

Posted by Aheram   (23 posts)  Bio
Date Reply #2 on Mon 27 Dec 2004 05:22 PM (UTC)
Message
Will this work?

setvariable "ExperienceFromKill", Cint(GetVariable("XP1"))-%1 ?

I am going to try. Haha.
Top

Posted by Flannel   USA  (1,230 posts)  Bio
Date Reply #3 on Mon 27 Dec 2004 08:06 PM (UTC)
Message
To add, subtract, multiply, and divide (and other math functions) you just use the script language's. So usually thats simply '+','-','*', and '/'.

Yes, your subtraction will work.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
Top

Posted by Aheram   (23 posts)  Bio
Date Reply #4 on Mon 27 Dec 2004 08:11 PM (UTC)
Message
I was having problems with "overflow." I looked at some other posts and apparently I had to use CLng. That one worked.
Top

Posted by Flannel   USA  (1,230 posts)  Bio
Date Reply #5 on Mon 27 Dec 2004 08:11 PM (UTC)
Message
As for the timer, there's a couple of threads about different aspects of it.

http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=3362

http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=4793

Are just a couple, but they should help.

Edit: I see you've already found one of those.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
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.


17,880 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.