dudesareus
2007-05-02 20:15:36
Hey, it's me dudesareus here, and I'm going to teach you how to use cases. I have been looking around for the past couple days for some good tutorials that focus mainly on cases. So thanks for reading and hope I taught you something!
When your using a Case, you don't need a begin, just an end, which is pretty cool. Cases can be used in many things such as Anti-Ban, and Fail-Safes.
The first thing you need to know is how to use them.
Lets say you want a procedure to use as a Case random, if you would like to do something like that you would do this;
I hope you liked this brief tutorial on Cases, I may update when I have more time! If you would like more info on Fail-Safes and Anti-Ban then just search around the forums for them.
EDIT: I added a little script that shows how its used, I used Writeln and if you look through the entire debug box after you can see that all of the Writeln's are random and not all used the same.
Part 1
When your using a Case, you don't need a begin, just an end, which is pretty cool. Cases can be used in many things such as Anti-Ban, and Fail-Safes.
Part 2
The first thing you need to know is how to use them.
Case Random(3) of
end;
In between the Case and the end, you would do something like this;
Case Random(3) of
0: MakeCompass('S');
1: MakeCompass('E');
2: MakeCompass('W');
end;
If you noticed above you start with a 0 and not a 1. You can use something else than MakeCompass like MouseBox.Part 3
Lets say you want a procedure to use as a Case random, if you would like to do something like that you would do this;
Procedure DoSomething1;
begin
DoSomething;
end;
Procedure DoSomething2;
begin
DoSomething;
end;
Procedure CaseInThisProcedure;
begin
RadialWalk(FindRoadColor,1,1,70 etc. etc.);
Case Random(2) of
0: DoSomething1;
1: DoSomething2;
end;
end;
I hope you liked this brief tutorial on Cases, I may update when I have more time! If you would like more info on Fail-Safes and Anti-Ban then just search around the forums for them.
EDIT: I added a little script that shows how its used, I used Writeln and if you look through the entire debug box after you can see that all of the Writeln's are random and not all used the same.