|
spartan Newbie
Joined: 20 Nov 2003 Posts: 5
|
Posted: Thu Nov 20, 2003 7:22 am
command trig |
I'd like to create a trig that will fire a command every 2 ticks and another command every 6 when engaged in combat, then end when combat ends. Is there a way to do this?
It would be nice if there was a way for the client to check if im fighting, but if that's not possible typical mud output looks like the following:
You attack Squirrel!
[ HP: 419/438 PSI: 52/52 END: 335/336 ]
(Squirrel is really beat up)
[ HP: 438/438 PSI: 52/52 END: 329/336 ]
[ HP: 430/438 PSI: 52/52 END: 336/336 ]
(Squirrel is about to snuff it)
[ HP: 438/438 PSI: 52/52 END: 328/336 ]
[ HP: 425/438 PSI: 52/52 END: 334/336 ]
Squirrel dies and falls to the ground with a sickening thud.
This kill awards you with 235 credits.
This kill awards you with 442 experience points.
Thanks for your help! |
|
|
|
DevJez Newbie
Joined: 10 Dec 2002 Posts: 8
|
Posted: Thu Nov 20, 2003 10:55 am |
That is possible; if the typical mud output always says "You attack *" then that's a start, and then we can check to see when that thing dies. What commands do you want to execute, and do you really mean every two ticks? As in every two minutes (roughly)?
|
|
|
|
spartan Newbie
Joined: 20 Nov 2003 Posts: 5
|
Posted: Thu Nov 20, 2003 5:03 pm |
I'd like to use the command 'slice' every 2 seconds, and 'tailwhip' every 6 seconds. I've found that by using an alias and the #ALARM command that if i can use the loop
//alias j
#ALARM +2 {
slice
j
}
which works well except that it constantly runs and gives away my location when i'm stealthed (it echoes a message when there's no opponent). #ALARM +6 works well for tailwhip. Thank you for your help. |
|
|
|
Jezuit Beginner
Joined: 02 Nov 2002 Posts: 27 Location: USA
|
Posted: Thu Nov 20, 2003 7:59 pm |
I was thinking something along the lines of a class that would automatically turn on when it sees that you've begun fighting, and turns off as soon as it's finished. See if something like this'll work for ya:
Code: |
#TRIGGER {You attack (*)!} {#T+ "AutoAttack";j;k}
#TRIGGER {(*) dies and falls to the ground with a sickening thud.} {#T- "AutoAttack"}
#CLASS AutoAttack
#ALIAS j {#ALARM +2 {slice;j} "AutoAttack"}
#ALIAS k {#ALARM +6 {tailwhip;k} "AutoAttack"}
#CLASS 0
|
That should be all that does it for ya; At one point, it's gonna slice and tailwhip at the same time, is that all you wanted?
Anyway, See how that works out. |
|
|
|
spartan Newbie
Joined: 20 Nov 2003 Posts: 5
|
Posted: Thu Nov 20, 2003 9:44 pm |
Awesome! I'll give it a shot when I get home tonight!
I hate to ask dumb questions, but would you mind explaining to me what a class is? Can it be used to separate trigs for different player chars?
Thanks! |
|
|
|
spartan Newbie
Joined: 20 Nov 2003 Posts: 5
|
Posted: Thu Nov 20, 2003 9:46 pm |
One more thing, will this work if I'm attacked or attack multiple opponents?
|
|
|
|
Jezuit Beginner
Joined: 02 Nov 2002 Posts: 27 Location: USA
|
Posted: Thu Nov 20, 2003 9:48 pm |
No problem. A class is basically just a way of organizing all different parts of a similar goal together. In this example that's only a couple of aliases in the group, but I and many others make some really complex scripts that can contain buttons, menus, variables, triggers, and aliases. Grouping them together is a way to, first of all, easily find the settings of that class so you know if something goes wrong you don't have to sort through a list of variables/aliases 20 pages long. Also, as is demonstrated here, You can turn off and on classes to allow greater flexibility in a script.
|
|
|
|
Jezuit Beginner
Joined: 02 Nov 2002 Posts: 27 Location: USA
|
Posted: Thu Nov 20, 2003 9:50 pm |
hrm.... As far as the multiple opponents, it'll only do those commands on the oponnent you're currently fighting. If you GET attacked, you'll have to use the equivalent of your mud's 'redirect' action to start fighting the new character.
|
|
|
|
spartan Newbie
Joined: 20 Nov 2003 Posts: 5
|
Posted: Fri Nov 21, 2003 5:53 am |
The Trig works well for attacking a single mob, but i get autoattacked by every mob in the room and as a result instead of trying to fire one slice every 2 ticks, it fires one for each mob in the room, which command costs me. Is there a way to clear the trig before initiating the loop again?
|
|
|
|
|
|