Yago
2011-03-30 21:29:24
Can you call goto Label within a Case argument?
2011-03-30 21:29:24
2011-03-30 21:33:33
Procedure say1;
Begin
Writeln('Looks like the number was 1!');
End;
Procedure say2;
Begin
Writeln('Looks like the number was 2!');
End;
Begin
Case random(2) of
1: say1;
2: say2;
End.
2011-03-30 21:38:41
2011-03-30 21:38:44
Case Blah of
yeah: goto Whatever
nah: goto IDK
if blah = yeah then
goto whatever
else if blah = nah then
goto IDK;2011-03-30 21:38:45
From: i luffs yeww
Sure. I wouldn't recommend using goto's though.
From: Yago
ok so ill just change myCase Blah of
yeah: goto Whatever
nah: goto IDK
toif blah = yeah then
goto whatever
else if blah = nah then
goto IDK;
Edit: Yeah when i changes it to if thens it compiled
2011-03-30 21:40:23
2011-03-30 21:43:59
From: NCDS
Reasons?
2011-03-30 22:19:19
2011-03-30 22:36:10
2011-03-31 18:07:07
2011-03-31 18:10:43
2011-03-31 18:13:14
2011-03-31 18:16:08
2011-03-31 18:18:21
2011-03-31 18:19:23
From: Yago
Less code ;)
2011-03-31 18:27:25
repeat
repeat
repeat
until(true1)
if (false1) then
break; //but i want to go to the start ...
// i would have to add the if false thing to everything else...
// say i only wanted to break out of one loop or go to the next part of the function
// its more annoying in my opinion
until(true2)
if (false1) or (false2) then
break
until(true3)
if (false1) or (false2) or false3 then
exit
else ... //go to the next thing
2011-03-31 18:33:01
2011-03-31 18:34:08
2011-03-31 19:05:25
2011-03-31 19:06:50
2011-03-31 19:09:01
Label Starting;
var
A, B, Tries: Integer;
RawInv: TInvItem;
begin
if not (LoggedIn) then
Exit;
begin
Tries := 0;
WriteLn('Running Procedure CookFood.');
Starting:
AntiRandoms;
if (GetPlaneIndex = 0) then
if R_ItemExists(Players[CurrentPlayer].Integers[5], RawInv)then
begin
if not ItemActivated(RawInv.Slot) then
begin
if R_ClickItem(RawInv.Slot,true,'') then
begin
if WaitUntil(5000, ItemActivated(RawInv.Slot)) then
Writeln('Item Is Activated.')
else
Inc(Tries);
if (Tries >= 5) then
begin
EndScript('Item Not Activated.');
Exit;
end;
Goto Starting;
end
else
Inc(Tries);
if (Tries >= 5) then
begin
EndScript('Trouble Clicking Item.');
Exit;
end;
Goto Starting;2011-03-31 19:42:21
2011-03-31 20:15:49
Procedure CookFood;
Label Starting;
var
A, B, Tries: Integer;
RawInv: TInvItem;
begin
if not (LoggedIn) then
Exit;
begin
Tries := 0;
WriteLn('Running Procedure CookFood.');
Starting:
AntiRandoms;
if (GetPlaneIndex = 0) then
if R_ItemExists(Players[CurrentPlayer].Integers[5], RawInv)then
begin
if not ItemActivated(RawInv.Slot) then
begin
if R_ClickItem(RawInv.Slot,true,'') then
begin
if WaitUntil(5000, ItemActivated(RawInv.Slot)) then
Writeln('Item Is Activated.')
else
Inc(Tries);
if (Tries >= 5) then
begin
EndScript('Item Not Activated.');
Exit;
end;
Goto Starting;
end
else
Inc(Tries);
if (Tries >= 5) then
begin
EndScript('Trouble Clicking Item.');
Exit;
end;
Goto Starting;
end
else
Writeln('Item Is Activated.');
if (FindCRange) then
begin
AntiRandoms;
ClickMouse2(True)
WriteLn('Clicked On The Cooking Range.');
R_Flag; //If A Couple Tiles Away From The Range.
if WaitUntil(4000, FindText(A, B, 'Raw', StatChars, MCx1, MCy1, MCx2, MCy2)) then
begin
WriteLn('Found The RawDTM In The Chat Box.');
MouseBox(230,395,290,455,1);
if R_WaitUpText('ook', 5000) then
begin
ClickMouse2(True);
WriteLn('Clicked The Chat In An Attempt To Cook.');
if (IsCooking) then
begin
Writeln('Finished Cooking Food.');
IncEx(Players[CurrentPlayer].Integers[7], 1);
stats_IncVariable('Loads Done', 1);
end
else
Inc(Tries);
if (Tries >= 5) then
begin
EndScript('IsCooking Is False.');
Exit;
end;
Goto Starting
end
else
EndScript('Incorrect Uptext in Main Chat for Raw ' + Players[CurrentPlayer].Strings[1] + '.');
end
else
EndScript('Could not find RawText in Chat Box.');
end
else
EndScript('Unable To Find Cooking Range And Cook Food.')
end
else
EndScript('No Raw ' + Players[CurrentPlayer].Strings[1] + ' Exist In The Inventory.')
else
EndScript('Not On The Correct Floor.');
end;
end;
2011-03-31 21:38:32
2011-03-31 21:49:45
2011-03-31 21:52:23
2011-03-31 21:54:18
From: Sex
People are saying that they are bad in general. I am not sure of the reasons why although I was taught that it was a bad practice :p.
2011-03-31 21:56:05
2011-03-31 21:59:00
2011-03-31 22:01:06
2011-03-31 22:04:38
2011-03-31 22:12:57
2011-03-31 22:13:45
2011-03-31 22:19:36
2011-03-31 22:34:53
2011-04-01 19:00:02
2011-04-01 19:20:07
2011-04-01 19:25:21
2011-04-01 19:32:16
From: SexRight.. I didn't read the whole thread :p
That's what I said :p.