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
milty111
Beginner


Joined: 16 Jan 2017
Posts: 19
Location: Oregon

PostPosted: Mon Feb 13, 2017 4:00 pm   

variables question
 
Greetings!
I do foraging and depending on what I find, I'd like to enter that in a variable to be used for other commands.

Triggered on "You have found some" next word would be entered into a variable named foraged

Any help is greatly appreciated.
Thanks,
Mike
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4715
Location: Pensacola, FL, USA

PostPosted: Tue Feb 14, 2017 2:03 pm   
 
#TR {You have found some (%w)} {foraged=%1}
_________________
Discord: Shalimarwildcat
Reply with quote
milty111
Beginner


Joined: 16 Jan 2017
Posts: 19
Location: Oregon

PostPosted: Tue Feb 14, 2017 2:54 pm   
 
Thank you much! You guys are awesome!
Reply with quote
milty111
Beginner


Joined: 16 Jan 2017
Posts: 19
Location: Oregon

PostPosted: Tue Feb 14, 2017 3:06 pm   
 
shalimar wrote:
#TR {You have found some (%w)} {foraged=%1}



You guys are still awesome, but I'm having a problem.
Instead of using the #TR, I manually created the trigger in a particular CLASS
{You have found some (%w)} {foraged=%1}

Then I have a trigger on "You are done foraging" with the following commands

get all @foraged
put all @foraged in back

This results in trying to get %w which for some reason seems nil and the mud doesn't try to "get" anything.
If I replace @foraged with %1 it works but in the sense that %1 is just ignored and my trigger is attempting to get all that's in the room.
So I am kind of confused and wondering what I did wrong.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4715
Location: Pensacola, FL, USA

PostPosted: Tue Feb 14, 2017 3:53 pm   
 
in the second trigger, unless you have something in the pattern surrounded bu parenthesis %1 will have no value, so that looks like expected behavior.

As for the first trigger... try deleting what you have and entering my #TR on the command line, instead of manually from the settings editor.
You can always drag it into a given class folder later.
_________________
Discord: Shalimarwildcat
Reply with quote
milty111
Beginner


Joined: 16 Jan 2017
Posts: 19
Location: Oregon

PostPosted: Tue Feb 14, 2017 4:09 pm   
 
Worked like a charm! Thanks again!
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