PDA

View Full Version : RandomClick Procedure



Dumpin
11-08-2007, 04:58 PM
Quick made a Function that clicks with right mouse button or the left mouse button in random order..

Didn't test it but it should work in theory I think...

function RandomClick(Option: string; active : boolean): boolean;
var
ClickStyle, x, y : integer;
begin
if (active) then
begin
for ClickStyle := 1 To 2 Do
begin
Case Clickstyle of
1: Mouse(x, y, 3, 3, true);
2: ChooseOption(Option);
end;
result := true;
end;
end;
end;

fill it in as:
RandomClick('ttack', true)

'ttack' is right mouse option
true should be true, otherwise it won't click :)

gl

mat_de_b
11-08-2007, 05:15 PM
Why the active? surely if your running it you want it to work? You should include some failsafes such as looking for the right click box. And also you should Let the person set the random sizes. And finally let them pass in an X and Y so its

function RandomClick(Option: string; Cx , Cy, Rx, Ry: integer): boolean;

SuperScripter
11-08-2007, 05:21 PM
Nice One dumpin really easy to use. I might use this in my new tut if its ok with you :).

Dumpin
11-08-2007, 05:28 PM
Why the active? surely if your running it you want it to work? You should include some failsafes such as looking for the right click box. And also you should Let the person set the random sizes. And finally let them pass in an X and Y so its

function RandomClick(Option: string; Cx , Cy, Rx, Ry: integer): boolean;

people should add that themselves in the procedure, its just like you use mouse but then it right clicks to...


SuperScripter, you can use it :) but credit plz ;)