SRL Archive - General News

Simba and runescape include.


WT-Fakawi

2010-01-24 14:02:20

How is runescape specific development for Simba proceeding? Are there plans aleady for an include? Is there maybe already an include? with basic autoing stuff, like a simple findrandoms, loginplayer, loggedin and a gametab?

If not, I think this should be made asap so we can build the include and test stuff at the same time.

Maybe a SVN?

Function

2010-01-24 14:06:47

I would absouletly love to help. I want to get started scripting for runescape although I am limited to the mouse functions that are rather easily detected, I hear. But I would love to test and help create (if possible) an include.

Kyle Undefined

2010-01-24 14:18:34

Aren't the developers writing SRL 5 for Simba?

~Camo

WT-Fakawi

2010-01-24 14:26:48

So I hear. But I have seen no living proof (harhar). I am just impatient, thats all.

But I need to get 15000 highalchs safely done and I aim not doing them with Scar.

Kyle Undefined

2010-01-24 14:49:20

WindMouse ported over and works.

I got MMouse to work but since there's no MouseSpeed function as of yet, I had to set the randSpeed variable equal to 1.1 which seems like a decent speed.

I also had to change the Mouse function to use an Integer rather than True or False for left or right.

I know Simba is still in early development, but this could give some feedback I guess…

Below is the test script:


program test;

{*******************************************************************************
procedure WindMouse(xs, ys, xe, ye, gravity, wind, minWait, maxWait, maxStep, targetArea: extended);
By: Benland100
Description:
*******************************************************************************}
procedure WindMouse(xs, ys, xe, ye, gravity, wind, minWait, maxWait, maxStep, targetArea: extended);
var
veloX, veloY, windX, windY, veloMag, dist, randomDist, lastDist, step: extended;
lastX, lastY: integer;
sqrt2, sqrt3, sqrt5: extended;
begin
sqrt2:= sqrt(2);
sqrt3:= sqrt(3);
sqrt5:= sqrt(5);
while hypot(xs - xe, ys - ye) > 1 do
begin
dist:= hypot(xs - xe, ys - ye);
wind:= minE(wind, dist);
if dist >= targetArea then
begin
windX:= windX / sqrt3 + (random(round(wind) * 2 + 1) - wind) / sqrt5;
windY:= windY / sqrt3 + (random(round(wind) * 2 + 1) - wind) / sqrt5;
end else
begin
windX:= windX / sqrt2;
windY:= windY / sqrt2;
if (maxStep < 3) then
begin
maxStep:= random(3) + 3.0;
end else
begin
maxStep:= maxStep / sqrt5;
end;
end;
veloX:= veloX + windX;
veloY:= veloY + windY;
veloX:= veloX + gravity * (xe - xs) / dist;
veloY:= veloY + gravity * (ye - ys) / dist;
if hypot(veloX, veloY) > maxStep then
begin
randomDist:= maxStep / 2.0 + random(round(maxStep) / 2);
veloMag:= sqrt(veloX * veloX + veloY * veloY);
veloX:= (veloX / veloMag) * randomDist;
veloY:= (veloY / veloMag) * randomDist;
end;
lastX:= Round(xs);
lastY:= Round(ys);
xs:= xs + veloX;
ys:= ys + veloY;
if (lastX <> Round(xs)) or (lastY <> Round(ys)) then
MoveMouse(Round(xs), Round(ys));
step:= hypot(xs - lastX, ys - lastY);
wait(round((maxWait - minWait) * (step / maxStep) + minWait));
lastdist:= dist;
end;
if (Round(xe) <> Round(xs)) or (Round(ye) <> Round(ys)) then
MoveMouse(Round(xe), Round(ye));
end;

