Walking trigger(or script)

Posted by Chippy on Sat 01 Aug 2009 08:14 PM — 2 posts, 13,907 views.

USA #0
Before I get the "bot" flames, I'll start by stating Project Bob(the mud which I will be discussing) allows for "solo" accounts, which in short, are legal bots that can play but not interact with other players.

I have used Mushclient for years, and have a basic understanding of triggers, aliases, macros, and so forth. I have zero understanding of scripting.

On Project Bob there is the opportunity to goto the quest master and "quest mission", which creates a random instance filled with random mobs. At the end of the mission lies a boss and the rewards.

Here is my problem:
Project Bob displays unexplored exits in cyan, and explored exits in dark gray. I have tried everything I can think of to make the client go in the direction of the "cyan" exit(I haven't even began to ponder picking an exit when multiple exits are in cyan).

I did try a "wander bot", in which it just tried all the exits until one worked. Aside from the obvious problems, I don't know how to "pause" the trigger, kill the mob, then resume the wandering.

Can anyone help me in tackling this? I guess in short I am asking for a bot, and I know many people are against that. But really, I'm just asking for you to make robot legs... which could potentially be used for good, instead of evil!

Basically I want something that will start exploring the mission area, stopping to kill mobs, and make it to the end boss. Oh.. and there are dead ends, which would result in trying to navigate back through gray exits. Crap. Is this even possible?

projectbob.game-host.org
port:4000
In case anyone is interested.

Thanks in advance to anyone who can provide any level of assistance!
Australia Forum Administrator #1
It could be done alright.

Quote:

I have zero understanding of scripting.


However it will be tricky. :)

My first approach would be to detect the cyan exits. A trigger which calls a script in your script file gets the "style runs" of the matching line. By iterating through those style runs you could work out which word or words are in cyan.

One approach would be to use string.find to find, on the exits line, every possible exit. That is, search one at a time for "north", "south", "east" and so on. Then for each one, use GetStyle for the matching column number to find the colour of that word. See:

http://www.gammon.com.au/forum/?id=7818

This will give you one or more exits. You may as well take the first if there are more than one, as next time that one won't be there.

Quote:

Oh.. and there are dead ends, which would result in trying to navigate back through gray exits.


This will be tricky too. However it is probably a sub-set of the problem of escaping from the instance at the end, or do you just portal out?

What I would be doing here is "lay a trail of breadcrumbs" from a room that you know *does* have an exit in it. Basically this would involve remembering where you went, then backtrack to get back.

For example, if you kept a speedwalk string of what directions you went (eg. N S S E S) then you could apply ReverseSpeedwalk to it to get a speedwalk that would take you back out.

http://www.gammon.com.au/scripts/doc.php?function=ReverseSpeedwalk


Quote:

Aside from the obvious problems, I don't know how to "pause" the trigger, kill the mob, then resume the wandering.


You probably need a special trigger inside a coroutine, as described here:

http://www.gammon.com.au/forum/?id=4957

That describes how you can do something, wait for output, and then do something else.