Bug - Not A Bug Edpiece command prevents choice.php from running other choice adventures.

Joesus

New member
Tried writing my own script for Community Service where my character is pulling and using the Crown of Ed the Undying, and I've run into a snag.

Code:
cli_execute("edpiece owl");
doTest(10);

Where doTest is pretty similar to how most people use it:
Code:
void doTest(int which) {
	print("Undertaking community service task " + which);
	visit_url("choice.php?whichchoice=1089&option="+which+"&pwd="+my_hash());

However, it frequently doesn't work when the edpiece command has to switch from one setting to a different one. When reloading the doTest command to return the string value from the visit_url command, it'll have the choice adventure for setting the Edpiece (choice adventure 1063) instead of the council's CS quests. Also, running the "choice" command confirms that it's still in the choice adventure for the crown of Ed instead of being at the council.

Currently running the latest build (r16335).

Edit: workaround (for CS) is to add visit_url("council.php") commands like the following:
Code:
cli_execute("edpiece owl");
visit_url("council.php");
doTest(10)
 
Last edited:

Crowther

Active member
Not that it has much to do with your bug report, but if I was writing such a script, I'd let the maximizer adjust the edpiece for me. No idea if that would still exercise your bug.
 

Joesus

New member
After some more experimenting, the workaround seems to be the following:
Code:
cli_execute("edpiece owl");
[B]visit_url("council.php");[/B]
doTest(10);

This might suggest that the issue would be with the visit_url call within the doTest function, but the doTest function works fine without the extra council.php visits elsewhere in the script.
 

Darzil

Developer
I suspect that cli_execute isn't waiting for the command to complete, which I think you are assuming it does ?

(not a scripter, so only a guess)
 

Joesus

New member
Not that it has much to do with your bug report, but if I was writing such a script, I'd let the maximizer adjust the edpiece for me. No idea if that would still exercise your bug.
I tried that too, but the issue was still present when letting the maximizer make the edpiece adjustment.
 

Joesus

New member
I suspect that cli_execute isn't waiting for the command to complete, which I think you are assuming it does ?
I had also tried adding wait(2); blocks between the edpiece command and the doTest command but it also didn't have an effect.
 

Darzil

Developer
No, actually it's just that you have to visit the council before running the choice. You can't just run the choice when not at the council, KoL doesn't work like that.
 

Darzil

Developer
Try putting this into doTest:

visit_url("council.php");
run_choice( which ); // simpler than your visit_url, does the same thing
 

Crowther

Active member
No, actually it's just that you have to visit the council before running the choice. You can't just run the choice when not at the council, KoL doesn't work like that.
I should have noticed that. Also, you'll need to visit the council once after you ascend to get things started or doTest() will fail the first time and then you'll get really confused debugging it, because it will work from then on.
 
Top