SRL Archive - OSR Help

Mouse Doesn't click


alw98

2012-06-15 16:35:26

okay heres my code:
program silkstealer;
const
COLOR= 5180779;
var
x, y, w, h: integer;
begin
GetClientDimensions(w,h);
while(findcolor(x, y, COLOR, 0, 0, w-1, h-1))do
MoveMouse(x, y,);
ClickMouse(x, y, 1)
end.
but for some reason when ever it moves the cursor to the color, it doesn't click it. then if I manually click the mouse and the object diasapears, it clicks and finishes. What do I have to do to make it to where once it finds the color it clicks it, and then repeats.

Abu

2012-06-15 16:37:51

Replace this:
while(findcolor(x, y, COLOR, 0, 0, w-1, h-1))do
MoveMouse(x, y,);
ClickMouse(x, y, 1)

with this:
if findcolor(x, y, COLOR, 0, 0, w-1, h-1) then
Mouse(x, y, 0, 0, True)
else
Writeln('Couldn''t find color!');

putonajonny

2012-06-15 16:43:40

and add this to the top of your script if it isn't already there:
{.include SRL/SRL.simba}

Also if you wanted to keep it how it was then:
program silkstealer;
const
COLOR= 5180779;
var
x, y, w, h: integer;
begin
GetClientDimensions(w,h);
while(findcolor(x, y, COLOR, 0, 0, w-1, h-1))do
begin
MoveMouse(x, y,);
ClickMouse(x, y, 1)
end;
end.

alw98

2012-06-15 16:44:03

[Error] (10:1): Unknown identifier 'Mouse' at line 9
i did what you said, this popped up.

Abu

2012-06-15 16:47:09

From: alw98
[Error] (10:1): Unknown identifier 'Mouse' at line 9
i did what you said, this popped up.


Oh yeh you have to add this at the top of your script under program
{.include SRL/SRL.simba}

And in your mainloop (final begin and end.) put this under begin:
SetUpSRL;

alw98

2012-06-15 16:51:06

when i add {.include SRL/SRL.simba} it says BEGIN expected at line 2 and it looks like this

{.include SRL/SRL.simba}
program silkstealer;
const
COLOR= 5180779;
var
x, y, w, h: integer;
begin
GetClientDimensions(w,h);
if findcolor(x, y, COLOR, 0, 0, w-1, h-1)then
Mouse(x, y, 0, 0, True);
end.

alw98

2012-06-15 16:53:56

Okay. Now it succesfully executes, but it doesn't go to the color and click it.

Abu

2012-06-15 17:50:21

Run this and tell me what it says in the debug box:

program SilkStealer;
{$i srl\srl.simba}

const
COLOR= 5180779;

procedure StealSilk;
var
x, y, w, h: integer;
begin
GetClientDimensions(w, h);
if FindColor(x, y, COLOR, 0, 0, w-1, h-1)then
begin
Writeln('Silk found!');
Mouse(x, y, 0, 0, True);
end else
Writeln('Couldn''t find silk, update your colors!');
end;


begin
ClearDebug;
SetUpSRL;
StealSilk;
end.

Also, is this script for RS?

alw98

2012-06-16 11:35:44

Thank, you so much, it worked! It says Silk Found in the debug Box, and then clicks the silk! And the great thing is, I can edit it to click any stall:) And its for a private server.