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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
HerenIstarian
Novice


Joined: 30 Oct 2005
Posts: 40

PostPosted: Fri Oct 12, 2012 8:06 pm   

Detecting multiple mobs in a room with a stepper.
 
So 3Kingdoms recently changed rules to allow monitored botting. So I've create a stepper that runs semi-automatically clearing out an area. I start it and when it's done it goes to the entrance and waits for my next command. However I've run into a problem when faced with more than 1 mob in a room.

First this is how my setup works:

There is a path that pilots through the area and then returns to the exit.

I've created a trigger that sends an erroneous look message that is triggered from the ansi color of the short description message that gets a return of the object not being there as my #OK trigger (this is so there is time to check if a mob is in a room).

I have created an ansi trigger for mobs that waits to see if a player is in the room and if that condition is not met the mob is attacked.

When the mob is killed there is a trigger for #STEP.

My problem right now is that I can't figure out how to have the bot keep killing mobs in a room if there is more than one, and if I've killed all the mobs in the room send the #STEP command.

If anyone has any ideas I would really appreciate it. Thanks.


Last edited by HerenIstarian on Fri Oct 12, 2012 8:09 pm; edited 1 time in total
Reply with quote
HerenIstarian
Novice


Joined: 30 Oct 2005
Posts: 40

PostPosted: Fri Oct 12, 2012 8:07 pm   
 
Code:

The Land of Dancing Silver (n,w)                                   1-@       


You fall into the room of sharpness, the land of dancing silver. There
are large drawers for the silverware to lay down in when they are tired,
which appear to be empty at the moment. This is the place the giant
silverware call home, when giant silverware talk, that is.  Which isn't
often, now that you think about it...  A scream for help interrupts your
musings, but you can't tell where it is coming from.

    There are two obvious exits: north, west                             
An evil looking steel fork [wounded] attacking you!.
An evil looking steel fork.
An evil looking spoon [wounded] attacking you!.
An evil looking spoon.
A hard steel butter knife attacking you!.
A hard steel butter knife.


In some cases it looks like this:

Code:


Droopy Celery Room (s,e)                                             @-2     
                                                                     | |     
                                                                    -v-       
                                                                     |       
                                                                    -6       


You walk into the room and green stringy slime is up to your ankles.  It
smells like rotten vegetables, and you can't imagine how anything could
be any less crunchy than this.  The ceiling has droopy clear strings of
organic matter hanging from it that brush against you and coat you with
slime.  Your eyes begin to water at the noxious atmosphere of the room.

    There are two obvious exits: south, east                             
A limp stringy celery stick {4}.


The short description and mobs have their own background ANSI that I use for triggers.
Reply with quote
meddlesome
Wanderer


Joined: 24 Aug 2012
Posts: 70

PostPosted: Fri Oct 12, 2012 10:34 pm   
 
Not sure there is much I can offer here. I can tell you what I have done and perhaps it will give you an idea. It would help to see the trigger that you use to attack your mob.

In cases where attacking mobiles I looked at a variety of methods and settle for capturing those lines between two certain areas. In your case it seems everything after the exit line is a potential mobile, but then there are those cases where it could just be an object in the room.

What I would do is try and count them for example:

#TRIGGER {{A|An *.} {#ADD mobcnt 1}
#TRIGGER {celery} {#ADD mobcnt -1}
#TRIGGER {attacking you} {#ADD mobcnt -1}

What this would do is count all those that were anything but those listed to #ADD mobcnt -1

That is if I am reading your Mud Output correctly and that there are 3 total mobiles that are attacking you.

I am also curious as to what your Mud Prompt looks like. It could be that would be a prime location to initiate combat. For example

#TRIGGER {*} {#IF (@mobcnt>0) {kill @mob} {#STEP}} "" "prompt"

This however leads to knowledge of the name of the mobile being stored in the variable "mob" and I am guessing as to what your prompt is because I have no idea.

You will however when using a counter, have to reduce it once the mobile dies.

#TRIGGER {is DEAD!!} {#ADD mobcnt -1}
_________________
Intel Core 2 Quad Q9450 @2.66GHz
MDAC 2.8 SP1 ON WINDOWS XP SP3
Msjet40.dll ver 4.0.9511.0 + Security Bulletin MS08-028
CMUD v237
Order number: **7829

Last edited by meddlesome on Sat Oct 13, 2012 4:15 am; edited 1 time in total
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4691
Location: Pensacola, FL, USA

PostPosted: Fri Oct 12, 2012 11:21 pm   
 
#TR {attacking you!$} {combat=1}

#TRIGGER {is DEAD!!} {
combat=0
look
#ALARM "combatCheck" +2 {#IF (@combat=0) {#STEP}
}

#EVENT onStep {
combat=0
#PAUSE
#ALARM "combatCheck" +2 {#IF (@combat=0) {#STEP}
}

Something like that -should- work, and be all you need
You don't need to know how many mobs there are
You just need to know if you are still in combat
_________________
Discord: Shalimarwildcat
Reply with quote
meddlesome
Wanderer


Joined: 24 Aug 2012
Posts: 70

PostPosted: Sat Oct 13, 2012 4:11 am   
 
From what I understood, he could kill one ok, he couldn't however get a kill started/finished on the second one before he moved out of the room. And, what if the mobile isn't AGRO?
_________________
Intel Core 2 Quad Q9450 @2.66GHz
MDAC 2.8 SP1 ON WINDOWS XP SP3
Msjet40.dll ver 4.0.9511.0 + Security Bulletin MS08-028
CMUD v237
Order number: **7829
Reply with quote
Kisujere
Newbie


Joined: 18 Oct 2012
Posts: 1
Location: Livingston, Texas

PostPosted: Thu Oct 18, 2012 3:32 am   
 
Always test to see if you are in combat. I normally test off of my prompt since the display is roughly the same. (Description, blank line, exits, blank line, any mobs in the room, and then prompt).

For this line: A limp stringy celery stick {4}.
Code:

#TRIGGER {A limp stringy celery stick ~{(%d)~}. } {#%1 {#VAR hitList %additem("lamb", @hitList)}}


Ok, that may or may not work. I'll have to go play 3Kingdoms, hah. I also use a string list to keep track of what mobs are needing to be killed. When you kill a mob, or when you attack a mob, you can pop the first item off of the string list.

Code:

#IF (%numitems(@hitList) >= 1)
{
  #SEND {use assault at %pop(hitList)}
} {
  currentStep = @currentStep + 1
  #SEND {%item(@lambPath, @currentStep)}
}


This is a trigger that fires when you kill a mob.
@hitList is the list of mobs that need to be beaten to death. I check to see if it is greater than or equal to 1, and if so, I kill the next mob. if @hitList has no more mobs, then it adds 1 to the currentStep (just a variable that holds a number for where we are in the run), and then sends the next direction in the path (@lambPath is the path in the area).

I'll try making one specifically for 3kingdoms, I've been really wanting to program for a few days, but I couldn't think of anything. Yay!
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Thu Oct 18, 2012 7:40 am   
 
Hah... Good luck with that. I've worked on one with a close friend of mine, and it works beautifully. :D

The problem was, she ran it on the wrong character and got herself killed. I laughed so hard at her for it.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
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