SRL Archive - General Botting Help

Loading extensions into includes


hackingislol133

2014-08-31 16:07:08

My client has an issue where it frequently fails to type the correct login information into the correct fields. When this happens, smart.simba prints Failed to login player after restart.

I came up with a solution to send an email using ProSock whenever this happens. I manage to append import ProSock into smart.simba and sucessfully compile, but then the script itself runs into compiling issues.

Exception in Script: Duplicate declaration "SSLSocketType" at line 1, column 1 in file "!addGlobalType"
Exception TLPThread.Destroy: Access violation

is solved easily by simply by removing {$I Socks.Simba} and any associated variables from the script. But then it compiles once more with errors:

Exception in Script: Can't assign "(record [0]array of AnsiString; [4]array of AnsiString; [8]array of AnsiString; [12]AnsiString; [16]AnsiString; [20]Int32; [24]record [0]UInt32; [4]UInt32; [8]UInt32; [12]^AnsiChar; [16]UInt16; [18](False=0, True=1); [19](TLS1_CLIENT_METHOD=0, TLS1_SERVER_METHOD=1, TLS11_CLIENT_METHOD=2, TLS11_SERVER_METHOD=3, SSL2_CLIENT_METHOD=4, SSL2_SERVER_METHOD=5, SSL3_CLIENT_METHOD=6, SSL3_SERVER_METHOD=7, SSL23_CLIENT_METHOD=8, SSL23_SERVER_METHOD=9); end; end).function():AnsiString of object" to "AnsiString" at line 515, column 10 in file "C:\Simba\Includes\Socks.Simba"

Brandon

2014-08-31 19:33:38

If your client fails to log you in (assuming you are talking about RS), then that is dealt with in SRL-6 or the OSRS includes.

You should NOT be editing Smart.Simba. If anything, just include whatever files you want in your own script. Again, do not modify Smart.Simba.

hackingislol133

2014-08-31 21:03:43

I'm not sure I understand. when SMART has finished loading the client, there's a period where the input fields are still inaccessible. In fact, the entire client is unresponsive. I made a thread a few weeks back asking if others had a similar issue

https://villavu.com/forum/showthread.php?t=109766&p=1302998&highlight=#post1302998

According to documentation, SMART should attempt to login twice before printing [Failed to login player after restart], but it only attempts once. This isn't really an issue if I'm paying attention to the client, but if I run a bot overnight and it fails to login in the middle of the night, I have no way to knowing it failed to login after the 6 hour reset.

edit: I guess I could try to convert the debug print into a string and write a function to send an email when it detects the string. Honestly, I'd prefer just to change smart.simba so it globally works for all of my scripts though.

TheeMason

2014-09-02 00:31:45

I also have major issues logging in because of a few seconds of lag. It writes in my username and password into the username window, then just sits there and fails. If I run one client it is fine, but if I run more then one this is where it runs into issues. I wish there was a way that it would check to see if any password was entered before trying to log in.[ATTACH=CONFIG]23948[/ATTACH]

Brandon

2014-09-02 00:43:27

I understand what both of you are saying but SMART itself is NOT the issue here.. SMART isn't what logs you in. SMART is simply a shell for the client/applet to sit it. A simple simulator that performs whatever it is told to do. It simulates what your browser would do (load the game).


SMART does nothing if you tell it to do nothing.. Where am I going with this? Well.. SRL is the controller. The includes are what command SMART to do specific actions. Scripts are commands/controllers and SMART just executes the action.

SMART has no idea about the login screen, the chatbox, minimap, the text on screen, nothing.. It doesn't even know where the main screen is.. It has no idea what colours are even on screen. It just knows that it has to send the buffer to Simba (which will determine what to do with it and identify things using it).

Simba/SRL is what determines what to do, when to do it, where to do it, and how.. If you are having log-in issues, it is the SRL include that is broken. Not SMART itself.

In fact, only one in a blue moon is the Smart.simba file ever updated/changed. You should not modify this file with anything unrelated to SMART itself (which is just a plugin for Simba).

If you want all your scripts to have emailing capabilities, add the emailing code to a file and include that file in all your scripts.. OR include that file into SRL's main file.


If the SRL login functions are broken, report it as an issue on the github here: https://github.com/SRL/SRL-6/issues or here: https://villavu.com/forum/project.php?projectid=10

or tag one of the devs.. Either way, it would get noticed and is more likely to be fixed faster.. Again, don't modify Smart.simba because it has no idea about anything other than SMART's internal functions (ie: loading smart).

If you really really want to modify files, modify SRL.simba OR create a file that does whatever you want and do {$I PathToMyFile/MyFile.Simba} in one or more of your scripts.

hackingislol133

2014-09-02 01:38:52

From: Brandon
{$I PathToMyFile/MyFile.Simba} in one or more of your scripts.


I'm still not quite convinced but I'll take your advice and write a plugin for the text to string.

Even then though. I still don't understand why appending plugins doesn't work the same way in smart.simba as it does in a regular script.

Brandon

2014-09-02 02:26:18

From: hackingislol133
I'm still not quite convinced but I'll take your advice and write a plugin for the text to string.

Even then though. I still don't understand why appending plugins doesn't work the same way in smart.simba as it does in a regular script.



Not sure what you mean by "appending" plugins. Why do you need a plugin for "text to string"? Isn't text already a string?

If you really wanted to load a plugin using SMART's include files, you'd have to get used to using compiler directives.. For example:


{$IFNDEF PLOADED}
{$DEFINE PLOADED}
{$I ../Socks.Simba} //OR {$loadlib Socks}
{$ENDIF


These are known as: "The include guard idiom" http://en.wikipedia.org/wiki/Include_guard. It applies to many languages.. C & C++ being the most popular for its usage.

It prevents you from including/loading the same thing twice which is what would cause a duplicate error. Most likely that's why you got that error.

For Simba files, there's an easier directive:


{$include_once ../Socks.Simba}

which automatically protects against duplication. However, include guards can be more powerful in that it works for both plugins/libraries and include files/.simba files.


But again, I'd indeed stay away from modifying SMART's include.. Mistakes can make things go bad easily.
I'm not sure how exactly you modified the file or what modifications you made to give you a duplication error though..