SRL Archive - S.M.A.R.T. Questions and Answers.

Making SMART restart the script


Cstrike

2010-08-16 14:02:56

I have one thing limiting my script only, and that is when runescape gets updated. When smart changes worlds, if it cannot log in due to a change then it stays logged out and my script terminates due to fail safes.

Though since it just requires a basic reload, is there a way to:
a) Terminate the script
b) Then restart the script ?

This would require closing of the window. Don't know if this is possible (or if SRL/SCAR
 has a command for this), thanks in advance

i luffs yeww

2010-08-16 14:16:06

You could have two separate Simbas. One for seeing if the other is running, and one to just auto.

Cstrike

2010-08-16 17:09:07

From: i luffs yeww
You could have two separate Simbas. One for seeing if the other is running, and one to just auto.


That's interesting, I never thought of that

The only problem is the script would need to do it infinite times since it can run forever. Is there any way to do that? The only bug in my script is when it world changes, occasionally RS updates which bugs it all up. If I could restart, my script would run forever until a major update occurs.

i luffs yeww

2010-08-16 17:22:06

Something like this should run forever.


var
x, y, PlayButtonDTM: Integer;

begin
PlayButtonDTM := DTMFromString();
repeat
if(FindDTM(PlayButtonDTM, x, y, 0, 0, 2000, 2000))then
ClickMouse(x, y, True);
until(false);
end.

You might need to add a wait in there, depending on how good your computer is. (Good thing about this is you can have a wait of like. 5 minutes or 30 minutes or anything, and you can have a random amount between a millisecond or six hours. Could be a pseudo-break addition.)

Hope that helps.

Frement

2010-08-16 17:26:03

Maybe this could be achieved with extensions?

Cstrike

2010-08-16 17:33:01

From: Frement
Maybe this could be achieved with extensions?


I'm unfamiliar with extensions, do you mean like the includes, or a plugin (.dll or .ini file) that can detect that? Something codeable? :P

From: i luffs yeww
Something like this should run forever.


var
x, y, PlayButtonDTM: Integer;

begin
PlayButtonDTM := DTMFromString();
repeat
if(FindDTM(PlayButtonDTM, x, y, 0, 0, 2000, 2000))then
ClickMouse(x, y, True);
until(false);
end.

You might need to add a wait in there, depending on how good your computer is. (Good thing about this is you can have a wait of like. 5 minutes or 30 minutes or anything, and you can have a random amount between a millisecond or six hours. Could be a pseudo-break addition.)

Hope that helps.


Now that's a great idea! I like that and I'm going to try it out hopefully soon. Thank you very much for the input and idea :)

i luffs yeww

2010-08-16 18:15:55

An extension is kind of like another thread (I believe). It's ran in Simba's main thread instead of the script's thread (I think). That's how srl.sex, reflection.sex, dtm_editor.sex, etc. work. You can take a look at them and maybe figure out a way to see if the script is running to start it. Shuttleu (I think) made a tutorial on extensions.

Bad Boy JH

2010-08-23 01:34:25

What about a way reload Runescape in Smart, and then use goto, which might not be good scripting practice but it would work…

CX gamer

2010-08-23 08:22:20

From: Bad Boy JH
What about a way reload Runescape in Smart, and then use goto, which might not be good scripting practice but it would work…

*Shoots Bad Boy JH* :sasmokin:

Wizzup?

2010-08-23 08:45:00

I think you can just close smart, and reload it. If you then set the target to smart again you can just let your script keep running, if your script can handle it, logic wise.