A question on Choices, visit_url and aborts

Winterbay

Active member
I'm trying to get Bumcheekascend to handle the sonar room in a good fashion and I've managed to grab the urls needed to enter the correct values into the sonar machine, however I have two small questions:

1) What happens if I automate to make Mafia hunt for a choice-adventure and said chocie-adventure is unsupported (or set to 0). Will the script abort? If I catch said abort can I then use the lastEncounter-property to make sure it was the correct adventure?
(problem here being that setting the choiceAdventure588 property to anything but 0 will fail due to KoL wanting a second parameter as well for the value of the button)

2) Can anyone come up with a good regex that makes it possible to see what the current values of the buttons are? This in order to be able to pick up from where teh scritp left off in case of runnign out of turns, or being aborted, or someone doing part of it outside of mafia.
The code in the html is the following:
Code:
Button1:
<form name=butt1 action=choice.php><input type=hidden name=whichchoice value=588><input type=hidden name=pwd value=d9fb3c8355cf6c37663cadc3598f1171><input type=hidden name=option value=1>Value: (1-11) <input type=text name=pingvalue size=5 value=2> <input type=submit class=button value="Set Pinging Machine"></form>

Button2:
<form name=butt2 action=choice.php><input type=hidden name=whichchoice value=588><input type=hidden name=pwd value=d9fb3c8355cf6c37663cadc3598f1171><input type=hidden name=option value=2>Value: (1-11) <input type=text name=whurmvalue size=5 value=4> <input type=submit class=button value="Set Whurming Machine"></form>

Button3:
<form name=butt3 action=choice.php><input type=hidden name=whichchoice value=588><input type=hidden name=pwd value=d9fb3c8355cf6c37663cadc3598f1171><input type=hidden name=option value=3>Value: (1-11) <input type=text name=boomchuckvalue size=5 value=1> <input type=submit class=button value="Set Boomchucking Machine"></form>
 

lostcalpolydude

Developer
Staff member
I don't know about making a complex regex for that, but
Code:
int index = page.indexOf( "name=pingvalue" ) + 28;
int value1 = to_int( page.char_at( index ) );
should get the first value (possibly an off-by-one error in there, since I haven't tested it). Similar code could easily grab the other two values.
 

Winterbay

Active member
Thanks. I managed to work it out based upon that. Now to make sure it never marks any of the areas as complete before they are...
 
Top