SRL Archive - SRL Archives

A lot of st00f ;)


Harry

2008-04-10 13:05:32

Hi again :p

{**********************************************************************

*********
function LinearWalkEx(var tpa: TPointArray; cx, cy, TheColor, tol: Integer;

Direction: Integer; Radius: Integer): Boolean;
By: Nielsie95
Description: Finds TheColor from Radial (scanning outwards) for Radius

Distance.
Valid Arguments:
tpa: Result points.
Direction: Any number between 0-720. 0=N,90=E,180=S,270=W.
Radius: Distance from the centre of minimap, i.e. how far away the mouse

clicks. Use numbers 20-72
*****************************************************************************

**}

function LinearWalkEx(var tpa: TPointArray; cx, cy, TheColor, tol: Integer;

Direction: Integer; Radius: Integer): Boolean;
var
i, SD, ED: Integer;
begin
Result := False;
if (not LoggedIn) then Exit;
i := GetSystemTime;
Direction := Direction mod 360;
if (Direction < 50) then
SD := ((Direction + 360) - 50)
else
SD := (Direction - 50);
ED := (Direction + 50);
while (SD > 360) do
SD := SD - 360;
while (ED > 360) do
ED := ED - 360;
try
FindColorsTolerance(tpa, TheColor, MMX1, MMY1, MMX2, MMY2, tol);
FilterPointsPie(tpa, SD, ED, 10, Radius, cx, cy);
LinearSort(tpa, cx, cy, Direction, False);
Result := (Length(tpa) > 0);
except Exit; WriteLn('LWex error!'); end;
// Uncomment this for debug
// WriteLn('LWex time: '+IntToStr(GetSystemTime - i)+'ms. Found points:

'+IntToStr(Length(tpa)));
end;

As LinearWalkEx is ATM, if it has an error, it never wirteLn's the error

because it exits before it is able to do so. Oh yeah, and srl_Warn there too

;)

Here is how it should be:

{**********************************************************************

*********
function LinearWalkEx(var tpa: TPointArray; cx, cy, TheColor, tol: Integer;

Direction: Integer; Radius: Integer): Boolean;
By: Nielsie95
Description: Finds TheColor from Radial (scanning outwards) for Radius

Distance.
Valid Arguments:
tpa: Result points.
Direction: Any number between 0-720. 0=N,90=E,180=S,270=W.
Radius: Distance from the centre of minimap, i.e. how far away the mouse

clicks. Use numbers 20-72
*****************************************************************************

**}

function LinearWalkEx(var tpa: TPointArray; cx, cy, TheColor, tol: Integer;

Direction: Integer; Radius: Integer): Boolean;
var
i, SD, ED: Integer;
begin
Result := False;
if (not LoggedIn) then Exit;
i := GetSystemTime;
Direction := Direction mod 360;
if (Direction < 50) then
SD := ((Direction + 360) - 50)
else
SD := (Direction - 50);
ED := (Direction + 50);
while (SD > 360) do
SD := SD - 360;
while (ED > 360) do
ED := ED - 360;
try
FindColorsTolerance(tpa, TheColor, MMX1, MMY1, MMX2, MMY2, tol);
FilterPointsPie(tpa, SD, ED, 10, Radius, cx, cy);
LinearSort(tpa, cx, cy, Direction, False);
Result := (Length(tpa) > 0);
except WriteLn('LWex error!'); Exit; end;
// Uncomment this for debug
// WriteLn('LWex time: '+IntToStr(GetSystemTime - i)+'ms. Found points:

'+IntToStr(Length(tpa)));
end;
Same as above with RadialWalkEx.
Here is how it is now

except Exit; srl_Warn('RadialWalkEx', 'An exception has occured',

warn_AllVersions); end;
and this is how it should be:

except srl_Warn('RadialWalkEx', 'An exception has occured',

warn_AllVersions); Exit; end;


Also, just a thought … could we have a boolean in MakeCompass, like

"MakeCompass('N',True);", with the Boolean in there means Perfect degrees if

it is True, and if it is False, it will have the direction have a Randomness

of 10 added, and subtract 10, from the DirectionDeg, for anti-ban ya know? ;)
Example:
MakeCompass('S',False);
When a user puts that in, the compass has a possibility of being from 190

degreese, to 170.

MakeCompass('S',True);
When a user puts that in, the compass goes to exactly 180 degreese.

