SRL Archive - Help

How to add timer?


rj

2012-10-27 17:46:08

I made a agility script for a p server, and i was wondering how would i add a timer to calculate the xp per hour?
script looks like this:
program autoagile;
var
X,Y: Integer;
xp: Integer;
runs: Integer;
mode: Integer;

procedure climb;
begin
//climb
FindColorTolerance(X,Y,3038590,808,188,844,244,4)
Wait(150 + Random(40));
movemouse(x, y);
Wait(220 + Random(50));
ClickMouse(x, y, Mouse_Right);
wait(100);
FindColorTolerance(X,Y,16776960,787,185,861,238,4)
wait(200);
movemouse(x, y);
wait(200);
ClickMouse(x, y, Mouse_left);
wait(2400)
FindColorTolerance(X,Y,3038590,808,188,844,244,4)
Wait(150 + Random(90));
movemouse(x, y);
Wait(220 + Random(50));
ClickMouse(x, y, Mouse_Right);
wait(300);
FindColorTolerance(X,Y,16776960,787,185,861,238,4)
wait(200);
movemouse(x, y);
wait(200);
ClickMouse(x, y, Mouse_left);
wait(2400)
IncEx(xp, mode);
IncEx(runs, 1);
Writeln('-----------------------------------------------')
Writeln('-----------------------------------------------')
Writeln('----------RJJ95 pserver agility--------------')
Writeln('Gained xp:' + Tostr(xp))
Writeln('Runs:' + Tostr(runs))
Writeln('-----------------------------------------------')
Writeln('-----------------------------------------------')

end;
begin
xp:=0;
runs:=0;
mode:= 2500;
repeat
climb;
until False;
end.

___

2012-10-27 18:04:19

This is what I use in my proggies
WriteLn('Time Running: ' + TimeRunning);
then per hour it would just be simple math calculations.

Enslaved

2012-10-27 18:06:56

there is :
TimeRunning
and also
GetTimeRunning

Alternatively you can use: MarkTime(Integer)
and TimeFromMark(Interger)

Footy

2012-10-27 18:12:13

Take a look at my fletching script, I believe I have the formula for xp/h in the proggy of that script.

rj

2012-10-27 18:54:09

From: Footy
Take a look at my fletching script, I believe I have the formula for xp/h in the proggy of that script.


i tried to open your fletching script right when i open it, it opens for like a third of a second then closes

Footy

2012-10-27 19:12:01

That's a SIMBA problem, not my script. Do other scripts work?

Enslaved

2012-10-27 19:24:08


procedure Proggy;
var
xp: integer;
begin
XP := GetXpBar(XpBar) - Startxp;
CurrentXP := Xp - CurrentXp;
Writeln('********************************');
WriteLn('Time Running = '+TimeRunning);
Writeln('Exp Gained = ' + IntToStr(Xp));
Writeln('Exp/Hour = ' + IntToStr(Round((xp/(GetTimeRunning/3600000.0)))));
Writeln('Fletched/Hour = ' + IntToStr(Round(( Fletched/(GetTimeRunning/3600000.0)))));
Writeln('Items Done = ' + IntToStr(fletched));
Writeln('AIO Fletcher by EnSlaved ');
Writeln('********************************');
Writeln('Post Feedback and Proggies On Forum Thread Please!');
Stats_IncVariable('Fletching EXP (Gained)',currentXp);

end;