|
Darkspawn Beginner
Joined: 18 Sep 2002 Posts: 15
|
Posted: Wed Oct 09, 2002 5:19 am
Autoranking script |
Ok so, I'm trying to work out this autoranking script and I'm using a slow walk to move around the area and attack things, the problem is I only want to attack when 1 of the creatures are in the room because they assist.
I'm getting stumped because I have a trigger
#TR X is here
#Add enemy 1
#If @enemy<2 {kill x} {#Step;#var enemy 0}
and when 2 of them are in the room it obviously fires twice and things get all messed up, does someone know a differant way to go about doing this? |
|
|
|
Troubadour GURU
Joined: 14 Oct 2000 Posts: 556 Location: USA
|
Posted: Wed Oct 09, 2002 6:44 am |
Depending on how your MUD uses and abuses blank lines, you could try something like this:
#TR {X is here.} {#ADD enemy 1; #IF (@enemy = 1) {#TEMP {^$} {#IF (@enemy <2) {kill x} {#STEP; #VAR enemy 0}}}}
The first time you encounter X, a temporary trigger is created which will fire on the first blank line. This was not tested.
Troubadour
(Win 98, Pentium III, 550 MHz) |
|
|
|
Darkspawn Beginner
Joined: 18 Sep 2002 Posts: 15
|
Posted: Wed Oct 09, 2002 7:29 pm |
won't that just have the same problem of firing twice and creating 2 temporary triggers?
|
|
|
|
iljhar GURU
Joined: 10 Oct 2000 Posts: 1116 Location: USA
|
Posted: Wed Oct 09, 2002 8:36 pm |
No, that if check will only fire when enemy is equal to 1. If the trigger were to fire twice, then the enemy var would be set to 2 and the 2nd part of the trigger would not be fired.
Iljhar |
|
|
|
|
|