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
Alvisar
Newbie


Joined: 04 Jan 2004
Posts: 3

PostPosted: Sun Jul 18, 2004 5:32 pm   

Trigger Help! Should be simple, but I can't figure it out.
 
I am trying to create a trigger, or if anyone else has a suggestion another way of accomplishing the following.

I want to be able to pick up all ions and convert them. Here is a sample of the lines from the game that I am playing:

On the ground lies:
A Broken-Weapon, A Magnum-staff, A Skull,

To pick up an item I would type the folling commands (each is a seperate line)

get br
con br

-0r-

get magn
con mang

So if I manually typed in the commands the output would look like this:

On the ground lies:
A Broken-Weapon, A Magnum-staff, A Skull, A Skull (1).
>get br (zmud input line)
get br
***
You pick up the Broken-Weapon.
>con br (zmud input line)
con br
***
The Broken-Weapon vanishes with a flash!
You convert the Broken-Weapon into 100 ions.
>get mag
get mag
***
You pick up the Magnum-staff.
>con mag
con mag
***
The Magnum-staff vanishes with a flash!
You convert the Magnum-staff into 2500 ions.
>



Each item must be picked up individually and there is not a command in the game to "get all".
The problem I have is that every item in the game is described as "A soemthing" but when you pick it up you don't use the letter "A" just the first few letters of the item name.

I have searched the forums and read the help in the program...just can't figure it out!!!

Thanks!
_________________
Reply with quote
Charbal
GURU


Joined: 15 Jun 2001
Posts: 654
Location: USA

PostPosted: Sun Jul 18, 2004 6:58 pm   RE:Trigger Help! Should be simple, but I can't figure it out
 
Here's a quick script that should parse that MUD output and send the appropriate get and con commands for each item by using the first 5 letters of the name.

#CLASS {ItemConvert}
#FUNC getIdentifier {%left(%right("%1", %pos(" ", "%1")), 5)}
#TRIGGER {On the ground lies:} {#NOOP}
#COND {^(*)$} {#LOOP 1,%numwords("%1", ", ") {get @getIdentifier(%word("%1", %i, ", "));con @getIdentifier(%word("%1", %i, ", "))}} {within|param=1}
#CLASS 0
_________________
- Charbal
Reply with quote
Alvisar
Newbie


Joined: 04 Jan 2004
Posts: 3

PostPosted: Sun Jul 18, 2004 7:28 pm   
 
Thanks! It worked perfectly!
_________________
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