View Full Version : ClickMouse & ClickMouse2 Problem(Maybe)
AideniRS
05-04-2012, 08:31 AM
So Im just trying to create a simple Slay assist to use on my main..
program SlayAssist;
{$i srl/srl.simba}
{$i sps/sps.simba}
const
RenewPray = 550;
Procedure CheckPray;
var
X, Y:Integer;
S:String;
begin
if (GetMMLevels('Pray', S) < RenewPray) then
begin
repeat
FindColor(X, Y, 8103474, 566, 213, 719, 278);
WaitUptext('Drink', 200);
ClickMouse2(1);
Wait(2500+Random(100));
until(GetMMLevels('Pray', S) > RenewPray)
end else;
end;
begin
SetupSRL;
ActivateClient;
Repeat
CheckPray;
Until(false);
end.
Probably a small mistake that I cant realize but, Im using Simba to control RS Client and when I start it, it switches to RS and then once the ClickMouse2 is called, it opens Simba back up and then spam clicks the mouse.
Ive tried ClickMouse2 and normal ClickMouse just to test, when I remove them it no longer switches back to Simba and it just stays on RS, what am I doing wrong?
punkd
05-04-2012, 08:50 AM
Clickmouse2(true) left click
Clickmouse2(false) right click
AideniRS
05-04-2012, 08:56 AM
Clickmouse2(true) left click
Clickmouse2(false) right click
I dont think it matters if you use 1/0 for clicking instead of true/false, didnt fix it though :/
Flight
05-04-2012, 09:06 AM
Where are you trying to have your mouse click? The way I read it is you find a color in a certain area (nothing is done, just found), whether or not that color is found your script will wait for an uptext to appear (again, nothing is done, even if the uptext is not found the script continues), and then clicks the mouse where ever it was originally.
You never moved your mouse, so I'm guessing when you call 'ClickMouse2(True)' (true = left click, false = right click) it will just left click at coordinate 0, 0.
Edit:
Try this:
Procedure CheckPray;
var
X, Y:Integer;
S:String;
begin
if (GetMMLevels('Pray', S) < RenewPray) then
begin
repeat
if FindColor(X, Y, 8103474, 566, 213, 719, 278) then //Only "IF" the color is found then...
begin
MMouse(X, Y, 5, 5); //Let's move our mouse to that color
if WaitUptext('Drink', 600) then //Only "IF" the uptext is found then...
ClickMouse2(True); //'Now' we click our mouse
Wait(2500+Random(100));
end;
until(GetMMLevels('Pray', S) > RenewPray)
end else;
end;
punkd
05-04-2012, 09:09 AM
Have you tried
getmousepos(x,y);
Mmouse(x,y,3,3);
Clickmouse2(true);
Should work fine
Flight beat me to it (on my phone) :P
Have you tried
getmousepos(x,y);
Mmouse(x,y,3,3);
Clickmouse2(true);
Should work fine
Flight beat me to it (on my phone) :P
You don't need GetMousePos(X, Y);
If you take a look ar ClickMouse2(); how it works
procedure ClickMouse2(button: variant);
var
a,b,c : integer;
iButton: Integer;
begin
{ Eventually, should be made to just use Integers }
if (varType(button) = varBoolean) then
begin
if (button) then
iButton := mouse_left
else
iButton := mouse_right;
end else
iButton := button;
if (iButton = mouse_move) then Exit; { we aren't actually clicking! }
GetMousePos(b, c);
HoldMouse(b, c, iButton);
repeat
Wait(20 + Random(30));
a := a + 1;
until (a > 4);
GetMousePos(b, c);
ReleaseMouse(b, c, iButton);
Wait(50+Random(50));
end;
You understand that it will do the trick for you. All what you need to do is
MMouse(X, Y, 2, 2)
ClickMouse2(mouse_Left) or ClickMouse2(mouse_Right)
~Home
AideniRS
05-04-2012, 09:17 AM
Thank you both, I knew the failsafes were incorrect but it was just cause I was trying to test it not add the full thing yet, the problem was moving mouse, I forgot FindColor doesnt move the mouse.
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.