 |
asm Wanderer
Joined: 19 Jul 2004 Posts: 68
|
Posted: Mon Jul 19, 2004 11:51 am
Bot movement. |
I recently (Today) obtained zmud, and have been working on a simple combat bot. I have done the combat system, and so far, I haven't had any problems. However, I'm not sure how to write the movement component of the bot. I'd like it to slowwalk to a predetermined location, and pause if it enters combat (I already have a system for disabling certain triggers once it attacks something, and enabling once the target has been killed and looted, so if it could be done that way....).
If someone could inform me as to what commands and/or a good system to use, it would be greatly appreciated. |
|
|
|
 |
Rorso Wizard
Joined: 14 Oct 2000 Posts: 1368
|
Posted: Mon Jul 19, 2004 12:02 pm Re: Bot movement. |
| asm wrote: |
I recently (Today) obtained zmud, and have been working on a simple combat bot. I have done the combat system, and so far, I haven't had any problems. However, I'm not sure how to write the movement component of the bot. I'd like it to slowwalk to a predetermined location, and pause if it enters combat (I already have a system for disabling certain triggers once it attacks something, and enabling once the target has been killed and looted, so if it could be done that way....).
If someone could inform me as to what commands and/or a good system to use, it would be greatly appreciated. |
One way to make the bot wander around to predefined locations is to use the speedwalking commands. Like first you could do a "#step path". Then to continue to walk the path you have to send #step until you have arrived to the goal location. This way you first check if you have entered combat, and if you haven't, you continue walking using #step. |
|
Last edited by Rorso on Mon Jul 19, 2004 12:13 pm; edited 1 time in total |
|
|
 |
asm Wanderer
Joined: 19 Jul 2004 Posts: 68
|
Posted: Mon Jul 19, 2004 12:04 pm |
Alright, thanks.
|
|
|
|
 |
asm Wanderer
Joined: 19 Jul 2004 Posts: 68
|
Posted: Mon Jul 19, 2004 1:02 pm |
I'm having a bit of trouble with #step. I entered the following for the bot startup alias:
| Code: |
| #step 7w3s1w4sw2nw6s2se4s5e4s2se5s6e2s13e1ne6e2s7e1se1sw2w7s3e4ne5n |
The first problem is that it's not recognizing diagonal directions. The second problem is that it acts like fastwalk for the first ten commands or so, queuing them up, which, in turn, screws up my trigger for moving a room at a time, since it adds one to the queue everytime one of the earlier ones is cleared. I think the trigger would work perfectly if the second problem could be fixed, though. Anyone? |
|
|
|
 |
hykou Wanderer
Joined: 29 Apr 2004 Posts: 63 Location: USA
|
Posted: Mon Jul 19, 2004 4:37 pm |
use the #PAUSE command... help pause in zMUD help files.
|
|
|
|
 |
asm Wanderer
Joined: 19 Jul 2004 Posts: 68
|
Posted: Mon Jul 19, 2004 7:50 pm |
That works, thanks...Now, my final question: How do you put diagonal directions in the path string? Using sw, for example, does south then west, but I'd like to change that to southwest. Doesn't mention that in the help files....At least, not for #slow or #step.
|
|
|
|
 |
Rorso Wizard
Joined: 14 Oct 2000 Posts: 1368
|
Posted: Mon Jul 19, 2004 7:56 pm |
| asm wrote: |
| That works, thanks...Now, my final question: How do you put diagonal directions in the path string? Using sw, for example, does south then west, but I'd like to change that to southwest. Doesn't mention that in the help files....At least, not for #slow or #step. |
h - nw
j - ne
k - sw
l - se
Example:
.nh -> north, northwest |
|
|
|
 |
asm Wanderer
Joined: 19 Jul 2004 Posts: 68
|
Posted: Mon Jul 19, 2004 8:48 pm |
That works, but I found a minor bug...When it encounters a mob, it sends the kill command after the move command. Normally, the trigger to attack would temporarily disable the trigger for movement, but since the move tirgger fires first, it ends up moving ot the next room, and then telling me that mob cannot be found. The reason for this is probably that the exits are listed before the mobs...Anyone know a solution to this problem? Note that you cannot list the mobs before the exits, or only list the mobs.
|
|
|
|
 |
Darker GURU
Joined: 24 Sep 2000 Posts: 1237 Location: USA
|
Posted: Mon Jul 19, 2004 9:08 pm |
Sheesh, we ought to make 'version' a required field when posting. Couldn't find what version you're using, but assuming 7.05, instead of just sending #step when you see the exits, make a timer to send it a second or 3 in the future - as a condition in an #if statement that checks to see if you encounted any mobs.
Sort of like this:
set mob counter = 0
move to next room
set 3 second delay on checking whether to step
count mobs
when 3 second timer runs out:
if the mob count is 0, step.
else, attack.
You'll also need a trigger for when the mob dies, to set the mob counter back to 0, and look around the room to see if there are more mobs/run the 3 second timer-step again. |
|
_________________ Darker
New and Improved, for your Safety. |
|
|
 |
asm Wanderer
Joined: 19 Jul 2004 Posts: 68
|
Posted: Mon Jul 19, 2004 9:37 pm |
Heh, well, you can assume I have v7.05 from my first post. Anyways, although that looks like it would work, I have run into a problem; no other triggers can fire if one is already active, thus I cannot do any processing/checking during the 3 second delay...
|
|
|
|
 |
Vijilante SubAdmin

Joined: 18 Nov 2001 Posts: 5187
|
Posted: Mon Jul 19, 2004 11:22 pm |
Use an #ALARM instead of #WAIT.
|
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
 |
asm Wanderer
Joined: 19 Jul 2004 Posts: 68
|
Posted: Tue Jul 20, 2004 12:03 am |
Cool, it works. Thanks everyone.
|
|
|
|
 |
|
|
|