Log in

View Full Version : How to add timer?



rj
10-27-2012, 09:46 PM
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.

___
10-27-2012, 10:04 PM
This is what I use in my proggies
WriteLn('Time Running: ' + TimeRunning);
then per hour it would just be simple math calculations.

Enslaved
10-27-2012, 10:06 PM
there is :
TimeRunning
and also
GetTimeRunning

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

Footy
10-27-2012, 10:12 PM
Take a look at my fletching script, I believe I have the formula for xp/h in the proggy of that script.

rj
10-27-2012, 10:54 PM
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
10-27-2012, 11:12 PM
That's a SIMBA problem, not my script. Do other scripts work?

Enslaved
10-27-2012, 11:24 PM
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;