Page 1 of 5

Herb gathering code (zMud 7.21)

Posted: 19 Sep 2010 09:53
by Makfly
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)

Re: Herb gathering code (zMud 7.21)

Posted: 19 Sep 2010 11:47
by OgreToyBoy
Cool, I'll send you the one you gave me.

Re: Herb gathering code (zMud 7.21)

Posted: 19 Sep 2010 15:07
by Makfly
OgreToyBoy wrote:Cool, I'll send you the one you gave me.
Ehh..what?

When did I send anything to you?

Re: Herb gathering code (zMud 7.21)

Posted: 19 Sep 2010 15:36
by Yanus
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-)

Re: Herb gathering code (zMud 7.21)

Posted: 19 Sep 2010 16:12
by Makfly
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 :)

Re: Herb gathering code (zMud 7.21)

Posted: 19 Sep 2010 18:57
by Yanus
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?

Re: Herb gathering code (zMud 7.21)

Posted: 19 Sep 2010 20:28
by Makfly
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.

Re: Herb gathering code (zMud 7.21)

Posted: 14 Jan 2011 11:24
by Rhaegar
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.

Re: Herb gathering code (zMud 7.21)

Posted: 14 Jan 2011 21:33
by Johnny
There is an easier way to do this without the need of variables and what not, just simple triggers and works smoothly.

Re: Herb gathering code (zMud 7.21)

Posted: 14 Jan 2011 22:58
by Cherek
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.