Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Mordann
Beginner


Joined: 30 Mar 2003
Posts: 13
Location: USA

PostPosted: Sun Mar 30, 2003 8:49 am   

Could use a little help with auto-loot script...
 
HI, I'm really new to zmud (like I've had the software for 3 days or so now) and I'm trying to figure out how all these aliases and variables and triggers and such work and I've gotten most everything I've tried to work except for my auto-loot trigger.

Now, I play in SlothMUD III and there, when you kill a mob it reports a string that basically amounts to "<long mob name> is dead! R.I.P." where <long mob name> is the FULL name of the creature killed. Now what I'm trying to do is get zmud to scan <long mob name> for a pattern equal to a variable. The value of teh variable should always be equal to PART of the <long mob name> but not all of it.

The script I tried and failed with was as follows...

#TRIGGER {(*) is dead!} {%if( "[%1]"="@v1", loot, noloot)}

where loot and noloot are aliases and v1 is the name of the variable for <current target>

I thought that this would make it so that when the mud reported the creatures death that it would automatically save the <long mob name> value to a parameter, then it would search the full range of all characters in %1 for the pattern of v1 and if it finds it then it loots and if it doesn't than it doesn't loot (mainly I do this because sometimes there is report of a death that was not my kill and I don't wish to loot anyone elses efforts from under their noses).

Now that script failed and I'm not sure why unless I'm missing or misunderstanding something in the trigger script construction and structure itself, but the syntax is correct at least.

If anyone can help me out with commetns, suggestions of things to try, a clear defined explanation of where I screwed up, etc... I'd appreciate any help offered :).

Thanks,
Mordann
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Mar 30, 2003 4:42 pm   
 
Since %1 is never equal to @v1, except when the monster's long name is just the keyword you're using in @v1, you will almost always get "noloot". Instead, your IF expression should check whether @v1 exists anywhere within the string.

#TR {(*) is dead!} {#IF (%pos( @v1, "%1")) {loot} {noloot}}

Using wildcards to match the excess words in the long mob name might also work.
#TR {@v1* is dead! R.I.P} {loot}

LightBulb
Advanced Member
Reply with quote
Mordann
Beginner


Joined: 30 Mar 2003
Posts: 13
Location: USA

PostPosted: Sun Mar 30, 2003 7:49 pm   
 
Thanks much LightBulb I'll play with it some and see how it goes, but I think that using wild cards might be best actually so we'll do that one first :). Thanks for the help :).

Mordann
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
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

© 2009 Zugg Software. Hosted by Wolfpaw.net