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
➜ How can I trigger a command when something is NOT present?
How can I trigger a command when something is NOT present?
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Rjak
Romania (42 posts) Bio
|
Date
| Wed 07 Jul 2004 12:13 AM (UTC) |
Message
| The title of the post is pretty much explains my problem.
Let's say I type my score, and should be a something like "you have a minshield in place". But when the mindshield wears off, i have no notification to warn me, i can see that only if i type score. So how can i do something - i have no ideea what - to read my score and when that line is missing, to send the command mindshield?
It is even possible?
Thank you,
R | Top |
|
Posted by
| Flannel
USA (1,230 posts) Bio
|
Date
| Reply #1 on Wed 07 Jul 2004 01:07 AM (UTC) Amended on Wed 07 Jul 2004 01:08 AM (UTC) by Flannel
|
Message
| An alias for when you type score, turns a variable off (one per spell, affliction, whatever), basically sets it as 0, or "off" or whatever. Then you have a trigger for each thing, which will set the variable back to an "on" state.
the initial alias also turns on a final trigger (prompt? or something "non score") once that final trigger triggers, it checks to see if the variable is on, or off.
Basically, you assume its not there, if it is there, you change that assumption, then afterwards you check everything for its current status.
I suppose you could also do something with multiline triggers, but that has the potential to get complicated quickly if youre looking for more than one thing. Then again, this way isnt exactly simple either. |
~Flannel
Messiah of Rose
Eternity's Trials.
Clones are people two. | Top |
|
Posted by
| Rjak
Romania (42 posts) Bio
|
Date
| Reply #2 on Wed 07 Jul 2004 01:23 AM (UTC) |
Message
| You lost me. Gimme an example. I know a lot about many things but i know nothing about programming/coding. | Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #3 on Wed 07 Jul 2004 01:51 AM (UTC) Amended on Wed 07 Jul 2004 03:40 AM (UTC) by Nick Gammon
|
Message
| Paste an example of the score both with and without the mindshield. Then it is easier to advise.
What Flannel is suggesting is something like this:
* When you type "score" clear a variable ("mindshield_found")
* When the score appears have a trigger check for mindshield and set the variable if found
* If, afterwards, the variable is still not set you know that you do not have the mindshield
However depending on what the score looks like it might be possible to do it with a trigger or two. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Rjak
Romania (42 posts) Bio
|
Date
| Reply #4 on Wed 07 Jul 2004 02:34 AM (UTC) |
Message
| Name: Rjak the Holy One
Ethnicity: Asian Capitalist of: The Zone.
[30] Savage Age: 32 years 16 months Playing: 40 days 21 hours
You are of the Rednek. (Rednek sublevel: 17)
Levels: [Fight 30] [Mental 30] [Comm 28] [Misc 28]
Exp: [ 54190248] [ 35919242] [ 2301231] [ 2990513]
Need to level: [-33190248] [-14919242] [ 11698769] [ 11009487]
Points: Curr Max Pedometer: 319709
- Fight 3230 3230 Learning sess: 8
- Body 258 258 Kills: 9956
- Energy 1664 2683 Completed jobs: 1773
- Stamina 2577 2577 Cash: $ 324026
Concentration: 21
You have a mindshield in place.
You are hardening your body.
You are boosting your mental powers.
You are jamming mental frequencies.
Professional titles:
Assassin Wrestler Priest Fanatic Hunter Infiltrator Burglar
Psionist Ninja Sailor Ranger Samurai Operator Marksman
Shaman Technician Doctor Chemist Fencer Biomedic
You're very happy lately.
You are heavily armored. You will stay fairly cool on a hot day.
You are standing.
You have a glowing aura.
You are sensitive to the presence of cloaked things.
You can see in the dark.
Your kinetic powers are enhanced.
Points: Curr Max Pedometer: 319709
- Fight 3230 3230 Learning sess: 8
- Body 258 258 Kills: 9956
- Energy 2355 2730 Completed jobs: 1773
- Stamina 2577 2577 Cash: $ 324026
You are boosting your mental powers.
Professional titles:
Assassin Wrestler Priest Fanatic Hunter Infiltrator Burglar
Psionist Ninja Sailor Ranger Samurai Operator Marksman
Shaman Technician Doctor Chemist Fencer Biomedic
You're very happy lately.
You feel pretty buff in that armor. You will stay fairly cool on a hot day.
You are standing.
You are sensitive to the presence of cloaked things.
You can see in the dark.
with and without boostings | Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #5 on Wed 07 Jul 2004 03:46 AM (UTC) Amended on Wed 07 Jul 2004 03:48 AM (UTC) by Nick Gammon
|
Message
| OK, I would pick two lines that definitely *will* be there and trigger on them. eg.
Clear variable
match: Points: Curr Max Pedometer: *
send: no
send to: variable
variable name: mindshield_found
So, assuming you always get the line "Curr Max Pedometer: (something)" that will set the "mindshield_found" variable to "no".
Detect mindshield
match: You have a mindshield in place.
send: yes
send to: variable
variable name: mindshield_found
This will set the variable to "yes" if it finds the mindshield.
Later on ...
match: Professional titles:
send:
if world.GetVariable ("mindshield_found") = "no" then
world.Send "mindshield"
world.SetVariable "mindshield_found", "yes"
end if
send to: script
This small piece of script tests the mindshield variable, and if still "no" sends the mindshield command. It then sets the variable to "yes" to indicate you now have a mindshield.
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Rjak
Romania (42 posts) Bio
|
Date
| Reply #6 on Mon 12 Jul 2004 12:29 PM (UTC) |
Message
| thanks Nick. I understand the ideea.
R. | 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.
16,431 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top