SRL Archive - Research & Development Lounge

Does Simba Thread Smart?


Brandon

2012-03-20 00:59:16

Dunno if I'm posting in the wrong area.. but I wrote a lot of code for smart and whatever else.. only to find out that smart has an infinite while loop.. and that if killed, the process running smart will segfault/crash/terminate/undefined behaviour/leak..

So.. how does Simba do all the mouse moving stuff, if smart itself is in an infinite while loop :S

My code:
http://paste.villavu.com/show/2vIwZs9ptJjGNwfXn0pM/

Problem:


stringstream SS;
SS<<"http://world"<<Server<<".runescape.com/";
string World = SS.str();

SmartSetup((char*)World.c_str(), (char*)",f5", 765, 503,(char*)"");

//Problem starts here.. See that? If removed, everything will go haywire.. So does Simba Insert it's code in there or what? OR Does it thread smart and somehow hook the functions and send the commands?


while (true)
{
Sleep(1000);
}

LolL

2012-03-20 16:19:55

Are you meaning to tell me SMART has a loop that executes a sleep the entire time???

Brandon

2012-03-20 16:40:23

Exactly what I'm saying.. without that loop, the destructor activates AND smart gets destroyed.. along with the host program aka the one that loads it will crash. So.. I wanna know if Simba threads smart :S

I'm thinking maybe simba doesn't implement that loop when loading smart.. instead it just loads smart and it's up to the scripter to implement such a loop? but still.. if that's the case.. how is Smart still loaded even when a script isn't running :S