SRL Archive - OSR Help

XP per hour?


Dinosaurrr

2012-12-06 08:03:27

Hey what's up? :D I just made a script for a private server that ran flawlessly all night and made me 800m. Man I feel awesome ^_^ But anyway I'm trying to make a debug box that'll show my exp per hour. But I'm unsure on the value of GetTimeRunning. Is it in seconds milliseconds minutes hours? How would I set this up to find exp per hour if the exp per hour is say 500? I don't understand how I'm getting the value of 48.——- for GetTimeRunning.. Might be over thinking something idk. Help would be much appreciated :)

Edit- I'm pretty sure I'm getting a permanently set value of 48 because I tried doing round(xp/x) where xp raises by 500 each time it goes and x is GetTimeRunning and it came up with 10 the next time I got a steal xp goes up and I get 20 ect.

2nd Edit- Pretty sure I put this in the wrong section.. I'm going back to bed -_-

Daniel

2012-12-06 08:21:11

Thread moved: Development Tutorials -> Scripting Help.

GetTimeRunning is in milliseconds (1/1000th of a second, so: 1000 milliseconds is the equivalent of one second).

Dinosaurrr

2012-12-06 08:23:15

Appreciate the help thanks :)

Dinosaurrr

2012-12-06 08:58:11


-in the main program begin. Not in repeated part.
coins:=0;
gaingp:=30000;

-in the main program begin but in the repeated part.
s := GetTimeRunning;

-in the main procedure after it does the needed procedure to earn the gp.
IncEx(coins, gaingp);

-In the paint procedure in the main program repeated part.

Writeln('Gained coins: ' + ToStr(coins))
Writeln('Coins per hour: ' + ToStr(Round(3600*(coins)/(s/(1000)+1))));

Why would this gives me negative amount of coins per hour after running the script for a few minutes?

Edit - Never mind got it. :)
Edit 2 - Grr.. Thought I did but it just ran for longer and then failed :( Way more annoying than php and html combined..

Edit 3 - Came to the conclusion it isn't me.. So it's gonna have to be wrong I guess *shrugs*

Dinosaurrr

2012-12-06 10:24:00

It does it after it hits running time of 60 seconds or more. No idea why…

footballjds

2012-12-06 10:38:54

From: Dinosaurrr
It does it after it hits running time of 60 seconds or more. No idea why…


type integer can only be so big before it floats off into the mystery lands

Dinosaurrr

2012-12-06 10:41:57

From: footballjds
type integer can only be so big before it floats off into the mystery lands


Just figured that out had to / the coins by 1000 and put K on the end :) Thank you so much

edit - Unless there is a way to make a bigint??

footballjds

2012-12-06 10:55:15

var
i: Int64;

Dinosaurrr

2012-12-06 11:57:18

Anything that'd show me how exactly to use that? :o

IntToStr(i:int64): String

How exactly would I use something like that?

IntToStr(i):Round(3600*(coins)/(ms/1000)))

Was also playing around with it and saw a function Int64ToStr?

footballjds

2012-12-06 11:59:07

Generally i just ToStr() everything.
please post the calculation you're doing. int64 is a type similar to integer but can hold a larger value. Use it the same way you used integer.

Dinosaurrr

2012-12-06 12:14:11

vars are all set to integer

in the main begin and end;
coins:=0;
gaingp:=30313;

In the procedure making the gp
IncEx(coins, gaingp);

In paint procedure
ms:= GetTimeRunning;
Writeln('Gained coins: ' + ToStr(coins))
Writeln('Coins per hour: ' + ToStr(Round(3600*(coins)/(ms/1000))));

Just trying to make it give me the amount of coins per hour I'd get if I got 30313 per stall steal it's a thieving bot so it's pretty quick. I'll post the entire script if that's not enough info

footballjds

2012-12-06 12:18:58

just post the whole thing man.

Dinosaurrr

2012-12-06 12:30:28


program FishTheiver;
var
x, y: Integer;
c, d: Integer;
xp: Integer;
theives: Integer;
mode: Integer;
ms: Integer;
brawler: Integer;
coins: Integer;
gaingp: Integer;

