SRL Archive - RS3 Help

Way to add a constant to differentiate between procedures?


Clutch

2015-05-19 22:15:56

Okay so my heads really starting to hurt. I've tried to get as creative as possible but nothing I think up of seems to work. Ultimately all I want is to have a const at the top of the script - to help with setting up the script. Ultimately there will be in this case; 2 loops both performing completely different things (neither are integrated with eachother other than the skill that they train). Is there a way to add a const to the top of the script to do this?

Ex. Const
mL= 'mainLoop'

then at the bottom I would just have (mL); < (this being the procedure but obviously this way doesn't freaking work)
procedure mainLoop;
var
Reaction : Procedure() =@doNothing;
begin
{ClearDebug;
Proggy; }
if canPosition.isFinished() then
Reaction:=@pPosition
{else if canRotateCamera.isFinished() then
Reaction:=@RotateCamera {Stun
else if canPickPocket.isFinished() and doneWalking.isFinished() and length(ogl.getModels(NPC)) and ogl.getModels(3274042734).isEmpty() then
Reaction:=@StealFromMerchant
else if canPickPocket.isFinished() or canPosition.isFinished() or doneWalking.isFinished() or ogl.getModels(3274042734).isEmpty() then
Reaction:=@RandomAFK
else if ogl.getModels(NPC).isEmpty() then
Reaction:=@LookForMerchant}
else if (actionBar.getLifePoints()<99) and (canWalk.isFinished())then
Reaction:=@pWalk;
{Reaction:=}
Reaction();
end

Procedure mainLoop2;
begin
terminatescript;
end;

begin
ogl.setup();
repeat
mainLoop;
until false;
end;

Turpinator

2015-05-19 22:22:03

huh?


if const_whatever = 'thing1' then
mainloop1()
else
mainloop2();

?

or use a case if you have multiple options?

Clutch

2015-05-19 22:46:01

From: Turpinator
huh?


if const_whatever = 'thing1' then
mainloop1()
else
mainloop2();

?

or use a case if you have multiple options?


Lol… thanks.