News:
Last Updated: July 7th, 2012. @11:17 AM
Coming soon with the release of Simba v0.99x will be an update to SRL that will potentially break your scripts.
This update helps to keep smart undetectable by passing it the correct parameters.
The update will also require a new version of Smart which is currently released as Smart v7.1 and a new version of Simba released as Simba v0.99 and as such the following updates may take place:
- Smart.Simba is completely removed as there is no need for wrappers anymore.
- The Include is backwards compatible now so these changes do not affect old Simba/Smart users.
- LibSmart.dll is replaced by LibSmartRemote although LibSmart.dll can still be loaded manually
- Three Global Variables Added: Smart_FixSpeed, SRL_SixHourFix, and Smart_CurrentClient.
- SmartParams.Simba has everything you need to load a new client.
- Paint Smart Left Untouched. A new file "SmartGraphics.Simba" has been used instead. Still backwards compatible. See the examples section for more info.
- A warning may be added to SRL's include for 1 month to allow scripters to get used to the changes and update their scripts. After 1 month, this warning may be removed and you may be forced to update.
- The above is suppressed by the backwards compatibility. Not actually necessary.
Documentation:
SRL_SixHourFix: allow Scripts to restart Smart and continue running without the need of SmartManager or any third party software. Your scripts will start right where it left off. It is implemented using SRL_Procs[SRL_OnRSUpdate].
Usage:
-------------------------------------------------------------------
Smart_FixSpeed: fixes the speed of the loading for some users who experience a lag or delay when Smart is loading. It does this by waiting until Smart is enabled and then moving the mouse/refresh bar until a colour is detect on screen.
Usage:
-------------------------------------------------------------------
SetupSmart: Allows a user to setup a new remote client. This has one parameter which allows you to forcefully start a new client if true. If false, it will use a client that is already loaded. After calling this method, the controller and the client are automatically paired. This will allow you to have multiple smarts per simba process as smart now has it's own process: "SmartRemote.exe". Each Client Spawned has it's own Identifier.
Usage:
Simba Code:
SetupSmart(ForceNewClient: Boolean);
-------------------------------------------------------------------
Smart_CurrentClient: Returns the ID of the current running client (paired or unpaired).
Usage:
Simba Code:
var
ID: Integer;
ID:= Smart_CurrentClient; //OR Writeln(Smart_CurrentClient); //etc..
SmartKillClient(ID);
-------------------------------------------------------------------
SmartGetClientIDs: Gets a list of all running clients (paired and unpaired) and returns their IDs as a TIntegerArray.
Usage:
Simba Code:
var
IDs: TIntegerArray;
IDs:= SmartGetClientIDs; //OR Writeln(SmartGetClientIDs); //etc..
-------------------------------------------------------------------
SmartKillClients: Kills All clients paired with the current controller. If a client is paired to another controller, that client is not killed.
Usage:
PaintSmart.Simba Update:
PaintSmart.Simba has been changed to SmartGraphics for Simba 0.99+. If using Simba 0.98, it will use PaintSmart instead. Why two files? This is because with such a drastic change it was better to separate it rather than use a larger IFDEF. Simba 0.99+ uses Bitmaps from pointers and requires TMufasaBitmap. Simba 0.98 uses Integer Handles to create bitmaps and a TBitmap. It's completely different!
Now how does this affect you? Well it really doesn't. All the parameters are the exact same and the functions work the exact same except for 1! Smart_DrawBoxes now has an option to fill the box. That is the only change and it is only in 0.99+.
HowTo:
How to update your Simba and your Smart:
Latest Smart here: http://villavu.com/forum/showthread.php?t=84789
Latest Simba here: http://villavu.com/forum/showthread.php?t=85725
1. Create a backup of your Simba scripts, Includes folder and your Plugins folder.
2. Install Simba v0.99x from the link provided.
3. Place the plugins you just downloaded into your plugins folder; Usually located at C:/Simba/Plugins.
How to update your Script when the update hits:
- Create a backup copy of the script.
- Use IFDEF's for backwards compatibility if necessary. See the example below.
Sample Script:
Platform Specific Simba 0.98x:
Simba Code:
{$DEFINE SMART}
{$I SRL/SRL.Simba}
{$I SRL/SRL/Misc/PaintSmart.Simba}
begin
Smart_Server := 72;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
SetupSRL;
end.
Platform Specific Simba 0.99x:
Simba Code:
{$DEFINE SMART}
{$I SRL/SRL.Simba}
{$I SRL/SRL/Misc/SmartGraphics.Simba}
begin
SRL_SixHourFix := True;
Smart_FixSpeed := True;
SetupSRL;
end.
Backwards Compatibility:
Simba Code:
{$DEFINE SMART}
{$I SRL/SRL.Simba}
{$IFDEF SIMBAMAJOR980}
{$I SRL/SRL/Misc/PaintSmart.Simba}
{$ELSE}
{$I SRL/SRL/Misc/SmartGraphics.Simba}
{$ENDIF}
begin
{$IFDEF SMART}
{$IFDEF SIMBAMAJOR980}
Smart_Server := 72;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
{$ELSE}
SRL_SixHourFix := True;
Smart_FixSpeed := True;
{$ENDIF}
{$ENDIF}
SetupSRL;
end.
Drawing On Smart Manually(No SmartGraphics):
Simba Code:
{$DEFINE SMART}
{$I SRL/SRL.Simba}
procedure PrintOnSmart(TP: TStringArray; Placement: TPoint; Colours: TIntegerArray);
var
Width, Height, bmp, I, B, H: Integer;
ATPA: T2DPointArray;
Canvas: Integer; //Canvas: TCanvas;
Colors: TIntegerArray;
begin
GetClientDimensions(Width, Height);
Bmp := BitmapFromString(22, 24, 'meJw9lEko/VEUx5+/OQobsraTIh' +
'bm9+OZp5ANKdkrGWIlpSgbJVmIDVlQYqXIApk2Ssos8/R4Hh4yJLz' +
'/p9837yxu5957zvd8z7n3HMMwUlJSSkpKMjIy0tPTc3JysrKybDZb' +
'ZmYmWw7ZGoaRnJzMyqFuWbOzsz1bvABJS0vLy8tjm5SUZDOFrUAwR' +
'gcBS7xyc3OtViu+HAqBq4KCAhQscSkqKmpsbBwbG1teXl5bW1taWp' +
'qYmGhqaiovL1cgcRC47U+44gQcLA8ODs7Pz+12+/39/ePj4/Pz8+v' +
'rq9Pp3N/f7+zsLC4uTk1NJTruKATFHVgwS0tLx8fH8cXR5XI9PT2h' +
'vLy83N7enp6egvPw8HB0dDQ3N1dbW0u4/Px8VQMhL9aZmRnFJRz2K' +
'Hd3d+Bw+Pv7+/X1BdrHxwchZmdnYaKsVUz4dHd3X19fu0zBEdqHh4' +
'fT09NDQ0N7e3tutxvf7+/vn58f2QwODlJV6gkO7pQInoQGhBXa6+v' +
'rZBoZGent7U36b29vgLy/v6OQCyEAqaqqwp3SQYP08YKkw+HAYHV1' +
'NSwszGKx/DOFW3zdpoAgMwLxRvjyjvylzc1NEMiX9fj4mHPcfXx8L' +
'KZER0cvLi7yKHiR19XVld5oZ2enuroaGjU1NTwfFaN6gFAlPz8/X1' +
'9fouPu7+8vnNDQUPSoqCiM4QmNm5ublpYWylhXV3dycqLUwBkYGAg' +
'JCbH8iZeXF2geKHRCQwB3KLW3t0MYBP0fTgAHgXA4kgVlFBNY6YT6' +
'bG1tqdrgtLW18RxkwT9hCwG4LSwsBAcHy0XuQUFBKNomJCSQheoAb' +
'T6/Ksnb6RUQwCsqKlRGD3NtgWpubnaaQrjd3V0elM9AIsPDw8Dyi8' +
'7OzqgGa0xMTEBAAEFFBvfAwMC4uDglCwEizs/P6zeCUFlZub29zS1' +
'vDcLl5SV5tba2xsbGRkREhIeHx8fHd3R04IWNyogN6YNAc4EADk3H' +
'OUwuLi4+Pz9Flf+8sbFBjpQa2uCr6VD6+/vpJs/ESExMLCsrGx0d5' +
'ZZc9GfUYqz4UjS7KSj8/KmpKRrZMEUIkGGlEXp7ewmnxmSFDy3pMA' +
'UcNc7IyAh9JBe1FQpNChT9jtLQ0LCysqLorEocYUtSXV1dJK55qEG' +
'niWo1hXMQNBXr6+t7enroqcnJSV6qr6+Pj1dYWIgLlpqTMhYZrphy' +
'nINMCPFhOKvImrGeeYixxjg2oqEOxUtjExxuxUfhsAEfe2a4nk+Tm' +
'Vsp/wHgCRiF');
SetArrayLength(ATPA, Length(TP));
for I := 0 to High(ATPA) do
begin
ATPA[i] := LoadTextTPA(TP[i], UpChars, H);
for B := 0 to High(ATPA[i]) do
ATPA[i][B].y := ATPA[i][B].y + i*(H);
end;
if Length(Colours) = 4 then
begin
SetArrayLength(Colors, Length(TP));
for i := 0 to High(Colors) do
Colors[i] := Colours[1];
end else
Colors := Colours;
DrawATPABitmapEx(bmp, ATPA, Colors);
//Canvas := TCANVAS.Create;
//Canvas.Handle := SmartGetDebugDC; //Smart 7.X++ No longer has Device Contexts aka DC's.
//DrawBitmap(bmp, Canvas, Placement.x, Placement.y);
Canvas := CreateBitmap(Width, Height); //Creates a bitmap using the client's dimensions.
SetPersistentMemoryBitmap(Canvas, SmartDebugArray, Width, Height); //Essentially Makes Our Bitmap Point To Smart's Debug Canvas.
FastDrawTransparent(Placement.X, Placement.Y, BMP, Canvas); //Draw Our Bitmap On Smart's Canvas at the specified Position.
ResetPersistentMemoryBitmap(Canvas); //Reset The Canvas Bitmap to point to NULL data. AKA Nothing. Prevents leaks.
FreeBitmap(Canvas); //Free Our Canvas Bitmap.
FreeBitmap(bmp); //Free The bitmap we drew on.
end;
begin
{$IFDEF SMART}
{$IFDEF SIMBAMAJOR980}
Smart_Server := 72;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
{$ELSE}
SRL_SixHourFix := True;
Smart_FixSpeed := True;
{$ENDIF}
{$ENDIF}
SetupSRL;
PrintOnSmart([''], Point(200, 200), [clWhite]); //SmartGraphics should contain everything you need to draw. This function is just for
//those who prefer manual drawing.
end.
Drawing On Smart Automatically(SmartGraphics):
Simba Code:
{$DEFINE SMART}
{$I SRL/SRL.Simba}
{$I SRL/SRL/Misc/SmartGraphics.Simba}
procedure PrintOnSmart2(TP: TStringArray; Placement: TPoint; Colours: TIntegerArray);
var
Bmp: Integer;
I, H: Integer;
begin
Bmp := BitmapFromString(22, 24, 'meJw9lEko/VEUx5+/OQobsraTIh' +
'bm9+OZp5ANKdkrGWIlpSgbJVmIDVlQYqXIApk2Ssos8/R4Hh4yJLz' +
'/p9837yxu5957zvd8z7n3HMMwUlJSSkpKMjIy0tPTc3JysrKybDZb' +
'ZmYmWw7ZGoaRnJzMyqFuWbOzsz1bvABJS0vLy8tjm5SUZDOFrUAwR' +
'gcBS7xyc3OtViu+HAqBq4KCAhQscSkqKmpsbBwbG1teXl5bW1taWp' +
'qYmGhqaiovL1cgcRC47U+44gQcLA8ODs7Pz+12+/39/ePj4/Pz8+v' +
'rq9Pp3N/f7+zsLC4uTk1NJTruKATFHVgwS0tLx8fH8cXR5XI9PT2h' +
'vLy83N7enp6egvPw8HB0dDQ3N1dbW0u4/Px8VQMhL9aZmRnFJRz2K' +
'Hd3d+Bw+Pv7+/X1BdrHxwchZmdnYaKsVUz4dHd3X19fu0zBEdqHh4' +
'fT09NDQ0N7e3tutxvf7+/vn58f2QwODlJV6gkO7pQInoQGhBXa6+v' +
'rZBoZGent7U36b29vgLy/v6OQCyEAqaqqwp3SQYP08YKkw+HAYHV1' +
'NSwszGKx/DOFW3zdpoAgMwLxRvjyjvylzc1NEMiX9fj4mHPcfXx8L' +
'KZER0cvLi7yKHiR19XVld5oZ2enuroaGjU1NTwfFaN6gFAlPz8/X1' +
'9fouPu7+8vnNDQUPSoqCiM4QmNm5ublpYWylhXV3dycqLUwBkYGAg' +
'JCbH8iZeXF2geKHRCQwB3KLW3t0MYBP0fTgAHgXA4kgVlFBNY6YT6' +
'bG1tqdrgtLW18RxkwT9hCwG4LSwsBAcHy0XuQUFBKNomJCSQheoAb' +
'T6/Ksnb6RUQwCsqKlRGD3NtgWpubnaaQrjd3V0elM9AIsPDw8Dyi8' +
'7OzqgGa0xMTEBAAEFFBvfAwMC4uDglCwEizs/P6zeCUFlZub29zS1' +
'vDcLl5SV5tba2xsbGRkREhIeHx8fHd3R04IWNyogN6YNAc4EADk3H' +
'OUwuLi4+Pz9Flf+8sbFBjpQa2uCr6VD6+/vpJs/ESExMLCsrGx0d5' +
'ZZc9GfUYqz4UjS7KSj8/KmpKRrZMEUIkGGlEXp7ewmnxmSFDy3pMA' +
'UcNc7IyAh9JBe1FQpNChT9jtLQ0LCysqLorEocYUtSXV1dJK55qEG' +
'niWo1hXMQNBXr6+t7enroqcnJSV6qr6+Pj1dYWIgLlpqTMhYZrphy' +
'nINMCPFhOKvImrGeeYixxjg2oqEOxUtjExxuxUfhsAEfe2a4nk+Tm' +
'Vsp/wHgCRiF');
Smart_DrawBitmap(True, Bmp, Placement);
For I := 0 To High(TP) Do
begin
LoadTextTPA(TP[I], UpChars, H);
Placement.Y := Placement.Y + I*(H);
Smart_DrawTextEx(False, Placement.X, Placement.Y, 'UpChars', TP[I], Colours[I]);
end;
FreeBitmap(Bmp);
end;
begin
{$IFDEF SMART}
{$IFDEF SIMBAMAJOR980}
Smart_Server := 72;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
{$ELSE}
SRL_SixHourFix := True;
Smart_FixSpeed := True;
{$ENDIF}
{$ENDIF}
SetupSRL;
Smart_ClearCanvas;
PrintOnSmart2(['B', 'R'], Point(250, 250), [clWhite, clBlue]);
end.
In the above, It shows an example of how to draw on Smart 7.X++ Manually and Automatically. By Manually it means without SmartGraphics.Simba. Some scripts still use SmartGetDebugDC and TCanvases for drawing on Smart. Inorder to port those scripts to Simba 0.99 and draw on Smart Manually, you need to learn how to use SetPersistentMemoryBitmap and ResetPersistentMemoryBitmap. The first will make our bitmap use Smart's Canvas. Whatever is drawn on our bitmap will be drawn on Smart's canvas. The second function will reset the memory pointer. This will prevent leaks. It is recommended to use SmartGraphics for drawing on Smart if you are in-experienced. Smart_DrawBitmap and Smart_DrawTextMulti will do the same thing and is MUCH MUCH easier!
Note: The Automatic Drawing Example does the EXACT same thing as the Manual Drawing Example is it is much shorter and easier.
Platform Info:
Simba v0.98x + Smart v6.x:
As said before, Simba 0.98x does not support EIOS and Smart v6.x does not support it either. Thus it isn't possible for me to port the SixHourFix without external libraries or external software such as a batch file.
Simba 0.99x + Smart v7.x:
The only difference for you here is that you can use SixHourFix and the SmartFixSpeed. Now I know some of you may say: "Zomg!! Why doesn't 0.98x have the FixSpeed!" Well.. truth is, I didn't want to touch the include to implement it for the current Smart.
See when I started working on the updates with Mormanman, Kyle, Ben, Wiz, and the others, I made a copy of SRL and made two files I can work in. It just so happens those are SmartGraphics and SmartParams which is only included when Smart is defined and when Simba is 0.99x used.
To implement it, I'd have to edit the original Smart.Simba which is included when 0.98x is used; Something I didn't want to do. Someone else or myself may look into it eventually and implement it for the old Smart/Simba users eventually. At the time, my goal was to make as little changes to the actual include as possible, and it still is.
Notes & Recommendations:
Smart is backwards compatible and will still load if a user decides to do: {$LoadLib LibSmart32.Dll} instead of {$Define Smart}
For more details on the latest Smart and it's features, visit: http://villavu.com/forum/showthread.php?t=84789
For more details on the latest Simba and it's features, visit: http://villavu.com/forum/showthread.php?t=85725
For more details on the latest Pull Requests and Comments: https://github.com/SRL/SRL-5/pull/46
PaintSmart issue information[Fixed]
If I missed anything, anything was added, or something is to be added, let me know or else if you have the power, then edit the thread by all means.
Thank You's & Contributions:
Benland100, Wizzup, Mormanman, Kyle Undefined, Nava2.
Yohojo & Ashaman.