1
0
mirror of https://github.com/moparisthebest/Simba synced 2024-11-22 09:12:19 -05:00

Fix in plugins. Small export change for SetTargetArray.

Added Pointer as Integer to PS.



git-svn-id: http://www.villavu.com/repositories/merlijn/mufasa@360 3f818213-9676-44b0-a9b4-5e4c4e03d09d
This commit is contained in:
Wizzup? 2010-01-02 22:32:46 +00:00
parent 2dc2725364
commit 48242e8cb1
6 changed files with 137 additions and 96 deletions

View File

@ -10,7 +10,7 @@
<TargetFileExt Value=""/> <TargetFileExt Value=""/>
<Title Value="Simba"/> <Title Value="Simba"/>
<UseXPManifest Value="True"/> <UseXPManifest Value="True"/>
<ActiveEditorIndexAtStart Value="9"/> <ActiveEditorIndexAtStart Value="12"/>
</General> </General>
<VersionInfo> <VersionInfo>
<ProjectVersion Value=""/> <ProjectVersion Value=""/>
@ -138,7 +138,7 @@
<ResourceBaseClass Value="Form"/> <ResourceBaseClass Value="Form"/>
<UnitName Value="TestUnit"/> <UnitName Value="TestUnit"/>
<CursorPos X="59" Y="424"/> <CursorPos X="59" Y="424"/>
<TopLine Value="657"/> <TopLine Value="723"/>
<EditorIndex Value="7"/> <EditorIndex Value="7"/>
<UsageCount Value="202"/> <UsageCount Value="202"/>
<Loaded Value="True"/> <Loaded Value="True"/>
@ -282,8 +282,8 @@
<Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/> <Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="mmlpsthread"/> <UnitName Value="mmlpsthread"/>
<CursorPos X="20" Y="193"/> <CursorPos X="25" Y="453"/>
<TopLine Value="174"/> <TopLine Value="438"/>
<EditorIndex Value="6"/> <EditorIndex Value="6"/>
<UsageCount Value="202"/> <UsageCount Value="202"/>
<Loaded Value="True"/> <Loaded Value="True"/>
@ -344,8 +344,8 @@
</Unit40> </Unit40>
<Unit41> <Unit41>
<Filename Value="../../Units/MMLAddon/PSInc/pscompile.inc"/> <Filename Value="../../Units/MMLAddon/PSInc/pscompile.inc"/>
<CursorPos X="42" Y="14"/> <CursorPos X="91" Y="39"/>
<TopLine Value="11"/> <TopLine Value="12"/>
<UsageCount Value="97"/> <UsageCount Value="97"/>
</Unit41> </Unit41>
<Unit42> <Unit42>
@ -571,9 +571,11 @@
<Filename Value="../../Units/MMLAddon/plugins.pas"/> <Filename Value="../../Units/MMLAddon/plugins.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="plugins"/> <UnitName Value="plugins"/>
<CursorPos X="36" Y="32"/> <CursorPos X="40" Y="49"/>
<TopLine Value="32"/> <TopLine Value="33"/>
<EditorIndex Value="11"/>
<UsageCount Value="200"/> <UsageCount Value="200"/>
<Loaded Value="True"/>
</Unit75> </Unit75>
<Unit76> <Unit76>
<Filename Value="../../../Compilertje/Units/CogatUnits/compfiles.pas"/> <Filename Value="../../../Compilertje/Units/CogatUnits/compfiles.pas"/>
@ -603,7 +605,7 @@
</Unit79> </Unit79>
<Unit80> <Unit80>
<Filename Value="../../Units/MMLAddon/PSInc/psdefines.inc"/> <Filename Value="../../Units/MMLAddon/PSInc/psdefines.inc"/>
<CursorPos X="53" Y="25"/> <CursorPos X="1" Y="1"/>
<TopLine Value="2"/> <TopLine Value="2"/>
<UsageCount Value="10"/> <UsageCount Value="10"/>
</Unit80> </Unit80>
@ -659,9 +661,9 @@
<Filename Value="../../Units/MMLAddon/colourpicker.pas"/> <Filename Value="../../Units/MMLAddon/colourpicker.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="colourpicker"/> <UnitName Value="colourpicker"/>
<CursorPos X="3" Y="189"/> <CursorPos X="21" Y="187"/>
<TopLine Value="167"/> <TopLine Value="167"/>
<EditorIndex Value="9"/> <EditorIndex Value="10"/>
<UsageCount Value="201"/> <UsageCount Value="201"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit88> </Unit88>
@ -869,9 +871,11 @@
</Unit117> </Unit117>
<Unit118> <Unit118>
<Filename Value="../../Units/MMLAddon/PSInc/Wrappers/window.inc"/> <Filename Value="../../Units/MMLAddon/PSInc/Wrappers/window.inc"/>
<CursorPos X="50" Y="41"/> <CursorPos X="52" Y="55"/>
<TopLine Value="20"/> <TopLine Value="22"/>
<EditorIndex Value="9"/>
<UsageCount Value="12"/> <UsageCount Value="12"/>
<Loaded Value="True"/>
</Unit118> </Unit118>
<Unit119> <Unit119>
<Filename Value="../../../FPC/FPCCheckout/rtl/objpas/classes/compon.inc"/> <Filename Value="../../../FPC/FPCCheckout/rtl/objpas/classes/compon.inc"/>
@ -1962,9 +1966,11 @@
</Unit274> </Unit274>
<Unit275> <Unit275>
<Filename Value="../../Units/MMLAddon/PSInc/psexportedmethods.inc"/> <Filename Value="../../Units/MMLAddon/PSInc/psexportedmethods.inc"/>
<CursorPos X="87" Y="133"/> <CursorPos X="81" Y="63"/>
<TopLine Value="111"/> <TopLine Value="45"/>
<EditorIndex Value="12"/>
<UsageCount Value="20"/> <UsageCount Value="20"/>
<Loaded Value="True"/>
</Unit275> </Unit275>
<Unit276> <Unit276>
<Filename Value="../../Units/Synapse/synautil.pas"/> <Filename Value="../../Units/Synapse/synautil.pas"/>
@ -1979,7 +1985,7 @@
<UnitName Value="updater"/> <UnitName Value="updater"/>
<CursorPos X="1" Y="1"/> <CursorPos X="1" Y="1"/>
<TopLine Value="44"/> <TopLine Value="44"/>
<EditorIndex Value="10"/> <EditorIndex Value="13"/>
<UsageCount Value="41"/> <UsageCount Value="41"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit277> </Unit277>
@ -2078,103 +2084,127 @@
<UsageCount Value="10"/> <UsageCount Value="10"/>
</Unit290> </Unit290>
</Units> </Units>
<JumpHistory Count="24" HistoryIndex="23"> <JumpHistory Count="30" HistoryIndex="29">
<Position1> <Position1>
<Filename Value="updateform.pas"/>
<Caret Line="9" Column="28" TopLine="1"/>
</Position1>
<Position2>
<Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/>
<Caret Line="138" Column="70" TopLine="125"/>
</Position2>
<Position3>
<Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/>
<Caret Line="193" Column="20" TopLine="174"/>
</Position3>
<Position4>
<Filename Value="updateform.pas"/>
<Caret Line="9" Column="28" TopLine="1"/>
</Position4>
<Position5>
<Filename Value="../../Units/MMLAddon/updater.pas"/>
<Caret Line="169" Column="15" TopLine="151"/>
</Position5>
<Position6>
<Filename Value="updateform.pas"/>
<Caret Line="27" Column="21" TopLine="12"/>
</Position6>
<Position7>
<Filename Value="updateform.pas"/>
<Caret Line="9" Column="28" TopLine="1"/>
</Position7>
<Position8>
<Filename Value="../../Units/MMLAddon/colourpicker.pas"/> <Filename Value="../../Units/MMLAddon/colourpicker.pas"/>
<Caret Line="189" Column="37" TopLine="177"/> <Caret Line="189" Column="37" TopLine="177"/>
</Position1>
<Position2>
<Filename Value="../../Units/MMLCore/bitmaps.pas"/>
<Caret Line="82" Column="23" TopLine="64"/>
</Position2>
<Position3>
<Filename Value="../../Units/MMLAddon/colourpicker.pas"/>
<Caret Line="203" Column="25" TopLine="188"/>
</Position3>
<Position4>
<Filename Value="../../Units/MMLAddon/colourpicker.pas"/>
<Caret Line="188" Column="14" TopLine="167"/>
</Position4>
<Position5>
<Filename Value="../../Units/MMLCore/bitmaps.pas"/>
<Caret Line="67" Column="33" TopLine="49"/>
</Position5>
<Position6>
<Filename Value="../../Units/MMLCore/bitmaps.pas"/>
<Caret Line="68" Column="33" TopLine="49"/>
</Position6>
<Position7>
<Filename Value="../../Units/MMLAddon/colourpicker.pas"/>
<Caret Line="190" Column="37" TopLine="167"/>
</Position7>
<Position8>
<Filename Value="../../Units/MMLCore/bitmaps.pas"/>
<Caret Line="82" Column="23" TopLine="64"/>
</Position8> </Position8>
<Position9> <Position9>
<Filename Value="../../Units/MMLCore/bitmaps.pas"/> <Filename Value="../../Units/MMLCore/bitmaps.pas"/>
<Caret Line="82" Column="23" TopLine="64"/> <Caret Line="399" Column="10" TopLine="373"/>
</Position9> </Position9>
<Position10> <Position10>
<Filename Value="../../Units/MMLAddon/colourpicker.pas"/> <Filename Value="../../Units/MMLCore/windowutil.pas"/>
<Caret Line="203" Column="25" TopLine="188"/> <Caret Line="21" Column="37" TopLine="3"/>
</Position10> </Position10>
<Position11> <Position11>
<Filename Value="../../Units/MMLAddon/colourpicker.pas"/> <Filename Value="../../Units/MMLAddon/colourpicker.pas"/>
<Caret Line="188" Column="14" TopLine="167"/> <Caret Line="190" Column="24" TopLine="167"/>
</Position11> </Position11>
<Position12> <Position12>
<Filename Value="../../Units/MMLCore/bitmaps.pas"/>
<Caret Line="67" Column="33" TopLine="49"/>
</Position12>
<Position13>
<Filename Value="../../Units/MMLCore/bitmaps.pas"/>
<Caret Line="68" Column="33" TopLine="49"/>
</Position13>
<Position14>
<Filename Value="../../Units/MMLAddon/colourpicker.pas"/>
<Caret Line="190" Column="37" TopLine="167"/>
</Position14>
<Position15>
<Filename Value="../../Units/MMLCore/bitmaps.pas"/>
<Caret Line="82" Column="23" TopLine="64"/>
</Position15>
<Position16>
<Filename Value="../../Units/MMLCore/bitmaps.pas"/>
<Caret Line="399" Column="10" TopLine="373"/>
</Position16>
<Position17>
<Filename Value="../../Units/MMLCore/windowutil.pas"/>
<Caret Line="21" Column="37" TopLine="3"/>
</Position17>
<Position18>
<Filename Value="../../Units/MMLAddon/colourpicker.pas"/>
<Caret Line="190" Column="24" TopLine="167"/>
</Position18>
<Position19>
<Filename Value="../../../../Documents/lazarus/lcl/graphics.pp"/> <Filename Value="../../../../Documents/lazarus/lcl/graphics.pp"/>
<Caret Line="931" Column="54" TopLine="913"/> <Caret Line="931" Column="54" TopLine="913"/>
</Position19> </Position12>
<Position20> <Position13>
<Filename Value="../../../../Documents/lazarus/lcl/graphics.pp"/> <Filename Value="../../../../Documents/lazarus/lcl/graphics.pp"/>
<Caret Line="893" Column="24" TopLine="875"/> <Caret Line="893" Column="24" TopLine="875"/>
</Position20> </Position13>
<Position21> <Position14>
<Filename Value="../../../../Documents/lazarus/lcl/graphics.pp"/> <Filename Value="../../../../Documents/lazarus/lcl/graphics.pp"/>
<Caret Line="931" Column="60" TopLine="913"/> <Caret Line="931" Column="60" TopLine="913"/>
</Position21> </Position14>
<Position22> <Position15>
<Filename Value="../../../../Documents/lazarus/lcl/graphics.pp"/> <Filename Value="../../../../Documents/lazarus/lcl/graphics.pp"/>
<Caret Line="1255" Column="24" TopLine="1237"/> <Caret Line="1255" Column="24" TopLine="1237"/>
</Position22> </Position15>
<Position23> <Position16>
<Filename Value="../../../../Documents/lazarus/lcl/graphics.pp"/> <Filename Value="../../../../Documents/lazarus/lcl/graphics.pp"/>
<Caret Line="1304" Column="72" TopLine="1286"/> <Caret Line="1304" Column="72" TopLine="1286"/>
</Position23> </Position16>
<Position24> <Position17>
<Filename Value="../../../../Documents/lazarus/lcl/graphics.pp"/> <Filename Value="../../../../Documents/lazarus/lcl/graphics.pp"/>
<Caret Line="2448" Column="9" TopLine="2437"/> <Caret Line="2448" Column="9" TopLine="2437"/>
</Position17>
<Position18>
<Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/>
<Caret Line="14" Column="68" TopLine="1"/>
</Position18>
<Position19>
<Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/>
<Caret Line="76" Column="13" TopLine="58"/>
</Position19>
<Position20>
<Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/>
<Caret Line="181" Column="19" TopLine="163"/>
</Position20>
<Position21>
<Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/>
<Caret Line="210" Column="19" TopLine="192"/>
</Position21>
<Position22>
<Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/>
<Caret Line="51" Column="56" TopLine="34"/>
</Position22>
<Position23>
<Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/>
<Caret Line="74" Column="54" TopLine="58"/>
</Position23>
<Position24>
<Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/>
<Caret Line="76" Column="13" TopLine="58"/>
</Position24> </Position24>
<Position25>
<Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/>
<Caret Line="278" Column="18" TopLine="251"/>
</Position25>
<Position26>
<Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/>
<Caret Line="219" Column="23" TopLine="207"/>
</Position26>
<Position27>
<Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/>
<Caret Line="268" Column="17" TopLine="262"/>
</Position27>
<Position28>
<Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/>
<Caret Line="193" Column="17" TopLine="163"/>
</Position28>
<Position29>
<Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/>
<Caret Line="453" Column="25" TopLine="438"/>
</Position29>
<Position30>
<Filename Value="../../Units/MMLAddon/PSInc/psexportedmethods.inc"/>
<Caret Line="1" Column="1" TopLine="23"/>
</Position30>
</JumpHistory> </JumpHistory>
</ProjectOptions> </ProjectOptions>
<CompilerOptions> <CompilerOptions>

