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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » Finished MUD Scripts Goto page 1, 2, 3  Next
asm
Wanderer


Joined: 19 Jul 2004
Posts: 68

PostPosted: Tue Jul 20, 2004 6:37 pm   

A simple combat bot.
 
This is a very simple bot that travels a predetermined path and kills any mobs that match what the user has specified.

Code:
;Trigger for looting corpse and resuming walking.

#TRIGGER {^You killed *.} {take coins from corpse;bury corpse;#T+ akill;#T+ walk;look;#ALARM +2 {#RESUME a1}}

;Class that contains triggers for attacking mobs and temporarily stopping movement.
;First triggers kills all types of pickpockets, and suspends the alarm for walking. Note that the order of those 4 commands should not matter.

#CLASS {akill}
#TRIGGER {a* pickpocket* standing here} {
  #T- walk
  #SUSPEND a1
  kill pickpocket 1
  #T- akill
  }
#TRIGGER {a* youth* standing here} {
  #T- walk
  #SUSPEND a1
  kill youth 1
  #T- akill
  }
#TRIGGER {a* rat* standing here} {
  #T- walk
  #SUSPEND a1
  kill rat 1
  #T- akill
  }
#TRIGGER {a* sensei* standing here} {
  #T- walk
  #SUSPEND a1
  kill sensei 1
  #T- akill
  }
#TRIGGER {a* child* standing here} {
  #T- walk
  #SUSPEND a1
  kill child 1
  #T- akill
  }
#CLASS 0

;This is what keeps it moving. The alarm will be suspended if there are any matching mobs in the room, and it will resume once all matching mobs have been killed.

#CLASS {walk}
#TRIGGER {^There are * obvious exits:*} {
  #ALARM "a1" +2 {
    #STEP
    #PAUSE
    }
  } "" {notrig}
#CLASS 0


To actually start the bot, you'll need an alias that does the following:
Code:
#SLOW path
#PAUSE


This bot can be easily tricked, should someone decide to quote a mob list, however. If that happens for some reason or another, then you can have it resume by enabling both classes again and entering "#RESUME a1" to the command line.

This bot lacks alot of features, such as HP monitoring and following fleeing mobs, but should be easy for even the newest people to this syntax and zMUD to adapt to their preferred MUD.

I am new to zMUD myself, so any suggestions for optimized code would be appreciated.
Reply with quote
megamog75
Enchanter


Joined: 20 Nov 2002
Posts: 627
Location: USA

PostPosted: Thu Aug 05, 2004 12:22 am   
 
ASM, Congrats.
I have made a combat bot and have successfully had it running for about 3 years, it got so good I loan it out to newbies or people leveling up. I always wanted to post it but I like to work all the bugs out. So congrats to you on doing it.

Here is a little of what I did so I could lend it out for money or for profit sharing.

I made a command structure that only I could give it
then I made a rental class and gave it limited commands for the renter.
everything else was automatic like eating and stuff.
I gave it the ability to tell me when it killed something and what it shared
if the person who had it abused the situation I usually waited to they got into an area they could not handle alone and simply left.

I also made a list of rules they had to follow like feeding him
letting him rest or telling him to sleep
In my mud it tells you when you are not grouped anymore so if they try to leave my guy he will just return home.

Pro's
money, exp, friends, helping

con's
occasional death, loss of equipment, and once early in the program my guy wandered off and I did not have a recall scroll, so it was a bit tough to get him back.
_________________
megamog75 Smile
I will do this.Nothing in my life matters except this.No moment in my life exists except this moment.I am born in this moment, and if I fail, I will die in this moment. Raistlin Majere
Reply with quote
richard111
Newbie


Joined: 26 Oct 2004
Posts: 2

PostPosted: Tue Oct 26, 2004 11:35 am   
 
Thank you for providing this script.

One thing gave me some problems, though: if you have multiple mobs in a room that asisst each other, the trigger stops working correctly, that is, it doesn't pause the autowalk and keeps on walking, which is impossible as long as you are fighting. After the fight is over, the script is "off-track" since it already send one or multiple directions to the mud server while staying in the room where the fightin occured. Is there a solution for this?

