Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion Goto page 1, 2  Next
darkfenix
Wanderer


Joined: 02 Feb 2002
Posts: 58

PostPosted: Sat Feb 02, 2002 8:27 am   

Robot Script
 
hmmm ok i read the help file which didnt help much cuz it was a 4.62 help file hehe that needs to be updated =) i also read through the forums....found the other posts about robots....read through em....lol tried em.....but i cant kick out the bugs.....would anyone be kind enough to post a already FIXED version pls?? hehe cuz its gettin really annoying =) thanxxx in advance =)
Reply with quote
WarChild
Novice


Joined: 15 Jul 2001
Posts: 31
Location: USA

PostPosted: Sat Feb 02, 2002 8:53 am   
 
Considering that a bot-script is usually catered to the type of mud your on, you need to give a little more detail.
Sure, I can post a bot-script to you that will move around and if a target thats listed in your ok_to_hit array is there it will start the attack.. but then I'd be doing it for an lpmud whereas you might be playing on a diku, or rom, merc, circle or any number of hybrids and variations

WarChild
Reply with quote
darkfenix
Wanderer


Joined: 02 Feb 2002
Posts: 58

PostPosted: Sat Feb 02, 2002 10:46 am   
 
yes i forgot to describe the MUD i play in, i need this script for weekends....during weekends i cant do anything else but RAT...since there are over 100 people online and every other monster is dead hehe tiring to keep waiting for the respawn.....well anyway i just need a script that will help me auto RAT as.

would be nice if the script would work well with triggers as rats arent in the room as u enter...they appear while ur there. if its also possible to incorporate it with PATHS and SLOW WALK with timer of say 10 secs per room. i tried making one but like i mentioned the help file is for a very old version of zmud so i cant figure it out...

Here is the trigger class i use to rat...note the CO is an alias which is a combo move

#CLASS {rat}
#TRIGGER {eyes are drawn} {co}
#TRIGGER {all limbs.} {get 3 @target;co}
#TRIGGER {noses its way cautiously} {co}
#TRIGGER {wanders into view,} {co}
#TRIGGER {balance on your left arm.} {get 3 @target;co}
#TRIGGER {darts into the room,} {co}
#TRIGGER {I see no "rat" to take.} {ql}
#CLASS 0
#ALIAS ron {#cla rat 1;rats}
#ALIAS roff {#cla rat 0;rats}

i tried incorporating this to some of the scripts i found on the forums here but i end up looping and spamming.....

to sum it up

BOT needs:
1. to accept at least 5 triggers like the ones above to see the RAT or better yet just able to work with the RAT folder...whichever
2.be able to use PATH
3. stop 10 secs per room PAUSE if im not mistaken and kill
4.only enemy is RAT 3 per room usually
5. stop if someone else in in the room.

i dont know maybe im asking too much cuz from wat have seen here in the forums ppl use the N|S|S|S| method....wont really matter it think as long as the script does as needed =)

thanx for your help guys
Reply with quote
darkfenix
Wanderer


Joined: 02 Feb 2002
Posts: 58

PostPosted: Mon Feb 04, 2002 2:17 pm   
 
hmmmm i tried using this but the bot wont continue moving after spotting and killin a rat

#CLASS {robot}
#VAR moves {ne|nw|ne|nw|ne|ne|n|ne|ne|n|ne|n|n|nw|nw|nw|n|n|n|nw|nw|w|w|w|w|nw|nw|ne|n|nw|nw|w|sw|w|w|w|w|s|s|se|s|se|sw|s|sw|e|se|s|s|s|se|se|se|se|se|s|se|se}
#VAR mobs {rat}

#ALIAS goBot {
#VAR dircnt 1
#VAR mobcnt 1
#EXEC %item(@moves, @dircnt)
punch %item(@mobs, @mobcnt)
}

#TRIGGER {You swing viciously at the corpse *$} {
get 3 rat
punch %item(@mobs, @mobcnt)
}
#TRIGGER {that * here.} {
#ADD mobcnt 1
#IF (@mobcnt <= %numitems(@mobs)) {
co %item(@mobs, @mobcnt)
} {
#ADD dircnt 1
#VAR mobcnt 1
#IF (@dircnt <= %numitems(@moves)) {
#EXEC %item(@moves, @dircnt)
punch %item(@mobs, @mobcnt)
} {
#ECHO Cycle is complete.
}
}
}
#CLASS 0
#ALIAS roboton {#cla robot 1}
#ALIAS robotoff {#cla robot 0}
Reply with quote
darkfenix
Wanderer


Joined: 02 Feb 2002
Posts: 58

PostPosted: Wed Feb 06, 2002 3:24 pm   
 