View File

@ -2,8 +2,15 @@ program new;
{.LoadDLL libsmart} {.LoadDLL libsmart}
var
w,h:integer;
begin begin
SmartSetup('http://world19.runescape.com/', 'plugin.js?param=o0,a1,m0', 765, 503); SmartSetup('http://world19.runescape.com/', 'plugin.js?param=o0,a1,m0', 765, 503);
Wait(5000); SetTargetArray(SmartImageArray, 765,503);
getclientdimensions(w,h);
writeln(inttostr(w) + ' , ' + inttostr(h));
if findcolortolerance(w,h,clwhite,0,0,764,502,300) then
smartmovemouse(w,h);
savescreenshot('/tmp/smart.bmp');
//Wait(5000);
end. end.

View File

@ -47,9 +47,9 @@ begin
result := CurrThread.Client.MWindow.Unfreeze; result := CurrThread.Client.MWindow.Unfreeze;
end; end;
procedure SetTargetArray(P: Integer; Size: TPoint); procedure SetTargetArray(P: Integer; w, h: integer);
begin begin
CurrThread.Client.MWindow.SetTarget(PRGB32(P), Size); CurrThread.Client.MWindow.SetTarget(PRGB32(P), point(w,h));
end; end;
procedure activateclient; procedure activateclient;

