I am trying to understand this sub and make sure that it is correct.sub CheckMana
gosub newstatus lime black Checking Mana
set %_test ( 100 * #mana ) / #maxmana
if ( %_test < 20 ) || ( #mana < %mana )
{
If I am correct, it is setting the amount of mana at 100% I.E. if the character has 138 mana, it sets 138 as 100% mana and then it sets 20% mana so it can do something when mana falls below the 20% threshold.
gosub newstatus lime black 10 Meditating
while #systime < %_lastskillt
{
sleep 10
}
Checks the system time compared to when the last skill was used, if it is less than what time will be set, sit idle for 10 (not sure if it is like a wait 10 or wait 10s)?
event macro 13 46 ; meditate
set %_lastskillt #systime + 10200
while #mana < ( 95 * #maxmana / 100 )
{
wait 20
if %_lastskillt < #systime
ok, this uses the skill meditate and then sets that time as the last skill time and ads a timer of 10.2 seconds? Then says keep going as long as mana is less than 95%? Then has a short wait then starts comparing the time to the time of the last skill used?
{
event macro 13 46 ; meditate
set %_lastskillt #systime + 10200
}
};
Does the same thing again?
set %_diff #systime - %_lastskillt - 9000
if %_diff > 0
{
set %_diff ( %_diff / 50 ) + 1
}
}
This part loses me, sets a difference between the system time and the last skill time - 9 seconds and then halfs that difference and adds 1 second? I am stumped for sure on this part.
menu delete scriptstatus
return
Deletes the menu status message and a return
So, how far off am I, is this code solid as a mana check/med sub?