Capturing Equilibrium/Balance

Posted by Natasi on Mon 02 May 2005 02:37 PM — 4 posts, 20,884 views.

#0
I'm trying to capture if I have equilibrium and/or balance and have it kept track of in variables, so I can set certain actions to go off if I currently have both balance and equilibrium. The prompt looks like this:

3088h, 5056m, 3334e, 10p exk-

Now, I need something that works like this, but working,

Trigger:
^(.*?)h\, (.*?)m\, (.*?)e\, (.*?)p (.*?)\-$

Send:
if (%5 = e) then
world.setvariable "equilibrium", "1"
if (%5 = x) then
world.setvariable "balance", "1"
else
world.setvariable "equilibrium", "0"
world.setvariable "balance", "0"
end if
end if
USA #1
Is it 'not working' because it doesn't match? or does the script not fire at all? or does it just never step into any of the logic?

Assuming the last, it is because your wildcard (%5) can't simply equal 'e' AND 'x'. Even if it does equal just 'e' sometimes.
That wildcard has something in it like (from your example) "exk" so you'll need to use a function (something like InStr, something that ultimately checks for existance) and then check against the returned value.
#2
Ok, I tried this to see what was happening:

if (%5 = e) then
world.note "you have eq"
if (%5 = x) then
world.note "you have balance"
else
world.note "you have nothing"
end if
end if


and even off balance or off eq (no e or x)I would still see the
"you have eq"
"you have balance"
notes.

how would I wrtie the IntStr for this...never emssed with those scripts yet
Russia #3


if instr("%5", "e") then
   world.setvariable "equilibrium", "1"
else
   world.setvariable "equilibrium", "0"
end if
if instr("%5", "x") then
   world.setvariable "balance", "1"
else
   world.setvariable "balance", "0"
end if


I don't even know how your script is working at all, as it is. It's probably just making up global variables as it goes, seeing that you don't have the strings you are testing quoted.