Eduard
2014-08-20 14:54:25
Hi guys,
What kind of scipt skeleton are the best to use for pascal/simba?
I'm currently using a failsafe in every procedure, but it looks kinda akward:
What could I use to code more efficient?
I'm thinking off a having a State loop that returns a value. Then in the mainloop use a case or if loops too see what the current status is:
For example:
What is good way to program this? It's not really a question regarding a particulair function, it's a way of programming logic that I lack off.
What kind of scipt skeleton are the best to use for pascal/simba?
I'm currently using a failsafe in every procedure, but it looks kinda akward:
procedure bank;
begin
if not(BankScreen) then
begin
// open the banks..
end;
end;
procedure fletch;
begin
if not (Bankscreen) then
begin
// not at bankscreen, we can fletch now.
end;
end;
procedure mainloop;
begin
while(Pixelshiftinv > 100) do //psuedo -> we are busy doing something in inventory, perhaps fletching?
Wait(1000);
if(InvLog < 1) then
bank;
if(InvLog > 1) then
Fletch;
end;
What could I use to code more efficient?
I'm thinking off a having a State loop that returns a value. Then in the mainloop use a case or if loops too see what the current status is:
For example:
if(StateFunction = 'Fletching') then
Wait(1000);
if(StateFunction = 'NoLogs') then
Bank;
if(StateFunction = 'Logs') then
Fletch;
What is good way to program this? It's not really a question regarding a particulair function, it's a way of programming logic that I lack off.
