SRL Archive - Reflection Development

WalkBox;


turbobk

2008-09-06 00:15:30

Hey guys,

This little sexy function will walk anywhere in a Box of Tiles, as long as they are on the MM.


{*******************************************************************************
Function: WalkBox(TileX1, TileY1, TileX2, TileY2, Click, FFlag): Boolean;
By: TurboBk.
Description: Will click anywhere in the box on the MM, defined by, x1 y1 x2 y2.
Click = (1 - LeftClick, 2 - RightClick, 3 - NoClick).
Flag = FFlag.
*******************************************************************************}

Function WalkBox(x1, y1, x2, y2: Integer; Click: Integer; Flag: Integer): Boolean;
Var
P: TPoint;
Y, Z: TPoint;
Begin
If Not LoggedIn Then Exit;
P := GetMyPos;
If PointInBox(P, IntToBox(x1, y1, x2, y2)) Then
Begin
Result := True;
Exit;
End;
Y := TileToMM(IntToPoint(x1, y1));
Z := TileToMM(IntToPoint(x2, y2));
MouseBox(Y.x, Y.y, Z.x, Z.y, Click);
Wait(200 + Random(200)); // Edit
FFlag(Flag);
P := GetMyPos;
If PointInBox(P, IntToBox(x1, y1, x2, y2)) Then
Begin
Result := True;
Exit;
End;
End;



So for example,
If I wanted to walk into this Shop,

I would make the compass WEST to get the proper box.
Then get the x1, y1 Tiles from the green dot, and get the x2, y2 Tiles from the blue dot.

It will then make an invisible box, and click anywhere inside of it.
I had to make this for the script im making, and it is also usefull, so I released it. :)

Hope you like,
If you can think of anything I missed, then please tell me.

Thanks,
TurboBk. :)

P1nky

2008-09-06 00:47:18

dude it looks really useful i could use in my pause script hmm

gj

Daniel

2008-09-06 02:57:36

The green dot is supposed to be in the top left corner of that box and the blue dot has to be in the bottom right corner of that box too ;)

Gu3st...

2008-09-06 03:10:45

[quote=Dan's The Man;461049]The green dot is supposed to be in the top left corner of that box and the blue dot has to be in the bottom right corner of that box too ;)[/quote]

Not when the compass is West like he said… ;)
[quote=turbobk;460983]I would make the compass [B]WEST[/B] to get the proper box.
Then get the x1, y1 Tiles from the [I]green dot[/I], and get the x2, y2 Tiles from the [I]blue dot[/I].[/quote]

turbobk

2008-09-06 03:25:48

Yah I had my compass on North, sorry guys.. :p
Well I'm glad you's like it! :D

Thanks for the feedback.
TurboBk. :)

HyperSecret

2008-09-06 03:28:47

dude great function this needs to be added into the reflection IMO. Great example and great way to walk a path with randomness.

turbobk

2008-09-06 03:33:26

From: HyperSecret
dude great function this needs to be added into the reflection IMO. Great example and great way to walk a path with randomness.


Haha hey thanks alot man, I really appreciate it.

Nothing makes me happier than making others happy :D




EDIT: I had to edit the code just a little,
I just put a wait time for the Flag to appear before FFlag is called ;)


Thanks again,
TurboBk. :)

Tniffoc

2008-09-06 21:04:08

Thank you alot! I will use in my new autofighter! I never would have thought of this!

Nava2

2008-09-07 01:25:58

{*******************************************************************************
Function: WalkBox(TileX1, TileY1, TileX2, TileY2, Click, FFlag): Boolean;
By: TurboBk.
Description: Will click anywhere in the box on the MM, defined by, x1 y1 x2 y2.
Click = (1 - LeftClick, 2 - RightClick, 3 - NoClick).
Flag = FFlag.
*******************************************************************************}

Function WalkBox(WBox: TBox; Click: Integer; Flag: Integer): Boolean;
Var
P, Y: TPoint;
Begin
If Not LoggedIn Then Exit;
P := GetMyPos;
If PointInBox(P, WBox) Then
Begin
Result := True;
Exit;
End;
P := TileToMM(IntToPoint(WBox.x1, WBox.y1));
Y := TileToMM(IntToPoint(WBox.x2, WBox.y2));
MouseBox(P.x, P.y, Y.x, Y.y, Click);
Wait(RandomRange(200, 400)); // Edit
R_FFlag(Flag); // why not use reflection, eh?
P := GetMyPos;
Result := PointInBox(P, WBox);
End;

Since reflection uses all TPoints why not use a TBox? :) Could probably be two TPoints as well, but what ever! :D

Shady?

2008-09-14 01:35:38

Really nice, this function will surely help walking scripts. I also made one, but i think it's a fail compared to yours xD. Great job.

Wyn

2010-09-14 20:59:52

Even thought this thread is two years old. I'm gonna say thanks. I've been looking for an exact function that does this.

Thanks.

turbobk

2010-09-15 04:26:11

Haha thanks, wow this is old I had forgotten about it..
Hope it still works the same with all these new updates going on lol.

Gu3st...

2010-09-15 11:38:30

Shouldn't this be committed?

Wyn

2010-09-15 11:41:38

From: Zyt3x
Shouldn't this be committed?


Either that or I'm importing it.

Cstrike

2010-09-15 12:49:38

How well does it work if it accidentally clicks on something and the flag doesn't appear?
… when reflection is fixed that is

Frement

2010-09-15 12:55:36

Isn't there something like WalkingToFlag()? That waits some time before the flag appears, that would delete the need for Reflection.

Cstrike

2010-09-15 13:23:41

From: Frement
Isn't there something like WalkingToFlag()? That waits some time before the flag appears, that would delete the need for Reflection.


But the WHOLE thing is aimed at reflection