|
bluedragon Novice
Joined: 01 Jul 2003 Posts: 30 Location: USA
|
Posted: 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. |
|
|
|
user0101 Apprentice
Joined: 01 Aug 2003 Posts: 100 Location: USA
|
Posted: 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. |
|
|
|
bluedragon Novice
Joined: 01 Jul 2003 Posts: 30 Location: USA
|
Posted: Mon Oct 20, 2003 4:16 pm |
when i do that, it does this:
Variable: botaction
reply |
|
|
|
user0101 Apprentice
Joined: 01 Aug 2003 Posts: 100 Location: USA
|
Posted: 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. |
|
|
|
bluedragon Novice
Joined: 01 Jul 2003 Posts: 30 Location: USA
|
Posted: 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? |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: 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}
} |
|
|
|
bluedragon Novice
Joined: 01 Jul 2003 Posts: 30 Location: USA
|
Posted: 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. |
|
|
|
|
|