So I thought I'd try to compile a definitive list of every spell in game that enables invisibility (partially out of boredom and looking for a challenge, partially because I want to make a quick macro that will drop invis no matter what the invis is. Here's my code...
It works just fine until it occasionally crashes. I thought it was randomly crashing, but I put in the /echo ${x} and found exactly where it crashes (at least one spot). It crashes when trying to access...
${Spell[15931].Slot[3].Find[Invisibility]}
I found this out by just typing in each variable in the /if statement until it crashed manually, and it always does on that one. In lucy, that slot contains the following data...
Unknown #404 (100/-5/0)
Now, I can just work around the occasional crashes when it hangs up on a spell by restarting it and adjusting the X everytime, but I was wondering if there might be an issue with the Slot accessing the data if it's Unknown like that?
Code:
Sub Main
/declare x int local 0
/declare ctr int local 0
/for x 1 to 50000
/echo ${x}
/if (${Spell[${x}].Slot[1].Find[Invisibility]} || ${Spell[${x}].Slot[2].Find[Invisibility]} || ${Spell[${x}].Slot[3].Find[Invisibility]} || ${Spell[${x}].Slot[4].Find[Invisibility]} || ${Spell[${x}].Slot[5].Find[Invisibility]}) {
/echo ${Spell[${x}]}
/ini "InvisSpells.ini" "Invis" "Spell${ctr}" "${Spell[${x}]}
/varcalc ctr ${ctr}+1
}
/next x
/end
It works just fine until it occasionally crashes. I thought it was randomly crashing, but I put in the /echo ${x} and found exactly where it crashes (at least one spot). It crashes when trying to access...
${Spell[15931].Slot[3].Find[Invisibility]}
I found this out by just typing in each variable in the /if statement until it crashed manually, and it always does on that one. In lucy, that slot contains the following data...
Unknown #404 (100/-5/0)
Now, I can just work around the occasional crashes when it hangs up on a spell by restarting it and adjusting the X everytime, but I was wondering if there might be an issue with the Slot accessing the data if it's Unknown like that?