mirror of
https://github.com/moparisthebest/Simba
synced 2025-01-31 07:10:28 -05:00
NEW CPASCAL with new and improved internals. (note, plugintest works, but not in debug mode, for some reason) valgrind says the jvm is trying to do something its not supposed to...
git-svn-id: http://www.villavu.com/repositories/merlijn/mufasa@536 3f818213-9676-44b0-a9b4-5e4c4e03d09d
This commit is contained in:
parent
79cdefecdd
commit
0ecc5f06dd
Binary file not shown.
Binary file not shown.
@ -81,14 +81,6 @@ const medium_maze ='61' + #10 +
|
||||
'0110111111111111111010000000001111111111101111111111111111110' + #10 +
|
||||
'0000000000000000000000000000000000000000000000000000000000000' + #10 ;
|
||||
|
||||
type Tpoint = record
|
||||
x,y: integer;
|
||||
end;
|
||||
|
||||
type TpointArray = array of TPoint;
|
||||
|
||||
type TpointArrayArray = array of TpointArray;
|
||||
|
||||
type TboolGrid = array of array of boolean;
|
||||
|
||||
function readLine(raw: string; var off: integer): string;
|
||||
|
64
trunk/Tests/CPascal/plugintest.simb
Normal file
64
trunk/Tests/CPascal/plugintest.simb
Normal file
@ -0,0 +1,64 @@
|
||||
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.
|
Loading…
Reference in New Issue
Block a user