I've seen alot of people having problems with their char having to rest, but only rests a second or 2 then stands and resumes attack without hp being fully recovered and no monsters attacking/interrupting the rest. I too had the same problem, and i studied it for a bit. I found the reason for it being that your MP & SP is full, i've tested it and wasted ALL my MP before a HP rest, and it seems that it follows the order which ever bar fills up first will make the char exit resting.
After reading through the scripts multiple time (mind you, been a while since i've looked at an actual source code, and its similar to c/c++) i've edited the variables to my personal setting:
Code: Select all
HP = 10000;
MaxHP = HP;
MP = HP;
MaxMP = MP;
SP = HP;
MaxSP = SP;
since i didn't care about the value of my MP, SP... and also took off some variable checks on the while command:
Code: Select all
while( HP < MaxHP ) do
if( HP < lasthp ) then
printf("Exiting rest...under attack\n");
return;
else
lasthp = HP;
end
yrest(100);
end
line 1 originally had
Code: Select all
while( HP < MaxHP and MP < MaxMP and SP < MaxSP ) do
i am pretty clueless right now as to how i figured to change that, since earlier my comprehension was much better, but now i am just dead tired and need sleep x.x
anyways, This is a nice program you have here! still trying to go through learning lua languange, since i wanted to make a function that activates a timer once a target has been selected. That way when the timer reaches a certain value, it will assume that the target is bugged (cannot be attacked) or you are stuck on something and cannot get to your target and will then on select another target using the key.VK_` (<-- i tried that, but threw me a code about invalid so i tried key.VK_TILDE) and execute fight. I was mainly focusing on getting out of terrain since most likely if i can't get to a target, I am stuck. Then i remembered there was Unf that had clippin on it and trashed all the coding i attempted since i could just clip instead of getting stuck right? wrong! i couldn't download the latest Unf so now im back to scratch... GO FIGURE!