n3ss3s
2007-11-30 08:46:03
Well today I got the balloon random, but it was on my main which isn't only mine, so I don't wanna spend hours in the random, anyways, I managed to get some code there, and I hope it helps somebody who has solving of this random in development…
Detecting - works
Animal detection - works
Lever pulling - works
the pete chat thing I haven't tested…
program New;
{.include SRL/SRL.scar}
Var
I: Integer;
Function DetectScapeRune: Boolean;
Var
GreenRoad: TPointArray;
Begin
If Not LoggedIn Then Exit;
If FindNpcChatText('just happen') Then
Result := True;
If Not Result Then
Begin
FindColorsTolerance(GreenRoad, 3622203, MMX1, MMY1, MMX2, MMY2, 10);
If GetArrayLength(GreenRoad) >= 500 Then
Begin
Result := True;
End;
End;
If Result Then
Begin
Writeln('*** Detected ScapeRune balloon random ***');
// Players[CurrentPlayer].Loc := 'ScapeRune';
End;
End;
Function ToLeverWindow: Boolean;
Var
TPAA: Array of TPointArray;
TPA: TPointArray;
TP: TPoint;
CTS, I, C: Integer;
Begin
If Not LoggedIn Then Exit;
CTS := GetColorToleranceSpeed;
Status('To lever');
If Not CTS = 2 Then ColorToleranceSpeed(2);
Repeat
FindColorsTolerance(TPA, 6850457, 40, 40, MSX2 - 25, MSY2 - 25, 10);
TPAA := SplitTPA(TPA);
For I := 0 To High(TPAA) Do
Begin
If GetArrayLength(TPAA[i]) >= 40 Then
Begin
TP := MiddleTPA(TPAA[i]);
MMouse(TP.x, TP.y, 2, 2);
If IsUpTextMulti('Lever', 'ull', 'eve') Then
Begin
GetMousePos(TP.x, TP.y);
Mouse(TP.x, TP.y, 0, 0, False);
If Not ChooseOption('ever') Then
MMouse(MSX1, MSY1, MSX2, MSY2)
Else
Begin
FFlag(0);
Wait(500 + Random(250));
Result := True;
ColorToleranceSpeed(CTS);
Exit;
End;
End;
End;
End;
C := C + 1;
Wait(2500 + Random(500)); // Till other players get outta way if any...
Until(Not(LoggedIn)) Or (C > 10);
ColorToleranceSpeed(CTS);
End;
Function GetAnimal: String;
Var
PPoints: TPointArray;
CTS, I, S: Integer;
Begin
If Not LoggedIn Then Exit;
Status('GetAnimal');
CTS := GetColorToleranceSpeed;
If Not CTS = 2 Then ColorToleranceSpeed(2);
For I := 0 To 4 Do
Begin
Wait(800);
FindColorsTolerance(PPoints, 14040538, 10, MSY1, MSX2, MSY2, 15);
S := S + GetArrayLength(PPoints);
End;
Writeln('Animal Points: '+IntToStr(s));
ColorToleranceSpeed(2);
If S >= 15200 Then
Result := 'Ram';
If S >= 10100 Then
Result := 'Cat';
End;
Function HandlePeteChat: Boolean;
Var
FTime: Boolean;
Begin
If Not LoggedIn Then Exit;
If FindNpcChatText('reat') Then
Begin
Wait(8000 + Random(2000));
Repeat
ClickToContinue;
If FTime Then
Begin
FTime := False;
Wait(1400 + Random(300));
If FindNpcChatText('ooray') Then
Begin
Result := True;
Exit;
End;
End;
Wait(500 + Random(100));
Until(Not(ClickToContinue)) Or (Not(LoggedIn));
End;
End;
Detecting - works
Animal detection - works
Lever pulling - works
the pete chat thing I haven't tested…