SRL Archive - S.M.A.R.T. General and Q/A.

Close / Reopen SMART?


FrÕzÑ_§ÕµL

2008-02-23 13:34:01

Is there a way to close and then reopen SMART?

Because I have the option for users that have member accoutns to go onto members worlds, however with SMART, if you are on a F2P world and click on a P2P world it does nothing as (I guess) the client can not re load.

So, is there a command to close SMART, so that I can reopen it at the desired world?

WITHOUT WASTING MEMORY. Because if I continuously call
SmartSetupEx(stuff)
then the memory usage of SCAR goes from 80k to 130k after about 4 openings. This is obviously unreliable and will either crash SCAR, your computer, or lag like hell and get you banned :p

Psychor

2008-02-23 13:38:01

What about using the world switching option on the login page?

FrÕzÑ_§ÕµL

2008-02-23 13:41:05

No I explained that it will not click them as SMART will not let you reinitialize it as you have to reload the java and stuff. I even tried clicking them myself and they don't load.

Timer

2008-02-23 14:18:54

You may only switch from F2P to F2P, Members To Members.

And I Think There Is A Way

Like…

Form1.ModalResult:= mrOk;
FreeForm(Form1);

Then

SmartSetupEx(1, False, True);
while not SmartReady do Wait(100);
SetTargetDC(SmartGetDC);

Not sure it that would work, It May.

Cause i recall The Smart Var to Be Sumthing Like Form1, its done through form, I think, well, I also think There Should Be A Option Like

procedure CloseSmart;

along with

procedure RestartSmart(World: LongInt; HighDetail, Signed: Boolean);
begin
CloseSmart;
while SmartReady do Wait(100);//Waits For Full Close
SmartSetupEx(World, HighDetail, Signed);
while not SmartReady do Wait(100);
SetTargetDC(SmartGetDc);
end;

Smartzkid

2008-02-23 16:15:39

No way to make it work without changing SMART; and since its development has pretty much stopped, don't count on it.

FrÕzÑ_§ÕµL

2008-02-23 20:31:57

Yea I totally agree timer. Thanks I'll try with Form1 then, sweet as.

Well if the Freeform works then we can make most of those procedures ourselves!

PriSoner

2008-02-23 20:59:25

just re-run your smart setup when you start a new player. if the world is different smart will automatically close itself and re-open a new window and new world. couldn't be easier :)

<<–PriSoner–>>

Timer

2008-02-23 22:26:39

hmm, Hey What Do Ya Know, It Does!!! :p

No way to make it work without changing SMART; and since its development has pretty much stopped, don't count on it.

Hmm, Think I Could Get The Un "Plugin Formatted" Copy?

FrÕzÑ_§ÕµL

2008-02-24 02:24:26

Yes I already knew it did, but the memory usage increases by over 10k every time you call it, as SMART does not shut down tidely.

And unfortunately FreeForm(Form1) did not work.

Any one got any more ideas / know the name of the form?

Timer

2008-02-24 02:57:03

Lets See. Cntrl + Space's Scar. Begins Looking.

Edit: Can't Find Anything, BenLand, Gimme The Un Pluginafied Version Please!?

FrÕzÑ_§ÕµL

2008-02-24 03:48:21

Benland doesn't even come on now does he? Markus said he doesn't :( DAMIT THIS IS ANNOYING!

Smartzkid

2008-02-24 17:30:40

Haha, Ben protects his SMART source religiously. He claims that there's something really special about the C++ part that he doesn't want anyone else to get their hands on. People have been able to decompile the java part; nothing special, though.

FrÕzÑ_§ÕµL

2008-02-24 17:37:23

Arg well theres still no reason for him to not fix memory leaks or create CLoseSMART omfg! or EVEN SIMPLY LET IT SWITCH WORLDS LOL.

Smartzkid

2008-02-24 17:42:06

I think the world switching would take editing of the RS client, which isn't something we want. Even if it was possible with C++, Ben doesn't really care about RS right now; he's busy with other stuff.

HellBoyz

2008-02-25 21:21:38

So… does that mean smart will not fully support on scar?

Harry

2008-02-25 21:31:43

[offtopic] BenLand talks to me on MSN :p He still is alive… [/offtopic]

You could open 2 smarts, one for f2p one for members… isn't multi-log one of the reasons why SMART was made? :)

FrÕzÑ_§ÕµL

2008-02-25 22:06:35

Yes but MultiLog is only possible with two scars installed, and two scars running, which can not be done from a script lol. That would be users choice. Ask him to add me please Hy. And it was made for control of the mouse to continue scripting and do other stuff actually :p

Widget

2008-02-26 00:13:11

Didn't we figure out how to use two SMARTs at once just by using API calls?

You could just change your smart.scar file and use a global MembersWorld or something and have both SMARTs open.
procedure MoveMouse(x,y:integer);
begin
if MembersWorld then
SmartMoveMouse2(x,y)
else
SmartMoveMouse(x,y);
end;

Something like that maybe?

FrÕzÑ_§ÕµL

2008-02-26 00:15:30

Wow thats clever and advanced… But i do understand it. However I ain't gna go edit every SMART procedure lol.

Widget

2008-02-26 00:18:35

http://www.villavu.com/forum/showthread.php?t=23933

He doesn't have all the procedures, I'll probably make them later =).

