taltamir
Member
trying to use mall_price in a choice adventure has the following issues:
issue 1: it tries to navigate to the mall which encounters a choice adventure and thus immediately forces the choice adventure to process again. this causes a semi infinite loop (it eventually reaches stack overflow after ~700 iterations... and 700 server hits).
I am guessing that in a choice adventure that can be navigated away from it will lose the choice adventure instead.
>script gets called
>script tries to use mall_price() to try to determine if we should make a specific choice
>mall_price calls tries to navigate to the mall which calls the script again
repeat until stack overflow
issue 2:
when that choice adventure is set to anything other than "show in browser"
or if a script is called and handles it without the infinite loop of calling it again. then it will result in a value of -1 being set for that item's price for the rest of the day
mafia choiceAdventure### handling example:
script handling problem 3 example:
In both cases it returned -1 which then sets the price for the rest of the day (as due to the anti abuse code for mall the price can only be set once per day.
I think the issues can be solved by having mall_price return historical_price when called inside a choice adventure.
Not sure what would happen if an item did not even have a historical price, would it try to look it up in such a case? in which case historical_price needs a check to see if in an NC and make sure to not try to do the lookup in such a case. probably something like
issue 1: it tries to navigate to the mall which encounters a choice adventure and thus immediately forces the choice adventure to process again. this causes a semi infinite loop (it eventually reaches stack overflow after ~700 iterations... and 700 server hits).
I am guessing that in a choice adventure that can be navigated away from it will lose the choice adventure instead.
>script gets called
>script tries to use mall_price() to try to determine if we should make a specific choice
>mall_price calls tries to navigate to the mall which calls the script again
repeat until stack overflow
issue 2:
when that choice adventure is set to anything other than "show in browser"
or if a script is called and handles it without the infinite loop of calling it again. then it will result in a value of -1 being set for that item's price for the rest of the day
mafia choiceAdventure### handling example:
Code:
> ash mall_price($item[imp unity ring])
Searching for "imp unity ring"...
Encounter: One Mahogany Nightstand
You acquire an item: old coin purse
Search complete.
Returned: -1
script handling problem 3 example:
Code:
> ash mall_price($item[shiny ring])
Searching for "shiny ring"...
Encounter: One Ornate Nightstand
Encounter: One Ornate Nightstand
[DEBUG] Running auto_choice_adv.ash
Submitting option 2 for choice 878
You gain 91 Magicalness
You can now equip a Mer-kin scholar mask (and possibly other things).
You gain a Mysticality point!
You gain a Level!
Search complete.
Returned: -1
I think the issues can be solved by having mall_price return historical_price when called inside a choice adventure.
Not sure what would happen if an item did not even have a historical price, would it try to look it up in such a case? in which case historical_price needs a check to see if in an NC and make sure to not try to do the lookup in such a case. probably something like
Code:
if(available_choice_options() contains 0 || available_choice_options() contains 1) //we are in a choice adventure.