You get where I am going with this?
(Would be troublesome for a few users if/when it is added into SRL … but

it'd be worth it :P)

Also…

procedure Wait2(timetowait: Integer; Randoms: Boolean);
var
starttime: Integer;
randcounter: Integer;
randamount: Integer;
idlecounter: Integer;
idleamount: Integer;
......
Compress those integers into one integer line? It will decrease the compiling

time (not by much, but every little bit helps).

procedure Wait2(timetowait: Integer; Randoms: Boolean);
var
starttime,randcounter,randamount,idlecounter,idleamount: Integer;

Yes, there is more (I am really bored right now :p )
In BoredHuman, when it Makes the compass North, what if you had the compass

at South, or something? It could mess everything up you are doing.

procedure BoredHuman;
var
i, x, y: Integer;
begin
for i := 1 to (3 + Random(11)) do
begin
MMouse(Random(MSX2), Random(MSY2), 0, 0);
if IsUpText('opti') then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, False);
ChooseOption('Examine');
end;
FindNormalRandoms;
case Random(6) of
0: SendArrowSilentWait(((Random(2) * 2) + 1), 1000 + Random(200));
1: SendArrowSilentWait(((Random(2) * 2)), 1000 + Random(200));
2: SendArrowSilentWait(((Random(2) * 2) + 1), 200 + Random(200));
3: SendArrowSilentWait(((Random(2) * 2)), 200 + Random(200));
4: SendArrowSilentWait(((Random(2) * 2) + 1), 20 + Random(20));
5: SendArrowSilentWait(((Random(2) * 2)), 20 + Random(20));
end;
FindNormalRandoms;
end;
MakeCompass('N');
SendArrowSilentWait(0, 750 + Random(500));
end;
to

procedure BoredHuman;
var
i, x, y, Deg: Integer;
begin
Deg := rs_GetCompassAngleDegrees;
for i := 1 to (3 + Random(11)) do
begin
MMouse(Random(MSX2), Random(MSY2), 0, 0);
if IsUpText('opti') then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, False);
ChooseOption('Examine');
end;
FindNormalRandoms;
case Random(6) of
0: SendArrowSilentWait(((Random(2) * 2) + 1), 1000 + Random(200));
1: SendArrowSilentWait(((Random(2) * 2)), 1000 + Random(200));
2: SendArrowSilentWait(((Random(2) * 2) + 1), 200 + Random(200));
3: SendArrowSilentWait(((Random(2) * 2)), 200 + Random(200));
4: SendArrowSilentWait(((Random(2) * 2) + 1), 20 + Random(20));
5: SendArrowSilentWait(((Random(2) * 2)), 20 + Random(20));
end;
FindNormalRandoms;
end;
MakeCompass(IntToStr(Deg));
SendArrowSilentWait(0, 750 + Random(500));
end;
so it will set the compass back to the way you had it to before changing it.

SetBar in GameTab.scar.

else WriteLn('ERROR: Unknown bar!');
srl_Warn can be used here ;)

Globals.scar

Const
ShowWarnings = False;
Can this be a Global var please? :) So in SetupSRL you can choose if you want

these warnings or not. Else, you have to tell everyone to go to Globals.scar

and change that if you don't want your script to tell people that info.
(Like if a non-experienced SCAR user gets "** WARNING **" in their debug,

they act weird sometimes :rolleyes: )

Inventory.scar

procedure DragItem(inv1, inv2: Integer);
var
x, y: Integer;
begin
MMouseItem(Inv1);
GetMousePos(x, y);
HoldMouse(x, y, True);
Wait(150 + Random(50));
MMouseItem(Inv2);
GetMousePos(x, y);
ReleaseMouse(x, y, True);
Wait(100 + Random(100));
MMouse(x, y, 2, 2)
end;
Moves the mouse to where you just dropped the item? :confused: Why does it

have MMouse(x, y, 2, 2) at the end? What is the point of that? Shouldn't it

be

procedure DragItem(inv1, inv2: Integer);
var
x, y: Integer;
begin
MMouseItem(Inv1);
GetMousePos(x, y);
HoldMouse(x, y, True);
Wait(150 + Random(50));
MMouseItem(Inv2);
GetMousePos(x, y);
ReleaseMouse(x, y, True);
Wait(100 + Random(100));
end;

Login.scar

function Logout: Boolean;
var
c, i: Integer;
begin
Result := (not (LoggedIn));
if Result = True then
Exit;
if GameTab(14) = False then
Exit;
Wait(200 + Random(100));
while (LoggedIn) or (c < 10) do
begin
Inc(c);
if(ClickText('here', UpChars, MIX1, MIY1, MIX2, MIY2, True))then
for i := 0 to 10 do
begin
Wait(1000);
if not(LoggedIn)then
begin
Result := True;
Exit;
end;
end;
end;
end;
MouseBox on the LogOut button please? Not the ClickText on 'here'. (I am not

on RS atm, so I can't make the MouseBox ATM, but I know it will work).


Why is Setup.scar still in the Core? As far as I can see, it is not used by

any Core SRL features. Move to Misc folder please? It isn't even called by

SetupSRL, or even Compile SRL.scar! :p It is broken anyways.. Line 102:

[Error] (21732:1): Unknown identifier 'Filename' in script C:\Program

Files\SCAR 3.15\Includes\SRL\SRL\Misc\Setup.scar (I added to my Includes list

just to see if it even still works).

Thanks for reading.
~ Harry.

EDIT: Sorry for the spaces after some lines, I wrote in Notepad, and when I copied and pasted it here, it got weird :|

EvilChicken!

2008-04-10 16:16:20

You're right about almost all functions here. And also, mousebox on LogIN button aswell? This deserved more attention.

Starblaster100

2008-04-10 16:21:30

Compressing Integers does not make compiling time any quicker. It oly makes it look neater.

DragItem needs a bit of randomness on the end. When you click, most of the time you drag the mouse slightly before releasing the click. That why it is there.

We have been using ClickText on the 'here' for a while now, and it has not caused any problems. ClickText also clicks randomly on the actual word, so its OK

I'll check the others and see what should be added

Thanks

Edit: Added a few of your suggestions

ShowerThoughts

2008-04-10 16:41:09

Btw, check Skill/ranging.scar and then getarrowcolor or something like that the where the function is about is not right, i am not sure again wat but you should check it

Harry

2008-04-10 17:46:41

Thank you Starblaster :)

