Problem solved! The RSPS was in OpenGL mode instead of safemode (never heard of a RSPS with OpenGL support..) so Simba couldn't get the colors!
Problem solved! The RSPS was in OpenGL mode instead of safemode (never heard of a RSPS with OpenGL support..) so Simba couldn't get the colors!
where's your mmouse, I guess you wanna clicK?
Creds to DannyRS for this wonderful sig!
woops forgot that:
Simba Code:function findCrab():Boolean;
var
TPA:TPointArray;
ATPA:T2DPointArray;
i, x, y:Integer;
Bounds:TBox;
begin
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.00, 0.10);
FindColorsSpiralTolerance(256, 166, TPA, 3820363, 3, 3, 514, 339, 8);
ColorToleranceSpeed(1);
SetColorSpeed2Modifiers(0.02, 0.02);
if (Length(TPA) > 0) then
begin
ATPA := TPAToATPAEx(TPA, 40, 40);
filterTPAsBetween(ATPA, 1, 50);
SortATPAFromFirstpoint(ATPA, Point(256, 166));
DebugATPABounds(ATPA);
for i := 0 to high(ATPA) do
begin
Bounds := GetTPABounds(ATPA[i]);
MiddleTPAEx(ATPA[i], x, y);
if not hpExists(Bounds, 0, 6) then
begin
result := true;
mmouse(x, y, 0, 0);
ClickMouse2(Mouse_left);
//updatestate('Attacking rock crab');
wait(1500);
while (isMoving) do
wait(200);
exit;
end;
end;
end;
end;
but that still didn't solve the issue
You have ACA looking at 250 tolerance. But your tolerance in the function isn't 250.
Try that, and tell us what happens.
FindColorsSpiralTolerance(256, 166, TPA, 3820363, 3, 3, 514, 339, 8);
Add WriteLn everywhere to make sure it's doing what you want.
Simba Code:program autocrabs;
{$I SRL/SRL.Simba}
{$i SRL/srl/misc/debug.simba}
procedure filterTPAsBetween(var atpa: T2DPointArray; len1, len2: integer);
var
h, l, i: integer;
c: T2DPointArray;
begin
h := high(atpa);
for i := 0 to h do
begin
l := length(atpa[i]);
if (not (inRange(l, len1, len2))) then
begin
setLength(c, length(c) + 1);
c[high(c)] := atpa[i];
end;
end;
atpa := c;
end;
function getHp():Integer;
begin
end;
Procedure report;
begin
end;
function hpExists(bounds:TBox; offx, offy:Integer):Boolean;
var
TPA:TPointArray;
ATPA:T2DPointArray;
begin
//if (not t_loggedin) then exit;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.68, 0.00);
FindColorsSpiralTolerance(256, 86, TPA, 47445, Bounds.X1-offx, Bounds.Y1-offy, Bounds.X2, Bounds.Y2, 8);
ColorToleranceSpeed(1);
SetColorSpeed2Modifiers(0.02, 0.02);
if (Length(TPA)>0) then
begin
result := true;
end;
end;
function findCrab():Boolean;
var
TPA:TPointArray;
ATPA:T2DPointArray;
i, x, y:Integer;
Bounds:TBox;
begin
ColorToleranceSpeed(2);
writeln('1');
SetColorSpeed2Modifiers(0.00, 0.10);
writeln('2');
FindColorsSpiralTolerance(256, 166, TPA, 3820363, 3, 3, 514, 339, 8);
writeln('3');
ColorToleranceSpeed(1);
writeln('4');
SetColorSpeed2Modifiers(0.02, 0.02);
writeln('5');
if (Length(TPA) > 0) then
begin
writeln('found a tpa');
ATPA := TPAToATPAEx(TPA, 40, 40);
filterTPAsBetween(ATPA, 1, 50);
SortATPAFromFirstpoint(ATPA, Point(256, 166));
DebugATPABounds(ATPA);
for i := 0 to high(ATPA) do
begin
Bounds := GetTPABounds(ATPA[i]);
MiddleTPAEx(ATPA[i], x, y);
if not hpExists(Bounds, 0, 6) then
begin
result := true;
mmouse(x, y, 0, 0);
ClickMouse2(Mouse_left);
//updatestate('Attacking rock crab');
wait(1500);
while (isMoving) do
wait(200);
exit;
end;
end;
end;
end;
begin
activateclient;
wait(800);
if findcrab then
writeln('found crab');
end.
It gets to 5. The TPA length is < 0 for some reason..
FindColorsSpiralTolerance is a boolean, put it in if..then statements.
Last edited by Vinyl Scratch; 07-25-2013 at 10:42 PM. Reason: forgot a little bit.
The problem is your mixing up includes again. your probably using regular runescape functions on soulsplit or something.
Edit : i think it's because it's loosing focus so there is no image buffer being passed to simba if that makes sense.
Edit2 : to test this, just debug the current client image right before it hits if (Length(TPA) > 0) then... if the client it blank or doesnt = the actual window then it's loosing focus.
Last edited by Kasi; 07-26-2013 at 02:27 AM.
There are currently 1 users browsing this thread. (0 members and 1 guests)