SRL Archive - Research & Development Lounge

Spiral Mouse


Queso

2008-07-15 13:17:28

Spiral Mouse

By: Queso


The Idea:

Scar and SRL focus on getting around through color finding and images. It pays off, too; the most functional non-catchable bots are made here at these forums. However, the ability to find objects lies in coloring, and that is where botting can be caught off-guard, and get banned.

My idea was to find other ways to locate objects without the use of colors. The only way I could think of (besides checking the .jar files like RSBot does) was by randomly moving the mouse around where you think the object is. But how does one go about accomplishing this without getting caught? The answer: the spiral.

By calculating a spiral around your character, you can select points on the spiral to check. My goal is to offer fellow scripters the ability to use spirals as a mean to functionally find objects around their bots.

Versions:

v3.1
+Procedure SprialMouseAngle: Made mouse smoother, faster, starts a bit away from your character. All-in-all awesome!
+Procedure SprialMouseOutward: Also made mouse smoother and faster. A bit more practical for a failsafe now!
+Procedure SpiralMouseRandom: Number of spirals made with mouse even more randomized!

v3.0
+Procedure SpiralMouseRandom: crazy new antiban works functionally!

v2.0
+Procedure SprialMouseAngle: works functionally
+Procedure SprialMouseOutward: fixed going offscreen error

v1.0
+Procedure SpiralMouseOutward: works functionally
+Procedure SpiralMouseAngle: in construction

Reverse Unit Circle SpiralMouse Uses:


Final Words:

As always, feedback from testing is always great. Let me know if you use in your scripts, and tell me how well it works for your creations! If you feel that a procedure doesn't function to its potential, if you found a bug, or if you have an idea on how else these spirals can be used, please comment in this thread appropriately!

Versions downloaded:

SpiralMouse.scar v3.0 (7.4 KB, 4 views)
SpiralMouse.scar v2.0 (5.0 KB, 6 views)
SpiralMouse.scar v1.0 (2.7 KB, 19 views)


Current Version: v3.1

skilld u

2008-07-15 13:22:50

looks nice, better than any of the functions I've ever made :p

you might want to take a look at your standards though, they are a bit off in some places.

Harry

2008-07-15 13:27:00

Nice idea!

Queso

2008-07-15 13:28:59

From: skilld u
you might want to take a look at your standards though, they are a bit off in some places.


standards? mer? and how might they be off?

skilld u

2008-07-15 13:31:32

procedure SpiralMouseOutward(UpText, Option: string; Distance: Extended);
var
a, b, angle, angleINC, r: extended;
z, x, y, Pointx, Pointy, Mousex, Mousey: integer;
WrapUp: boolean;
begin
a:= (random(3) * 1.571); //turns spiral randomly
b:= (5 + (random(2) * 0.4)); //distance btw turnings
angle:= (a + 0.524); //angle
angleINC:= 0.785; //angle increment rate
z:= 43; //number of times it creates a point , goes to 0
WrapUp:= false; // ends loop
r:= a + b * angle;
x:= Round(r * cos(angle));
y:= Round(r * sin(angle));
z:= z - 1;
repeat
Pointx:= x + 256;
Pointy:= y + 167;
MMouse(Pointx,Pointy,5,5);
wait(250 + random(150));
if IsUpText(UpText) then
begin
GetMousePos(Mousex,Mousey);
Mouse(Mousex,Mousey,0,0,false);
wait(250 + random(150));
ChooseOption(Option);
WrapUp:= true;
end;
angle:= angle + angleINC;
r:= a + b * angle;
x:= Round(r * cos(angle));
y:= Round(r * sin(angle));
z:= z - 1;
if InIntArray([28, 16, 0], z) then
begin
if z= 0 then
begin
WrapUp:= true;
end;
if angleINC = 0.524 then
begin
angleINC:= 0.393;
angle:= 19.046;
end else
if angleINC = 0.785 then
begin
angleINC:= 0.524;
angle:= 12.828;
end;
end;
until(WrapUp = true);
end;

Queso

2008-07-15 13:33:36

Ah, forgot SCAR programmin's got its own way of organizin. Please keep in mind I'm used to other languages. :) I'll try to stick to those standards.

skilld u

2008-07-15 13:38:35

just a general rule of thumb for standards:

  • two spaces after each begin
  • one space after a var
  • don't capitalize bold words
  • capitalize all other words
  • two spaces after a case
  • two spaces after a repeat

Scaper

2008-07-15 22:00:55

hey not a bad idea very good infact ill be testing this see how i like oor not =)

