pwnaz0r
2008-10-09 21:14:24
function TalkToMordaut: boolean;
var
Tile, Modaut: TPoint;
begin
SetAngle(true);
Tile:= Point(1886, 5022);
Modaut:= TileToMS(Tile, 5);
Mouse(Modaut.X, Modaut.Y, 5, 5, false);
result:= ChooseOption('k-t');
end;
function RetrieveQuestionType(var Question: string): boolean;
begin
Question:= '';
if FindNPCChatText('bjec', Nothing)then
Question:= 'Pattern';
if FindNPCChatText('xamin', Nothing)then
Question:= 'Hint';
result:= (not(Question = ''));
end;
function AnsweredCorrect: boolean;
var
Str: Array of string;
i : integer;
begin
Str:= ['rrec', 'onder'];
for I:= 0 to High(Str) do
begin
result:= FindNPCChatText(Str[I], Nothing);
if result then exit;
end;
end;
function FinishedTest: boolean;
begin
result:= FindNpcChatText('WELL DONE', nothing);
end;
function FindDoorColor: boolean;
var
ColorList: Array of String;
I: integer;
begin
ColorList:= ['red', 'blue', 'green', 'purple'];
for I:= 0 to High(ColorList) do
begin
if FindNPCChatText(ColorList[I], Nothing)then
begin
DoorColor:= ColorList[I];
result:= true;
exit;
end;
end;
end;
function TestScreen: boolean;
begin
result:= (GetColor(22, 8) = 1855055);
end;
function HandleMrMordaut: boolean;
begin
MakeCompass('N');
if not TestScreen then
begin
If not ClickToContinue then TalkToMordaut;
FFlag(0);
wait(500+random(500));
While ClickContinue(true, true) do
wait(500);
result:= true;
end;
if RetrieveQuestionType(CurrentQuestion) then
Writeln('Question Type Found: '+CurrentQuestion);
end;
function HintBox(Col, Row: integer): TBox;
var
StartPoint: Tpoint;
begin
StartPoint:= Point(40, 30);
Result.X1:= StartPoint.X + (66 * (Row - 1));
Result.Y1:= StartPoint.Y + (90 * (Col - 1));
Result.X2:= Result.X1 + 66;
Result.Y2:= Result.Y2 + 90;
end;
function BoxClicked(Col, Row:integer): boolean;
var
OurBox: TBox;
XX, YY: integer;
begin
OurBox:= HintBox(Col, Row);
result:= FindColor(XX, YY, 2105631, OurBox.X1, OurBox.Y1, OurBox.X1+(64-40), OurBox.Y1+(54-30));
if Not Result then
Writeln(IntToStr(GetColor(OurBox.X1+4, OurBox.Y1+4)));
end;
function ClickBox(Col, Row: integer):boolean;
var
OurBox: TBox;
Mark: Integer;
ClickPoint: TPoint;
begin
OurBox:= HintBox(Col, Row);
Mark:= GetSystemTime;
repeat
Mouse(OurBox.X1, OurBox.Y1, 66, 90, true);
Wait(300+random(500));
if ((GetSystemTime - Mark) >= 5000)then
exit;
result:= BoxClicked(Col, Row);
if result then exit;
until(false);
end;
function HandleHint(Answers: TIntegerArray): boolean;
var
I, x, y: integer;
begin
if not TestScreen then exit;
for I:= 0 to High(Answers) do
begin
X:= Answers[I] mod 5;
if (X <= 0) then X:= 5;
If Inrange(Answers[I], 1, 5)then
Y:= 1;
If Inrange(Answers[I], 6, 10)then
Y:= 2;
If Inrange(Answers[I], 11, 15)then
Y:= 3;
if not ClickBox(Y, X)then exit;
end;
result:= true;
while TestScreen do
begin
wait(300);
Mouse(418, 260, (441-418), 23, true);
end;
end;
function GetToDoor(Color: string): boolean;
var
Dir: string;
DoorPoints: array [0..1] of TPoint;
ClickPoint: TPoint;
begin
case Capitalize(Color) of
'Blue':
begin
Dir:= 'W';
DoorPoints[0]:= Point(1882, 5030);
DoorPoints[1]:= Point(1881, 5030);
end;
'Red':
begin
Dir:= 'W';
DoorPoints[0]:= Point(1882, 5022);
DoorPoints[1]:= Point(1881, 5022);
end;
'Purple':
begin
Dir:= 'N';
DoorPoints[0]:= Point(1886, 5032);
DoorPoints[1]:= Point(1886, 5033);
end;
'Green':
begin
Dir:= 'E';
DoorPoints[0]:= Point(1890, 5019);
DoorPoints[1]:= Point(1891, 5019);
end;
end;
WalkToTile(DoorPoints[0], 0, 0);
Wait(500+random(1000));
MakeCompass(Dir);
ClickPoint:= TileToMS(DoorPoints[1], 3);
Mouse(ClickPoint.X, ClickPoint.Y, 0, 0, false);
result:= ChooseOption('pen');
end;
function HandleMordaut: boolean;
begin
end;
begin
SmartSetup('world'+inttostr(SmartWorld), true, Signed, false);
while not SmartActive do wait(100);
SetTargetDC(SmartGetDC);
SetupSRL;
DeclarePlayers;
if not LoggedIn then LoginPlayer;
end.
Thats what I have. Its pretty far. Just needs to actually find the answers, haha. I guess I will leave that to people who know more about reflection or whatever. I haven't been here for awhile as some of you guys know, so yeah. I might get around to solving the actual questions, but for now this is enough to do almost everything.
Problems -
- I couldn't get FindNPCChatText to work for determining what kind of question it was, but I suppose it can be done several ways, I just ran out of questons :).
- Have to actually get the answers, I'm assuming you can do it just like you would the box, however I wasn't here when we solved it so I don't know how we did it. Leave it to greater minds.
Everything else works perfectly. Good luck whoever wants it.