{*******************************************************************************
procedure MMouse(x, y, rx, ry: integer);
By: Benland100
Laptop Movement by Hobbit with help from nielsie95!
Description: Moves the mouse.
*******************************************************************************}
procedure MMouse(x, y, rx, ry: integer);
var
cx, cy: integer;
randSpeed: Extended;
{$IFDEF UseLaptopMouse}
seg, e, f, g, nx, ny, hypo: Integer;
a, b, c: Extended;
Miss: Boolean;
{$ENDIF}
begin
GetMousePos(cx, cy);
{$IFDEF UseLaptopMouse}
miss := (Random(LMouse_MissChance) = 0);
e:= 0;
a:= x - cx;
b:= y - cy;
c:= Pow(a,2) + Pow(b,2)
hypo:= Round(Sqrt(c));
case hypo of
0: Exit;
1..225: seg:=1;
226..600: seg:= Random(2) + 1;
601..1800: seg:= random(3) + 2;
else seg := 5;
end;
f := Round( a / seg);
g := Round( b / seg);
repeat
Wait(30 + random(50));
{Begin: Modified from MMouse by Benland100}
randSpeed := 1.1; //(random(MouseSpeed) / 2.0 + MouseSpeed) / 10.0;
if randSpeed = 0.0 then
randSpeed := 0.1;
getMousePos(cx,cy);
nx:= (cx + (f * e)) + random(rx);
ny:= (cy + (g * e)) + random(ry);
{End: Modified from MMouse by Benland100}
if Miss then
begin
nx:= nx + RandomRange(rx, rx * 2);
ny:= ny + RandomRange(ry, ry * 2);
end;
WindMouse(cx,cy,nx,ny,11.0,8.0,10.0/randSpeed,12.0/randSpeed,10.0*randSpeed,10.0*randSpeed);
e:= e + 1;
until(e = seg);
GetMousePos(cx, cy);
if not PointInBox(Point(cx, cy), IntToBox(x, y, x + rx, y + ry)) then
begin
Wait(30 + random(30));
WindMouse(cx,cy,(x + random(rx)),(y + random(ry)),11.0,6.0,10.0/randSpeed,15.0/randSpeed,10.0*randSpeed,10.0*randSpeed);
end;
{$ELSE}
randSpeed:= 1.1; //(random(MouseSpeed) / 2.0 + MouseSpeed) / 10.0;
if randSpeed = 0.0 then
randSpeed := 0.1;
X := x + random(rx);
Y := y + random(ry);
WindMouse(cx,cy,x,y,9.0,3.0,10.0/randSpeed,15.0/randSpeed,10.0*randSpeed,10.0*randSpeed);
{$ENDIF}
end;

{*******************************************************************************
procedure Mouse(mousex, mousey, ranx, rany: Integer; left: Boolean);
By: Mutant Squirrle, with a small fix by hy71194
Description: Moves then clicks mouse.
*******************************************************************************}
procedure Mouse(mousex, mousey, ranx, rany, left : Integer);
var
a, b, c: Integer;
begin
MMouse(mousex, mousey, ranx, rany);
Wait(60 + Random(30));
GetMousePos(b, c);
HoldMouse(b, c, left);
repeat
Wait(20 + Random(30));
a := a + 1;
until (a > 4);
GetMousePos(b, c);
ReleaseMouse(b, c, left);
Wait(100 + Random(100));
end;

begin
//WindMouse(600, 300, 700, 400, 9.0, 3.0, 10.0, 15.0, 10.0, 10.0);
//MMouse(663, 367, 0, 0);
Mouse(663, 367, 0, 0, 1); // 0 == False 1 == True
end.

~Camo

Wanted

2010-01-24 15:19:37

From: WT-Fakawi

But I need to get 15000 highalchs safely done and I aim not doing them with Scar.


Why not, what would the difference at all?

noidea

2010-01-24 15:32:53

From: IceFire908
Why not, what would the difference at all?


SCAR always screws up and gives him dib handle errors.

mixster

2010-01-24 15:36:57