View File

@ -40,6 +40,7 @@ Sender.Comp.AddTypeS('pDTM','record l: Integer;p: TPointArray;c, t, asz, ash: TI
Sender.Comp.AddTypeS('T2DExtendedArray', 'array of array of extended;'); Sender.Comp.AddTypeS('T2DExtendedArray', 'array of array of extended;');
Sender.Comp.AddTypeS('TStringArray','Array of string;'); Sender.Comp.AddTypeS('TStringArray','Array of string;');
Sender.Comp.AddTypeS('TMousePress', '(mouse_Down, mouse_Up);'); Sender.Comp.AddTypeS('TMousePress', '(mouse_Down, mouse_Up);');
Sender.Comp.AddTypeS('Pointer', 'Integer');
Sender.Comp.AddConstantN('mouse_Right','integer').SetInt(ps_mouse_right); //0 Sender.Comp.AddConstantN('mouse_Right','integer').SetInt(ps_mouse_right); //0

View File

@ -60,7 +60,7 @@ AddFunction(@Unfreeze, 'function unfreeze: boolean;');
AddFunction(@GetClientDimensions, 'procedure GetClientDimensions(out w, h:integer);'); AddFunction(@GetClientDimensions, 'procedure GetClientDimensions(out w, h:integer);');
AddFunction(@SetTargetBitmap,'procedure SetTargetBitmap(Bitmap : integer);'); AddFunction(@SetTargetBitmap,'procedure SetTargetBitmap(Bitmap : integer);');
AddFunction(@SetDesktopAsClient,'procedure SetDesktopAsClient'); AddFunction(@SetDesktopAsClient,'procedure SetDesktopAsClient');
AddFunction(@SetTargetArray, 'procedure SetTargetArray(P: Integer; Size: TPoint);'); AddFunction(@SetTargetArray, 'procedure SetTargetArray(P: Integer; w, h: integer);');
AddFunction(@ActivateClient, 'procedure activateclient;'); AddFunction(@ActivateClient, 'procedure activateclient;');
{files} {files}

View File

@ -265,14 +265,17 @@ procedure TMMLPSThread.OnCompile(Sender: TPSScript);
var var
i,ii : integer; i,ii : integer;
begin begin
{$I PSInc/pscompile.inc}
for i := high(PluginsToLoad) downto 0 do for i := high(PluginsToLoad) downto 0 do
for ii := 0 to PluginsGlob.MPlugins[PluginsToLoad[i]].MethodLen - 1 do for ii := 0 to PluginsGlob.MPlugins[PluginsToLoad[i]].MethodLen - 1 do
PSScript.AddFunctionEx(PluginsGlob.MPlugins[PluginsToLoad[i]].Methods[i].FuncPtr, PSScript.AddFunctionEx(PluginsGlob.MPlugins[PluginsToLoad[i]].Methods[ii].FuncPtr,
PluginsGlob.MPlugins[PluginsToLoad[i]].Methods[i].FuncStr, cdStdCall); PluginsGlob.MPlugins[PluginsToLoad[i]].Methods[ii].FuncStr, cdStdCall);
for i := 0 to high(VirtualKeys) do for i := 0 to high(VirtualKeys) do
PSScript.Comp.AddConstantN(Format('VK_%S',[VirtualKeys[i].Str]),'Byte').SetInt(VirtualKeys[i].Key); PSScript.Comp.AddConstantN(Format('VK_%S',[VirtualKeys[i].Str]),'Byte').SetInt(VirtualKeys[i].Key);
// Here we add all the Consts/Types to the engine. // Here we add all the Consts/Types to the engine.
{$I PSInc/pscompile.inc}
//Export all the methods //Export all the methods
for i := 0 to high(ExportedMethods) do for i := 0 to high(ExportedMethods) do
PSScript.AddFunction(ExportedMethods[i].FuncPtr,ExportedMethods[i].FuncDecl); PSScript.AddFunction(ExportedMethods[i].FuncPtr,ExportedMethods[i].FuncDecl);