const
BRAWLERCOLOR = 602420; //602420 brown, 6439284 purple.
BORDERWIDTH = 16; //Black border around game.
BRAWLERS = ('No'); //Use brawlers? 'Yes' or 'No'

Procedure CheckBrawlers;
begin
if (BRAWLERS = 'Yes') then
begin
if FindColorTolerance(x, y, BRAWLERCOLOR, 568+(BORDERWIDTH), 371, 599+(BORDERWIDTH), 396, 10 ) = false then
begin
PressKey(112);
repeat
Wait(50);
until(FindColorTolerance(x, y, 1482692, 550+(BORDERWIDTH), 205, 735+(BORDERWIDTH), 461, 10) = true);
if FindColorTolerance(x, y, BRAWLERCOLOR, 550+(BORDERWIDTH), 205, 735+(BORDERWIDTH), 461, 10) = true then
begin
MoveMouse(x, y);
repeat
wait(100);
until(FindColorTolerance(c, d, 3768029, 0+(BORDERWIDTH), 1, 246+(BORDERWIDTH), 27, 30) = true);
ClickMouse(x, y, 1);
repeat
wait(50);
until(FindColorTolerance(c, d, 3768029, 0+(BORDERWIDTH), 1, 246+(BORDERWIDTH), 27, 30) = false);
PressKey(113);
repeat
wait(50);
until(FindColorTolerance(x, y, BRAWLERCOLOR, 570+(BORDERWIDTH), 368, 602+(BORDERWIDTH), 400, 10) = true);
IncEx(brawler, 1);
end;
end;
end;
end;


Procedure Theive;
begin
if FindColorTolerance(x, y, 9611960, 0, 0, 513+(BORDERWIDTH), 332, 5) = true then
begin
MoveMouse(x, y);
wait(100);
if (FindColorTolerance(c, d, 15724822, 0+(BORDERWIDTH), 1, 246+(BORDERWIDTH), 27, 40) = true) then
begin
ClickMouse(x, y, 1);
repeat
wait(50);
until(FindColorTolerance(c, d, 15724822, 0+(BORDERWIDTH), 1, 246+(BORDERWIDTH), 27, 40) = false);
IncEx(xp, mode);
IncEx(theives, 1);
IncEx(coins, gaingp);
wait(500);
end;
end;
end;

Procedure Paint;
begin
ms:= GetTimeRunning;
if (ms > 0) then
begin
Writeln('--------------------------------------------------')
Writeln('----------Dinosaurrr Soulsplit Theiving-----------')
Writeln('Time ran: ' + ToStr(Round(ms/1000/60)) + ' Minutes.')
Writeln('Gained exp: ' + ToStr(xp))
Writeln('Exp per hour: ' + ToStr(Round(3600*(xp)/(ms/1000))));
Writeln('Runs: ' + ToStr(theives))
Writeln('Runs per hour: ' + ToStr(Round(3600*(theives)/(ms/1000))));
Writeln('Gained coins: ' + ToStr(coins))
Writeln('Coins per hour: ' + ToStr(Round(3600*(coins)/(ms/1000))));
if (BRAWLERS=('yes')) then
begin
Writeln('Brawlers used:' + Tostr(brawler))
end;
Writeln('--------------------------------------------------')
end;
if (ms = 0) then
begin
Writeln('--------------------------------------------------')
Writeln('----------Dinosaurrr Soulsplit Theiving-----------')
Writeln('-------Please give paint a momment to begin.------')
Writeln('--------------------------------------------------')
end;
end;

begin
xp:=0;
theives:=0;
mode:= 208;
coins:=0;
gaingp:=30313;
repeat
CheckBrawlers;
Theive;
ClearDebug;
Paint;
until(false);
end.


I for some strange reason didn't think code tags put stuff in boxes with scroll bars. I thought it was gonna span the whole page >_>

footballjds

2012-12-06 13:45:56

fixed your standards a bit. try this then.
also next time use SIMBA tags instead of CODE :)
program FishTheiver;
var
x, y: Integer;
c, d: Integer;
xp: Integer;
theives: Integer;
mode: Integer;
ms: Integer;
brawler: Integer;
coins: Integer;
gaingp: Integer;

