mredge73
Member
I have used this little function for almost two years but mafia now aborts my script if I am stuck in the sewer when using it at the beginning of a breakfast script. All mafia breakfast options are disabled so my breakfast script does get executed but halts when this function is called. The purpose of the function is to detect if I am in the cage, if I am in the cage the bot will resume chat functionality and disable all other functions so not to hit the server. The bot should also get out if rescued so it has to periodically hit the "wait for rescue" button. When stuck I typically run this function over and over in 3-5 minute intervals until released and I use the unix timestamp to exit mafia right before rollover if not released.
I am looking for suggestions on improving/fixing it. The visit_url is just one that I picked at random, if in the cage then the normal text will be replaced with the choice adventure.
I am looking for suggestions on improving/fixing it. The visit_url is just one that I picked at random, if in the cage then the normal text will be replaced with the choice adventure.
Code:
boolean StuckInSewer()
{
string office= visit_url("clan_office.php");
if( contains_text( office, "Despite All Your Rage" ) && contains_text( office, "211" ) )
{
set_property( "choiceAdventure211" , "2" );
set_property( "choiceAdventure212" , "2" );
run_choice(office);
set_property( "choiceAdventure211" , "0" );
set_property( "choiceAdventure212" , "0" );
office= visit_url("clan_office.php");
}
if( contains_text( office , "Despite All Your Rage" ) )
return true;
else
{
if(contains_text( office , "Pop!" ))
{
set_property( "choiceAdventure296" , "1" );
run_choice(office);
cli_execute("refresh all");
}
set_property( "choiceAdventure211" , "0" );
set_property( "choiceAdventure212" , "0" );
return false;
}
}