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
bluedragon
Novice


Joined: 01 Jul 2003
Posts: 30
Location: USA

PostPosted: Mon Oct 20, 2003 3:18 am   

nested trigger and variable not coming out right
 
i'm attempting to do a control trigger - so that i may choose people who i'll let them control my character.. which this works fine, here's the trigger:
pattern: ^(%w) tells you: DO THIS -- (*) --$
value:
#if (%ismember( %1, @trusted)) {
%2
#temp {%d~% ~[%d/%dh %d/%dm %d/%dv %d/%dg %dtl~] (*)} {reply %%1}
}


%d~% ~[%d/%dh %d/%dm %d/%dv %d/%dg %dtl~]
this is my prompt.

now, the point of this temporary trigger is to attempt to reply to the person that controled me and give them any info as to why something didn't work (such as a typo'd command or whatever).
and the first line of what the mud responded to will always end up being on the same line as the prompt.

but this doesn't reply with anything - it just does "reply" with no arguments..
so i tried:
#temp {%d~% ~[%d/%dh %d/%dm %d/%dv %d/%dg %dtl~] (*)} {reply %1}

which expanded the %1 from inside the trigger and ended up replying with the person's name


i've checked the help files, and it seems like the %%1 would be my answer, but it doesn't work - and i havn't found anything posted here about it - can anyone shed some light on this?

and i am using zmud 6.62.
Reply with quote
user0101
Apprentice


Joined: 01 Aug 2003
Posts: 100
Location: USA

PostPosted: Mon Oct 20, 2003 4:00 am   
 
pattern: ^(%w) tells you: DO THIS -- (*) --$
value:
#if (%ismember( %1, @trusted)) {
%2
#temp {%d~% ~[%d/%dh %d/%dm %d/%dv %d/%dg %dtl~] (*)} {#var botaction %%1;reply @botaction}
}

This worked for me when I tested it, try it out.
Reply with quote
bluedragon
Novice


Joined: 01 Jul 2003
Posts: 30
Location: USA

PostPosted: Mon Oct 20, 2003 4:16 pm   
 
when i do that, it does this:
Variable: botaction
reply
Reply with quote
user0101
Apprentice


Joined: 01 Aug 2003
Posts: 100
Location: USA

PostPosted: Mon Oct 20, 2003 8:13 pm   
 
Can you give a sample of the output? I envisioned something like this:

[prompt stuff here] cast heal targetname

If the variable botaction contains nothing at all, I'm guessing the output looks more like this:

[prompt stuff here]
cast heal targetname

If the action that they are trying to get done is on the second line, try this:

pattern: ^(%w) tells you: DO THIS -- (*) --$
value:
#if (%ismember( %1, @trusted)) {
%2
#temp {%d~% ~[%d/%dh %d/%dm %d/%dv %d/%dg %dtl~]$(*)} {#var botaction %%1;reply @botaction}
}

I ran a test using the prompt you gave, with the bot action on the same line as the prompt and it captured the action into the variable and replied back successfully so I am curious why it is not working for you.
Reply with quote
bluedragon
Novice


Joined: 01 Jul 2003
Posts: 30
Location: USA

PostPosted: Mon Oct 20, 2003 9:44 pm   
 
as i said, the response the mud gives is always on the same line as the prompt - here's exact duplication of what's happening when i use the trigger you pasted, the commands sent to the mud are blue

Bluedragon tells you: DO THIS -- scribe 'heal' --
scribe 'heal'

(*) 45% [828/931h 2492/2577m 755/755v 1173734/13000000g 266395272tl] You hold up a scroll and bind it with magical enchantments.
Variable: botaction
reply


(*) 45% [828/931h 2412/2577m 755/755v 1173734/13000000g 266395272tl] What is your reply?

---------------

there must be some other setting in another area maybe?
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Mon Oct 20, 2003 10:47 pm   
 
You need another % because you used #IF.

Value:
#IF (%ismember( %1, @trusted)) {
%2
#TEMP {%d~% ~[%d/%dh %d/%dm %d/%dv %d/%dg %dtl~] (*)} {reply %%%1}
}
Reply with quote
bluedragon
Novice


Joined: 01 Jul 2003
Posts: 30
Location: USA

PostPosted: Tue Oct 21, 2003 12:53 am   
 
thank you!

that makes sense. i've seen you answer a lot of questions here lightbulb, thanks for your input.
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