SRL Archive - Test corner

Some balloon solver code...


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…


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…

Santa_Clause

2007-11-30 22:28:00

Good luck actually clicking on the right balloon…:p

Bobarkinator

2007-12-01 01:31:06

Pwnaz0r is somewhere in the making of this, I'm not sure how far he is.

Santa_Clause

2007-12-01 05:16:08

As great as pwnaz0r is at scripting…I doubt this one will ever be perfected.

n3ss3s

2007-12-01 05:24:23

Yup, I just posted if anyone is making a similar system so he could get the point amounts or something :)

Now, we will wait and wish pwnaz0r succeeds…

Too bad I've noticed the balloon random isn't very common?

I get balloon random only if I stand still for an hour.

R0b0t1

2007-12-08 11:52:55

Same. I think it would be a waste of time to actually make one, as rare as they are.

pwnaz0r

2007-12-09 00:26:52

hah, well yes I get accounts every so often though and I have a whole "database" of pictures from different angles, all different animals etc. It is slowly scooting along, I just made a plugin today for it, and it went rather well. Now the only thing to do is plug the information and if it works, tweak. If it doesn't start over and try again :).