SRL Archive - OSR Help

Killswitch


Footy

2012-06-25 12:14:34

How do I add a killswitch to my script? By that, i mean a button or something that will kill it when I want. Thanks

Heres my script

program Alcher;
{$i srl/srl.simba}

Procedure Start;
begin
GameTab(tab_Magic);
end;

Procedure alch;
var
x, y:integer;
begin
if findcolorspiraltolerance(x, y, 226957, 568, 370, 580, 382, 5) then
mouse(x, y, 3, 3, 1);
wait(randomrange(100, 213));
if ExistsItem(CoordsToItem(x,y)) then
begin
ClickMouse2(mouse_Left);
WriteLn('Successfully clicked the item');
end else
begin
WriteLn('No item available');
LogOut;
TerminateScript;
end;
end;

procedure AntiBan;
begin
if(not(LoggedIn))then
exit;
Findnoninventoryrandoms;
Case Random (2500) of
0..18: Begin SleepAndMoveMouse(5000 + Random(750)); End;
19..24: Begin GameTab(tab_Inv) ExamineInv; GameTab(tab_Magic); SleepAndMoveMouse(2500 + Random(553)); End;
25..42: Begin RandomAngle(1); End;
43..48: Begin GameTab(Tab_Stats); Wait(3000 + Random(400)); GameTab(tab_Magic); SleepAndMoveMouse(2550 + Random(658)); End;
49..54: Begin GameTab(tab_Stats) HoverSkill('random', False); GameTab(tab_Magic); SleepAndMoveMouse(2200 + Random(545)); End;
55..60: Begin PickUpMouse; End;
61..66: Begin RandomMovement; End;
67..72: Begin BoredHuman; GameTab(tab_Magic); End;
73..78: if(gametab(tab_inv))then Begin ExamineInv; GameTab(tab_Magic); End;
End;
end;

begin
setupSRL
Start
repeat
Alch
Antiban
until(false);
end.

CephaXz

2012-06-25 12:16:48

Kill it? You mean stop the script? Or close Simba?

Based Lord

2012-06-25 12:18:04

From: Foooty
LogOut;
TerminateScript;

You could have it do If *condition* = true or something along those lines TerminateScript;

You basically have one in your script already :p

Footy

2012-06-25 12:20:39

lol, i had one, but it tried to log out every loop, so that kinda failed. And i mean to close the script im running, not simba. Can someone show me how to do that? ive been scripting for less then a week, so i dont really know how to do it…

CephaXz

2012-06-25 12:33:15

You copied those codes out of somewhere? If you just want to stop the script, TerminateScript is enough. LogOut is not needed.

Footy

2012-06-25 12:37:53

no, i watched yohojo's youtube stuff, but i copied the antiban from a different script. But while the script is running, and I decide I want to stop it, how do I trigger terminatescript? I think I saw it in a script, where he had arrowdown as a trigger to terminatescript.

Abu

2012-06-25 13:33:26

You just call it normally.

When Simba reads it, it will stop your script.

P1ng

2012-06-25 18:55:41

Press F2 with the simba window active. Boom killswitch ;)

You can't really do this otherwise if you are running through SMART because it only registers SMART's keystrokes. Just use the F2 method or the red stop button in simba.