zarqon
Well-known member
Simple: I would like to request another script hook in mafia, a detectionScript. The script would require a void main(string), and every time mafia internally or externally (relay) loads a URL (the final URL in the case of redirects/re-login), the script would run, with mafia passing the unaltered page text as the parameter. The script would not be for editing the page text, but for acting or setting flags based on what it detects in the page text. In the case of relay, it should probably act before any relay scripts -- but the relay script would still act based on the original page.
This request, if implemented, would be useful for many sorts of event-driven scripting (setting properties or counters when you encounter something, which another script such as a consult or betweenBattleScript would reference), and could take some of the detection workload off of the devs -- requests for "can mafia track X?" could be accomplished rather easily by scripters.
Originally, I was going to request that mafia set an informational "No Turtles" counter for the duration of the remaining Eau de Tortue whenever a turtle-taming encounter is found. I couldn't think of a good way to detect whether you have already gotten your tamed turtle encounter in a betweenBattleScript -- the current method of adding the turtle to goals was problematic for a variety of reasons (sometimes it extends adventuring longer than desired, sometimes the encounter happens without getting a turtle). But I could do this -- and more -- quite easily using a detectionScript.
This request, if implemented, would be useful for many sorts of event-driven scripting (setting properties or counters when you encounter something, which another script such as a consult or betweenBattleScript would reference), and could take some of the detection workload off of the devs -- requests for "can mafia track X?" could be accomplished rather easily by scripters.
Originally, I was going to request that mafia set an informational "No Turtles" counter for the duration of the remaining Eau de Tortue whenever a turtle-taming encounter is found. I couldn't think of a good way to detect whether you have already gotten your tamed turtle encounter in a betweenBattleScript -- the current method of adding the turtle to goals was problematic for a variety of reasons (sometimes it extends adventuring longer than desired, sometimes the encounter happens without getting a turtle). But I could do this -- and more -- quite easily using a detectionScript.