I've tried adding a new trigger on "is fighting you" as part of the AKILL class in order to force the alarm trigger to remain suspended, but that didn't help. Even putting the timer higher (at +10, e.g.) didn't help.

Thanks!
Reply with quote
asm
Wanderer


Joined: 19 Jul 2004
Posts: 68

PostPosted: Sun Oct 31, 2004 8:29 pm   
 
As I said, this is a rather simple bot, so it does not provide support for mobs that link. However, if the mob type that is assisting your enemy is listed under the akill class, it should attack it after it finishes off the first mob. Also, keep in mind class akill will be disabled during a fight, so any triggers in there won't fire until after it detects that you've killed a mob. I don't know exactly what you're trying, but if the MUD sends back something like "mob is fighting you" when the command look is sent, then this trigger should work for you (put in akill):

Code:
#TRIGGER {^%w is fighting you.} {
  #T- walk
  #SUSPEND a1
  kill %1           ;Remove this line if your character automatically attacks hostile mobs which have engaged you.
  #T- akill
  }
Reply with quote
fightcancer
Beginner


Joined: 01 Nov 2004
Posts: 17

PostPosted: Mon Nov 01, 2004 10:44 pm   
 
dumb question, what game is this script for? :)
Reply with quote
asm
Wanderer


Joined: 19 Jul 2004
Posts: 68

PostPosted: Mon Nov 01, 2004 10:59 pm   
 
Once again, as I stated in my original post, it's designed to be adapted to the syntax of any mud. However, I used output from the discworld engine (downloadable and open-source) for the original code.
Reply with quote
fightcancer
Beginner


Joined: 01 Nov 2004
Posts: 17

PostPosted: Thu Nov 04, 2004 8:50 pm   
 
megamog75, would u mind posting your bot script? I understand if you'd rather not. TIA!
Reply with quote
fightcancer
Beginner


Joined: 01 Nov 2004
Posts: 17

PostPosted: Thu Nov 04, 2004 9:17 pm   
 
asm, what are "linked" mobs please? I don't think my MUD has those, but I'm not sure.
Reply with quote
asm
Wanderer


Joined: 19 Jul 2004
Posts: 68

PostPosted: Fri Nov 05, 2004 12:15 am   
 
When one mob attacks you because you are attacking another mob. For example, if a citizen and a city guard are in the same room, the city guard will probably attack you if you attack the citizen.
_________________
My collections of scripts.
Reply with quote
fightcancer
Beginner


Joined: 01 Nov 2004
Posts: 17

PostPosted: Fri Nov 05, 2004 12:37 am   
 
thanks.
Reply with quote
littleron
Beginner


Joined: 05 Feb 2005
Posts: 11

PostPosted: Tue Feb 08, 2005 8:29 pm   
 
I attempted to use this bot and I assigned a #path, but when I attempted to slow walk on the Mud is just keeps aborting the slow walk. Anyone know the reason for that or how I could fix it so I could try this bot? Thanks
Reply with quote
Odoth
Wanderer


Joined: 13 Nov 2004
Posts: 54
Location: Visalia, CA

PostPosted: Tue Feb 22, 2005 11:03 am   
 
I adapted this for use on the mud I play and it's working great. One observation though is this:
Code:

#TRIGGER {^You killed *.} {take coins from corpse;bury corpse;#T+ akill;#T+ walk;look;#ALARM +2 {#RESUME a1}}


Unless I am missing something, the #ALARM +2 {#RESUME a1} here is not necessary since the exits trigger should reset a1 when you look. In fact this alarm caused trouble for me which is why I noticed.

Thanks again though, because I am getting a lot of use out of this Wink
_________________
*ribbit*
Reply with quote
Graphite
Newbie


Joined: 05 Feb 2005
Posts: 3

PostPosted: Tue Feb 22, 2005 6:43 pm   
 
i dont get what makes it walk.
its not working for me at all :(
Reply with quote
Odoth
Wanderer


Joined: 13 Nov 2004
Posts: 54
Location: Visalia, CA

PostPosted: Sat Feb 26, 2005 6:27 pm   
 
If you can't get it to work pm me and I will try to help you out if you like.
_________________
*ribbit*
Reply with quote
asm
Wanderer


Joined: 19 Jul 2004
Posts: 68

PostPosted: Sun Feb 27, 2005 8:05 pm   
 
Thanks for the feedback. I believe I put that there since #suspend only pauses, not resets, the countdown. That was my quick and dirty work around, which worked for me. There might be a command (If there is, please point it out to me) that resets the countdown for an alarm without destroying that particular instantiation, and I'll have to look into it.

Recently I haven't been mudding as much, and, therefor, haven't been playing with zmud too much, so I am still unaware of its finer points.
Reply with quote
umdbandit
Wanderer


Joined: 31 Oct 2004
Posts: 94

PostPosted: Sat Oct 29, 2005 4:25 am   just used this script
 
Just used this script, and made a small adjustment:

Instead of many instances of this:

#TRIGGER {a* child* standing here} {
#T- walk
#SUSPEND a1
kill child 1
#T- akill
}

just changed it to

#TRIGGER {@enemy is standing here{
#T- walk
#SUSPEND a1
kill @enemy
#T- akill
}


and that way you can just add different enemies to the string list, making it that much easier to deal with and customize.


thats all!


-UMDBANDIT
_________________
Rufus- Winner of Stuff
Reply with quote
Sir1l
Wanderer


Joined: 01 Oct 2005
Posts: 54

PostPosted: Sat Jun 16, 2007 7:36 pm   
 
I was wondering how you would go about making it so if there's an aggie mob in the room it attacks that first?

for instance


a knight is about to attack the dragon.
(aggie)a dragon is here waiting to kill.

so right now it attacks the knight, then the dragon aggies me while im attacking the knight, is there a way to attack the dragon, and then the knight? I thought of maybe added a timer before it attacks anyone, but would prefer to move as fast as I can without a timer...
Reply with quote
Progonoi
Magician


Joined: 28 Jan 2007
Posts: 430

PostPosted: Sat Jun 16, 2007 7:47 pm   
 
First question is if agro mob attacks you automatically? Either way, you'd most likely be better off doing a priority list where first the list with agro mobs are checked and if not any present, succeeding to usual ones. The use of it is pretty much the same regardless of the mob actually attacks you automatically or not, though.


Prog
_________________
The Proud new owner of CMud.

--------------------------------
Intel Core i5-650 3,2GHz
4 DD3 RAM
GTX 460 768MB
Win 7 Home Premium 64x
--------------------------------
Reply with quote
Sir1l
Wanderer


Joined: 01 Oct 2005
Posts: 54

PostPosted: Mon Jun 18, 2007 1:43 pm   
 
Okay, so I made it so it will add the mob keyword to the variable and then check if the mob is aggie and if it is it attacks first, but I wanna know if there's a way to put a string in the variable in the first line like this .....#VAR mob {mob1|mob2|mob3}, so here's my varialbe and then I see a mob in the room, an aggie one, so it adds that to the mob varialbe, but I want to add it in before mob1, so the new varialbe mob would be aggie|mob1mob2|mob3.....what's the syntax for this if there is even one?
Reply with quote
Taz
GURU


Joined: 28 Sep 2000
Posts: 1395
Location: United Kingdom

PostPosted: Mon Jun 18, 2007 1:55 pm   
 
%push
_________________
Taz :)
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Mon Jun 18, 2007 2:58 pm   
 
For Progonoi we made two seperate variables, One for agressive mobs and one for normal ones. Then if (agmobs!=null) {kill %pop(agmobs)} {if (mobs!=null) {kill %pop(mobs)}}

