SRL Archive - OSR Help

How to detect...


rjk1990

2012-04-30 14:43:07

Hey, i thought with the easily exploitable nature of runespan, it would be a nice time to learn some more scripting :D

Right now i have this :D (I'm a noob! i admit this wholeheartedly :P) It's a really simple script that just clicks on a law essling every 10 or so seconds (this is just the main procedure, i do have antiban and stuff)


Procedure Findlawessling;
var
x, y: Integer;
begin
repeat
if FindObj(x, y, 'Law', 14394158, 5)then
mouse(x, y, 5, 5, true);
Antiban;
wait(5000+random(5000));
Until(false);
end;

I don't really know what i'm doing and i'm sure both those "untils" are not gonna work xD


Obviously, this is totally shit and will probably get you banned in about 5 minutes, regardless, it /works/ as even with my rubbish attempt i still have 124k xp upwards after a few hours My question is:

Is there a simple way to detect when they spawn and click on them right away, rather then just automatically clicking it's color every set amount of seconds regardless of if you're already using it, or it hasn't even spawned yet and having to wait another 10-odd seconds to click again


Should i be aiming for:

Procedure Findlaw;
var
x, y: Integer;
begin
repeat
if FindObj(x, y, 'Law', 14394158, 5)then
mouse(x, y, 5, 5, true);
Antiban;
Until not isuptext('law');
end;






begin
SetupSRL;
ActivateClient;
declareplayers;
loginplayer;
repeat
Findlaw;
until(false);
end.

(seems to work but clicks like crazy haha xD)

I'd google it but i honestly have no idea what i should be looking for :P

Total

2012-04-30 14:53:35

You can have it check your exp before you click it, when you click just do a loop until you don't gain exp after X amount of seconds.

rjk1990

2012-04-30 15:04:32

From: TotalKillz
You can have it check your exp before you click it, when you click just do a loop until you don't gain exp after X amount of seconds.


Sounds like that would work, but how exactly do i do that? Remember i'm pretttty new to this and only know the basics

Total

2012-04-30 15:12:08


var
CheckExp : Integer;
begin
repeat
CheckExp := GetXPBarTotal;
Wait(5000);
until CheckExp = GetXPBarTotal;
end;

Something like that, just set a variable to your exp every time it goes through the loop and it will stop when your exp hasnt increased.

rjk1990

2012-04-30 15:21:57

Not sure i understand any of that but i shall try and use it anyway, trial and error never hurts xD thank you!

Total

2012-04-30 15:52:36

It just checks if you gained any exp every 5 seconds, and if you haven't it will continue.

rjk1990

2012-04-30 17:27:36

Sigh, i can't figure it out :(

I basically want it to click the essling, monitor the xp without anymore clicking until it stops increasing then when it detects stoppage it repeats the procedure. I just can't figure out how to put it in code xD In my head it's like (and not in actual code xD)

Procedure Mainloop;
Begin;
Click Essling;
checkXP;
If XPstopsIncreasing then
startfrombeginning;
end;


but i lack the vital skills to actually do it. i'm so dumb :/ *sadly goes back to tutorials*

masterBB

2012-04-30 17:38:06

This could turn out in a very nice first script! Start looks promising! If you really can't figure it out, I will help you, but it would be great to see you do it yourself. The trick is to think like a very stupid robot, how would it recognize certain things? When will it perform certain actions?

From: rjk1990
but i lack the vital skills to actually do it. i'm so dumb :/ *sadly goes back to tutorials*


You ain't dumb, watch Jersey Shore, those people are dumb.

edit:
One piece of the puzzle:

procedure WaitTillNoXP(interval:Integer;maxTime:Integer);
var
t:Integer;
begin
repeat
CheckExp := GetXPBarTotal;
Wait(interval);
if CheckExp = GetXPBarTotal then
Inc(t)
else
t := 0;
until((t * interval) > maxTime);
end;

Element17

2012-05-01 00:28:47

Could use pixelshift and set it to a value of like 550 or something, which is what I'm currently using and it works pretty good. 550 gives a few false readings and sometimes it is slow so mess around with that maybe?