Daniel

2008-07-15 22:21:35

From: skilld u
just a general rule of thumb for standards:

  • one space after a var


One space? It was always two ;)

munk

2008-07-16 05:43:12

I did this idea a while ago! I'll dig it up.


function findObjFast(var rx,ry:integer;uTs:Array of string;col,x1,y1,x2,y2,tol:integer):boolean;
var
i,rad,mx,my,cx,cy:integer;
p:Array of Tpoint;
pp:Array of Array of Tpoint;
begin
FindColorsSpiralTolerance(mscx,mscy,p,col,x1,y1,x2,y2,tol);
pp:=TPAtoATPAEx(p,50,50);
SortATPASize(pp,true);
if length(pp)>0 then
begin
middleTPAex(pp[0],cx,cy);
rad:=random(90);
for i:=0 to 25 do
begin
mx:=round((i*3)*sine(rad))+cx;
my:=round(-(i*3)*cose(rad))+cy;
mmouse(mx,my,2,2);
if isUptextMultiCustom(uTs) then
begin
getMousePos(mx,my);
rx:=mx;
ry:=my;
result:=true;
exit;
end;
rad:=rad+20;
end;
end;
writeln('Object not found!');
result:=false;
end;
:)
yours looks real nice though

Queso

2008-07-16 07:40:56

From: munk
I did this idea a while ago! I'll dig it up.


function findObjFast(var rx,ry:integer;uTs:Array of string;col,x1,y1,x2,y2,tol:integer):boolean;
var
i,rad,mx,my,cx,cy:integer;
p:Array of Tpoint;
pp:Array of Array of Tpoint;
begin
FindColorsSpiralTolerance(mscx,mscy,p,col,x1,y1,x2,y2,tol);
pp:=TPAtoATPAEx(p,50,50);
SortATPASize(pp,true);
if length(pp)>0 then
begin
middleTPAex(pp[0],cx,cy);
rad:=random(90);
for i:=0 to 25 do
begin
mx:=round((i*3)*sine(rad))+cx;
my:=round(-(i*3)*cose(rad))+cy;
mmouse(mx,my,2,2);
if isUptextMultiCustom(uTs) then
begin
getMousePos(mx,my);
rx:=mx;
ry:=my;
result:=true;
exit;
end;
rad:=rad+20;
end;
end;
writeln('Object not found!');
result:=false;
end;
:)
yours looks real nice though


Looks interesting, I'll have to test that out, and possibly use your example to broaden my ideas on using curves.

Camaro'

2008-07-16 11:00:31

From: Queso
Looks interesting, I'll have to test that out, and possibly use your example to broaden my ideas on using curves.


Queso americano! i love it XD ..

But i like the idea and its very well written

Queso

2008-07-16 19:31:07

Righto, I was workin on my second procedure during work today (I work at Target btw…respect the workers!) and since it was my first time programming on paper at work, I thought I'd share the moment with you:



I got bored by the end of my last break … lol.

EDIT: Oh, aren't my feetsies cute?

Queso

2008-07-22 00:41:07

-=v2.0 complete=-

Though now that I have knowlege of TPA's and how to use them, and learned that other scripters are learning how to use in-game java variables to find things, these scripts seem really … outdone?

I might not continue this experiment much further, though I may make the current procedures more flexible for the users, such as allowing people to increase/decrease number of points on each rotation.

Metagen

2008-07-22 19:42:18

We should promote Queso to member :D

Queso

2008-07-28 15:32:22

-=v3.0 complete=-

Thought of an amazing antiban idea, and I decided to whip it up real quick. Though it only took 15 minutes to produce, it's ability to make humanlike mouse movements is amazing!

If you use it in your antiban, lemme know! Not that I want credit, but mostly because I would love to see it in action more!

Metagen

2008-07-31 07:43:50

Ok i tried the first function, works nicely except for some reason on the third ring at -45 it skips down 180 degrees.?

spiralmouseangle just kindof hovers it ove rmy head? :(

Queso

2008-07-31 09:29:21

From: Metagen
Ok i tried the first function, works nicely except for some reason on the third ring at -45 it skips down 180 degrees.?

spiralmouseangle just kindof hovers it ove rmy head? :(


I knew the first error, I kinda just got lazy with the angle increments. I might make the mouse movements more smooth.

What imputs did you use for SpiralMouseAngle?

Queso

2008-08-01 10:28:02

-=v3.1 complete=-

I made the mouse movements in SpiralMouseOutward and SpiralMouseAngle more like SpiralMouseRandom's, making it nice and smooth.