PDA

View Full Version : Mouse Not working in particular region...[RUNIQUE]



rj
11-22-2016, 07:47 PM
FIXED

Okay so the mouse will for whatever reason not click on the chat region of the client.(Runique)


http://image.prntscr.com/image/4e6548d3e25d4395856cec6ba14d2ade.png


procedure Mouse(T:TPoint;fuckyou:string)overload;
begin
moveMouse(T);
wait(100);
clickMouse(T.X, T.Y, 1);
end;

function teleportTo(place:TLOCATION):boolean;
begin
wait(50);
mouse(Point(504, 512), '');
wait(500);
case place of
SWBANK : sendKeys('MS', 100, 100);
DUNGEON: sendKeys('DB', 100, 100);
end;
end;



I have no idea why it refuses to click inside that red square, all it does it move the mouse there and type 'MS' (I am aware it does not press enter yet I want to resolve this clicking issue first..)



If anyone would like to test it yourself, here is the code you don't need to download anything other than the RSPS (runique)

{$I srl-6/srl.simba}

const

USERNAME = '';
CLIENTNAME = 'Runique';
CLIENTWIDTH = 765;
CLIENTHEIGHT = 525;

type
TLOCATION = (SWBANK, NEWSPOT, DUNGEON, LOST);

var
rsClient:TSysProc;

procedure Mouse(T:TPoint;fuckyou:string)overload;
begin
moveMouse(T);
wait(100);
clickMouse(T.X, T.Y, 1);
end;

function findBank():boolean;
begin
end;

function teleportTo(place:TLOCATION):boolean;
begin
wait(50);
mouse(Point(504, 512), '');
wait(500);
case place of
SWBANK : sendKeys('MS', 100, 100);
DUNGEON: sendKeys('DB', 100, 100);
end;
end;

function string.contains(s:string):boolean;
var
i:integer;
begin
for i := 1 to length(self) do
if (Pos(s[i], self) > 0) then
exit(true);
end;

function activateRsClient(firstTime:boolean):boolean;
var
processes: TSysProcArr;
i: integer;
begin
result := false;
processes := GetProcesses();
if (firstTime) then
writeln('Scanning for ' , CLIENTNAME , 'Client..');
for i := 0 to high(processes) do
if (processes[i].title.contains(CLIENTNAME)) and (processes[i].width = CLIENTWIDTH) and (processes[i].height = CLIENTHEIGHT) then
begin
if (firstTime) then
begin
writeln('Found client');
writeln('Target set to: ' , toStr(processes[i]));
end;
rsClient := processes[i];
setTarget(processes[i]);
ActivateClient();
exit(true);
end;
end;

function getClientName():string;
begin
activateRsClient(false);
result := rsClient.title;
end;

function isLoggedIn():boolean; override;
begin
if (USERNAME = '') then
begin
writeln('Please enter a username at the top of the script');
terminateScript();
end else
result := getClientName().contains(USERNAME);
end;

begin
activateRsClient(true);
Mouse(Point(334, 216), ''); // clicks the main screen...
teleportTo(SWBANK); // does not click the chat region..
end.




I suspect it was something to do with SRL-6 as I was using the SRL-6 mouse function and they wouldn't work until I had to create my own slightly different. Then mine wouldn't work so I just rewrote the damn thing

procedure Mouse(T:TPoint;fuckyou:string)overload;
begin
moveMouse(T);
wait(100);
holdMouse(t.x, t.y, 1);
wait(50);
releaseMouse(t.x, t.y, 1);
wait(10);
end;

Joopi
11-22-2016, 08:41 PM
Have you tried overriding clickMouse so that it holds down the mouse for a couple of tens of millisecs?

rj
11-22-2016, 08:49 PM
Have you tried overriding clickMouse so that it holds down the mouse for a couple of tens of millisecs?

Yeah it's what I ended up doing.

FFS I forgot about ovverriding lol only reason I had that extra param