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
➜ General
➜ hopelessly lost
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Littlebear
USA (2 posts) Bio
|
Date
| Wed 24 Oct 2007 11:38 AM (UTC) |
Message
| I have searched and haven't found anything that resembles my problem so i will try to explain what i am trying to do, heh.
The mud i play doesn't say "You gained 250 exp" when you kill a mob, what i am trying to do, is have the xp stored in a variable then when i kill something, makes the xp into another variable, subtracts the first one and says "you gained x exp" then stores the second one as the first.
the command to get the total exp is "xp" and the line is:
Your current experience points: xxxx
i hope that sounds rational, not good at explaining things too well. | Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #1 on Wed 24 Oct 2007 09:16 PM (UTC) |
Message
| What does it say when you kill a mob, exactly?
I would make a trigger on that message, eg.
Match: You have killed *
That trigger would send the "xp" command to the MUD.
Then when you get the message:
Your current experience points: xxxx
You have a trigger, eg.
Match: Your current experience points: *
This trigger has a script that subtracts that from the previous xp value, and displays the difference. It then saves this as the new value. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Littlebear
USA (2 posts) Bio
|
Date
| Reply #2 on Wed 24 Oct 2007 10:27 PM (UTC) |
Message
| I follow you up until the subtracting part, i don't know how to make it subtract and store the new number.
when something dies the match is:
* dies in fits of twitching agony.
| Top |
|
Posted by
| Mccane
(28 posts) Bio
|
Date
| Reply #3 on Tue 27 Nov 2007 09:28 AM (UTC) |
Message
| Try this:
<triggers>
<trigger
enabled="y"
match="* dies in fits of twitching agony."
send_to="12"
sequence="100"
>
<send>EnableTrigger("xpgain", true)
Execute("exp")</send>
</trigger>
<trigger
match="Your current experience points: *"
name="xpgain"
omit_from_output="y"
send_to="14"
sequence="99"
>
<send>Note ("You have gained ", tostring(tonumber(%1) - tonumber(GetVariable("XP"))), " XP.")
SetVariable("XP", "%1")
EnableTrigger("xpgain", false)</send>
</trigger>
<trigger
enabled="y"
match="Your current experience points: *"
name="xp_set"
send_to="12"
sequence="100"
>
<send>SetVariable("XP", %1)</send>
</trigger>
</triggers>
| Top |
|
Posted by
| Mccane
(28 posts) Bio
|
Date
| Reply #4 on Tue 27 Nov 2007 09:30 AM (UTC) |
Message
| Oh, also make sure scripting is enabled and set to Lua. If you don't normally use Lua, you can just use the plugin wizard to export it as a plugin. | 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.
14,770 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top