Re: Help with hobo monkey script
Ok, here is my first pass at a consult script...
First of all the ccs script should be set up like this:
[default]
1: consult hobomonkey.ash
2: attack
(Really you can put whatever finishing move is best for your class in 2).
consult hobomonkey.ash will only use up rounds until the monkey steals the meat, and then dump
you back into the ccs script.
By using up rounds it tries to use in order: facsimile dictionary, dictionary, spices, turtle totem, seal tooth,
spectre scepter
If you don't have any of these things, are you aren't using the hobo monkey familiar the script will abort.
Please let me know if anyone has any idea for what else if anything this script should do:
Code:
# hobomonkey.ash (version 0.4)
# written by Captain Kirk 7/20/2008
// This script assumes you can survive on your own with moods. All it does
// is use an item that won't kill the monster until the monkey steals, then it
// dumps you back to the ccs script to do whatever finishing moves are designed there.
item itemToUse;
boolean itemFound;
boolean didSomething;
void PickItem()
{
boolean inValley;
//Pick the best items to use to do no damage for a while
inValley = (my_location() == $location[Orc Chasm]);
itemFound=true;
if (! inValley ) {
if (item_amount($item[facsimile dictionary])>0) {
itemToUse = $item[facsimile dictionary];
} else if (item_amount($item[dictionary])>0) {
itemToUse = $item[dictionary];
} else {
itemFound=false;
}
}
if ( inValley || (! inValley && itemFound == false) ) {
itemFound = true;
if (item_amount($item[spices])>0) {
itemToUse = $item[spices];
} else if (item_amount($item[turtle totem])>0) {
itemToUse = $item[turtle totem];
} else if (item_amount($item[seal tooth])>0 ) {
itemToUse = $item[seal tooth];
} else if (item_amount($item[spectre scepter])>0) {
itemToUse = $item[spectre scepter];
} else {
itemFound=false;
}
}
}
void main (int theRound, monster theEncounter, string pageString)
{
PickItem();
if(my_familiar() != $familiar[hobo monkey]) {
// print a warning, and use item and exit
abort("You need to switch to using a hobo monkey");
}
didSomething = false;
if (contains_text(pageString,"You get the jump")) {
if (my_class() == $class[accordion thief] || my_class() == $class[disco bandit]) {
pageString = steal();
theRound = theRound + 1;
didSomething = true;
}
}
// climbs up and sits is part of the string that shows up when monkey steals
while ( ! contains_text(pageString, "climbs up and sits") && theRound < 27 ) {
if (itemFound) {
pageString = throw_item(itemToUse);
theRound = theRound + 1;
didSomething = true;
} else {
abort("You don't have any applicable items to use");
}
}
// hack to prevent ccs from aborting if script is not called in round 1
if (! didSomething ) {
if (itemFound) {
throw_item(itemToUse);
}
}
}