Code:
Program AirCrafter;
{.Include SRL\SRL.scar}
{.Include SRL\SRL\Misc\FaladorColorFinder.scar}
{.Include SRL\SRL\Skill\RuneCrafting.scar}
{ Wizzups Aircrafter version 0.72.
Set up the Colors and Declare players.
32-Bit.
Low Detail.
Notes : Progress report is unaccurate when using pouches.
Known Bugs : Sometimes does not find the Altar. (quite rare)
Players[0].Boolean1 := true; // For Talisman, set False; for Tiara set True;
Players[0].String1 := 'NoPouch' // What pouch are you using, if any.
Players[0].Extended2 := 5 // How many air runes do you craft per Rune Essence? }
Const StartPlayer = 0; // Player you wish to start with.
Const Loads = 5; // Loads per User.
Const SetMouseSpeed = 25; // 25 Would be fine.
Const Debug = True; // Debug messages ?
Const WallColorTol = 25; // 25 Would be fine.
Var Ess,Airs,Essence,WallBMP,AirAltar: Integer;
// **************************************************************************
{ Declare your players in this procedure. }
// **************************************************************************
Procedure DeclarePlayers;
Begin
HowManyPlayers := 1;
NumberOfPlayers( HowManyPlayers );
CurrentPlayer := StartPlayer;
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Loc := 'Falador';
Players[0].Boolean1 := True;
Players[0].String1 := 'NoPouch'
Players[0].Active:=True;
Players[0].Extended2 := 5;
Players[1].Name := '';
Players[1].Pass := '';
Players[1].Nick := '';
Players[1].Loc := 'Falador';
Players[1].Boolean1 := True;
Players[1].String1 := 'NoPouch'
Players[1].Active:=True;
Players[1].Extended2 := 1;
Players[2].Name := '';
Players[2].Pass := '';
Players[2].Nick := '';
Players[2].Loc := 'Falador';
Players[2].Boolean1 := True;
Players[2].String1 := 'NoPouch'
Players[2].Active:=True;
Players[2].Extended2 := 1;
Players[3].Name := '';
Players[3].Pass := '';
Players[3].Nick := '';
Players[3].Loc := 'Falador';
Players[3].Boolean1 := True;
Players[3].String1 := 'NoPouch'
Players[3].Active:=True;
Players[3].Extended2 := 1;
Writeln( IntToStr ( HowManyPlayers ) + ' Players' );
End;
// *******************************************************//
Function WizRadialWalk(TheColor:Integer; StartRadial,EndRadial:Integer; Radius:Integer; Xmod,Ymod,MX,MY:integer): Boolean;// By Wizzup? and WT-Fakawi.
Var i: Integer;
Var X1,Y1: integer;
Begin
Result:=False;
If StartRadial<EndRadial Then
Begin
Repeat
For i:=StartRadial To EndRadial Do
Begin
x1:=Round ( Radius * Sine[i]) + 646;
y1:=Round (- Radius * Cose[i]) + 84;
If FindColor(X,Y,TheColor,X1,Y1,X1+1,Y1+1) Then
Begin
MouseFindNoFlag(X+MX,Y+MY,Xmod,Ymod);
Result:=True;
FindNormalRandoms;
FFlag(10);
Exit;
End
End
Radius:=Radius-4;
Until Radius<=1 ;
End
If StartRadial>EndRadial Then
Begin
Repeat
For i:=StartRadial Downto EndRadial Do
Begin
x1:=Round ( Radius * Sine[i]) + 646;
y1:=Round (- Radius * Cose[i]) + 84;
If FindColor(X,Y,TheColor,X1,Y1,X1+1,Y1+1) Then
Begin
MouseFindNoFlag(X+MX,Y+MY,Xmod,Ymod);
Result:=True;
FindNormalRandoms;
FFlag(10);
Exit;
End
End
Radius:=Radius-4;
Until Radius<=1;
End
End;
// ***************************************************************************\\
Procedure Fillmem;
Begin
Essence := BitmapFromString(8, 8, 'z78DA8D8C410E802010C4BE' +
'2438B3C01110FEFF24372C0712259A26BDB5E2989904BC58A7858' +
'D6D3ACAA198B378F1AC14A5332AC36287CD8789A762D58F964043' +
'63A053CC76D87D3C0ACAB4B5BBC3A8D09194E197F651E142C057B' +
'5B4C8A062D5D2EEAA1BE50F5397');
WallBMP := BitmapFromString(5, 5, 'z78DA73747134B670721C642' +
'400B2C5243C');
AirAltar := BitmapFromString(98, 1, 'z78DA65905BB2C4200844B' +
'7843C043F27F1BAFF250D289961EA56CA961CE83646A6DC4D0CD4' +
'14CD7C7FF9826E470738C3AA3E078AD1EBAC31733D1AA483985C5' +
'EC1D1CF4CBAA2CE6E99747AD4BA648E55F2B8BE7C9370754F01FE' +
'DB69BDA8661778B0CA121511F0B7FB105FF4A34D9417CF9C0F8DD' +
'CE0E1FA9048F8E75526BAB965CE763999CE165B497B92958C9090' +
'912EBAC2BB9F4E3D6BC389D3BB42E224F8A2C57136EC7CDB69C62' +
'3EE2EE81524B15D378E494C2D245DBF7A328BFA3ECBCCB9B5159E' +
'E49CCBE05F3CFCEF8E266FFB007A9B');
End;
// ***************************************************************************\\
Function GetRoadColor(var TheNewColor:Integer;MaxTol:Integer):Boolean;
Var RTol,RoadBitMap,Fx,Fy:Integer;
Begin
RoadBitMap := BitmapFromString(4, 4, 'z78DA33373673367334A7' +
'190900172C15A1');
Repeat
RTol := Rtol+1
Until ( FindBitMapToleranceIn(RoadBitMap,Fx,Fy,MMX1,MMY1,MMX2,MMY2,RTol)
Or (Rtol > MaxTol))
If Not (RTol > MaxTol) Then
Begin
Result := True;
TheNewColor := GetColor(Fx,Fy);
WriteLn('TheNewColor := '+IntToStr(TheNewColor));
End
Else Result := False;
Rtol := 0;
FreeBitMap(RoadBitMap);
End;
// **************************************************************************
Procedure EnterAltar;
Var C,D: Integer;
Begin
GetRoadColor(RoadColor,35);
Repeat
D := D+1;
If Players[CurrentPlayer].Boolean1 = True Then
Begin
Repeat
C:= C + 1;
Wait( 1000 + Random( 50 ) );
Until ( FindObj(x, y, 'nter', 3686464, 5) Or (C > 3) )
If (C > 3) Then Begin LogOut; Exit; End;
C:= 0;
If LoggedIn Then Mouse(x, y, 0, 0, True);
End
Else
Begin
UseItem( 1 );
Repeat
C:= C + 1;
Wait( 1000 + Random( 50 ) );
Until ( FindObj(x, y, 'uins', 3686464, 5) Or (C > 3) )
If (C > 3) Then Begin LogOut; Exit; End;
C:= 0;
If LoggedIn Then Mouse(x, y, 0, 0, True);
End;
Flag;
Wait(1000+Random(500))
Until (Not FindColor(x,y,RoadColor,MMX1,MMY1,MMX2,MMY2) Or (D > 10));
D := 0;
Wait(3000+Random(2000))
Players[CurrentPlayer].Loc := 'Altar';
End;
// **************************************************************************
Procedure ToAltar;
Var Dx,Dy,Ex,Ey: Integer;
Begin
WizRadialWalk(WaterColor,180,250,70,1,1,5,0);
Wait(5000+Random(500));
FFlag(10);
SymbolAccuracy := 0.8;
Repeat
FindNormalRandoms;
WizRadialWalk(WaterColor,180,250,40,1,1,10,0);
Until(FindSymbol(Dx,Dy,'tree'));
FindNormalRandoms;
Mouse(Dx,Dy,2,2,True);
Wait(7000+Random(500));
FFlag(10);
FindNormalRandoms;
Mouse(650, 120, 5, 5, True);
FFlag(10);
Repeat
Mouse(625, 120, 5, 5, True);
FFlag(10);
Until (Not FindSymbol(Ex,Ey,'spin'))
EnterAltar;
End;
// **************************************************************************
Function ClickAirAltar: Boolean;
var
acc:extended;
var
Dx, Dy: integer;
begin
MarkTime(Mark);
Repeat
FindDeformedBitmapToleranceIn(AirAltar, Dx, Dy, MSX1,MSY1,MSX2,MSY2, 5, 1, True, acc);
begin
AddToReport('acc'+FloatToStr(acc));
if (acc >= 0.1) then
begin
Mouse(Dx+20+Random(20),Dy,0,0,True);
Result:=True;
Exit;
end
else
WWait(100);
end;
until TimeFromMark(Mark)>30000;
end;
// ***************************************************************************
Procedure Craft;
Begin
ClickAirAltar;
Case Players[CurrentPlayer].String1 Of
'NoPouch' : Wait( 1 );
'Small' : Begin ClickPouch('Small', 'Empty', 10); ClickAirAltar; End;
'Medium' : Begin ClickPouch('Small', 'Empty', 10); ClickPouch('Medium', 'Empty', 10); ClickAirAltar; End
'Large' : Begin ClickPouch('Small', 'Empty', 10); ClickPouch('Medium', 'Empty', 10); ClickPouch('Large', 'Empty', 10); ClickAirAltar; End;
'Giant' : Begin ClickPouch('Small', 'Empty', 10); ClickPouch('Medium', 'Empty', 10); ClickPouch('Large', 'Empty', 10); ClickAirAltar; ClickPouch('Giant', 'Empty', 10); ClickAirAltar; End;
End;
Wait(3000 + Random( 500 ) );
End;
// **************************************************************************
Procedure EnterPortal;
Var C : Integer;
Begin
Wait(2500+Random(800));
Repeat
Wait(100+Random(50));
C:=C+1;
Until(FindObj(x, y, 'se', 11132641, 20) Or (C > 5));
Mouse(x,y,0,0,True);
If C>5 Then Begin LogOut; Exit; End;
C:=0;
Flag;
Wait(4000+Random(500));
GetRoadColor(RoadColor,35)
End;
// **************************************************************************
Procedure ToBank;
Var FB1,FB2,FB3: Integer;
Begin
FB1 := DTMFromString('78DA636C66626008634001972E5E66F80FA41' +
'981F83F1030B601D5C4A0AAF9F38789810BAA0604189B8850D345' +
'580D00CA7B110D');
FB2 := DTMFromString('78DA63EC61626008614001478F1E65F80FA41' +
'981F83F1030F602D544A1AAF9F38789810BAA0604182712A1662A' +
'504D247E3500C2961107');
FB3 := DTMFromString('78DA636C646260086140038C0CFFC12403C37' +
'F206004A9894255F1E70F130317540D58472B504D3401359D4035' +
'31F8D50000978B0E8E');
MarkTime(Mark);
RoadColor := RoadColor;
Repeat
If ( Not ( LoggedIn ) Or (WeAreDead) Or ( TimeFromMark ( Mark ) > 120000 ) ) Then Break;
RadialWalk(RoadColor, 70, 160, 50 + Random ( 10 ), -1, -1);
FindNormalRandoms;
Until FindColor(x,y, WaterColor, MMX1, MMY1, MMX2, MMY2)
RadialWalk(RoadColor, 350, 390, 50 + Random ( 10 ), -1, -1);
If ( Random( 5 ) > 3 ) Then SetRun( True );
MarkTime(Mark);
Repeat
If ( Not ( LoggedIn ) Or (WeAreDead) Or ( TimeFromMark ( Mark ) > 120000 ) ) Then Break;
RadialWalk(RoadColor, 350, 390, 50 + Random ( 10 ), -1, -1);
FindNormalRandoms;
Until FindColor(x, y, WaterColor, MMX1, MMY1, MMX2, MMY2)
RadialWalk(RoadColor, 350, 390, 50 + Random ( 10 ), -1, -1);
FindNormalRandoms;
Wait( 1000 + Random( 500 ) );
Repeat
WizRadialWalk(WaterColor,300,350,70,+1,+1,+20,0);
FindNormalRandoms;
Until(FindColor(x,y,BankColor,MMX1,MMY1,MMX2,MMY2));
Flag;
DTM3Flag(FB1, FB2, FB3, True);
Flag;
FreeDTM(FB1);
FreeDTM(FB2);
FreeDTM(FB3);
Players[CurrentPlayer].Loc := 'Falador';
End;
{ **************************************************************************
Procedure WithdrawAllBitMapTol(BitMap,Tol:Integer);
Withdraws a item from the bank.
***************************************************************************}
Procedure WithdrawAllBitMapTol(BitMap, Tol:Integer);
Begin
If FindBitMapToleranceIn(BitMap, x, y, MSX1, MSY1, MSX2, MSY2, Tol) Then
Begin
Mouse(x, y, 2, 2, False);
ClickOption('All', 1);
If Debug Then WriteLn( 'BitMap Found.' );
End
Else
Begin
WriteLn ( 'BitMap Not Found, Out of Item.' );
CloseWindow;
LogOut;
Exit;
End;
End;
{ **************************************************************************
Procedure DepositAllBitMapTol(BitMap,Tol:Integer);
Deposits a item from the inv to bank.
***************************************************************************}
Procedure DepositAllBitMapTol(BitMap, Tol:Integer);
Begin
If FindBitMapToleranceIn(BitMap, x, y, MIX1, MIY1, MIX2, MIY2, Tol) Then
Begin
Mouse(x, y, 2, 2, False);
ClickOption('All', 2);
End
End;
{ **************************************************************************
Banks.
***************************************************************************}
Procedure Bank;
Var J: Integer;
Begin
Flag;
FindNormalRandoms;
If ( Not ( LoggedIn ) Or (WeAreDead) ) Then Exit;
OpenBankColor( 10726323 );
DepositAllBitMapTol(AirRune, 25);
Wait( 200 + Random( 200 ) );
WithdrawAllBitMapTol(Essence ,10);
CloseWindow;
Begin
Case Players[CurrentPlayer].String1 Of
'NoPouch' : Wait( 1 );
'Small' : Begin
ClickPouch('Small', 'Fill', 10);
Wait( 50 + Random( 100 ) );
OpenBankColor( 10726323 );
WithdrawAllBitMapTol(Essence, 10);
Wait( 500 + Random( 200 ) );
CloseWindow;
End;
'Medium' : Begin
ClickPouch('Small', 'Fill', 10);
Wait( 50 + Random( 100 ) );
ClickPouch('Medium', 'Fill', 10);
Wait( 50 + Random( 100 ) );
OpenBankColor( 10726323 );
WithdrawAllBitMapTol(Essence, 10);
Wait( 500 + Random( 200 ) );
CloseWindow;
End;
'Large' : Begin
ClickPouch('Small', 'Fill', 10);
Wait( 50 + Random( 100) );
ClickPouch('Medium', 'Fill', 10);
Wait(50+Random(100) );
ClickPouch('Large', 'Fill', 10);
Wait(50 + Random( 100 ) );
OpenBankColor( 10726323 );
WithdrawAllBitMapTol(Essence, 10);
Wait( 500 + Random( 200 ) );
CloseWindow;
End;
'Giant' : Begin
ClickPouch('Small', 'Fill', 10);
Wait(50 + Random( 100) );
ClickPouch('Medium', 'Fill', 10);
Wait(50 + Random( 100 ) );
ClickPouch('Large', 'Fill' ,10);
Wait(50 + Random( 100 ) );
OpenBankColor( 10726323 );
WithdrawAllBitMapTol(Essence, 10);
Wait( 500 + Random( 200 ) );
CloseWindow;
ClickPouch('Giant', 'Fill', 10);
Wait(50 + Random( 100 ) );
OpenBankColor( 10726323 );
WithdrawAllBitMapTol(Essence, 10);
End;
End;
End;
CloseWindow;
Wait( 1000 + Random( 500 ) );
FindNormalRandoms;
Banks := Banks + 1;
Players[CurrentPlayer].Banked := Players[CurrentPlayer].Banked+1;
{
Case I Of
1: If Players[CurrentPlayer].Extended1 < 11 Then Players[CurrentPlayer].Integer1 := 1;
2: If ((Players[CurrentPlayer].Extended1 < 22) And (Players[CurrentPlayer].Extended1 > 11)) Then Players[CurrentPlayer].Integer1 := 2;
3: If ((Players[CurrentPlayer].Extended1 < 33) And (Players[CurrentPlayer].Extended1 > 22)) Then Players[CurrentPlayer].Integer1 := 3;
4: If ((Players[CurrentPlayer].Extended1 < 44) And (Players[CurrentPlayer].Extended1 > 33)) Then Players[CurrentPlayer].Integer1 := 4;
5: If ((Players[CurrentPlayer].Extended1 < 55) And (Players[CurrentPlayer].Extended1 > 44)) Then Players[CurrentPlayer].Integer1 := 5;
6: If ((Players[CurrentPlayer].Extended1 < 66) And (Players[CurrentPlayer].Extended1 > 55)) Then Players[CurrentPlayer].Integer1 := 6;
7: If ((Players[CurrentPlayer].Extended1 < 77) And (Players[CurrentPlayer].Extended1 > 66)) Then Players[CurrentPlayer].Integer1 := 7;
8: If ((Players[CurrentPlayer].Extended1 < 88) And (Players[CurrentPlayer].Extended1 > 77)) Then Players[CurrentPlayer].Integer1 := 8;
9: If ((Players[CurrentPlayer].Extended1 < 99) And (Players[CurrentPlayer].Extended1 > 88)) Then Players[CurrentPlayer].Integer1 := 9;
10: If Players[CurrentPlayer].Extended1 = 99 Then Players[CurrentPlayer].Integer1 := 10;
End; }
Case J Of
1: If Players[CurrentPlayer].String1 = 'NoPouch' Then Players[CurrentPlayer].Extended2 := 0;
2: If Players[CurrentPlayer].String1 = 'Small' Then Players[CurrentPlayer].Extended2 := 3;
3: If Players[CurrentPlayer].String1 = 'Medium' Then Players[CurrentPlayer].Extended2 := 9;
4: If Players[CurrentPlayer].String1 = 'Large' Then Players[CurrentPlayer].Extended2 := 16;
5: If Players[CurrentPlayer].String1 = 'Giant' Then Players[CurrentPlayer].Extended2 := 28;
End;
If Players[CurrentPlayer].Boolean1 = True Then Players[CurrentPlayer].Integer2 := Players[CurrentPlayer].Integer2 + ( ( 28 + Round(Players[CurrentPlayer].Extended2)) * Players[CurrentPlayer].Integer1)
Else Players[CurrentPlayer].Integer2 := Players[CurrentPlayer].Integer2 + ( ( 27 + Round(Players[CurrentPlayer].Extended2)) * Players[CurrentPlayer].Integer1);
End;
// ***************************************************************************\\
Procedure PlayerStats;
Var Active: String;
Var I: Integer;
Begin
For I := 0 to HowManyPlayers - 1 Do
Begin
If Players[i].Active=True Then Active := 'True' Else Active := 'False';
WriteLn((IntToStr(I))+' : '+Players[i].name+ ' = '+Active+', Banks = '+ IntToStr(Players[I].Banked)+'.'+', Loc: '+ Players[I].loc+', RC Lvl = ' + FloatToStr(Players[I].Extended1)+' - Airs Crafted : '+ IntToStr (Players[CurrentPlayer].Integer2)+'.');
End
WriteLn( '<============== Wizzups? Player Report V 0.71 ===============>');
End;
// ***************************************************************************\\
Procedure ProgressReport;
Begin
WriteLn( ' ' );
WriteLn( '<============== Wizzups? Aircrafter Report V 0.73 ===============>');
WriteLn( 'Worked for '+ ( TimeRunning ) );
WriteLn( 'Gained ' + IntToStr ( Ess * 5 ) + ' Runecrafting Experience.' );
WriteLn( 'Gaining approx ' + IntToStr ( 28 * 5 * 22) + ' Runecrafting Experience a hour.' );
WriteLn( 'Made ' + IntToStr ( ( Airs ) * 20 ) + ' Gold pieces.' );
WriteLn( 'Crafted ' + IntToStr ( Airs ) + ' Air Runes.' );
WriteLn( 'Made ' + IntToStr ( Banks ) + ' Trips.' );
WriteLn( '<============== Wizzups? Aircrafter Report V 0.71 ===============>');
WriteLn('');
WriteLn( '<============== Wizzups? Player Report 0.71 ===============>');
WriteLn('');
PlayerStats;
End;
// ***************************************************************************\\
Procedure SetUp;
begin
SetupSRL;
SetUpSRLRuneCrafting;
Fillmem;
BenMouse := False;
MouseSpeed := SetMouseSpeed;
DeclarePlayers;
CurrentPlayer := StartPlayer;
LoginPlayer;
NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
end;
// ***************************************************************************\\
Begin
SetUp;
SymbolAccuracy:=0.4
FindFaladorBasicColors;
SymbolAccuracy:=0.8
Repeat
If Players[CurrentPlayer].loc = 'Falador' Then
Begin
Bank;
ToAltar;
End;
If Players[CurrentPlayer].loc = 'Altar' Then
Begin
Craft;
EnterPortal;
ToBank;
End;
If Players[CurrentPlayer].Boolean1 = True Then
Airs := ( Ess + (28 * Round(Players[CurrentPlayer].Extended2)) )
Else
Airs := ( Ess + (27 * Round(Players[CurrentPlayer].Extended2)) )
If Players[CurrentPlayer].Boolean1 = True Then
Ess := ( Ess + 28 )
Else
Ess := ( Ess + 27 )
If ((LoggedIn) and (Players[CurrentPlayer].Banked mod Loads = 0) ) then
Begin
LogOut;
NextPlayer(True);
End;
ProgressReport;
If (Not(Loggedin)) Then NextPlayer(False);
Until( False )
End.