MouseSpeed is just a variable, not a function. You can just add it as a variable then set it to 15 + Random(3); at the beginning which is what SetupSRL does (iirc).
M/Mouse as well as WindMouse are then fine as long as you switch the left: Boolean option for Mouse to an integer as ClickMouse uses the mouse_left/middle_right stuffs (or something similar). From then onwards, most of the problems with the SRL include is altering the various mouses and the like, which makes me think it may be worth just having Mouse stick with a boolean then do left or right clicking based on the boolean (middle mouse clicking isn't used at all anyway, so porting a lot of files based on it seems silly). There's a few missing functions and types from then on, but I don't think it would take long to produce equivalent versions - maybe I'll have a little go in a bit (there is also a problem with Scar having case insensitivity and Simba not, but that's just a bit of renaming here and there).

mastaraymond

2010-01-24 15:39:36

Currently trying to get SRL 4 to compile.. However ran into another bug in the Intepreter engine (functions which return array's won't work, like GetColors).

Kyle Undefined

2010-01-24 15:47:52

Oh ok, thanks Mixster. I got it working with just setting it to 1.1. Also, I had already changed the Mouse to use 0 and 1, since HoldMouse uses an integer instead of a boolean.

program test;
{.Include SRL/Mouse.mufa}

begin
Mouse(663, 367, 0, 0, mouse_right); // mouse_left or mouse_right
end.

~Camo

Town

2010-01-24 16:50:16

From: mastaraymond
Currently trying to get SRL 4 to compile.. However ran into another bug in the Intepreter engine (functions which return array's won't work, like GetColors).


I had the same problem earlier.

Array of Array of TPoint –> GetColors(Var) worked

while

T2DPointArray –> GetColors(Var) did not.

Nava2

2010-01-24 16:58:13

I had already recreated Mouse.mufa but I think I lost it..

Kyle Undefined

2010-01-24 16:59:35

That's not good Nava :(

~Camo

Wizzup?

2010-01-24 17:43:00

What's the point of recreating mouse stuff? We're going to add the few functions we need to add to make Simba work with SRL 4. Mouse etc will obviously work, as it only depends on stuff like MoveMouse.

But like Raymond said, the interpreter has to be stable before we can make full use of MML's power.

mastaraymond

2010-01-24 17:53:57

This is how I fixed the issue with the params:


function MouseAction(left : boolean) : {$ifdef simba} integer; {$else} boolean; {$endif}
begin
{$ifdef Simba}
if left then
result := mouse_left
else
result := mouse_right;
{$else}
result := left;
{$endif}
end;
{*******************************************************************************
procedure Mouse(mousex, mousey, ranx, rany: Integer; left: Boolean);
By: Mutant Squirrle, with a small fix by hy71194
Description: Moves then clicks mouse.
*******************************************************************************}

procedure Mouse(mousex, mousey, ranx, rany: Integer; left: Boolean);
var
a, b, c: Integer;
begin
MMouse(mousex, mousey, ranx, rany);
Wait(60 + Random(30));
GetMousePos(b, c);
HoldMouse(b, c, mouseaction(left));
repeat
Wait(20 + Random(30));
a := a + 1;
until (a > 4);
GetMousePos(b, c);
ReleaseMouse(b, c, mouseaction(left));
Wait(100 + Random(100));
end;

Smartzkid

2010-01-31 16:45:37

Why not build Windmouse into Simba?

mastaraymond

2010-01-31 17:37:20

From: Smartzkid
Why not build Windmouse into Simba?

Might be done later, yes. For now I just want SRL 4 to work with Simba so one can actually test the created functionality.

BraK

2010-06-07 19:18:37

From: Function
I would absouletly love to help. I want to get started scripting for runescape although I am limited to the mouse functions that are rather easily detected, I hear. But I would love to test and help create (if possible) an include.


Mouse Functions can be made pretty random. Add in your randx and randy within the limitations. while still make sure you'll click on target. Then at wait functions on to it. Always remember you can add stuff like

WAIT(1200+random(300));

or

Clickwindmouse(1234,123,20,2,true);

might even add random choice on specific things that will give the same result. Such as withdraw all, withdraw #, and withdrawal all but one. Then add in a random choice Such as:

Randwithdraw:=random(3);

if randwithdraw = 0 then
Begin
Clickwindmouse(1234,123,20,2,False);
Wait(500+random(200));
Clickwindmouse(1234,123,20,2,true);
end;

Not very good at arrays yet since I only came back recently but arrays would be great in this scenario.

Bottom Line there is always a good amount of imagination you can put into being random.

PS. Dev's Smart threw me for a loop for a hot minute. still haven't figure it all out. Good Leech blocking :)

Sir R. M8gic1an

2010-06-07 19:40:24

You are kinda late to the party, BraK, .. SRL 4 and Simba are now fully compatible ;)

SRL 5, coming along.

As for the Randoms:
The developers haven't quite come around to cracking this yet. I'd suggest a 'careful' re-write. Many randoms only solve because the looping and failsafes aren't perfect.. people were focused on getting the job done (random solved) rather than making sure that it will always solve it.

(Hopefully I will re-writing some of those anti-randoms myself, now that college has finished)

~RM

BraK

2010-06-07 20:26:49

Meh Better to get back late than never but it looks like I got loads of catching up to do. I wrote up an auto fletcher because I needed to get to 80. After using it for 3 days. I remembered you guys over here and so starts my programming adventure again. Maybe i'll get my name in SRL again. With a new function or procedure but it looks like alot of people are dedicating alot of time to it. :)