will a guru pls help out????
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Wed Feb 06, 2002 7:05 pm   
 
quote:
the bot wont continue moving after spotting and killin a rat


What does it do after spotting and killin(g) a rat?

I assume it works as expected before spotting a rat? If that's the case, then the problem is detecting that you have finished killing the rat and are ready to move on.

LightBulb
All scripts untested unless otherwise noted
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Wed Feb 06, 2002 7:36 pm   
 
Try to remember, everyone, that Guru's are normal people just like everyone else, we make mistakes just like everyone else, and our knowledge will always have a limit just like everyone else (although I consider myself to be a highly above average, perfect, and all-knowing human being )

I guess what I'm saying is that what a Guru says may not be the final word and definite authority in some subject and thus you cannot assume that just because a Guru said something it is perefect, without errors, and if someone else says it, it might be flawed or there might be a better way to do it. We do, however, have a little bit more knowledge on some of the internal workings of zMUD since Zugg does discuss some cool zMUD tibdits with us and this does help us to answer some questions which would not be possible to answer otherwise.

So, basically, anyone else that has read the help file completely (or at least extensively), with a knowledge in many areas of zMUD and some good progamming logic is as much or better capable than all of the Guru's to answer the questions of others in this forum. I, myself, tend not to give my answer to some question if someone has already provided an aswer or is in the process of walking the person through the steps of solving the problem. I do make exceptions to this rule when I see some small error that needs to be corrected so someone else's script will work, when I know of a much better or efficient way of doing some particular thing that deserves mention, or when the post has gone unanswered by the person that started giving help for some time.

Kjata
Reply with quote
darkfenix
Wanderer


Joined: 02 Feb 2002
Posts: 58

PostPosted: Thu Feb 07, 2002 12:34 pm   
 
well lightbulb after spotting a rat it does CO whihc is an alias for a combo....after when I see no "rat" to take should make it move again....

kjata im just frustrated cuz everones questions seem to be answerd just not mine hehe looking for help from above if u catch my drift
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Feb 07, 2002 4:11 pm   
 
Your trigger to resume moving, after killing a rat, is
#TRIGGER {that * here.} {actions}
It's been a long time since I played on Achaea, but on the MUDs I'm familiar with the phrase would be "You don't see that here", which would NOT match. You probably need to change that trigger phrase.

LightBulb
All scripts untested unless otherwise noted
Reply with quote
darkfenix
Wanderer


Joined: 02 Feb 2002
Posts: 58

PostPosted: Fri Feb 08, 2002 8:31 am   
 
hehe um nice guess on the mud i play did i mention it? well im not sure wat u want me to change wat should i put in after the trigger to nove??
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Fri Feb 08, 2002 1:06 pm   
 
What LightBulb is saying is that this trigger:
#TRIGGER {that * here.} {actions}

which is the one you use to know when you have killed a rat and thus continue with another one, will not match a line like:
You don't see that here.

which is a pretty standard message MUDs use to tell you that you tried to do something to some mob or someone that isn't in that room. It won't match because you have an * surrounded by spaces between "that" and "here" and the message of "You don't see that here" has nothing surrounded by spaces between the words "that" and "here". So, perhaps you need to change the pattern of this trigger to something else that will match when you receive the message that there is not rat in the room.

Kjata
Reply with quote
darkfenix
Wanderer


Joined: 02 Feb 2002
Posts: 58

PostPosted: Fri Feb 08, 2002 4:06 pm   
 
hmmm i changed it but im still flooded and do not move after its done =(
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Fri Feb 08, 2002 5:19 pm   
 
Flooded with what?

What does happen after you kill a rat? And especially what happens after you kill the last rat?

It's difficult to figure out what the problem is when all you'll say is it doesn't work.

LightBulb
All scripts untested unless otherwise noted
Reply with quote
Tarn
GURU


Joined: 10 Oct 2000
Posts: 867
Location: USA

PostPosted: Fri Feb 08, 2002 11:23 pm   
 
Bots composed purely of triggers are extremely hard to get right because of the various states you might be in.

Consider the following:

Path variable - "N|E|S|W|STOP"
PositonInPath - which direction to go next (start with 1)
RatCount variable - how many rats are present
Fighting variable - true/false
Alarm that goes off every second

Increment RatCount up when a rat arrives. Decrement it when one leaves or when you kill one.

Fighting - Set to false when you kill a rat or see the 'not here' message. Set to true when you attack one.

Every time the alarm goes off:
If not Fighting and RatCount > 0, attack the rat and set Fighting = true
If not Fighting and RatCount = 0, then pick up the dead rats in the room and move to the next room. If the next direction is "STOP", kill the alarm and signal that you're done.

Extra triggers:
on Balance recovery, if fighting=true attack the rat again.
If upon trying to attack a rat there are none there, set RatCount=0 and fighting=false

I haven't botted ratting myself. As an experiment, I once tried acting like a bot via macros, and the enforcement police arrived very quickly (in the form of a large number of thug NPC's which seemed to be a bit stronger than usual).

