SRL Archive - OSR Help

Turn a simba script into a standalone program


Footy

2012-09-26 18:57:16

I am planning on writing a program in simba not for RS, just a simple program with a simple GUI and that kind of stuff. Is it possible to distribute this program to friends as a .exe or any other filetype that doesn't require the installation of simba?

Thanks
~Footy

Silentcore

2012-09-26 19:03:21

I'm not sure if inferring the right idea but are you saying that you are trying to make a program that would load any script. Kind of like an injection client?

Nebula

2012-09-26 19:04:45

No, since Simba is what contains all of the functions that you would need to use. And you would need somewhere to put SRL and all of the plugins.

But botting with a .exe is possible, back in 06 I used a fighter script that was exactly what you are describing. But I'm pretty sure that was Visual Basic or something along those lines, not pascalscript.

Footy

2012-09-26 19:06:05

Alright, and I dont need any of SRL's functions, its not for RS, completely unrelated. What do you recomend I use to make a simple program with a GUI?

From: Ucantseemebot
I'm not sure if inferring the right idea but are you saying that you are trying to make a program that would load any script. Kind of like an injection client?


Not quite. It would just be a program that would accept input from a GUI and generate an output based on the input and inner calculations.

Le Jingle

2012-09-26 19:09:41

From: Footy
Alright, and I dont need any of SRL's functions, its not for RS, completely unrelated. What do you recomend I use to make a simple program with a GUI?

Lazarus

Footy

2012-09-26 19:10:36

From: Le Jingle
Lazarus


Fancy name… I guess I'll look up some tuts, thanks for the reccomendation.

Runaway

2012-09-26 19:13:09

Tell your friends to stop being lazy and take 15 minutes to learn how to use it :pinch:

For real though, can't they just install Simba, download your script, double-click your script, and hit run? Assuming you use a form as your GUI.

NCDS

2012-09-26 19:13:11

From: Footy
Alright, and I dont need any of SRL's functions, its not for RS, completely unrelated. What do you recomend I use to make a simple program with a GUI?



Not quite. It would just be a program that would accept input from a GUI and generate an output based on the input and inner calculations.


From: Le Jingle
Lazarus


If you're looking to stick with Pascal(Script) then Lazarus for sure (which is the IDE used to develop Simba). Otherwise, I would recommend downloading VisualStudio and expanding your knowledge to VB.NET, as it is quite similar to pascal.

Footy

2012-09-26 19:16:42

From: Runaway
Tell your friends to stop being lazy and take 15 minutes to learn how to use it :pinch:

For real though, can't they just install Simba, download your script, double-click your script, and hit run? Assuming you use a form as your GUI.


Simba = RSBotting, and RS is one of those things that you keep to yourself in my community, :p

From: NCDS
If you're looking to stick with Pascal(Script) then Lazarus for sure (which is the IDE used to develop Simba). Otherwise, I would recommend downloading VisualStudio and expanding your knowledge to VB.NET, as it is quite similar to pascal.


Jeez, the easy way, or expand my knowledge… Which to pick, which to pick? Thanks for the suggestions, I'll pick one sooner or later…
E: Chose lazerus. Why on earth is it 107 MB though?

Runaway

2012-09-26 19:29:12

From: Footy
Simba = RSBotting, and RS is one of those things that you keep to yourself in my community, :p


You can use SCAR, it utilizes most of the same core functions. Aaand it's got an awesome form editor!

Footy

2012-09-26 19:33:21

SCAR was also used for RS botting. :p And instead of posting another thread, I have anothr, completely unrelated question. How do I make an animated avatar with a gif? I put the gif URL in the avatar thingy, but it only shows the first frame.

Runaway

2012-09-26 19:39:02

From: Footy
SCAR was also used for RS botting. :p And instead of posting another thread, I have anothr, completely unrelated question. How do I make an animated avatar with a gif? I put the gif URL in the avatar thingy, but it only shows the first frame.


http://www.scar-divi.com/
^ RS isn't mentioned anywhere.

As for gif's, I think you have to be a mod/admin to use animated avatars.

Brandon

2012-09-26 23:18:22

Follow this Tutorial: http://villavu.com/vb/showthread.php?t=47141

But instead, use the following code for Simba:


#include <Windows.h>
#include <iostream>
#include <vector>
#include <sstream>


std::string FormTitle = "Notepad"; //Change this to your Form Name.

std::string SimbaPath = "Simba/Simba.exe";
std::string ScriptPath = "ScriptToRun.simba"; //Change this.

DWORD FormProcessID = 0; //Do not touch this variable.



template<typename T> inline std::string ToString(T Type){std::stringstream SS; SS<<Type; return SS.str();}

std::string CreateCommandLine(std::string SimbaPath, std::string ScriptPath)
{
return SimbaPath + " -o " + "\"" + ScriptPath + "\" -r";
}

int Pos(std::string Needle, std::string Haystack, int StartPos)
{
return Haystack.find(Needle, StartPos);
}

std::string LowerCase(std::string Str)
{
for (size_t I = 0; I < Str.length(); I++)
{
Str[I] = tolower(Str[I]);
}
return Str;
}

bool RunApplication(std::string ApplicationName, std::string ApplicationArguments, bool WaitInputIdle)
{
bool Result = false;
STARTUPINFO siStartupInfo;
PROCESS_INFORMATION piProcessInfo;

std::vector<char> Arguments(ApplicationArguments.begin(), ApplicationArguments.end() + 1); //strcpy(Arguments, ApplicationArguments.c_str());
memset(&siStartupInfo, 0, sizeof(siStartupInfo));
memset(&piProcessInfo, 0, sizeof(piProcessInfo));

if (CreateProcess(ApplicationName.empty() ? NULL : ApplicationName.c_str(), &Arguments[0], 0, 0, false, CREATE_DEFAULT_ERROR_MODE, 0, 0, &siStartupInfo, &piProcessInfo) != false)
Result = true;

FormProcessID = piProcessInfo.dwProcessId;

if (WaitInputIdle)
{
Result = false;
if (WaitForInputIdle(piProcessInfo.hProcess, 10000) == 0)
Result = true;
}
CloseHandle(piProcessInfo.hThread);
CloseHandle(piProcessInfo.hProcess);
return Result;
}

BOOL CALLBACK WorkerProc(HWND Hwnd, LPARAM lParam)
{
char Buffer[256] = {0};
GetWindowText(Hwnd, Buffer, 256);

if(Pos(LowerCase(FormTitle), LowerCase(Buffer), 0) != -1)
{
*(reinterpret_cast<HWND*>(lParam)) = Hwnd;
return FALSE;
}

return TRUE;
}

bool HideIDE(void)
{
HWND Blank = 0;
HWND* Hwnd = &Blank;
EnumWindows(&WorkerProc, reinterpret_cast<LPARAM>(Hwnd));
return ShowWindow(*Hwnd, SW_HIDE);
}

bool FindForm()
{
HWND Blank = 0;
HWND* Hwnd = &Blank;
EnumWindows(&WorkerProc, reinterpret_cast<LPARAM>(Hwnd));
return (*Hwnd != 0);
}

int main()
{
RunApplication(std::string(), CreateCommandLine(SimbaPath.c_str(), ScriptPath.c_str()), true);
while(!HideIDE())
{
Sleep(2);
}

while (FindForm())
{
Sleep(2000);
}

std::string KillPIDInfo = "TASKKILL /PID " + ToString(FormProcessID) + " /T";
system(KillPIDInfo.c_str());
}