SRL Archive - Simba (Testing) Scripts

(Beta)Active camera rotation


Flight

2011-02-28 03:40:28

I've lately been trying to think of ways botting differs from legit players, and watching myself (mainly) play Soul Wars, I noticed a huge use of camera rotation in accordance to where I click. So, after about a day's work or so I put together what you might consider a new Anti-Ban, which is what I think suits it best.

What this does is tracks a certain point on the screen, usually where you click, and will rotate the camera to align in view with the object in a North-bound region. This is something you'll have to put in manually, but it works most efficiently when clicking Objects/NPCs with a little distance away from you. You can choose at what point you want the camera to rotate.


These are the zones that triggers the 'ACR'.
0 - Neutral zone (Object is well within viewing range, we don't adjust for this)
1 - North-west / north-east
2 - Basically 90 degrees in either direction
3 - South-west / south-east (Big rotation!)

Essentially, it's just to give more human-like behavior to your player's client. But ultimately, it might prove to be, later on, an improvement in Obj/NPC finding if you wish to take it that far. This is very, very easy to implant, it's very basic-coded, and for all I know we might already have something like this. (But I hope not!) Beware though, this will obviously only work for certain scripts that involve moving around, and even then some scripts rely heavily on camera location, so this won't work for such scripts without heavy modifying.
[Note]This will automatically set the camera to the ideal height for using it. (You can change this if you'd like)

Now for the implanting… Declare this a global variable:
ChoseAngle
Here are the main procedures:
Procedure SetInitialCamera;
begin
//First, we move all the way down
Wait(RandomRange(550,750));
KeyDown(VK_Down);
Wait(RandomRange(950,1050));
KeyUp(VK_Down);
//Now, set it to the preferred height
Wait(RandomRange(550,750));
KeyDown(VK_Up);
Wait(RandomRange(350,450));
KeyUp(VK_Up);
end;

Procedure RotateToObj(Direction: String; Range: integer);
begin
if(Direction = 'West') then
begin
case Range of //3 zones in relation to player's north-bound viewing region
0:
begin
//Already in northern region, but we declare "0" just for laughs :)
end;
1: //North-west
begin
Wait(RandomRange(350,450));
KeyDown(VK_Right);
Wait(RandomRange(475,510));
KeyUp(VK_Right);
Wait(RandomRange(150,210));
end;
2: //South-west
begin
Wait(RandomRange(350,450));
KeyDown(VK_Right);
Wait(RandomRange(1575,1610));
KeyUp(VK_Right);
Wait(RandomRange(150,210));
end;
3: //Very south-west?
begin
Wait(RandomRange(350,450));
KeyDown(VK_Right);
Wait(RandomRange(1675,1710));
KeyUp(VK_Right);
Wait(RandomRange(150,210));
end;
end;
Inc(RotateCount);
end else if(Direction = 'East') then
begin
case Range of
0:
begin
//Already in northern region, but we declare "0" just for laughs :)
end;
1: //North-east
begin
Wait(RandomRange(350,450));
KeyDown(VK_Left);
Wait(RandomRange(475,510));
KeyUp(VK_Left);
Wait(RandomRange(150,210));
end;
2: //South-east
begin
Wait(RandomRange(350,450));
KeyDown(VK_Left);
Wait(RandomRange(1575,1610));
KeyUp(VK_Left);
Wait(RandomRange(150,210));
end;
3: //Very south-east?
begin
Wait(RandomRange(350,450));
KeyDown(VK_Left);
Wait(RandomRange(1675,1710));
KeyUp(VK_Left);
Wait(RandomRange(150,210));
end;
end;
end;
end;

Procedure GetObjPosition(Point:TPoint);
begin
if (Not ChoseAngle) then
begin
if(PointInBox(Point,IntToBox(0,0,175,165))) then
begin
RotateToObj('West',1);
end else if(PointInBox(Point,IntToBox(0,166,190,230))) then
begin
RotateToObj('West',2);
end else if(PointInBox(Point,IntToBox(0,231,265,335))) then
begin
RotateToObj('West',3);
end else if(PointInBox(Point,IntToBox(350,0,515,165))) then
begin
RotateToObj('East',1);
end else if(PointInBox(Point,IntToBox(350,166,515,231))) then
begin
RotateToObj('East',2);
end else if(PointInBox(Point,IntToBox(350,231,515,335))) then
begin
RotateToObj('East',3);
end;
end;
ChoseAngle := True;
end;
And now in the main beginning of the script, define these two:
SetInitialCamera;
ChoseAngle := False;
This will set your camera height and basically enable ACR.

Now that's all for adding it, here is how you would use it: (Manually put this wherever you want, I use a section from my test script to give an example)
if(FindObjCustom(x,y,['hop','own'],[3564376,3828833,2771522],7))then
begin
Mouse(x,y,4,4,True);
GetObjPosition(Point(x,y));
ChoseAngle := False;
This would first; rotate your camera in accordance to where you just clicked your mouse, and also it tells the procedures "No, we have not chose an angle yet". At this point the camera will rotate and return "Camera angle was chosen, ready to rotate again!". Simple, no?

I also threw together an example script so you can test this out on your own. Please note though, I in no way intended this script to be official, it lacks MANY features, so I don't suggest you actually use it for it's original purpose. Use it to see how my ACR works.

P.S, you can also use this script as a basis for an M1D1 mining script, as this is the Woodcutting version of one. :p

This script cuts down Evergreen trees, and I HIGHLY recommend you start with your player at the evergreen patch north of Falador.

Please leave comments, let me know how it works for you, or suggestions and what not. :)

Home

2011-02-28 04:11:45

Looks good. I will probs implement this into my M1D1 Miner.

~Home

EvilChicken!

2011-02-28 04:24:16

I really like interesting utilities like these!

Your description sounds interesting. I'll make sure give this a try when I get home, hopefully I'll have some comments regarding it. :)

Floor66

2011-03-26 09:38:33

Sorry for the bump, but I saw this in your Ardy miner and was wondering.

If the rocks I'm mining are very close to me (e.g: 1 tile east and 1 tile west of me), does this still rotate? Or is it for a bit more distant objects?

Looks cool btw!

Flight

2011-03-26 09:52:36

Nah, I figured rotating to object 'that' close to you would be over-doing it. This can obviously be change, if you like. :)

I Am Legend

2011-12-05 06:31:47

thank you i was looknig for this great.

Main

2011-12-13 20:21:25

If you could find the point(TPoint) of tree on MM, and if you could turn that point into a angle (A) from MM.

Then you could just do


MakeCompass( 360 - A);

and you will always look at the tree:p

kyocera

2011-12-16 09:29:11

Nice good work :)!

Nava2

2011-12-16 10:57:33

From: kyocera
Nice good work :)!


Please, try to keep on topic and be productive with your posts.

Flight

2011-12-16 11:31:12

From: Main
If you could find the point(TPoint) of tree on MM, and if you could turn that point into a angle (A) from MM.

Then you could just do


MakeCompass( 360 - A);

and you will always look at the tree:p


Was it Naike (or Home) who made the MM to mainscreen function? If so then that's a good suggestion, Main, thanks.

Swatarianess

2011-12-16 12:14:00

Rs comes with its own Camerapos finder? press "`" or "~" button then type in on the developer cmd "getcamerapos" and voula :D then move camera to set height and check it on the dev cmd :/ not practacle but helpful :D