SRL Archive - Research & Development Lounge

Duel Arena Functions, Testers Please!


Sandstorm

2008-11-29 01:31:48

Program Test;

var
x, y: Integer;

Function Duel : Boolean;
Begin
Result := FindColor(x, y, 12926, MCX1, MCY1, MCX2, MCY2);
End;

Function DuelScreen1 : Boolean;
Begin
Result := GetColor(73, 37) = 0;
End;

Function DuelScreen2 : Boolean;
Begin
Result := GetColor(391, 34) = 0;
End;

Function Challenge : Boolean;
Begin
Result := GetColor(12, 346) = 0;
End;

Begin
SetupSRL;
If DuelScreen1 Then
WriteLn('Duel Screen one is up!');
If DuelScreen2 Then
WriteLN('Duel Screen two is up!');
If Challenge Then
Begin
MouseBox(198, 189, 317, 208, 1);
WriteLn('Accepted a challenge!');
TerminateScript;
End;
If Duel Then
Mouse(x + 5, y + 5, 3, 3, true);
End.

Looking for testers. Updating a VERY old script of mine, and I realized this way was MUCH better then the 10-15 line procedures I had before :P.

DuelScreen1 is the first duel screen, number two is the confirmation screen. Challenge checks if there's a challenge screen up (where you choose stake or friendly), and Duel checks if someone challenged you. They should all work, but I want to be sure. Thanks in advance!

~Sandstorm

Sandstorm

2008-11-29 18:17:39

Sorry for the double post, I need this one tested. Only one left:


{.include srl/srl.scar}
Var
X, Y : Integer;

Function Fighting : Boolean;
Var
I : Integer;
ColorsToUse : Array of Integer;
Begin
ColorsToUse := [6840077, 8422416, 8882961]
For I:=0 To GetArrayLength(ColorsToUse)-1 Do
Begin
Result := Not FindColorTolerance(x, y, ColorsToUse[I], MMX1, MMY1, MMX2, MMY2, 3) And Not FindColorTolerance(x, y, 244, MMX1, MMY1, MMX2, MMY2, 15) And Not FindSymbol(x, y, 'bank');
If Not Result Then
Break;
End;
End;

Begin
SetupSRL;
Case Fighting Of
True : WriteLn('Fighting!');
False : WriteLn('Not Fighting!');
End;
End.

EDIT: Retest! I messed it up!

turbobk

2008-11-29 22:56:21

Maybe try using GetTextAt or something similar, colors are not always the best.

Sandstorm

2008-11-29 23:27:11

:P. I used absolute black (0) for most of them, so it shouldn't change. I'll try the text check to. I really need my in fight function tested, even though it SHOULD work 100% of the time.