How can I trigger a command when something is NOT present?

Posted by Rjak on Wed 07 Jul 2004 12:13 AM — 7 posts, 23,375 views.

Romania #0
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
USA #1
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.
Amended on Wed 07 Jul 2004 01:08 AM by Flannel
Romania #2
You lost me. Gimme an example. I know a lot about many things but i know nothing about programming/coding.
Australia Forum Administrator #3
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.
Amended on Wed 07 Jul 2004 03:40 AM by Nick Gammon
Romania #4
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
Australia Forum Administrator #5
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.
Amended on Wed 07 Jul 2004 03:48 AM by Nick Gammon
Romania #6
thanks Nick. I understand the ideea.
R.