Basic breakfast/gym script

aphroguy

New member
Modified Script:
Code:
if (my_adventures() > 160)
        {
                cli_execute("adventure 20 pump up moxie");
                cli_execute("adventure 20 pump up mysticality");
                cli_execute("adventure 20 pump up muscle");

}

cli_execute("breakfast");

Original message follows.


Hello all,

I'm almost embarrassed to be posting this, but at least you know you'll be getting a snicker at my code's expense! ;)

So what I'm trying to do is run a VERY basic daily script:

Code:
if (my_adventures() > 160)
        (
                cli_execute("adventure 20 pump up moxie");
                cli_execute("adventure 20 pump up mysticality");
                cli_execute("adventure 20 pump up muscle");

);
else (continue);




cli_execute("breakfast");

Ugh, I don't even know where to begin. I'm sure just by looking at this chicken-scratch, you coding geniuses can at least get a feel for what I'm trying to do. If I have over 160 adventures remaining when I run the script, I want it to work out in each of the gyms for 20 adventures, then get breakfast. If I have less than that many, I'll just have it get breakfast.

Using the 'verify' command in the CLI yields the following message:

Script parsing error at line 2 in file /home/me/KoLmafia/breakfast.ash
Script verification complete.

I know my syntax is probably inexcusably horrific, this is just my first attempt at any type of ASH script. Well, unless you consider my previous version of the same script my first attempt:

Code:
cli_execute("breakfast");

But hey, that first one worked. So I'm 1 for 2 at the moment, in that case; batting a .500.

Any help or input would be appreciated! Not looking for anything fancy, just a clean up of what I have. Thanks!
 

holatuwol

Developer
Re: Basic breakfast/gym script -- Help needed!

Code blocks use { and }, not ( and ), so the ( on line 2 should be a {, and the ) later on should be changed into a }.  Also, else(continue) is meaningless and can be omitted.  That's all I see off-hand.
 

aphroguy

New member
Re: Basic breakfast/gym script -- Help needed!

Geez, I thought I was the only one around here that lost sleep to KOL and the internet. :D

Yup, that did it, case closed, thanks guys. I don't know if you wanna move this to the working scripts section of the forum, but now that you guys got it working for me, others are more than welcome to it. For those who would like the finished product:

Code:
if (my_adventures() > 160)
        {
                cli_execute("adventure 20 pump up moxie");
                cli_execute("adventure 20 pump up mysticality");
                cli_execute("adventure 20 pump up muscle");

}

cli_execute("breakfast");

BOO-YAH. Thar she blows, a simple daily 'do stuff and get stuff so stuff's not wasted' script.
 
Top