From b5e7def002418153d5d694927b7f77a65d026472 Mon Sep 17 00:00:00 2001 From: John Peel Date: Mon, 7 Oct 2013 15:24:55 -0400 Subject: [PATCH] x64 Support --- lib/core/client.simba | 3 ++- lib/core/text.simba | 22 ++++++++++----------- lib/misc/smart.simba | 46 +++++++++++++++++++++---------------------- 3 files changed, 35 insertions(+), 36 deletions(-) diff --git a/lib/core/client.simba b/lib/core/client.simba index 1d26acb..15aa7f5 100644 --- a/lib/core/client.simba +++ b/lib/core/client.simba @@ -68,7 +68,8 @@ Example: *) function waitClientReady(): boolean; var - t, i: integer; + t: UInt32; + i: integer; begin result := false; diff --git a/lib/core/text.simba b/lib/core/text.simba index d408eec..0ab6fc3 100644 --- a/lib/core/text.simba +++ b/lib/core/text.simba @@ -1083,11 +1083,11 @@ TRSChooseOption.select .. code-block:: pascal -function TRSChooseOption._select(txt: TStringArray; mouseAction: integer; close: boolean; matchPercent: extended; waitTime: integer): boolean; +function TRSChooseOption._select(txt: TStringArray; mouseAction: integer; aclose: boolean; matchPercent: extended; waitTime: integer): boolean; * txt - An array of text you want to find in any of the options. * mouseAction - What to do if we succesfully find a option (MOUSE_MOVE, MOUSE_LEFT, MOUSE_RIGHT, MOUSE_NONE). - * close - Will we close the menu after we're done with it? + * aclose - Will we close the menu after we're done with it? * matchPercent - The min percentage that will we count as match (if using stringmatch) if not using stringmatch and want the old the method of finding txt anywhere in the string set it as 1.00. * waitTime - how long will we wait for the chooseoptions menu to appear?. @@ -1107,7 +1107,7 @@ Example: // to use string match chooseOption._select(['Walk To'], MOUSE_LEFT, true, 0.85, 150); *) -function TRSChooseOption._select(txt: TStringArray; mouseAction: integer; close: boolean; matchPercent: extended; waitTime: integer): boolean; +function TRSChooseOption._select(txt: TStringArray; mouseAction: integer; aclose: boolean; matchPercent: extended; waitTime: integer): boolean; var optionArr: __TOptionArray; l, i, j: integer; @@ -1134,8 +1134,8 @@ begin print('Failed to find any options', TDebug.ERROR); print('chooseOption.select() result = false', TDebug.FOOTER); - if (close) then - self.close(); + if (aclose) then + close(); exit(); end else @@ -1161,8 +1161,8 @@ begin if (mouseAction <> MOUSE_NONE) then mouseBox(optionArr[i].bounds, mouseAction) else // if it's mouse none lets see if we need to close - if (close) then - self.close(); + if (aclose) then + close(); exit(true); end else @@ -1179,16 +1179,16 @@ begin if (mouseAction <> MOUSE_NONE) then mouseBox(optionArr[i].bounds, mouseAction) else // if it's mouse none lets see if we need to close - if (close) then - self.close(); + if (aclose) then + close(); exit(true); end; end; // close the menu since we found no matches - if (close) then - self.close(); + if (aclose) then + close(); print('Failed to find any text matches'); print('ChooseOption._select() result = false'); diff --git a/lib/misc/smart.simba b/lib/misc/smart.simba index 7b03cfd..813111f 100644 --- a/lib/misc/smart.simba +++ b/lib/misc/smart.simba @@ -51,13 +51,13 @@ Variables that can be used in scripts. *) var - smartClientWidth = 960; - smartClientHeight = 640; - smartGetJavaPath = true; - smartShowConsole = true; - smartForceNewClient = false; - smartEnableDrawing = false; - smartInitSeq = ''; + smartClientWidth: UInt32 := 960; + smartClientHeight: UInt32 := 640; + smartGetJavaPath: boolean := true; + smartShowConsole: boolean := true; + smartForceNewClient: boolean := false; + smartEnableDrawing: boolean := false; + smartInitSeq: string := ''; {* var Internal @@ -71,10 +71,10 @@ Internal SMART variables used only in smart.simba. * __smartNativeDebugButtonID: The id of the debug button (if not using a native button) set as -1. * smartImage: TMufasaBitmap that is displayed onto smart. *} - __smartCurrentPid: integer; - __smartCurrentTarget: integer; - __smartIsDrawingSetup: boolean; - __smartNativeDebugButtonID: integer = 101; + __smartCurrentPid: Int32 := 0; + __smartCurrentTarget: PtrUInt := 0; + __smartIsDrawingSetup: boolean := False; + __smartNativeDebugButtonID: integer := 101; smartImage: TMufasaBitmap; (* @@ -241,10 +241,9 @@ begin {$ELSE} print('Not searching for your Java path. Make sure the JRE is in your system''s PATH before JDK (if you have JDK).', TDebug.WARNING); - if (smartShowConsole) then - result := 'java.exe' - else - result := 'javaw.exe'; + Result := 'java'; + if (not (smartShowConsole)) then + Result := Result + 'w'; {$ENDIF} print('getJavaPath()', TDebug.FOOTER); end; @@ -340,7 +339,7 @@ Example: .. code-block:: pascal *) -function smartSetAsTarget(pid: integer): boolean; +function smartSetAsTarget(pid: Int32): boolean; begin result := true; @@ -401,13 +400,9 @@ begin __smartCurrentPID := smartGetClientPID(__smartCurrentTarget); if (smartSetAsTarget(__smartCurrentPID)) then - begin print('smartCreateClient(): result = true', TDebug.FOOTER); - exit(); - end; end else print('Failed to spawn a SMART client', TDebug.FATAL); - end; (* @@ -466,7 +461,8 @@ Example: function smartPairToExistingClient(): boolean; var pidArr: TIntegerArray; - i, t, p: integer; + t: PtrUInt; + i, p: Int32; begin result := false; @@ -499,8 +495,8 @@ begin __smartCurrentPID := p; __smartCurrentTarget := t; - if (not smartEnabled(__smartCurrentTarget)) then - smartSetEnabled(__smartCurrentTarget, true); + if (not (smartEnabled(__smartCurrentTarget))) then + smartSetEnabled(__smartCurrentTarget, True); print('Succesfully paired to a existing client, SMART['+ intToStr(__smartCurrentPID) +']'); print('smartPairToExistingClient(): result = true', TDebug.FOOTER); @@ -624,7 +620,7 @@ begin smartSetDebug(true); try - smartImage.init(client.getMBitmaps()); + smartImage.init(Client.getMBitmaps()); smartImage.setName('SMART Debug Image'); smartImage.setPersistentMemory(SmartDebugArray(__smartCurrentTarget), smartClientWidth, smartClientHeight); smartImage.drawClear(0); @@ -775,7 +771,9 @@ end; begin SRL_Events[EVENT_RS_UPDATE] := sixHourFix; + {$IFDEF WINDOWS} // check for the plugin on compile if (not fileExists(PluginPath + 'OpenGL32.dll')) then print('SMART - Unable to find OpenGL32.dll (plugin required for SRL to work with SMART)', TDebug.FATAL); + {$ENDIF} end;