|
Tenchi_Masaki Newbie
Joined: 07 Nov 2002 Posts: 4 Location: USA
|
Posted: Sat Nov 16, 2002 5:13 am
If Statements |
I have a problem, i cant seem to figure out this problem, im fairly new to using Zmuds functions. I run a bot on a mud, and it has a feature to arcane. But i don't want it to arcane whe it Sees someone else arcaned the same thing.
Command: global
Mud output: The following global spells are in effect:
Mud output: [sol] Stream of Life (Thanks to (%w)) (XX ticks)
Or it can be this
Mud output: [pes] Pestilence ((%w) is immune) (XX ticks)
XX = any # of ticks
I want to make it so if i have a Trigger check Global, i want it to Respond in a Sayooc that Someone has already arcaned that, and if it isn't there, it will arcane it.
any help would be Appreciated,
Tenchi
Ive tried this
#IF %pos( "(Thanks to (%w))", %line2) {sayooc Im sorry but %1 has already arcaned SoL} {arcane sol}
and also this
#IF (Thanks to %w) {sayooc Im sorry but %1 has already arcaned SoL} {arcane sol}
Im so very lost,
Tenchi |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Sat Nov 16, 2002 8:11 am |
We don't really have enough information to go on. I can sort of kludge it, but the things I am missing make it messy.
#ALIAS glob {global;#TEMP {^The following global spells are in effect:$} {#T+ CapGlobals;GotGlobs=""}}
#CLASS CapGlobals
#VAR GotGlobs {} {}
#VAR GlobLine {}
#TR {^&%*{GlobLine}$} {GlobLine=%replace(%expand(@GlobLine,1),"[","");GlobLine=%replace(%expand(@GlobLine,1),"(",%char(254));#IF (@GlobLine=%null) {#NOOP I assume a blank line will indicate end of global list;Arcanix;#T- CapGlobals} {#ADDKEY GotGlobs {%left(@GlobLine,3)} {%word(%word(@GlobLine,2,%char(254)),1,")")}}}
#ALIAS Arcanix {GlobLine=%db(@GotGlobs,"sol");#IF (@GlobLine!=%null) {sayooc Im sorry but %word(%db(@GotGlobs,"sol"),3) has already arcaned SoL} {arcane sol}}
#CLASS 0
Obviously Arcanix could be designed to handle a much wider variety of globals, and of course I did nothing with the tick information other then threw it away. The problem with what your asking is that your want to trigger on something not being there. That requires that everything that is there be captured in some fashion, then a lack of presence can be checked for.
Think of it as walking in a room. In the case of a trigger you are looking for your best friend and merely need to look at each face till you see his. In the case of what you want to do here you step in the room and are looking for a guy named Billy, Buddy or Mac and happens to be wearing a blue shirt; obviously you have to talk to all those males wearing blue shirts till you find one that matches or have run out of possible people. I hope that clarifies the problem for you. |
|
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|