-Tarn
Reply with quote
darkfenix
Wanderer


Joined: 02 Feb 2002
Posts: 58

PostPosted: Sun Feb 10, 2002 4:26 pm   
 
light bulb by flooded i mean it spits out the CO alias which is

kick
punch
punch

over and over again.....and if doesnt do that it just stops after kiling the first set of rats.....

tarn hehe im sorry i dont know how to implement wat u just told me =(
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Feb 10, 2002 6:30 pm   
 
When you "co" (kick;punch;punch) you are sending 3 commands to the MUD. These will stack up as you go through the fight, and each one will have to be cleared by either
  • hitting a rat

  • missing a rat

  • swinging at a corpse(?)

  • finding there's nothing there

  • So, after the fight is done you will normally have several to many kicks and punches waiting to flood you. You can't move on until all the combo's you sent have been cleared. Then, IF your trigger works, you should.

    RECOMMENDATION: Replace "co" with either "kick" or "punch" in all your ratting triggers. You can still keep the alias in case you should some day want it for your own fighting.

    You say that if it doesn't flood, it just stops. That means your trigger for moving on isn't working. Does it work before you kill any rats? That is, do you usually move through 3 or 4 empty rooms, then find and kill a rat, and stop? Or do you usually find a rat to fight in the first two rooms (when your actions are set by the gobot alias).

    You said you changed the trigger phrase, what is it now? And what message does the mud typically provide when you try to kick or punch something that isn't there?


    LightBulb
    All scripts untested unless otherwise noted
    Reply with quote
    darkfenix
    Wanderer


    Joined: 02 Feb 2002
    Posts: 58

    PostPosted: Mon Feb 11, 2002 3:35 am   
     
    hmmm lightbulb i thnk im aproaching this at the wrong angle....i think the reason it floods is because there is no timer.....everytime i enter a room it throws all CO commands....and if there is nothing it moves.....and does the say to the next room....so thers the flood...i move from room to room in about 1 sec each...accomplishing nohting and crashing my self...

    i think a better way would be to use slow walking if i can figure it out.....cuz everytime i slow walk it aborts "SLOW WALKING ABORTED" i activate it, it moves to one room and aborts....is there anyway to set it to move from one room to another every 10 secs?

    i think this would solve my problem
    Reply with quote
    Kjata
    GURU


    Joined: 10 Oct 2000
    Posts: 4379
    Location: USA

    PostPosted: Mon Feb 11, 2002 1:07 pm   
     
    To use slow walking, you must execute the #OK command to let zMUD know that your move to the next room was succesful. This is usually done with a trigger that fires of your prompt. However, since you want to kill enemies, you will also have to create another trigger that will see the rat and use the #PAUSE command so you stop walking. Then, when you kill the rat, and are ready to continue, you use the #STEP command so the slow walk continues.

    Kjata
    Reply with quote
    Tarn
    GURU


    Joined: 10 Oct 2000
    Posts: 867
    Location: USA

    PostPosted: Mon Feb 11, 2002 7:21 pm   
     
    For non-Achaea players, an important point here:

    Rats generally don't exist in a room when you walk into it (unlike DIKU family mobs, they simply don't exist yet). After you've been standing in the room for a few seconds, they will arrive.

    That's why the timer is required (or a lot of complicated triggers and state variables).

    So, Darkfenix, which parts are you having trouble understanding? You haven't posted all the trigger strings so we can't just post a script, but we'll be happy to walk you through each step.

    -Tarn
    Reply with quote
    LightBulb
    MASTER


    Joined: 28 Nov 2000
    Posts: 4817
    Location: USA

    PostPosted: Mon Feb 11, 2002 7:40 pm   
     
    Go for it, Tarn. As I said before, it's been a long time since I've visited Achaea so I'm not particularly good at scripts for it.

    LightBulb
    All scripts untested unless otherwise noted
    Reply with quote
    Tarn
    GURU


    Joined: 10 Oct 2000
    Posts: 867
    Location: USA

    PostPosted: Mon Feb 11, 2002 8:32 pm   
     
    quote:

    ...so I'm not particularly good at scripts for it.



    You usually seem to manage well- unless you really do play all of the muds posters here are on

    Ok, lets break the problem into pieces. Most/all of the pieces will be useful in other contexts, so it's nice to leave them separate.

    1. kill rats and pick them up when they come into the room

    2. Walk through a preset path, pausing for a little while at each step for a set period, or until nothing interesting has happened in a while.

    3. Be polite - disable attacking and advance to the next room if another player is present

    4. Panic when a thug shows up (they can be dealt with, but probably need some autohealing triggers which we don't want to think about until everything else works)

    Does part 1 work right now for you if you disconnect the movement triggers?

    If so, we can move on to part 2, and either use slow-walking or a custom slow-walk alias setup.

    -Tarn
    Reply with quote
    darkfenix
    Wanderer


    Joined: 02 Feb 2002
    Posts: 58

    PostPosted: Tue Feb 12, 2002 4:38 pm   
     
    ok now we are getting somewhere thanx tarn....but like you said its complicated to make the triggers to make it move...

    first the rat isnt in the room already it appears after a few seconds. they appear with the following lines

    noses its way cautiously
    wanders into view,
    darts into the room,
    eyes are drawn

    next is i will have to wait for balance:

    balance on your left arm.

    then i can attack again. but since it doesnt give me specific sentence when the rat is dead (it give me a range of 4 sentences) i use triggers taht just attacks and at the same time picks up like so:

    get 3 rat
    kick rat
    punch rat
    punch rat

    these 4 go when a rat is around till its dead. (member theres 4 diff dead msgs)

    so the trigger to get it moving (the bot) again would have to be:

    I see no "rat" to take.

    which is when all 3 rats are dead becuz all 3 rats follow each other as they come out.

    timer for the room should be like 10 seconds..

    well i hope this will help you guys help me thanx so much i really appreciate all this.
    Reply with quote
    darkfenix
    Wanderer


    Joined: 02 Feb 2002
    Posts: 58

    PostPosted: Tue Feb 12, 2002 4:42 pm   
     
    i dont really know what trigger to use if someone is in the room....i guess it would be

    %1 is here.

    thugs would be

    a thug is here.
    Reply with quote
    TaisharMalkier
    Novice


    Joined: 28 Sep 2001
    Posts: 45
    Location: USA

    PostPosted: Tue Feb 12, 2002 6:47 pm   
     
    Ok...this is sorta complicated, but i think it may work.


    #ALIAS rat1 {n;#var next rat2;thugs=0;player=0;#T+ CheckForPpl;look:#ALARM {+10} #if (thugs=0) {#if (player=0) {kill rat} {next}} {next}}


    Contain rather than hurt.
    Hurt rather than maim.
    Maim rather than kill.
    Kill rather than be killed.
    Reply with quote
    TaisharMalkier
    Novice


    Joined: 28 Sep 2001
    Posts: 45
    Location: USA

    PostPosted: Tue Feb 12, 2002 7:35 pm   
     
    Sorry...got sidetracked last time...

    #ALIAS rat1 {n;#var next rat2;#var skiproom 0;#T+ CheckForPpl;look;#ALARM {+10} {#T- CheckForPpl;#if (skiproom=0) {#T+ Attack;co rat} {{#T- CheckForPpl;@next}}}
    #ALIAS rat2 {e;#var next rat3;#var skiproom 0;#T+ CheckForPpl;look;#ALARM {+10} {#T- CheckForPpl;#if (skiproom=0) {#T+ Attack;co rat} {{#T- CheckForPpl;@next}}}
    #TR {No rat here!} {@next;#T- Attack}

    #CLASS Attack
    #TR {balance on your left arm.} {co rat}

    #CLASS CheckForPpl
    #TR {* is here.} {#var skiproom 1}

    Ok...lets see if i can explain this. To start your bot you type whatever your first alias name is. That alias walks you to the first room, enqueues the next rooms alias, resets the skiproom variable, turns on the room checker, and waits for 10 seconds. Then if the room checker alias fires off in that 10 seconds, it sets the trigger to skip the room. If there is no one in the room, the attack class is turned on and the alias for co rat is run. Then the attack class takes over control. I this will loop the co alias every time you are able to attack, until there are no rats in the room (detected by the no rat here trigger) Once the rats are dead, the attack class is turned off and the next room is run to and it starts all over again.
    I hope i have everything right. If not, post here and ill take another crack at it.

    Contain rather than hurt.
    Hurt rather than maim.
    Maim rather than kill.
    Kill rather than be killed.
    Reply with quote
    Display posts from previous:   
    Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
    Goto page 1, 2  Next
    Page 1 of 2

     
    Jump to:  
    You cannot post new topics in this forum
    You cannot reply to topics in this forum
    You cannot edit your posts in this forum
    You cannot delete your posts in this forum
    You cannot vote in polls in this forum

    © 2009 Zugg Software. Hosted by Wolfpaw.net