That is as long as Ben doesn't get angrier at me since I already found his Java files which I didn't realize he was hiding :duh:

FrÕzÑ_§ÕµL

2008-02-26 00:31:57

:p geez widget ur so rebel! Tell me when your done everything k :)

Widget

2008-02-26 01:08:18

procedure SmartSetup(world:string;highdetail,signed:boolean); external '_setup@12@smart.dll stdcall';
function SmartReady: boolean; external '_isBlocking@12@smart.dll stdcall';
procedure SmartMoveMouse(x,y:integer); external '_moveMouse@8@smart.dll stdcall';
procedure SmartHoldMouse(x,y:integer;right:boolean); external '_holdMouse@12@smart.dll stdcall';
procedure SmartReleaseMouse(x,y:integer;left:boolean); external '_releaseMouse@12@smart.dll stdcall';
procedure SmartReleaseKey(key:integer); external '_releaseKey@4@smart.dll stdcall';
procedure SmartHoldKey(key:integer); external '_holdKey@4@smart.dll stdcall';
procedure SmartSendKeys(keys:string); external '_sendKeys@4@smart.dll stdcall';
procedure SmartGetMousePos(var x,y:integer); external '_getMousePos@8@smart.dll stdcall';
function SmartGetColor(x,y:integer):integer; external '_getColor@8@smart.dll stdcall';
function SmartGetDC: integer; external '_getHDC@0@smart.dll stdcall';
// _setTarget@4@smart.dll stdcall; // Not really sure what that is =P

Heh, taking apart things is fun, whether it be with dissasemblers or screwdrivers ;)

Also, I should note that that won't compile for me, but it's past midnight and I don't really feel like bothering to figure out why :p.

I should also say that that is only the stuff that gets mentioned in smart.scar.

And if you really care, you can attempt to make this run without crashing SCAR (compiles in 3.13 but not 3.14, bug?).
program New;
function GetFunctionCount:integer; external 'GetFunctionCount@smart.dll stdcall';
function GetFunctionInfo(info:integer):string; external 'GetFunctionInfo@smart.dll stdcall';
var i:integer;
begin
for i := 0 to (GetFunctionCount-1) do
Writeln(GetFunctionInfo(i));
end.
That should work on any plugin meant for SCAR.

FrÕzÑ_§ÕµL

2008-02-26 01:10:28

OK well good night lol, I don't no anything about that stuff ^^ or how the hell to use it!

Timer

2008-02-26 10:58:04

Omg, are you guys insane? I run like 7 smarts at once with only 1 SCAR Installed
Just open a new SCAR for each smart… :p

Markus

2008-02-26 12:21:38

From: Timer
Omg, are you guys insane? I run like 7 smarts at once with only 1 SCAR Installed
Just open a new SCAR for each smart… :p


Yea and then it crashes after a while.

FrÕzÑ_§ÕµL

2008-02-26 13:21:50

WTH timer is your computer like god damn QUAD-CORE!?

And what script lol, mine uses waaay to much memory.

Smartzkid

2008-02-26 15:45:54

Why install scar so many times? Make a batch file to copy and append numbers to the scar folder, then every time you make a change, say, updating srl, you just drag your 'main' scar folder to the batch file, and you have 4, 8, 10, however many you want, smarts all set up.