SRL Archive - Help

Using color now chords help


tiggerred

2012-12-24 21:26:20

Okay so I know how to use chords to find something. I am making a rsps script. But i don't know how to use color to find something.

If any1 will skype or msn me please pm me! I am a beginer and need a little help.

Here is my code.
program MoneyMaker;

procedure findshopkeeper;
begin
FindColors(11256498);
begin
end.

DannyRS

2012-12-24 21:36:10


{$I SRL/SRL.Simba}

Procedure ClickGuy;
Var
x,y: Integer;
Begin
If (FindColorSpiralTolerance(x, y, NPCcolor, 0, 0, 800, 600, 10)) Then
Begin
ClickMouse(x, y, True);
End;
End;

Most includes wont work on a PS, i think you want something like that?

tiggerred

2012-12-24 21:57:48

From: DannyRS

{$I SRL/SRL.Simba}

Procedure ClickGuy;
Var
x,y: Integer;
Begin
If (FindColorSpiralTolerance(x, y, NPCcolor, 0, 0, 800, 600, 10)) Then
Begin
ClickMouse(x, y, True);
End;
End;

Most includes wont work on a PS, i think you want something like that?



Now I have this and it still doesn't work
program MoneyMaker;

Procedure ClickGuy;
Var
x,y: Integer;
Begin
If (FindColorSpiralTolerance(196, 39, 11256498, 10533287, 9811871, 10272165, 8561292)) Then
Begin
ClickMouse(x, y, True);
End;
End;

DannyRS

2012-12-24 22:00:29

From: tiggerred
Now I have this and it still doesn't work


Needs to be like this

program MoneyMaker;

Procedure ClickGuy;
Var
x,y: Integer;
Begin
If (FindColorSpiralTolerance(x, y, ColorToClick, 0, 0, ScreenHorizontalEnd, ScreenVerticalEnd, Tolerance)) Then
Begin
ClickMouse(x, y, True);
End;
End;

FindColorSpiralTolerance(x, y, ColorToClick, ScreenHorizontalStart, ScreenVerticalStart, ScreenHorizontalEnd, ScreenVerticalEnd, Tolerance)

x,y return the screen position the color was found and puts it in the variables so you can put the mouse there

ColorToClick being a color specific to the NPC found nowhere else

ScreenHorizontalStart and ScreenVerticalStart being top left of your screen (should be top left of where the PS screen starts roughly)

ScreenHorizontalEnd being around 515 in official rs (should be far right of where the PS screen ends roughly)

ScreenVerticalEnd being around 335 in official rs (should be bottom of where the PS screen ends roughly)

Tolerance being how much the color can differ (normally 5-50)


Think i got that right, very tired could of made a mistake somewhere

riwu

2012-12-24 22:04:57

Last parameter of ClickMouse is integer. Use SRL const mouse_Left, mouse_Right etc.

tiggerred

2012-12-24 22:06:53

From: DannyRS
Needs to be like this

program MoneyMaker;

Procedure ClickGuy;
Var
x,y: Integer;
Begin
If (FindColorSpiralTolerance(x, y, ColorToClick, 0, 0, ScreenHorizontalEnd, ScreenVerticalEnd)) Then
Begin
ClickMouse(x, y, True);
End;
End;

x,y return the screen position the color was found
0,0 being top left of your screen (should be top left of where the PS screen starts roughly)
ScreenHorizontalEnd being around 515 in official rs (should be far right of where the PS screen ends roughly)
ScreenVerticalEnd being around 335 in official rs (should be bottom of where the PS screen ends roughly)
ColorToClick being a color specific to the NPC


Ok I'm suck a noob!

program MoneyMaker;

Procedure ClickGuy;
Var
x,y: Integer;
Begin
If (FindColorSpiralTolerance(x, y, 10272165, 0, 0,)) Then
Begin
ClickMouse(x, y, True);
End;
End;

10272165 That is my color

DannyRS

2012-12-24 22:13:59

From: tiggerred

10272165 That is my color


try this then

program MoneyMaker;

Procedure ClickGuy;
Var
x,y: Integer;
Begin
If (FindColorSpiralTolerance(x, y, 10272165, 0, 0,800,500,10)) Then
Begin
ClickMouse(x, y, mouse_Left);
End;
End;

also maybe read http://villavu.com/forum/showthread.php?t=15240

tiggerred

2012-12-24 22:21:29

From: DannyRS
try this then

program MoneyMaker;

Procedure ClickGuy;
Var
x,y: Integer;
Begin
If (FindColorSpiralTolerance(x, y, 10272165, 0, 0,800,500,10)) Then
Begin
ClickMouse(x, y, mouse_Left);
End;
End;

also maybe read http://villavu.com/forum/showthread.php?t=15240




I get this
[Error] (1:1): Unexpected end of file at line 0
Compiling failed.

riwu

2012-12-24 22:24:01


program MoneyMaker;

procedure ClickGuy;
var
x, y: Integer;
begin
if (FindColorSpiralTolerance(x, y, 10272165, 0, 0,800,500,10)) then
ClickMouse(x, y, mouse_Left);
end;

begin
ClickGuy;
end.

tiggerred

2012-12-24 22:28:11

From: riwu

program MoneyMaker;

procedure ClickGuy;
var
x, y: Integer;
begin
if (FindColorSpiralTolerance(x, y, 10272165, 0, 0,800,500,10)) then
ClickMouse(x, y, mouse_Left);
end;

begin
ClickGuy;
end.


Error: Exception: You passed a wrong xe to a finder function: 773. The client has a width of 773, thus the xe is out of bounds. at line 7

sorry for all the trouble =(

riwu

2012-12-24 22:42:19

Exactly what the warning says. If you want to search the whole client, you can do

GetClientDimensions(w, h);
Then your search region will be from 0, 0 to w - 1, h - 1. Read some tutorials if you can't understand it ;)