mirror of
https://github.com/moparisthebest/Simba
synced 2024-11-14 13:25:14 -05:00
0ecc5f06dd
git-svn-id: http://www.villavu.com/repositories/merlijn/mufasa@536 3f818213-9676-44b0-a9b4-5e4c4e03d09d
65 lines
1.2 KiB
Plaintext
65 lines
1.2 KiB
Plaintext
program new;
|
|
{$LoadDLL libsmart}
|
|
function IsKeyDown(C:Char): Boolean;
|
|
begin
|
|
Result := SmartIsKeyDown(ord(c));
|
|
end;
|
|
|
|
procedure MoveMouse(x, y: Integer);
|
|
begin
|
|
SmartMoveMouse(x, y);
|
|
end;
|
|
|
|
procedure HoldMouse(x, y: Integer; left: Boolean);
|
|
begin
|
|
SmartHoldMouse(x, y, left);
|
|
end;
|
|
|
|
procedure ReleaseMouse(x, y: Integer; left: Boolean);
|
|
begin
|
|
SmartReleaseMouse(x, y, left);
|
|
end;
|
|
|
|
procedure KeyUp(key: byte);
|
|
begin
|
|
If Key = 13 Then
|
|
Key := 10;
|
|
SmartReleaseKey(key);
|
|
end;
|
|
|
|
procedure KeyDown(key: byte);
|
|
begin
|
|
If Key = 13 Then
|
|
Key := 10;
|
|
SmartHoldKey(key);
|
|
end;
|
|
|
|
procedure SendKeys(S: String);
|
|
begin
|
|
SmartSendKeys(S);
|
|
end;
|
|
|
|
procedure GetMousePos(var x, y: Integer);
|
|
begin
|
|
SmartGetMousePos(x, y);
|
|
end;
|
|
|
|
function GetColor(x, y: Integer): Integer;
|
|
begin
|
|
result:= SmartGetColor(x, y);
|
|
end;
|
|
|
|
|
|
var
|
|
w,h:integer;
|
|
begin
|
|
SmartSetup('http://world19.runescape.com/', 'plugin.js?param=o0,a1,m0', 765, 503);
|
|
SetTargetArray(SmartImageArray(), 765,503);
|
|
getclientdimensions(w,h);
|
|
writeln(inttostr(w) + ' , ' + inttostr(h));
|
|
if findcolortolerance(w,h,00000,0,0,764,502,300) then
|
|
smartmovemouse(w,h);
|
|
savescreenshot('/tmp/smart.bmp');
|
|
//Wait(5000);
|
|
end.
|