SRL Archive - OSR Help

mouse function


Here2help

2012-05-21 19:48:10

Mouse(x, y, 0, 0, False);

What do the 0's and the False at the end mean?

Abu

2012-05-21 19:50:08

First 0: Randomness on the x-axis
Second 0: Randomness on the y-axis
False: Means Right-Click
True: Means Left-Click

CephaXz

2012-05-21 19:51:19

the numbers means the randomness of the mouse position in x and y axis, so mouse position will not be ALWAYS the same. Same mouse position everytime you click on something will make you look very bot-like.

As for the boolean of true and false, it means left click or right click. But I suggest you using:
mouse_Left
mouse_Right
mouse_move

Above 3 can be found when you type mouse, then press ctrl + space.

Here2help

2012-05-21 19:53:17

Thanks for the replies.

CephaXz how does this look?
begin
GetMousePos(x, y);
mouse_Left; //not sure if the ";" is needed there or not.
Wait(500+random(250));
Exit;
end;

?

CephaXz

2012-05-21 19:56:44

From: Here2help
Thanks for the replies.

CephaXz how does this look?
begin
GetMousePos(x, y);
mouse_Left
Wait(500+random(250));
Exit;
end;

?


What are you trying to do with those codes?
If you want to just click the mouse, use Clickmouse2(mouse_Left);
If you want to move and click, use Mouse(x, y, 4, 4, mouse_Left);
The randomness of axis x and y is up to you, but I usually use 3-5.

Here2help

2012-05-21 19:59:14

From: CephaXz
What are you trying to do with those codes?
If you want to just click the mouse, use Clickmouse2(mouse_Left);
If you want to move and click, use Mouse(x, y, 4, 4, mouse_Left);
The randomness of axis x and y is up to you, but I usually use 3-5.


Trying to make it go from lefting clicking an item in my inventory, to left clicking the stove.

Here's the code so fare.
 function
var
MyTPA : TPointArray;
MyPoint : TPoint;
x, y, i : Integer;
begin
FindColorsTolerance(MyTPA, 'range/stove color', MSx1, MSy1, MSx2, MSy2, 10);
for i := 0 to High(MyTPA)do
begin
MyPoint := MyTPA[i]
MMouse (MyPoint.x, MyPoint.y, 3, 3);
if (IsUpTextMultiCustom(['ange', 'Range'])) then
begin
GetMousePos(x, y);
Mouse(x, y, 4, 4, mouse_Left);
Wait(500+random(250));
Exit;
end;
Wait(350+random(350));
end;
end.

Abu

2012-05-21 20:02:33

The above function looks fine, but you have to actually name your function and say what it will return…so
function ClickRange: Boolean;

Here2help

2012-05-21 20:04:32

From: abu_jwka
The above function looks fine, but you have to actually name your function and say what it will return…so
function ClickRange: Boolean;


Boolean, what is that? Why does it need to be at the end of the function name?

CephaXz

2012-05-21 20:04:40

From: Here2help
Trying to make it go from lefting clicking an item in my inventory, to left clicking the stove.

Here's the code so fare.
 function
var
MyTPA : TPointArray;
MyPoint : TPoint;
x, y, i : Integer;
begin
FindColorsTolerance(MyTPA, 'range/stove color', MSx1, MSy1, MSx2, MSy2, 10);
for i := 0 to High(MyTPA)do
begin
MyPoint := MyTPA[i]
MMouse (MyPoint.x, MyPoint.y, 3, 3);
if (IsUpTextMultiCustom(['ange', 'Range'])) then
begin
GetMousePos(x, y);
Mouse(x, y, 4, 4, mouse_Left);
Wait(500+random(250));
Exit;
end;
Wait(350+random(350));
end;
end.


Just like what abu said. Should work fine, if you didn't copy and paste it from others scripts lol.

Here2help

2012-05-21 20:06:01

From: CephaXz
Just like what abu said. Should work fine, if you didn't copy and paste it from others scripts lol.


Got it from here
http://villavu.com/forum/showthread.php?t=33111

CephaXz

2012-05-21 20:15:31

Should work if you know what you're doing.

Function must return something, so it will always have something behind the name of the function.

In your case, I think you can use Procedure. Procedure only need a name. Example:
Procedure ClickStove;

Er1k

2012-05-23 06:16:23

From: CephaXz
Should work if you know what you're doing.

Function must return something, so it will always have something behind the name of the function.

In your case, I think you can use Procedure. Procedure only need a name. Example:
Procedure ClickStove;


It should be a function returning boolean. Knowing if clicking the stove is successful is very important. Anything that has a success/fail outcome should be coded as a function returning boolean.