SRL Archive - SRL-OSR Snippets

Restart Smart on update/whatever


Nebula

2013-08-10 22:34:11

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

2013-08-11 00:05:02

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

2013-08-11 00:28:38

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

2013-08-11 02:56:50

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

2013-08-11 04:51:25

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

2013-08-11 05:27:53

From: Flight
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

2013-08-11 17:25:01

From: Flight
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…