Eduard
2014-08-20 13:18:27
Dear SRL members,
After a long period of time not scripting, i'm in search of a method to incoorporate a nice way to program fail safes in a way that I don't have to call all the functions all the time.
For example, I would like to check if the Bankscreen is up. But if I don't place a Wait(x); in front of the function, the script will return false and goes to the next procedure without having it check again. I can solve this by using a While(Not()) loop, but this can cause infinite loops. I could use TimeMark, but is there a way to have a nice way to write failsafes in a matter of state feedback?
I'll give an example:
In other words, How do I script efficiently without needing so much random waits, it seems that waits are kinda buggy when it's laggy etc?
After a long period of time not scripting, i'm in search of a method to incoorporate a nice way to program fail safes in a way that I don't have to call all the functions all the time.
For example, I would like to check if the Bankscreen is up. But if I don't place a Wait(x); in front of the function, the script will return false and goes to the next procedure without having it check again. I can solve this by using a While(Not()) loop, but this can cause infinite loops. I could use TimeMark, but is there a way to have a nice way to write failsafes in a matter of state feedback?
I'll give an example:
procedure WithdrawLogs;
begin
if not(FindTPALogs) then
begin
if(not(Bankscreen)) then
begin
//Withdraw my logs here.
end;
end;
end;
// In this procedure, FindTPALogs is a function that returns true if there are logs in the inventory.
// When I'm calling this procedure, it will try and find the logs, if not true, it will check if the bank is up.
// problem with this is, if my character is banking and this procedure is called, the bankscreen may not already be up.
// to solve this problem, I could place a random wait or a while loop before If(Not(Bankscreen)).
// How can I code this more efficiently? What is the best way to have a feedback of the current state of the character?
In other words, How do I script efficiently without needing so much random waits, it seems that waits are kinda buggy when it's laggy etc?