Hello guys,
I'm currently developing my own 1-40 auto level script and it's going pretty smooth, eventhough my scripting knowledge is very narrow and dumb.
Anyway, what I'm doing is setting functions that have prerequisites to trigger, such as: position, check level, check items, check buffs, and if everything is ok they start. It's not the best way, but it's working and I'm pretty excited about it.
The main problem I'm facing atm is that after I get to my designated spot of leveling, I wanna keep checking 3 conditions to stay there:
1) Level restriction (user.level>=32)
2) Buffs ended User.Buffs.ByID(4326, buff)
3) Dead (User.Dead)
I have set those 3 functions written properly, but I dont know how to keep checking them in the previous function to be triggered. I managed to set one of them at a time, by using this:
while not level32check do Delay(1000); // while not level >31, keep leveling
But if I die, my script will be stuck in this loop, same if I ran out of buffs, it will probably die and do nothing. I tried to do something like this code below with "while not" at the end of the spot function, but it failed to work because it only considers the first if:
function spot3check: Boolean;
var buff: TL2Buff;
begin
if User.Dead then begin
deadcheck;
end else User.Buffs.ByID(4326, buff) then begin
soe;
end else (user.level>=32) then begin
level32check
The point is that after it get to the spot, keep checking buff,level and dead. If any of them, begin that function and end the previous one. Glad if you can help me, Im breaking my head for 4h already.
Some bonus questions: :D
1) How can I set a function to keep checking if my char is standing (not moving, not sitting, not dead, not fighting) for more than xx seconds and if true, use SOE (stuck check)
2) How can I check a specific skill from my character and check if he doenst have it. Same if he has it, then check it's level?