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
➜ Writing an IF routine (?) to do a certain action once a requirement is met
Writing an IF routine (?) to do a certain action once a requirement is met
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Natasi
(79 posts) Bio
|
Date
| Fri 12 Nov 2004 06:36 PM (UTC) |
Message
| When using a skill to peer at someones mana I would like the cleint to see when they are under half mana and if so perform a certain action. I figured this would have to be written through an IF routine, but unsure as to do the this with %1 = type stuff.
This is how it looks when I contemplate someone:
Midget's mana stands at 3142/3142.
I want it set so that if say it read:
Midget's mana stands at 1245/3142.
then it would send a command to slap Midget...it has to be set also so I can use it against others, so the mana total will never be the same. Thanks for any help guys | Top |
|
Posted by
| Flannel
USA (1,230 posts) Bio
|
Date
| Reply #1 on Sat 13 Nov 2004 12:28 AM (UTC) |
Message
|
<triggers>
<trigger
enabled="y"
expand_variables="y"
ignore_case="y"
match="@target's mana stands at */*."
send_to="12"
sequence="100"
>
<send>if (%1*2 <= %2) then
send "slap @target"
end if</send>
</trigger>
</triggers>
<variables>
<variable name="target">midget</variable>
</variables>
Copy between <triggers> and </triggers> and then paste in the trigger window, and do the same with <variables>.
You set the variable 'target' with whatever the name of the thing was (midget in this case) WITHOUT the apostrophe. |
~Flannel
Messiah of Rose
Eternity's Trials.
Clones are people two. | Top |
|
Posted by
| Flannel
USA (1,230 posts) Bio
|
Date
| Reply #2 on Sat 13 Nov 2004 12:34 AM (UTC) |
Message
| You can use this alias to set that other variable as well.
<aliases>
<alias
match="target *"
enabled="y"
echo_alias="y"
variable="target"
send_to="9"
ignore_case="y"
sequence="100"
>
<send>%1</send>
</alias>
</aliases>
Obviously, you can alter the match text to suit your needs, as well as changing the variable name (you'll have to do it to the trigger, and the alias, TWO locations in the trigger, and then one in the alias's "variable" field.
The trigger is in the match text, as well as the send field. |
~Flannel
Messiah of Rose
Eternity's Trials.
Clones are people two. | Top |
|
Posted by
| Natasi
(79 posts) Bio
|
Date
| Reply #3 on Sat 13 Nov 2004 01:50 AM (UTC) |
Message
| works perfectly! Thanks for the help | 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.
12,984 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top