Simba Code:
{*******************************************************************************
function SolveDemon: Boolean;
by: Sumilion
Description: Main solving procedure.
*******************************************************************************}
function SolveDemon: Boolean;
var
Task: string;
JogIndex, StarIndex, SitIndex, PushIndex, t: Integer;
begin
Result := false;
TakeScreen('Found Demon');
ClickContinue(True, True);
SetAngle(true);
MarkTime(t);
MakeCompass('N');
repeat;
Task := demon_GetTask;
Writeln(Task);
if (not(GetSigns(JogIndex, StarIndex, SitIndex, PushIndex))) then
begin
WriteLn('Could not identify demon signs.');
LogOut;
Exit;
end;
case Task of
'Jog': Result := PerformTask(JogIndex);
'Star': Result := PerformTask(StarIndex);
'Sit': Result := PerformTask(SitIndex);
'Push': Result := PerformTask(PushIndex);
end;
if (not (Result)) then
Exit;
Wait(100 + Random(200));
if FindNPCChatText('Wrong exercise', Nothing) then
Writeln('Wrong exercise.');
until FindNPCChatText('actually', Nothing) or (TimeFromMark(t) > 10 * 60 * 1000);
if (TimeFromMark(t) > 10 * 60 * 1000) then
begin
Writeln('We''ve been in the demon random for 10 minutes. It failed.');
LogOut;
Exit;
end;
Wait(10000);
while (ClickContinue(True, True)) do
Wait(500 + Random(500));
Writeln('Waiting 10 seconds now');
Wait(10000);
Result := (not(Demon_InRandom));
if (Result) then
Writeln('Demon random solved!');
end;