Herb gathering code (zMud 7.21)

Need some help with your MUD client? Forgot your password? Get help here.
Forum rules
- Use common sense and be respectful towards each other at all times, even when disagreeing.
- Do not reveal sensitive game information. Guild secrets, player seconds are examples of things not allowed.
Makfly
Champion
Posts: 598
Joined: 04 Mar 2010 00:36

Herb gathering code (zMud 7.21)

Post by Makfly » 19 Sep 2010 09:53

Based on zMud and this 'awesome' herbmap below, I'd like create a "script" (Bannination!1) that will let me gather the herbs most efficiently, and also react to any distractions if necessary.

Code: Select all

Now here's the map:

        A--B--C
        |     |
        x     y
   A=Attanar
   B=Whitehorn
   C=Skunk berries
I'd like to start at 'x' and end at 'y' when I'm done.
-When I go to a herb location, I want to search by searching for the herb specifically.
-If I find one, I'd like to try and find another one, except if I already found 3, then I want to go to the next location.
-If I find no herbs in a location, I want to move on to the next location.
-If I get distracted by an attack or someone sends me mail or something, I want to just stop the script and do whatever I need to do. Maybe go fancy and throw in a beep if "attacks you!" happens or something. :)

So I'm imagining some trigger based off on the result of the search.
A counter to keep track of the number of searches and when to move on.
And...I don't know...Maybe something else?

Can any of you script-wizards help me with this creation?
I promise I'll sit infront of the computer and keep an eye on the monitor, just while reading a book. :o)
Mortimor Makfly - Gnomish Xeno-Anthropologist

User avatar
OgreToyBoy
Champion
Posts: 610
Joined: 05 Mar 2010 11:36

Re: Herb gathering code (zMud 7.21)

Post by OgreToyBoy » 19 Sep 2010 11:47

Cool, I'll send you the one you gave me.

Makfly
Champion
Posts: 598
Joined: 04 Mar 2010 00:36

Re: Herb gathering code (zMud 7.21)

Post by Makfly » 19 Sep 2010 15:07

OgreToyBoy wrote:Cool, I'll send you the one you gave me.
Ehh..what?

When did I send anything to you?
Mortimor Makfly - Gnomish Xeno-Anthropologist

Yanus
Adventurer
Posts: 95
Joined: 08 Mar 2010 15:58

Re: Herb gathering code (zMud 7.21)

Post by Yanus » 19 Sep 2010 15:36

Makfly - don't you forget about herb areas that change every Arma.

That's only for appetizer. There are more tricks herb areas prepared for you. Much more. 8-)

Makfly
Champion
Posts: 598
Joined: 04 Mar 2010 00:36

Re: Herb gathering code (zMud 7.21)

Post by Makfly » 19 Sep 2010 16:12

Yanus wrote:Makfly - don't you forget about herb areas that change every Arma.

That's only for appetizer. There are more tricks herb areas prepared for you. Much more. 8-)
Yea, I know that.
But some area are (fairly) constant, so it can be used there. Which is fine, I want to learn and don't have too high demands :)
Mortimor Makfly - Gnomish Xeno-Anthropologist

Yanus
Adventurer
Posts: 95
Joined: 08 Mar 2010 15:58

Re: Herb gathering code (zMud 7.21)

Post by Yanus » 19 Sep 2010 18:57

Well... You need a simple herber, but that means you need much more preparations to make this herber work properly...
Do you need help with coding or with algorithms?

Makfly
Champion
Posts: 598
Joined: 04 Mar 2010 00:36

Re: Herb gathering code (zMud 7.21)

Post by Makfly » 19 Sep 2010 20:28

Yanus wrote:Well... You need a simple herber, but that means you need much more preparations to make this herber work properly...
Do you need help with coding or with algorithms?
Both, I guess.

I know how to make triggers, alias, paths and things. But it's all basic stuff.
Mortimor Makfly - Gnomish Xeno-Anthropologist

User avatar
Rhaegar
Legend
Posts: 960
Joined: 13 May 2010 06:22

Re: Herb gathering code (zMud 7.21)

Post by Rhaegar » 14 Jan 2011 11:24

Basic stuff is all you need to make a herbing script. You'll just have to write some more.

Example:

2 basic triggers needed:

a) herb found
b) herb not found

if a)
put it in pouch etc. and search again

if b)
move to next area and start searching

The way it can be solved with triggers:

1. Need to define step variable.

2. When herb is not found increase step value and launch corresponding trigger.
trigger: "You don't find any herbs" = /set step=$[step+1] and then /launch move

3. Need move trigger.

move = if (step=1) go north%; search here for attanar%;
if (step=2) go east%; search here for suranie%;

And so on. It's simple enough but you'll have to write down the entire path. It could be further simplified by additional triggers (which could handle herb names, in case you need to quickly adjust your script if the herb locations would change etc.) but you can figure it out by yourself.
I fear no evil for I am fear incarnate.

Johnny
Veteran
Posts: 226
Joined: 02 Apr 2010 09:33
Location: Washington State

Re: Herb gathering code (zMud 7.21)

Post by Johnny » 14 Jan 2011 21:33

There is an easier way to do this without the need of variables and what not, just simple triggers and works smoothly.

User avatar
Cherek
Site Admin
Posts: 2818
Joined: 04 Mar 2010 04:36

Re: Herb gathering code (zMud 7.21)

Post by Cherek » 14 Jan 2011 22:58

The simplest way is probably something like this:

Create an alias named "herbbot" or whatever you want.

In the syntax window do this:

north;
search here for herb;
#WA 11000;
search here for herb;
#WA 11000;
search here for herb;
#WA 11000;

Repeat this for as many rooms as you need.

No, it doesnt bother with checking if there are herbs left, it always searches three times in each room even if its empty. So thats a flaw. But you really dont lose that much time doing it. And besides, for the most part herb areas dont reset that quick anyway, so if you planned on walking around searching indefinitely its not really a problem either.

The positive is that its extremely simple. Just one alias with a list of commands and a "wait" command between. Its basically a "path" more than real scripting. But it works.

Post Reply
http://tworzymyatmosfere.pl/przescieradla-jedwabne-z-gumka/