Starfish Switch 1.1
So I've been using Mafia for a while now, and I decided to try my hand at scripting. One thing that I was wishing for was for Mafia to automatically pull out my starfish when I got low on mana (more important now that I'm actually playing hardcore). So I decided to write a nice little script that would do it for me. This is my first mafia script ever. I tried to document all my functions and stuff, and I think I maintained proper programming style through most of it. I'll take any criticism and stuff I can get.
This script acts as a betweenBattleScript. After each battle, it will check your mana percentage against a user set variable. If your mana is below a certain percentage, it will pull out the best starfish type familiar you have based on weight and calculations taken from KoLWiki. It will then switch back to your original familiar when your mana crosses a threshold that once again is user specified. It's pretty much automatic for the most part. Now a large portion of the code, I have been completely unable to test, because I don't have any of the familiars. However, the code works perfectly fine for the base Starfish familiar. I would love to get some feedback from people who actually have access to the different type of starfish familiars. If any of the veteran coders around here want to take a look at my code and give me some pointers, that would rock too. So to recap:
To use the script:
Variables that can and should be changed:
Changelog:
PS: If this goes in another section, please feel free to move it. This was just the best one I could think of >.<
So I've been using Mafia for a while now, and I decided to try my hand at scripting. One thing that I was wishing for was for Mafia to automatically pull out my starfish when I got low on mana (more important now that I'm actually playing hardcore). So I decided to write a nice little script that would do it for me. This is my first mafia script ever. I tried to document all my functions and stuff, and I think I maintained proper programming style through most of it. I'll take any criticism and stuff I can get.
This script acts as a betweenBattleScript. After each battle, it will check your mana percentage against a user set variable. If your mana is below a certain percentage, it will pull out the best starfish type familiar you have based on weight and calculations taken from KoLWiki. It will then switch back to your original familiar when your mana crosses a threshold that once again is user specified. It's pretty much automatic for the most part. Now a large portion of the code, I have been completely unable to test, because I don't have any of the familiars. However, the code works perfectly fine for the base Starfish familiar. I would love to get some feedback from people who actually have access to the different type of starfish familiars. If any of the veteran coders around here want to take a look at my code and give me some pointers, that would rock too. So to recap:
- Starfish Switch will automatically handle your starfish switching needs.
- The script will take into account adventuring under the sea.
- The script supports all the pure starfish type familiars.
To use the script:
- Download StarfishSwitch.ash to your scripts directory.
- Get ZLib if you don't have it already
- Open mafia and type set betweenBattleScript = StarfishSwitch.ash into the gCLI
- Get out your preferred familiar and start adventuring
Variables that can and should be changed:
- ss_enabled - Enables and disables the script completely.
- ss_starfishmin - The mana percentage at which to pull out your starfish
- ss_starfishmax - The mana percentage at which to put away your starfish
- You must pick only one of the below three options!!! Do not more than one at the same time!
- ss_useggg - Use gluttonous green ghost.
- ss_usespirithobo - Use spirit hobo.
- ss_useslimeling - Use slimeling.
Changelog:
- 2/16/2010: 1.0 - First Release
- 2/16/2010: 1.1 - The real first release because the first one was broken. Added some new features too! Now detects familiar changes better and takes them into account
PS: If this goes in another section, please feel free to move it. This was just the best one I could think of >.<
Attachments
Last edited: