SRL Archive - Development

MouseBox


Function

2010-01-17 13:48:48

Alright I don't how were doing this (was just added as a tester yesterday) but if we are recreating the whole library I made MouseBox :) I'm not experienced enough to make a new mouse procedure so it uses clickmouse. But that can easily be adjusted. So here is my version of MouseBox for the new mufasa library :D Feedback?

 <-- Suggestion :)
[SCAR]
procedure MouseBox( x1, y1, x2, y2, LeftClick: integer );
var
xi, yi : integer;

begin
xi := x2 - x1;
yi := y2 - y1;
ClickMouse( x1 + random( xi ), y1 + random( yi ), LeftClick );
end;
[/SCAR]
<– Suggestion :)

Naum

2010-01-17 13:53:32

Correct me if I'm mistaken but I'm sure MouseBox will remain in overwrite.scar, unless they decide to port it, in which case the Dev's will use WindMouse with RandomRange. I guess..

Function

2010-01-17 13:56:13

From: Naum
Correct me if I'm mistaken but I'm sure MouseBox will remain in overwrite.scar, unless they decide to port it, in which case the Dev's will use WindMouse with RandomRange. I guess..


So all of SCAR's library will be imported and able to be used in Simba? Cause I was confused about this.

Wanted

2010-01-17 13:56:19

Mouse(RandomRange(X1, X2), RandomRange(Y1, Y2), 0, 0, True);

Naum

2010-01-17 14:22:04

From: Function
So all of SCAR's library will be imported and able to be used in Simba? Cause I was confused about this.


MouseBox (well your version) belongs in SRL/Overwrite.Scar. I dont really think there would be a big reason for porting it into Simba, apart from the fact about speed:

{*******************************************************************************
procedure MouseBox(x1, y1, x2, y2: Integer; ClickType: Integer);
By: SKy Scripter and Nielsie95
Description: Moves mouse into a random position in the box. Clicks if told to.
*******************************************************************************}

procedure MouseBox(x1, y1, x2, y2: Integer; ClickType: Integer);
begin
case ClickType of
1 : Mouse(RandomRange(x1, x2), RandomRange(y1, y2), 0, 0, True);
2 : Mouse(RandomRange(x1, x2), RandomRange(y1, y2), 0, 0, False);
3 : MMouse(RandomRange(x1, x2), RandomRange(y1, y2), 0, 0);
else
srl_Warn('MouseBox', 'ClickType is NOT a valid number!', warn_AllVersions);
end;
end;

Nava2

2010-01-17 14:40:22

It will be placed in Mouse.scar Thanks for the input though :)