|
riemer11 Beginner
Joined: 28 Oct 2003 Posts: 10
|
Posted: Tue Mar 08, 2005 9:41 am
How to dispel only one mob when using bot program? |
Hello everyone,
I've recently applied a simple bot program that walks through an area and kills all bots. And it works fine. However, is it possible to prevent casting spells to one mob at a time only. See the following screen output, e.g.:
(White) A rat is here
(White) A rat is here
(White) A rat is here
(White) A rat is here
and once you're engaged in fighting:
(White) A rat is here, fighting you
(White) A rat is here, fighting you
(White) A rat is here, fighting you
(White) A rat is here, fighting you
How can I dispel the mobs one by one? Thus, first dispel only the first rat, look and dispel again if it still has the white aura. If not, move on to dispel the next rat. The total number of rats can easily be 5 or 6 so proper dispelling speeds up the killing considerably, not to mention it prevents you from being killed:-)
I've tried the obvious #TR {~(White~) A rat is here} {cast 'dispel magic' rat;look}. However, this approach is not working too well as it generates a lot of spells all casted at the same rat. By the time you're done casting, you're already dead:-)
Any help would be greatly appreciated. |
|
|
|
Dharkael Enchanter
Joined: 05 Mar 2003 Posts: 593 Location: Canada
|
Posted: Tue Mar 08, 2005 4:46 pm |
Code: |
#CLASS {Test}
#ALIAS dolook {#var sanced 0;#var count 0;#T+ STRIG;look}
#VAR sanced {0}
#VAR count {0}
#REGEX "STRIG" {^(\(White\) )?A rat is here} {#T+ ETRIG
#add count 1
#if (!%null(%1)) {#var sanced @count}
} "" {disable}
#TRIGGER "ETRIG" {<%dhp %dm %dmv %dw>} {#T- STRIG
#T- ETRIG
#if (@sanced>0) {cast 'dispel magic' %eval(@count+1-@sanced).rat}
} "" {prompt|disable}
#CLASS 0 |
You'll have to change the second "ETRIG" to match your prompt.
assuming that the last mob you see is the first mob in the room.
this trigger casts dispel magic on the last mob seen without sanc.
using the 1.rat 2.rat syntax you will have to adapt that if your mud uses
a different syntax.
not sure if I did the math logic correctly but its a guidline anyways |
|
_________________ -Dharkael-
"No matter how subtle the wizard, a knife between the shoulder blades will seriously cramp his style." |
|
|
|
riemer11 Beginner
Joined: 28 Oct 2003 Posts: 10
|
Posted: Thu Mar 10, 2005 7:46 am |
Thanks for your comments. I've tried to implement them in combination with the killer bot program from ASM (see http://forums.zuggsoft.com/phpbb/viewtopic.php?t=17006). The killer bot program works just fine, but I can't seem to get the dispel to work correctly.
For one thing, is the Alias dolook correct or should the last command read 'dolook' instead of 'look'?
Also, everytime i run it, the sanced and count variable have the same value, so i only dispel the first mob.
And could it be interfering with the killer bot program since it triggers on the same thing, namely when it sees the mob?
Thanks! |
|
|
|
Dharkael Enchanter
Joined: 05 Mar 2003 Posts: 593 Location: Canada
|
Posted: Thu Mar 10, 2005 2:30 pm |
the alias dolook is correct in that its an example of how you might initialize the sanced and count variables and turn on the STRIG before you look. if your having problems integrating it into your current program
why not post the code for that program, maybe my suggestion wont work with how you're doing things, or maybe we can tweak it so it works.
After looking at that link you showed.
Quote: |
#TRIGGER {^You killed *.} {take coins from corpse;bury corpse;#T+ akill;#T+ walk;look;#ALARM +2 {#RESUME a1}} |
instead of the look command issued here you would type dolook. |
|
_________________ -Dharkael-
"No matter how subtle the wizard, a knife between the shoulder blades will seriously cramp his style." |
|
|
|
riemer11 Beginner
Joined: 28 Oct 2003 Posts: 10
|
Posted: Fri Mar 11, 2005 12:27 pm |
Yep, it's working fine now. Only thing was the dolook command, which I included at the end of the prompt trigger so i dispel while fighting, just in case the spell fails. Another thing is that the two count variables always end up the same, so one of them could be deleted.
Here's the set of triggers I am now using (after renaming them a bit):
For each mob you want to detect, create a trigger called SeeMob:
#TR {~(White~) A Rat is here} {
#T+ SeePrompt
#add countrat 1
}
#TR {~(White~) A Fly is here} {
#T+ SeePrompt
#add countfly 1
}
..etc, create a similar trigger for all mobs you want to dispel
And create a trigger called SeePrompt:
#TR {%dhp %dm %dmv} {
#T- SeeMob
#if (@countrat>0) {cast 'dispel magic' %eval( @countrat).rat}
#if (@countfly>0) {cast 'dispel magic' %eval( @countfly).fly}
...insert other #IF's for each defined above
#T- SeePrompt
DoLook
}
#Alias {DoLook} {
#var countrat 0
#var countfly 0
...insert other resets for all mobs you want to dispel
}
Thanks for all your help and ideas, the scripts saves a lot of mana! |
|
|
|
|
|