const
BRAWLERCOLOR = 602420; //602420 brown, 6439284 purple.
BORDERWIDTH = 16; //Black border around game.
BRAWLERS = 'No'; //Use brawlers? 'Yes' or 'No'

procedure CheckBrawlers;
begin
if (BRAWLERS = 'Yes') then
begin
if FindColorTolerance(x, y, BRAWLERCOLOR, 568+(BORDERWIDTH), 371, 599+(BORDERWIDTH), 396, 10 ) = false then
begin
PressKey(112);
repeat
Wait(50);
until(FindColorTolerance(x, y, 1482692, 550+(BORDERWIDTH), 205, 735+(BORDERWIDTH), 461, 10) = true);
if FindColorTolerance(x, y, BRAWLERCOLOR, 550+(BORDERWIDTH), 205, 735+(BORDERWIDTH), 461, 10) = true then
begin
MoveMouse(x, y);
repeat
wait(100);
until(FindColorTolerance(c, d, 3768029, 0+(BORDERWIDTH), 1, 246+(BORDERWIDTH), 27, 30) = true);
ClickMouse(x, y, 1);
repeat
wait(50);
until(FindColorTolerance(c, d, 3768029, 0+(BORDERWIDTH), 1, 246+(BORDERWIDTH), 27, 30) = false);
PressKey(113);
repeat
wait(50);
until(FindColorTolerance(x, y, BRAWLERCOLOR, 570+(BORDERWIDTH), 368, 602+(BORDERWIDTH), 400, 10) = true);
IncEx(brawler, 1);
end;
end;
end;
end;


procedure Theive;
begin
if FindColorTolerance(x, y, 9611960, 0, 0, 513+(BORDERWIDTH), 332, 5) = true then
begin
MoveMouse(x, y);
wait(100);
if (FindColorTolerance(c, d, 15724822, 0+(BORDERWIDTH), 1, 246+(BORDERWIDTH), 27, 40) = true) then
begin
ClickMouse(x, y, 1);
repeat
wait(50);
until(FindColorTolerance(c, d, 15724822, 0+(BORDERWIDTH), 1, 246+(BORDERWIDTH), 27, 40) = false);
IncEx(xp, mode);
IncEx(theives, 1);
IncEx(coins, gaingp);
wait(500);
end;
end;
end;

procedure Paint;
var
cph, rph, xph: extended;
begin
ms:= GetTimeRunning;
if ms < 1 then exit;
cph := 3600*(coins)/(ms/1000);
rph := 3600*(theives)/(ms/1000);
xph := 3600*(xp)/(ms/1000);
if (ms > 0) then
begin
Writeln('--------------------------------------------------')
Writeln('----------Dinosaurrr Soulsplit Theiving-----------')
Writeln('Time ran: ' + ToStr(Round(ms/1000/60)) + ' Minutes.')
Writeln('Gained exp: ' + ToStr(xp))
Writeln('Exp per hour: ' + ToStr(xph));
Writeln('Runs: ' + ToStr(theives))
Writeln('Runs per hour: ' + ToStr(rph));
Writeln('Gained coins: ' + ToStr(coins))
Writeln('Coins per hour: ' + ToStr(cph));
if (BRAWLERS=('yes')) then
begin
Writeln('Brawlers used:' + Tostr(brawler))
end;
Writeln('--------------------------------------------------')
end;
if (ms = 0) then
begin
Writeln('--------------------------------------------------')
Writeln('----------Dinosaurrr Soulsplit Theiving-----------')
Writeln('-------Please give paint a momment to begin.------')
Writeln('--------------------------------------------------')
end;
end;

begin
xp:=0;
theives:=0;
mode:= 208;
coins:=0;
gaingp:=30313;
repeat
CheckBrawlers;
Theive;
ClearDebug;
Paint;
until(false);
end.

Dinosaurrr

2012-12-06 15:39:54

Thank you so much it works :) If you're ever on soulsplit add me 4 r's till I get banned haha :P

Sometimes has divided by 0 errors but I'll figure that out thanks :)