he-boulder consult (hopefully)

halfvoid

Member
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 26 rockmonster");
      if (get_counters("Major Yellow Recharge", 0, 999) == "" ** my_familiar() == $familiar[He-boulder])
         {
         repeat
            {
            throw_item($item[turtle totem]);
            }
            until (contains_text(url, "yellow eye" );
         use_skill( $skill[Point at your opponent] );
         }
      }
   }

i have this set as a consult script in my ccs. i'm hoping it will automatically make my character use a turtle totem when facing a clod hopper with the he-boulder equipped and the major yellow ray recharged, then using the yellow ray when its available in the combat round.
 
Last edited:

lostcalpolydude

Developer
Staff member
Code:
cli_execute("counters add 26 rockmonster");
Why? If you're switching back and forth with your he-boulder, or with your charged magnet, then you want 24 here.
 

halfvoid

Member
the 26 turns into 25 immediately after the combat with a rockmonster which is when this triggers. if i changed it to 24 then mafia would only wait 23 turns before switching which is early for the next rock monster fight.

the string parsing appears to not be working with detecting the yellow eye. can anyone help me out with that?
 

lostcalpolydude

Developer
Staff member
Then you want 25, because at the end of the fight you want it to be 24. You can get another rock monster 25 turns later with a charged magnet. Sorry I can't help with the other part of the script.
 

jasonharper

Developer
Code:
         repeat
            {
            throw_item($item[turtle totem]);
            }
            until (contains_text(url, "yellow eye" );
This is an infinite loop; if 'url' does not contain "yellow eye" initially, there's no possible way for it to do so later, as you never change its value. (Also, 'url' is a really bad name for a variable that holds the contents of a page, rather than its URL.) Try something like this (with 'url' changed to 'pageText'):
Code:
    while (!contains_text(pageText, "yellow eye") {
        pageText = throw_item($item[turtle totem]);
    }
This will also handle the possibility of seeing the yellow eye message on the first round of combat; no point in using the turtle totem 3 times in that case.
 
Top