Using Spell[1025].cast automatically checks for spell failures and will recast.
Using Spell[1025].cast automatically checks for spell failures and will recast.
Ok, figured something else out, forgot to add weapon type so only had two variables.
That's why the script started to try and recast.
Would this work:
If script.vars[3]=="" then fput "You need 3 variables!" break
added just after the line: target_id = nil and just before the comments?
Last edited by Eliseen; 01-05-2021 at 07:55 PM.
If you want to see if a variable doesn't have a value you can use nil.
So you could do:
Code:if script.vars[3].nil? echo "You need 3 variables." exit end
Thanks, I'm slowly getting the hang of this. I was wanting to try the script out walking around town. So not to attack anyone's pets or familiars or such chose bats and balls as the critters. Forgot to add in a weapon, singing sword does not recognize bats as a weapon. It failed to cast twice (armor hindrance it said rolled a 7 and a 1) finally pulled up a broadsword as default.
I figure if you do like I did and forgot to enter a weapon you would only have 2 variables # 3 would be nil, If you forgot all variables again #3 would be nil. Sort of a catch all. So I got all spelled up this evening so first thing in the morning I'm going to try it out. I think I may have all the bugs worked out, at least I hope so. Darn near ver 1.1.
Again much thanks.
Ok found a little glitch. If you die well it sort of goes off the deep end. How's this look
if checkdead.nil?
echo "program exiting."
exit
end
And that would be in the main loop correct?
Ok found a little glitch. If you die well it sort of goes off the deep end. How's this look
if checkdead.nil?
echo "program exiting."
exit
end
And that would be in the main loop correct?
Yeah just do:
exit if dead?