Okay so I revamped the script and uploaded it as ;mana-tracking
From the script's description:
I've decided to take a page out of Simu's handbook and am going to let you all test it for me to find any bugs. I did test the basics to make sure it all works but I might have missed something here and there, but the script should echo back to you the important things so if it doesn't then that's a problem. Let me know.Keep track of how much mana you have spent for all of your 925 needs!
This script does all sorts of stuff!
It will keep track of how much mana you have spent on offensive spells since the last time you reset the stats.
It will keep track of mana pulses and check to see if you have gained another enchantment level since the last check.
It will keep track of how much mana you have spent on offensive spells since the last enchantment level.
It will keep track of how many pulses since your the last enchantment level.
The script requires you to not use any custom spell prep messages so the script turns those off automatically. If you want them on afterwards be sure to turn them back on.
There are some limitations due to the way I track mana pulses:
Using Sign of Wracking is fine, however using any other society ability that gives mana will mess with the pulse tracking. So don't do it! This includes: Sigil of Concentration, Sigil of Power, and Symbol of Mana.
Using mana leech and it gives you back exactly how much mana you gain on or off a node, or if the cast brings you up to 100% mana. This is up to you so watch it.
If someone sends you mana and the send gives you back exactly how much mana you gain on or off a node, or if the mana received brings you up to 100% mana. Again up to you.
If you don't care about pulse tracking then you don't have to worry about using any mana boosting abilities.
To reset all stats to 0 start script as: ;mana-tracking reset
Script will keep track of all stats until reset, even if you kill the script or log off the game.
Also I know the pulse tracking isn't perfect but it's the best I could come up with. I could track experience pulses and wouldn't have to worry about mana, but then I figured what happens if there is a pulse but the ol' noggin is empty? Although maybe your static would be empty if the head was empty? I'm not sure. Let me know if you think the experience thing works better and I might update the script to make use of that instead and we wouldn't have all of these mana gaining problems.
So for example let's say when you started the script SENSE says you're able to do a +3 enchant. On every mana pulse the script does a SENSE to see if this has changed (ideally if it's higher, actually performing an enchant without resetting the stats is gonna mess with this part), so once it gets to +4 the script SHOULD (this is where your testing comes into play) tell you how many pulses it has been sense it first saw +3 via SENSE and how much mana you spent during those pulses. It will keep track of total mana spent until you reset the stats. All of these stats (pulses, current mana, total mana, etc) is all stored until you reset the stats, even if you logoff, so the only problem would be if you killed the script and a few pulses went by then you logged off and started the script again the next day. If you keep the script running until you logoff then the number of pulses and all of that should remain accurate.
The spell also casts 401 when you're at 100% mana so it can know when a mana pulse happened.
Oh yeah the script should work for all spell casting: prep the spell first then cast, using INCANT, etc. Making INCANT work means the "Sleep" spell won't be as accurate but it should still be good enough. When casting "Sleep" the script now calculates the mana cost based on your level rather than the level of the critter you are casting at.