Zach1188
2007-11-17 17:28:05
I'm a little unclear on how to check for randoms efficiently, however I have the basics down. Is this a decent procedure? I also commented it in places. Please read the comments, I have a few questions.
(Procedure "CheckForRandoms" is dominant)
(Procedure "CheckForRandoms" is dominant)
function FindQuickRandoms: boolean; //Boolean; True = unsolvable
begin
SolvePinball;
if InQuizRandom then
SolveQuiz; //Is this the quiz with Dr. Mordaut?
if DetectFrogCave then
SolveFrogSwamp;
if (FindDead) or (FindMime) or (FindMaze) or (NoSymbols) or
(NoGameTab) or (InBlack) then //NoSymbols is my own procedure
begin
result:= true;
exit;
end else result:= False;
end;
function CheckForRandoms(FullCheck: boolean): boolean;
var
NonInvRand, TalkRand: boolean;
begin
If Not(LoggedIn) then LoginPlayer;
if not(NoAxe) then //Dont check if it already knows there's no axe
if not(FindAxe2) then NoAxe:= true;
AvoidFight;
If FullCheck then
begin
if FindNormalRandoms then result:= True; //FIND ALL RANDOMS
exit; //No reason to continue checking for randoms
end; //Please give feedback here, I'm unsure exactly what FindNormalRandoms
//checks for.
if FindQuickRandoms then
begin
Result := True;
Players[CurrentPlayer].loc := 'Teleported to random.';
EndAuto('Unsolvable random found. Screenshot taken.', true, true);
Logout;
exit;
end;
//if talking random found AND it found points with tree color, then..
If ((FindTalk) and (Length(TreePTS) > 0)) then
begin
for x:= 0 to Length(TreePTS) - 1 do
begin
MMouse(TreePTS[i].x, TreePTS[i].y, 3 - Random(2), 1);
if IsUpText('down Yew') then
begin
result:= True;
exit;
end;
end;
end else result:= False;
end;