I've been studying Fakawi's Goblin Scheduler, and on it...
SCAR Code:
procedure PlayerStats;
var Active: string;
var i, temp: Integer;
begin
if Players[CurrentPlayer].Active=True then
Active:='True'
else
Active:='False';
WriteLn ('<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>');
Writeln (' Name : '+ Players[CurrentPlayer].Name);
Writeln (' Number : '+inttostr(CurrentPlayer));
Writeln (' Active : '+ Active);
if ( Players[CurrentPlayer].Worked > 0 ) then
Writeln (' Worked : '+ inttostr(Players[CurrentPlayer].Worked));
Writeln (' Location : '+ Players[CurrentPlayer].loc);
Temp:=(GetSystemTime div 1000);
Temp := Temp - StartTime;
if ( playtime < temp ) then
Writeln (' Time Left : '+ IntToStr ( Temp - PlayTime / 60 ) + ' min[s].');
WriteLn ('<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>');
for I := 0 to HowManyPlayers - 1 do
begin
if Players[i].Active=True then Active:='T' else Active:='F';
WriteLn ( ' ' + Inttostr ( I) + ' : ' + Players[i].Name + ' = ' + Active
+'. - Lvl : '
+' '+inttostr(Players[i].level[1])
+' '+inttostr(Players[i].level[2])
+' '+inttostr(Players[i].level[3])+
+' '+inttostr(Players[i].level[5])+
+' '+inttostr(Players[i].level[8])+'. '
+'W : '+IntToStr(Players[i].Worked)+' min. '
+'K : '+ IntToStr(Players[i].Killed)+' Goblins. '
+'L: '+Players[i].loc);
end
See how i is declared and used in that procedure, and in this one:
SCAR Code:
procedure FTWaitD ( Time : Integer );
var T, I : integer;
begin
try
T := (Time div 1000)+1;
for I := 1 to T do
begin
Wait ( 250 );
FindTalk;
end
except
begin
Wait ( Time );
FindTalk;
end;
end;
Can you use i multiple times after its been ended?
Also, btw, whats the "div" mean in the 2nd ScarScript?