PDA

View Full Version : Restart Smart on update/whatever



Nebula
08-11-2013, 02:34 AM
You'll thank me later for making this amazing procedure

it closes the current smart window, then opens a new one.


{made by nebula}
procedure restartsmart;
begin
SmartKillClient(smartcurrentclient);
SetupSmart(Smart_ForceNew);
SmartPairClient(SmartGetClients(true));
end;


Use it someway like this:


If not loggedin then
begin
restartsmart;
LoginPlayer;
ContinueWithScript;
Bot4Dayz;
PostEpicallyLongProggy;
end;

Brandon
08-11-2013, 04:05 AM
Hmm.. You might have memory leaks if you don't free your debug image and others alike.. This already existed in SRL-5 for several months: https://github.com/SRL/SRL-5/blob/master/SRL/misc/SmartParams.simba.. Just the modify "SixHourFix" function for OSR.. I doubt it even needs modifying.

Itankbots
08-11-2013, 04:28 AM
Pretty sure Someone else made a really good 6hr fix /Restart smart on command if you dont wanna use the built in one ...Was either Kevin or Flight...But im pretty sure it was Flight...

Turpinator
08-11-2013, 06:56 AM
It was flight who had a nice 6hrfix replacement, but with OSR, theres no 6 hour timeout, so the only time you would need to worry about would be updates.

Here's Flight's...
Procedure NewSmart;
var
Trash: TVariantArray;
Refresh: Integer;
begin
{$IFDEF SMART}
FreeSRL;
Refresh := SmartGetRefresh;
SmartKillClient(SmartCurrentClient);
SetupSRL;
try
CallProc('SMART_FreeDebug', Trash);
CallProc('SMART_SetupDebug', Trash);
except
end;
SmartSetRefresh(Refresh);
try
LoginPlayer;
except
srl_Warn('SixHourFix', 'Players not declared', warn_Terminate);
end;
{$ENDIF}
end; You also need to call this on startup. SRL_Procs[srl_OnRSUpdate] := @NewSmart;

Never used this on OSR, as... well theres no 6hr timeout, just updates/maintenance.

Flight
08-11-2013, 08:51 AM
How often does the Oldschool RS update? I didn't realize the same "6-hour" rule applied in OSRS because I've been running close to 10 hours a few times and never came across that.

Justin
08-11-2013, 09:27 AM
How often does the Oldschool RS update? I didn't realize the same "6-hour" rule applied in OSRS because I've been running close to 10 hours a few times and never came across that.

From memory, the only time the client should need reloading is when Jagex do an update (System Update), I don't believe there is a 6-hour or similar limit in OSRS. It should/could be removed from the include

cause
08-11-2013, 09:25 PM
How often does the Oldschool RS update? I didn't realize the same "6-hour" rule applied in OSRS because I've been running close to 10 hours a few times and never came across that.

I believe they update on Sundays...