Syntaxes have been changed to confuse the innocent and it is a little more complex than a nested if but, that conveys the idea.
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Mon Jun 18, 2007 8:59 pm   
 
It's probably a better idea to continue this in General Discussions now, this be a place where old scripts go to retire and reminisce about the good ol' days when their users and creators paid attention to them. Very Happy
_________________
EDIT: I didn't like my old signature
Reply with quote
Eul
Wanderer


Joined: 30 Jun 2007
Posts: 53

PostPosted: Sat Jun 30, 2007 11:01 am   
 
Hi there, I was wondering if I could get some help getting this script to work. The basic problem is that I am very new to this and have no idea where to start! Even the above laid down script is quite intimadating, even though it is there on a silver platter for me.

I am going to go read some of Zuggs novice guids on triggers now, but if anyone out there would mind pointing me in the right direction of using this script that would be awsome! I tried copying and pasting the whole thing into the triggres section in ZMUD but I am gessing I am way off the mark doing that as not all that much happend.
I tried chopping and changing a little and it started to do the whole loot sequence but then wouldent do anything else. Also I think I killed the functionality of it because it was clearly only responsing to a fixed value I had put in, rather than the varebles that where in the original script.

WoW, bit of a wall of text there considering I dont know what I am doing ^^.

Any help would be great,

Thanks.
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Sat Jun 30, 2007 11:40 am   
 
You just need to copy and paste this script onto the command line to install it. I wouldn't recommend it without tailoring it to your MUD first though. The manual's very comprehensive - look up any commands you don't understand.

The concept of this script is very simple. When you use the alias described just below the trigger, the #slow command will define a path for the bot to walk, and then pause movement. You'll probably need to look as well to get the bot moving. If I were using this script, I'd have both the akill and walk classes set to disable on startup, and then have this "begin botting" alias use #t+ to turn them both on as well. You could create an "end botting" alias to #t- those classes and disable the script.

The main loop is the trigger at the very end of the script. When the bot enters a room, it'll recieve the exits line of the room which sets off the trigger. The bot will wait two seconds and then use #step to move to the next room. The movement into the next room will set of the trigger again.

The action happens when you enter the room and there are also mobs in the room that you've told the bot to kill. You do this by creating a trigger for that mob - use the examples above. When you get a bit more confident, here's all those triggers condensed into one:

#TRIGGER {a* ({pickpocket|youth|rat|sensei|child})* standing here} {#T- walk;#SUSPEND a1;kill %1 1;#T- akill}

Then all you need to do is add items to the list there rather than creating a whole new trigger.

Anyway. If the bot detects one of the mobs it's supposed to kill, it'll set off that trigger. First, it disables the "walk" class to stop the bot moving. Then it uses #suspend to temporarily disable the two-second alarm that's going to trigger another move - obviously movement won't work while you're fighting. Then it tries to kill whatever it saw in the room. Finally, it disables the "akill" class to stop it attacking more than one mob at a time. If it didn't do this and there was a youth and a sensei in the room, it would send kill youth and kill sensei. Probably not what you want.

When whatever the bot attacked is dead, the first trigger activates - it turns back on the akill and walk classes, "look"s to simulate walking into a room (so that the main loop starts over from the beginning) and uses #resume to reactivate the movement alarm.

And you thought your post was a wall of text :P
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Eul
Wanderer


Joined: 30 Jun 2007
Posts: 53

PostPosted: Sat Jun 30, 2007 11:51 am   
 
Thanks so much! I had just stared to figure this out, but the trigger you just game me is priceless! <3

I am having a problem with one of the triggers now though. I am not sure why, but when I kill an NPC it is doing the loot/bury/look step twice. Any ideas?

Also #slow is confusing me. I looked up the command but it dose not tell me how to move southeast, I am just moving south then east. EDIT I figured out the slow walking, I put se in brackets and it liked that. Still not sure on the duplicate looting sequence though.

Any more help would be fantastic :)

Eul.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » Finished MUD Scripts All times are GMT
Goto page 1, 2, 3  Next
Page 1 of 3

 
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