jhildy
2007-06-06 21:33:05
I havn't seen any scripts use this. I myself started to use it recently because it is helpful.
Using Status and Getstatus
well a new function was put into scar and i took advantage of it and used it as basically a hidden variable.
Status
For people who dont know, there is a procedure"Status(s: string);"
In scar Status is used to change a text at the bottom. The program uses it quite frequently. Status is the text that says "Script running" or "Script terminated" near the bottom.
Get Status
You can change this using the procedure i mentioned earlier.
in the new verison of scar though, there was GetStatus: string; function.
this would return the value of Status as a string. This allows you to use this as an undeclared varaible(meaning you dont have to declare it in your script).
In some peoples scripts they used Players.loc = 'bank'; or a similar variable. I found using GetStatus to work just as well. it also could be a failsafe to make sure the script gets to the next part.
Below is an example of how it would be used.
this wont compile for me but it is not meant to work it's just an example of how to use it.
Therefore this function could be used as another failsafe.
Using Status and Getstatus
well a new function was put into scar and i took advantage of it and used it as basically a hidden variable.
Status
For people who dont know, there is a procedure"Status(s: string);"
In scar Status is used to change a text at the bottom. The program uses it quite frequently. Status is the text that says "Script running" or "Script terminated" near the bottom.
Get Status
You can change this using the procedure i mentioned earlier.
in the new verison of scar though, there was GetStatus: string; function.
this would return the value of Status as a string. This allows you to use this as an undeclared varaible(meaning you dont have to declare it in your script).
In some peoples scripts they used Players.loc = 'bank'; or a similar variable. I found using GetStatus to work just as well. it also could be a failsafe to make sure the script gets to the next part.
Below is an example of how it would be used.
program New;
{.include SRL/SRL.scar}
procedure FindBanks;
var x,y,i: integer;
begin
i:=0;
repeat
if (findsymbol('bank',x,y)=true) then
begin
Mouse(x,y,3,3,true);
Status('walking to bank');
flag;
end else;
i:=i+1;
until(getstatus='walking to bank') or (i>=10);
end;
begin
setupSRL;
repeat
findbanks;
if getstatus = 'walking to bank' then
writeln('walking to bank!');
else writeln('not walking to bank');
until(false);
end.
this wont compile for me but it is not meant to work it's just an example of how to use it.
Therefore this function could be used as another failsafe.