|
thanatos Newbie
Joined: 05 Dec 2001 Posts: 5 Location: USA
|
Posted: Wed Dec 05, 2001 5:43 am
trigger question |
How would I go about getting this to work:
TECH BLOCK bonus! Noyade is stunned.
Combination! ( lp rp )
What I need is for the lp to be converted into punch left name and then on a seperate line punch right name. Anyone have any ideas on that?
Also I have several #wa command triggers, and sometimes several of them run together messing it up. Is there a way to get rid of the previous wait commands as a new one comes in so it will execute precisely when the last one should without the others executing?
|
|
|
|
Troubadour GURU
Joined: 14 Oct 2000 Posts: 556 Location: USA
|
Posted: Wed Dec 05, 2001 6:39 am |
I'm not sure what you mean by converting the lp and rp. To place two lines in a pattern, use the $ as end-of-line.
#TR {TECH BLOCK bonus! (%w) is stunned.$Combination! ~( lp rp ~)} {
punch left %1
punch right %1
}
Troubadour |
|
|
|
thanatos Newbie
Joined: 05 Dec 2001 Posts: 5 Location: USA
|
Posted: Wed Dec 05, 2001 6:59 am |
What I was meaning was that I want my guy to left punch name when lp came up on the combo. On the combos there are four different actions(s,r,pl,pr) each combo can vary with different amounts of actions and what type of actions. So when I see the combo i need to have my guy hit sweep name, sweep name, punch right name, punch left name, round name(example of s s pr pl r).
So I need to store the name and the actions. But then need the actions to be converted the actual commands with the name following that. |
|
|
|
Troubadour GURU
Joined: 14 Oct 2000 Posts: 556 Location: USA
|
Posted: Wed Dec 05, 2001 6:59 pm |
Ok, I suggest you capture the combination and convert it to a string list, then step through the list and issue the appropriate command. I'd suggest using a record variable to hold the correlations. If the MUD waits for input after sending this line then the trigger should be a "prompt" triggger.
#VAR tactics {s=sweep|r=round|lp=punch left|rp=punch right}
#TR {TECH BLOCK bonus! (%w) is stunned.$Combination! ~( (*) ~)} {
#VAR combination %replace("%2"," ","|")
#FORALL @combination {%db(@tactics, %i) %1}
} {} "prompt"
Troubadour |
|
|
|
thanatos Newbie
Joined: 05 Dec 2001 Posts: 5 Location: USA
|
Posted: Thu Dec 06, 2001 2:48 am |
Bare with me here, I'm kind of new to this type of trigger code. I've got the person taken care of, where it stores it and I've got f1-4 setup to 'attack' @name. Now I just need to know how to get zmud to pick up on the single s or r in the combo line and then just have it trigger a button.
|
|
|
|
Troubadour GURU
Joined: 14 Oct 2000 Posts: 556 Location: USA
|
Posted: Thu Dec 06, 2001 10:39 am |
There is no need to interface with your buttons, the trigger action sends the commands directly to the MUD.
I'm going to rewrite it a bit, so it's a bit more explicit as to what's going on:
#TR {TECH BLOCK bonus! (%w) is stunned.$Combination! ~( (*) ~)} {
#VAR combination %replace("%2"," ","|")
#FORALL @combination {
#IF (%i = "s") {sweep %1}
#IF (%i = "r") {round %1}
#IF (%i = "lp") {punch left %1}
#IF (%i = "rp") {punch right %1}
}
}
When the trigger fires, the name of your opponent is placed in %1 and the entire combination sequence is placed in %2. At this point %2 looks like "s r lp rp". The %replace function replaces the blank spaces with pipes (|) so it now looks like "s|r|lp|rp". This is a string list. We use the #FORALL command with this stringlist (now named @combination) to step through each element. Each element of the string list is assigned to %i, which is then compared to "s", "r", "lp", and "rp". If a match occurs the appropriate command is sent to the MUD with your opponent's name appended as well. (It's in the %1.)
Troubadour |
|
|
|
iljhar GURU
Joined: 10 Oct 2000 Posts: 1116 Location: USA
|
Posted: Fri Dec 07, 2001 12:33 am |
Just gonna build on Troubadour's post and add some wait time for ya. I THINK alarms take variables but I can't be sure until I get home. If it doesn't work, disregard everything I've added, heh.
#TR {TECH BLOCK bonus! (%w) is stunned.$Combination! ~( (*) ~)} {
#VAR combination %replace("%2"," ","|")
#VAR counter 0
#FORALL @combination {
#IF (%i = "s") {#ALARM +[@counter] {sweep %1};#ADD counter 2}
#IF (%i = "r") {#ALARM +[@counter] {round %1};#ADD counter 2}
#IF (%i = "lp") {#ALARM +[@counter] {punch left %1};#ADD counter 2}
#IF (%i = "rp") {#ALARM +[@counter] {punch right %1};#ADD counter 2}
}
}
Iljhar |
|
|
|
|
|