SRL Archive - OSR Help

Where to put this timer?


Mor

2012-04-01 08:40:15

I have built a screen timer but I dont know where to put him because it stop
the script

Procedure Timer;
var
text: String;
begin
text:='Running Time:';
while (LoggedIn) do
SMART_DrawTextMulti(True,False,[text+MsToTime(GetTimeRunning, Time_Bare)],Point(50, 50),UpChars,clOlive) ;
end;

Abu

2012-04-01 09:19:11

First of all it shouldn't stop the script :confused:

Secondly, I guess you could just place this procedure near the top of your script and then at the start of all your other function/procedures - you could call it.

Mark

2012-04-01 10:07:53

Post more of your script that your trying to add it to.
Or try place in your main loop

Mor

2012-04-01 11:54:38

I tried to call it in the main loop but it just stuck the other calls.
here is my script:

program MorWillowsChopper;

{$DEFINE SMART}
{$i srl/srl.simba}
{$i sps/sps.simba}

{$IFDEF SMART}
{$i srl/srl/misc/paintsmart.simba}
{$ENDIF}



Procedure DeclarePlayers;
begin
HowManyPlayers:=1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer:=0;
//--------------------
//Pleas fill the form:
//-------------------
Players[0].Name:='';
Players[0].Pass:='';
Players[0].Active:=True;
end;


//----------------------------------------------
//Pleas don't touch the next part of the script
//---------------------------------------------



procedure AntiBan();
begin
if(not(LoggedIn))then
Exit;
FindNormalRandoms;
case Random(8) of
0:
begin
HoverSkill('Woodcutting', false);
wait(2453+Random(432));
end;
1: PickUpMouse;
2:
begin
MakeCompass('S');
wait(50+random(133));
MakeCompass('N');
FindNormalRandoms;
end;
end;
end;


Procedure Timer;
var
text: String;
begin
text:='Running Time:';
while (LoggedIn) do
SMART_DrawTextMulti(True,False,[text+MsToTime(GetTimeRunning, Time_Bare)],Point(50, 50),UpChars,clOlive) ;
end;




procedure DropLogs;
var
i: Integer;
begin
Writeln('Dropping');
if not (LoggedIn) then
Exit;
if(InvFull) then
for i := 1 to 28 do
begin
if ExistsItem(i) then
DropItem(i);
wait(50+random(80));
end;
end;



Procedure ChopTree;
var x,y:integer;
begin
repeat
FindNormalRandoms;
if FindObj(x,y,'hop',1120020,40)then
Mouse(x, y, 1, 1, false);
ChooseOption('hop');
AntiBan;
repeat
Wait(1200+random(250));
Until not IsUpText('illow') or (InvFull);
Until (InvFull);
end;



procedure MainLoop;
begin
repeat
ChopTree;
DropLogs;
Until not(LoggedIn);
end;



begin
{$IFDEF SMART}
Smart_Server := 0;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
{$ENDIF}
SetUpSRL();
ActivateClient();
DeclarePlayers();
LoginPlayer();
MainLoop();
end.