zarqon
Well-known member
I've wanted for some time to write support for the choice adventures in the Island Barracks into BBB. Obviously in order to do this, some knowledge of what you have already encountered (and where) is necessary, and it must persist across script instances and logins. So I thought I would track the current hacienda progress in a mafia-like style using two properties, lastHaciendaReset and lastHaciendaLayout. Like the old Hidden City layout property, the lastHaciendaLayout property would be an 18-character string (default "000000000000000000") with each character representing one of the choice termini. As you explore the hacienda, those characters would be replaced depending on what you find:
F - fight
R - reward (the location-specific item, or in one case meat)
K - key
C - clue
f - unvisited fight (deduced when the other two locations in the room are R and K/C)
r - unvisited reward (deduced)
k - unvisited key/clue (deduced)
I ran into some major problems trying to implement this tracking, however. Mainly, there's no way to get the text of an automated noncombat. I actually wrote some 50 lines of code tracking everything, using the lastEncounter property, extract_items(), extract_meat(), and contains_text(), before I realized that I couldn't actually access the page text for the last-encountered choice.php.
That means our only options for tracking your Hacienda progress in a script are:
Find a fight? This room is F (may replace f).
Find a clue? Indicated room gets k (if not already K) and this room is C (may replace k).
Find a key? K (may replace k).
Find an item? R (may replace r, or F post-quest).
Other results could be ignored.
If this information were tracked, not only could BBB add automation for completing the (otherwise rather irksome) AT Nemesis quest, but mafia could also add helpful spoilers for relay players or even automate the acquisition of goals. And if he wanted to, slyz could stop reinventing the wheel and remove quite a lot of code from his script, while improving it at the same time (since it would lose tracking vulnerabilities).
F - fight
R - reward (the location-specific item, or in one case meat)
K - key
C - clue
f - unvisited fight (deduced when the other two locations in the room are R and K/C)
r - unvisited reward (deduced)
k - unvisited key/clue (deduced)
I ran into some major problems trying to implement this tracking, however. Mainly, there's no way to get the text of an automated noncombat. I actually wrote some 50 lines of code tracking everything, using the lastEncounter property, extract_items(), extract_meat(), and contains_text(), before I realized that I couldn't actually access the page text for the last-encountered choice.php.
That means our only options for tracking your Hacienda progress in a script are:
- Using visit_url() to adventure there (as slyz's lovely Nemesis script does), which sidesteps tons of mafia automation features like running your mood, recovery, configured before/after battle scripts, etc (if you want to keep them you have to spend a lot of code simply trying to duplicate mafia's existing functionality). This tracking also breaks if you do any of the exploration outside the script.
- Parsing of session_logs() after every turn. This has the benefit of working no matter how you adventure, and you don't have to re-invent the wheel as you do with visit_url()-ing your turns. However, the text returned from that function can be massive, so I suspect running lots of string-parsing on that between every combat would noticeably slow things down.
Find a fight? This room is F (may replace f).
Find a clue? Indicated room gets k (if not already K) and this room is C (may replace k).
Find a key? K (may replace k).
Find an item? R (may replace r, or F post-quest).
Other results could be ignored.
If this information were tracked, not only could BBB add automation for completing the (otherwise rather irksome) AT Nemesis quest, but mafia could also add helpful spoilers for relay players or even automate the acquisition of goals. And if he wanted to, slyz could stop reinventing the wheel and remove quite a lot of code from his script, while improving it at the same time (since it would lose tracking vulnerabilities).
Last edited by a moderator: