Cli command for adding a adventure counter

halfvoid

Member
I was wondering what the CLI command is for adding an adventure countdown. For instance, i want to use it for my he-boulder to keep track of when my next major ray.

So something like

Yellow Eye (150 turns remaining).
 

lostcalpolydude

Developer
Staff member
counters add X name image.gif

The last two parameters are optional, but I highly recommend using the name parameter so you know why you created it.
 

Bale

Minion
Here are a couple of examples I use regularly. ;)

counters add 8 Get Steel Organ daquiri.gif
counters add 35 Dude Ranch Vacation dynamite.gif
counters add 35 Tropical Island Vacation orchid.gif
counters add 35 Ski Resort Vacation fence.gif
 

Bale

Minion
The WHOLE POINT of a counter is to cancel a script when it runs out. However, if you want it to handle the counter automatically and then return to your script, you can use this script. It handles all standard counters and some nonstandard counters as well.

You should be able to modify it easily enough for special counters only you use. You could even have it simply return to the script and do nothing when it hits a counter.

Code:
// CounterKeeper v1.1
// Thanks to those whose work has been absorbed to make this: 
//    jasonharper, StormCrow42, Alhifar, Ankorite, antimarty and Miser.
// Revisioned and reconstructed by Bale.

// To use:
// Download zarqon's zlib: http://kolmafia.us/showthread.php?t=2072
// set counterScript = CounterKeeper.ash
// set wormwoodGoal = objective
//     objective can be any wormwood prize or stat. (eg. moxie51 or cancan skirt) 
//     You can add 51 or 1 to a stat to limit the turns you spend on your stat adventures.
//     This script is very good at figuring out what you mean, so you can just type "cancan", "skirt" or "pants".

// Supported Counters:
//  - Fortune Cookie: If you're not in hardcore it will get the available semi-rare with highest mall price.
//  - Wormwood: Will automatically get the wormwood goal of your choice. You can set the goal in CLI with:
//         set wormwoodGoal = xxx
//         where xxx is a stat or item. (Optionally add 951, 51 or 1 to limit the turns spent on stats.)
//  - Dance Card: Will adventure in Ballroom, if you're not already there and use another dance card.
//  - Get Steel Organ: Will adventure in the Friar's Gate and then try to use the organ, if possible.
//  - Dude Ranch Vacation, Tropical Island Vacation, Ski Resort Vacation:
//         Will abort automatic adventuring and alert you that the vacation is ready to produce a tower item,
//         but it will not adventure there automatically so you can purposefully schedule those 3 turns.

Oh, it does make use of zarqon's zlib
 

Attachments

  • CounterKeeper.ash
    16.6 KB · Views: 37

halfvoid

Member
i have this counterscript running from the CCS to set a rockmonster counter:

Code:
void main(int initround, monster foe, string url)
   {
   if (foe == $monster[rock snake] || foe == $monster[rock homunculus] || foe == $monster[clod hopper])
      cli_execute("counters add 25 rockmonster");
}

and i'm running this script to do some floaty sand and sandworm farming:

Code:
notify <halfvoid>;

if ( item_amount($item[ drum machine ]) > 0 )
   {

int start = my_meat();
int startspice = item_amount($item[ spices ]);
int startmel = item_amount($item[ spice melange ]);
int startfs = item_amount($item[ floaty sand ]);
int startadv = my_adventures();
outfit("meat");



while ( item_amount( $item[ drum machine ]) > 0 && my_adventures() > 0 )
   {
   outfit("meat");
   use (1, $item[ drum machine ]);
   int iter = iter + 1;
   if (get_counters("rockmonster",0,0) != "")
      {
      outfit("item");
      adventure( 10, $location[ Oasis In The Desert ] );
      }
   }

int changemeat = my_meat() - start;
int changespice = item_amount($item[ spices ]) - startspice;
int changemel = item_amount($item[ spice melange ]) - startmel;
int changefs = item_amount($item[ floaty sand ]) - startfs;
int changeadv = startadv - my_adventures();

print("Meat change: " + changemeat + " | Spice gained: " + changespice + " | Melange gained: "
 + changemel + " | Sand gained: " + changefs);
print("Adventures used: " + changeadv + " | MPA: " + changemeat / changeadv);
print(" ");
   }
   else
   {
   print("Get some drum machines first!");
   }

it stops now whenever the rockmonster counter expires. how can i get it to continue after the rockcounter expires?
and possibly add in detection for the major yellow ray cooldown of the he-boulder?
and and possibly to autouse the he-boulder yellow ray on a clod hopper?
 
Last edited:

halfvoid

Member
just made a simpler counterscript and set the return on the rockmonster counter to true. working now but i'd still like to know how to install the other two features.
 

jasonharper

Developer
The expression:
get_counters("Major Yellow Recharge", 0, 999) == ""
will be true if a major yellow is available for use.

To actually use it in a consult script, you'd have to waste rounds (by using a seal tooth or whatever) until the page text contains "yellow eye", then use the "Point at your opponent" skill.
 
Top