Mind telling me a few things on which you added? :garfield:

Edit: ClickText is still not good to have. IMO a MouseBox would pwn. Don't you think Jagex looks at everyone who clicks that text? When I log out it is always random.
And TimeOutLogouts should be back into SetupSRL :p

Starblaster100

2008-04-11 07:45:02

Fixed the bug in LinearwalkEx, RadialWalkEx didn't have it. Added srl_Warn into them

Changed BoredHuman with your suggestion. Credited you.

srl_Warn in SetBar

Setup.scar has already been removed.

It ensures a proper logout to click on the text as we have a certain amount of randomness on the click. Previously, when we had a MouseBox on the Logout button, it only covered the here text + a bit extra anyway

EvilChicken!

2008-04-11 08:08:24

How about mousebox on LogIn? IMO its too little randomness in login ATM.

Wizzup?

2008-04-29 11:24:36

From: EvilChicken!
How about mousebox on LogIn? IMO its too little randomness in login ATM.


When you are logged out jagex does not check any mouse movements, there is no traffic between your computer and jagex when you are logged out.

Harry

2008-05-01 11:35:40

@Wizzup: But, you get logged in, and your mouse is sitting there ;)

Starblaster100

2008-05-01 11:43:17

They record where you click, how fast you click, and the intervals between clicks.

Every ~40 ms, they check to see if you are interacting with the client or not. If you are, they record what you are doing, and then allow your character to do it. If you aren't, they don't do anything.

They do not record where you move your mouse, as it is not interacting with the client.

Harry

2008-05-01 11:52:48

From: Starblaster100
They record where you click, how fast you click, and the intervals between clicks.

Every ~40 ms, they check to see if you are interacting with the client or not. If you are, they record what you are doing, and then allow your character to do it. If you aren't, they don't do anything.

They do not record where you move your mouse, as it is not interacting with the client.


May I ask how you know this?

And when you log on, it is interacting with the client :p

Starblaster100

2008-05-01 12:29:06

It has to be a mouse click to make your character interact with RS.

<tarajunky> Aw crud, meant to quote and reply and accidentally edited what you said. Sorry 'bout that ol' chap.

n3ss3s

2008-05-01 13:42:33

You can learn amazing amounts of things by decompiling (and obbing) the RuneScape client which can be downloaded from <prefixhere>.runescape.com/runescape.jar

If I haven't misunderstood that's how Yakman's for example learned the most.

tarajunky

2008-05-01 16:20:38

From: Starblaster100
It has to be a mouse click to make your character interact with RS.


When you move the mouse around, it will change the uptext displayed on the screen without clicking anything. Doesn't this cause "interaction" with RS?

Cazax

2008-05-01 16:51:36

From: Wizzup?
When you are logged out jagex does not check any mouse movements, there is no traffic between your computer and jagex when you are logged out.


uhm strange becouse a long time ago i logged in very fast(by hand) and i clicked 'click here to continue' and THUMP! a mysterious old man appeared.

MylesMadness

2008-05-01 20:18:08

you must of had him before you logged out last time

n3ss3s

2008-05-02 04:03:43

Tara, every object in RS propably has some onMouseOver() kind of thing, so they don't really need to record the mouse movements, but when the mouse enters the area of the object it launches the 'event'… Sounds something like right to me, might be wrong too…

Sir R. M8gic1an

2008-05-02 07:13:51

isn't there a function already like MakeCompassDegrees(int) ? or just MakeCompass also working with an int? if so hy, just do
MakeCompass(90+RandomRange(-10, + 10));

~RM

n3ss3s

2008-05-02 07:17:05

MakeCompass('72') is also valid, for example.

The Claw

2008-05-02 22:00:57

From: tarajunky
When you move the mouse around, it will change the uptext displayed on the screen without clicking anything. Doesn't this cause "interaction" with RS?


Nope, thats clientside, meaning that when you mouse over an object, it gets the uptext from the jar already on your computer, and it doesnt send any information to the server. Kind of like what n3ss3s said.