SRL Archive - Archive

Entry #3


Sir R. M8gic1an

2010-08-02 08:11:11


Program AirCrafter; //By mrpickle
// Thanks to Frement and Ogre (dillon) for much assistance in helping me pinpoint where doesn't work, and testing.
// Thanks to others like Nava & I luvz yeww for getting me to switch to Simba... which solved most problems.


{.include srl/srl.scar}
{.include srl/srl/skill/RuneCrafting.scar}
// Mid Point Map = 627,85

type
Grids = record
gX :Integer;
gY :Integer;
end;
//var MyGrids: Grids;


var
WestBankTree1,WestBankTree2,WestBankTree3,WestBankTree4,WestBankTree5,WestBankTree6,AirTiara,AirTiara2 , AirTalisman, RuneEssence, AirRune:Integer;
TiaraCheck,TalismanCheck,EssReady:Boolean;
TP : TPoint;
x,y,Index,WaitAmount:Integer;
ExpGained, AirRunesCreated, NumRuns, RuneEssenceUsed,MarkStart:Integer;


const
PixelInGrid = 4;

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;


Players[0].Name := 'ewryewu'; // Bot username.
Players[0].Pass := 'weher'; // Bot password.
Players[0].Nick := 'erhw'; // 3-4 letters of whatever you wanna name this bot.
Players[0].Active := True; // Do you wanna use it?
Players[0].Integers[1] := 1000; // How many loads to do.

// Delete the brackets for the amount of players you want to use.
// And edit the HowManyPlayers.

{
Players[1].Name := ''; // Your RS username.
Players[1].Pass := ''; // Your RS password.
Players[1].Nick := ''; // 3-4 letters of your RS username.
Players[1].Active := True; // Is player active?
Players[1].Integers[1] := 30; // How many loads to do.
}

{
Players[2].Name := ''; // Your RS username.
Players[2].Pass := ''; // Your RS password.
Players[2].Nick := ''; // 3-4 letters of your RS username.
Players[2].Active := True; // Is player active?
Players[2].Integers[1] := 30; // How many loads to do.
}

{
Players[3].Name := ''; // Your RS username.
Players[3].Pass := ''; // Your RS password.
Players[3].Nick := ''; // 3-4 letters of your RS username.
Players[3].Active := True; // Is player active?
Players[3].Integers[1] := 30; // How many loads to do.
}
end;

Procedure SetCompass(High:Boolean; Degrees:Integer);
begin
SetAngle(High);

if(not(rs_GetCompassAngleDegrees = Degrees))then
begin
MakeCompass(Degrees);
end;
Writeln('Compass Set');
end;


Procedure LoadBitmapsDTMs;
begin
WestBankTree1 := BitmapFromString(1, 2, 'beNrT5VIOEYkCAANQAR0=');
WestBankTree2 := BitmapFromString(1, 2, 'beNrT5TJOkowCAAPEAUA=');
WestBankTree3 := BitmapFromString(1, 2, 'beNrT51YIEw0HAANaAR0=');
WestBankTree4 := BitmapFromString(1, 2, 'beNrT5VELEYsFAANtASc=');
WestBankTree5 := BitmapFromString(1, 2, 'beNoz4lSMFI4AAANsASE=');
WestBankTree6 := BitmapFromString(1, 2, 'beNrT51YME40AAANfAR8=');

AirRune := DTMFromString('78DA63B461666058CBC8800CEE5EB902A661A' +
'28C2E4035CB51D5303030A1AA7100AA5942400DC8AEC504D49811360' +
'70073AC071D');
AirTiara := DTMFromString('78DA63AC666660D8CCC8800CEE5FBB0AA661A' +
'28C7940359B50D5303030A1AAC905AA5945404D07116A5A806A36E05' +
'70300FC9E087C');
AirTiara2 := DTMFromString('78DA63B4626660D8CAC8800C1E5CBF06A661A' +
'28CBA4035EB51D5303030A1AAD103AA5943408D27116A9C806A76E25' +
'703007A0D0749');
AirTalisman := DTMFromString('78DA63EC62626098C8C8800C3EBF7C01A661A' +
'28C4D40355351D5303030A1AAE907F26713503311C86F20A0661690D' +
'F8A5F0D000AC90872');
RuneEssence := DTMFromString('78DA635CCFC8C0B01D8891809FB7179886893' +
'282D4EC4155E3E2E888AA0664C611026A5600593B08A8590B64ED22A' +
'0661D90B51BBF1A001E440D56');


{ AirTiara := BitmapFromString(19, 1, 'beNorK8vLzAwPDmZgYISjJXPnrl' +
'i4YPGc2feuXpkxaRKQLMnPR1YARNUAIGERaw==');

RuneEssence := BitmapFromString(27, 1, 'beNpjYGJgYLKxtHS0s3Nzdvb28A' +
'AiXy8vCArw8YGgIH8/CAoJDASisOBgIIoMDQWi6PDw2MjI5Pj4rNT' +
'UvMxMBgBdIBex');

AirRune := srl_GetBitmap(18);
AirTalisman := srl_GetBitmap(31); // These bitmaps have failed me xD

AirRune := BitmapFromString(18, 1, 'beNprbclJT7975XJBdnZRbm5Jfj6' + //
'QDUFVJSUQRn1VVWNNdXNdLVyqCwCSSiMh');

AirTalisman := BitmapFromString(1, 11, 'beNoLD2dgYHpw/RoQARm+Xl4BP' +
'j4rFi6EoLDg4GgA7UsOqw=='); }
end;

// Click. True = Left click, False = Right Click
function MouseAroundForUpTextEx(UpText:String; WaitMs, NumTrials, x1, y1, x2, y2: Integer; Click :Boolean): Boolean;
var
x, y, i: integer;

begin
Result := False;
repeat
x := Random(x2 - x1);
y := Random(y2 - y1);
MMouse(x1, y1, x, y);
Wait(WaitMs + Random(150));
if (IsUpText(UpText)) then
begin
GetMousepos(x, y);
Mouse(x, y, 0, 0,Click);
Result:= True;
Exit;
end;
Wait(WaitMs + Random(150));
Inc(i);
until (i > NumTrials);
end;

Function WaitForBitmap(Bitmap,SearchRate,TimeBeforeStop:integer):Boolean;
var timer:integer;
begin
Result := False;
timer := 0;
Repeat
wait(SearchRate);
Timer := Timer + 1
writeln('Waiting for bitmap' + Inttostr(Bitmap));
If Timer > TimeBeforeStop then
begin
Writeln ('Bitmap '+ InttoStr(Bitmap) + ' Took too long to load');
break;
end;
Until(FindBitmap(Bitmap,x,y));
if(FindBitmap(Bitmap,x,y))then
Result := true;
//FreeBitmap(Bitmap);
end;

Function DTMexistsInv(DTM:Integer):Boolean;
begin
If(FindDTM(DTM,x,y,549,206,737,463))then
begin
result := True;
end else
begin
result := False;
end;
end;

Procedure InitializePlayer;
var
Slot1:TPoint;
xTo,yTo,Count:Integer;
begin
LoginPlayer;

SetCompass(True,0);

If(not(GetCurrentTab = 25))Then ////// To Inventory
begin
Mouse(650,180,12,14,true); //GameTab(25) // GameTab has a delay that I dont like.
wait(750+random(500));
end;

If(FindDTM(AirTiara2,x,y,549,206,737,463))Then
begin
Writeln('Equiping Air Tiara');
Mouse(x,y,4,3,true);
wait(550+random(250));
//TiaraCheck := True;
end;

If(FindDTM(AirTalisman,x,y,549,206,737,463))Then
begin
If not(CoordsToItem(x,y) = 1)Then
begin
Slot1 := ItemCoords(1);
xTo := Slot1.x;
yTo := Slot1.y;
DragMouse(x,y,4,3,xTo,yTo,3,3);
Writeln('Air Talisman moved to Slot 1');
end else
begin
Writeln('Air Talisman found in Slot 1');
end;
wait(250+random(250));
TalismanCheck := True;
end;


Mouse(677,175,12,14,true);//GameTab(26)////// To Equip Section!
wait(1550+random(500));
If(FindDTM(AirTiara,x,y,624,213,659,244))Then
begin;
Writeln('Found Air Tiara equiped');
TiaraCheck := True;
end;

Mouse(650,180,12,14,true); //GameTab(25)

If(Not BankScreen)Then
begin
Repeat
If(OpenBank('vwb',true,true))then //its so slow.... and fails alot
break;
Wait(100);
Count := Count + 1;
If (Count > 2)and(count < 5) then
begin
// If(MouseAroundForUpTextEx('booth',250, 1,30,5,130,176,false))Then
If(SpiralMouse(x,y,18,20,300,240,'ooth',30,12)) Then
begin
Mouse(x,y,0,0,false);
wait(650+random(350));
ChooseOption('uickl');
break;
end;
end;
If (Count > 4) then
begin
// If(MouseAroundForUpTextEx('booth',250, 1,368,53,438,216,false))Then
If(SpiralMouse(x,y,302,5,495,272,'ooth',40,10)) Then
begin
Mouse(x,y,0,0,false);
wait(650+random(350));
ChooseOption('uickl');
break;
end;
end;
If (Count > 8) then
begin
writeln('cannot find Bank');
logout;
terminateScript;
end;
Until(BankScreen);
count := 0;
end;

wait(1000+random(700));

If(TiaraCheck) Then
begin
DepositAll;
TalismanCheck := False;
end;

If(Not(TiaraCheck)) and (TalismanCheck)Then
begin
Deposit(2, 28, True);
end;

wait(1000+random(500));
FixBank;
If(FindDTM(RuneEssence,x,y,24, 83,479, 292))then
begin
TP := MSTPointToBankPoint(Point(x,y));
x := TP.x;
y := TP.y;
// Index := BankPointToBankIndex(TP);
If(Withdraw(x, y, 99))Then
begin

writeln('We have gotten New Rune Essence');
CloseBank;
Mouse(650,180,12,14,true); // Gametab(25);
EssReady := True;

end;
end;
If(EssReady)Then
begin
writeln('Player Ready To go for first Run');
end else
begin
writeln('Player failed....');
terminateScript;
end;
end;

Procedure StartNextPlayer;
var i:integer;
begin
logout;
Players[CurrentPlayer].Active := False;
repeat
If((HowManyPlayers - 1) > (CurrentPlayer + i ))Then
begin
If(Players[CurrentPlayer].Active = True)Then
begin
writeln('Player ' + inttoStr(CurrentPlayer) + ' is up');
TiaraCheck := False;
TalismanCheck := False;
InitializePlayer;
end;
end;
inc(i);
Until (AllPlayersInactive);
end;


Procedure TryingToKeepYouUnBanned;
begin
case Random(225) of
0..13 : Wait(1);
14-15 :
begin
HoverSkill('runecrafting', False);
GameTab(25);
end;
16-17 :
begin
GameTab(22);
Wait(1000 + Random(3000));
GameTab(25);
end;
18-20 :
begin
if (Random(2) = 1) then
begin
Keydown(VK_RIGHT);
KeyDown(Vk_Down);
Wait(300+random(1500));
KeyUp(VK_RIGHT);
KeyUp(Vk_Down);
end else
begin
Keydown(VK_LEFT);
Wait(300 + Random(1500));
KeyUp(VK_LEFT);
end;
Wait(1400 + Random(1400));
MakeCompass('N');
end;
21 - 60: MMouse(Random(500), Random(500), 0, 0);
61 - 80: RandomRClick;
81 - 99: PickUpMouse;
end;
end;

Function StartGridFromBank:Grids;
var ToStartGridx,ToStartGridy:Integer;
begin
if (not (LoggedIn)) then Exit;
if (not (TiaraCheck))and (not(TalismanCheck)) then Exit;
FindNormalRandoms;
If(FindBitmapToleranceIn(WestBankTree1,x,y,550,80,665,125,15) xor FindBitmapToleranceIn(WestBankTree2,x,y,550,80,665,125,15) xor FindBitmapToleranceIn(WestBankTree3,x,y,550,80,665,125,15) xor FindBitmapToleranceIn(WestBankTree4,x,y,550,80,665,125,15)xor FindBitmapToleranceIn(WestBankTree5,x,y,550,80,665,125,15)xor FindBitmapToleranceIn(WestBankTree6,x,y,550,80,665,125,15))Then
begin
ToStartGridx := x + 45;
ToStartGridy := y + 4;

Mouse(ToStartGridx,ToStartGridy,0,2,true);

With Result do
begin
gX := 57;
gY := 0;
end;
end else
begin
Mouse(627,85+6*PixelInGrid,0,0,true); // Moved character north abit. attemps to fix this problem
If(FindBitmapToleranceIn(WestBankTree1,x,y,550,80,665,125,15) xor FindBitmapToleranceIn(WestBankTree2,x,y,550,80,665,125,15) xor FindBitmapToleranceIn(WestBankTree3,x,y,550,80,665,125,15) xor FindBitmapToleranceIn(WestBankTree4,x,y,550,80,665,125,15)xor FindBitmapToleranceIn(WestBankTree5,x,y,550,80,665,125,15)xor FindBitmapToleranceIn(WestBankTree6,x,y,550,80,665,125,15))Then
begin
ToStartGridx := x + 45;
ToStartGridy := y + 4;

Mouse(ToStartGridx,ToStartGridy,0,2,true);

With Result do
begin
gX := 57;
gY := 0;
end;
end;
end;
end;


// Positivex = right Positivey = down
// and only ~80% accurate in terms of going exactly on the wanted grid
Function MoveGrids(MoveXGrid,MoveYGrid:Integer):Grids;
begin
Mouse(627+MoveXGrid*PixelInGrid,85+MoveYGrid*PixelInGrid,0,0,true);
With result do
begin
gX := gX + MoveXGrid;
gY := gY + MoveYGrid;
end;
end;


procedure FlagWait(MiliSeconds:Integer);
begin
if (FlagPresent) then
begin
repeat
wait(450+random(550));
until (FlagPresent = false)//(FFlag(15))
wait(MiliSeconds+random(400));
end;
end;


Procedure ToAltar;
begin
if (not (LoggedIn)) then Exit;
if (not (TiaraCheck))and (not(TalismanCheck)) then Exit;
FindNormalRandoms;
If(RunEnergy(35))Then
begin
WaitAmount := 400; // saves a tiny insignificant amount of time.
end else
begin
WaitAmount := 500;
end;

MoveGrids(-13,4);
FlagWait(WaitAmount);

MoveGrids(-9,8);
FlagWait(WaitAmount);

MoveGrids(-12,5);
FlagWait(WaitAmount);

MoveGrids(-9,4);
FlagWait(WaitAmount);

MoveGrids(-10,10);
FlagWait(WaitAmount);
FindNormalRandoms;
end;

Procedure ToBank;
begin
if (not (LoggedIn)) then Exit;
if (not (TiaraCheck))and (not(TalismanCheck)) then Exit;
FindNormalRandoms;
If(RunEnergy(35))Then
begin
WaitAmount := 400;
end else
begin
WaitAmount := 500;
end;

MoveGrids(12,-9);
FlagWait(WaitAmount);

MoveGrids(9,-1);
FlagWait(WaitAmount);

MoveGrids(11,-1);
FlagWait(WaitAmount);

MoveGrids(9,-7);
FlagWait(WaitAmount);

MoveGrids(9,-8);
FlagWait(WaitAmount);

StartGridFromBank;
FlagWait(WaitAmount);

MoveGrids(2,-5);
FlagWait(WaitAmount);

end;

Function Bank(Bitmap:Integer):Boolean;
var
Count:integer;
exitCheck:Boolean;
Begin
If(Not Loggedin)Then Exit;
if (not (TiaraCheck))and (not(TalismanCheck)) then Exit;
FindNormalRandoms;
UseRewardBox;
If(Not BankScreen)Then
begin
Repeat
If(OpenBank('vwb',true,true))then //its so slow.... and fails alot
break;
Wait(100);
Count := Count + 1;
If (Count > 2)and(count < 5) then
begin
// If(MouseAroundForUpTextEx('booth',250, 1,30,5,130,176,false))Then
If(SpiralMouse(x,y,18,20,300,240,'ooth',30,12)) Then
begin
Mouse(x,y,0,0,false);
wait(650+random(350));
ChooseOption('uickl');
break;
end;
end;
If (Count > 4) then
begin
// If(MouseAroundForUpTextEx('booth',250, 1,368,53,438,216,false))Then
If(SpiralMouse(x,y,302,5,495,272,'ooth',40,10)) Then
begin
Mouse(x,y,0,0,false);
wait(650+random(350));
ChooseOption('uickl');
break;
end;
end;
If (Count > 8) then
begin
writeln('cannot find Bank');
logout;
terminateScript;
end;
Until(BankScreen);
count := 0;
end;

wait(1000+random(523));

If(BankScreen)Then
Begin
If(TalismanCheck) Then
begin
Deposit(2, 28, True);
end;
If(TiaraCheck)Then
begin
DepositAll;
end;

FixBank;
If(FindDTM(RuneEssence,x,y,24, 83,479, 292))then
begin
TP := MSTPointToBankPoint(Point(x,y));
x := TP.x;
y := TP.y;
// Index := BankPointToBankIndex(TP);
If(Withdraw(x, y, 99))Then
begin

writeln('We have gotten New Rune Essence');
CloseBank;
Gametab(25);
Result := True;

end;
end else
begin
Writeln('No More Rune Essence Detected, Logging out');
StartNextPlayer;
end;
End;
End;

Function EnterAltar:Boolean;
begin
if (not (LoggedIn)) then Exit;
if (not (TiaraCheck))and (not(TalismanCheck)) then Exit;
Result := False;

wait(1000+random(500));
If(TalismanCheck = true)Then
begin
If(FindDTM(AirTalisman,x,y,549,206,737,463))Then
begin
Mouse(x,y,4,5,True);
writeln('Entering Ruins');
repeat
If(EnterRCAltar)Then/////// // Not working well.
begin
Result := True;
exit;
end else///////
begin
wait(500+random(250)); // avoids problems with click + uptext
If(SpiralMouse(x,y,5,5,510,335,'ous ruins',31,16)) Then
begin
getMousePos(x,y);
Mouse(x,y,0,0,true);
Result := True;
exit;
end else
begin
Result := False;
end;
end;
until(MouseAroundForUptextEx('ltar',250,10,304,5,415,90,false))
end else
begin
writeln('a');
end;
end;

If(TiaraCheck = true)Then
begin
repeat
If(EnterRCAltar)Then////////
begin
Result := True;
exit;
end else
begin////////
wait(500+random(250)); // avoids problems with click + uptext
If(SpiralMouse(x,y,5,5,510,335,'ous ruins',35,8)) Then
begin
Mouse(x,y,0,0,true);
Result := True;
exit;
end else
begin
Result := False;
end;
end;
until(MouseAroundForUptextEx('ltar',250,10,304,5,415,90,false))
end;
end;

{
function AutoColorAirStone: Integer; // can't get auto colour to work =\... dosn't find color 4 somereason
var // a.k.a. I lost the dedication to learn this
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer; GetAmount( a.x,a.y));
H, S, L: Extended;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(1);

FindColorsSpiralTolerance(MMCX, MMCY, arP, 7037287, MMX1, MMY1, MMX2, MMY2, 0);
if (Length(arP) = 0) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
Exit;
end;

arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);

for i := 0 to arL do
begin
ColorToHSL(arC[i], H, S, L);

if (H >= 76.65) and (H <= 76.69) and (S >= 4.88) and (S <= 4.92) and (L >= 39.98) and (L <= 40.02) then
begin
ColorToXYZ(arC[i], X, Y, Z);

if (X >= 12.50) and (X <= 12.54) and (Y >= 12.47) and (Y <= 12.51) and (Z >= 15.64) and (Z <= 15.68) then
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
end;
end;

ColorToleranceSpeed(tmpCTS);

if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;

function FindAirStone(var x: Integer; var y: Integer): Boolean;
var
i: Integer;
TPA: TPointArray;
ATPA: T2DPointArray;

begin
if not(FindColorsTolerance(TPA, AutoColorAirStone, 361, 16, MSX2, MSY2, 5)) then //I'm finding all of the colors of the autocolor function (your coords will be different from mine)
Exit;
ATPA:= TPAToATPA(TPA, 20);

for i:= 0 to High(ATPA) do
begin
MiddleTPAEx(ATPA[i], x, y); //check each of these for uptext
MMouse(x, y, 3, 3);
Wait(50 + Random(50));
if (IsUpText('ous ruins')) then
begin
GetMousePos(x, y);
Result:= True;
Break;
end;
end;
end; }

Function ClickAirStone:boolean;
begin
if (not (LoggedIn)) then Exit;
if (not (TiaraCheck))and (not(TalismanCheck)) then Exit;
Result := False;
If(MouseAroundForUptextEx('ltar',250,30,304,5,415,90,True))Then
begin
wait(4700+random(500));
Result := True;
end else
begin
writeln('We Cannot find The air rock thingi');
StartNextPlayer;
end;
end;


Function ClickPortal:Boolean;
var
xRand,yRand:integer;
begin
if (not (LoggedIn)) then Exit;
if (not (TiaraCheck))and (not(TalismanCheck)) then Exit;
Result := False;
If(MouseAroundForUptextEx('al',250,7,164,318,205,337,True))then // have problems finding a longer version of this uptext
begin
Result := True;
exit;
end else
begin
writeln('MouseAround not working... we are gonna click anyways');
xRand := random(10);
yRand := random(5);
Mouse(182,327,xRand,yRand,true);
wait(500+random(250));
If(TiaraCheck)Then
begin
If(SpiralMouse(x,y,5,5,510,335,'ous ruins',35,8)) Then
begin
writeln('Backup worked for Click portal =D');
Result := True;
end else
begin
writeln('backup failed for Click portal =[... not sure where we are');
end;
end;

If(TalismanCheck)Then
begin
If(FindDTM(AirTalisman,x,y,549,206,737,463))Then
begin
Mouse(x,y,2,2,true);
If(SpiralMouse(x,y,5,5,510,335,'ous ruins',35,8)) Then
begin
writeln('Backup worked for Click portal =D');
Mouse(x,y,2,2,true);
Result := True;
end else
begin
writeln('backup failed for Click portal =[... not sure where we are');
StartNextPlayer;
end;
end;
end;

end;
end;

procedure AirAltar;
var
Cnt:Integer;
Tp:Tpoint;
begin
if (not (LoggedIn)) then Exit;
if (not (TiaraCheck))and (not(TalismanCheck)) then Exit;
If(EnterAltar)Then
repeat
wait(500+random(400));
MMouse(304,5,111,85);
If(IsUpText('ltar'))then
break;
inc(Cnt);
If (Cnt > 30) Then
begin
writeln('Timed out...Check Internet');
StartNextPlayer;
end;
until (False);
If(ClickAirStone)Then
begin
TryingToKeepYouUnBanned;
If(TalismanCheck)Then
begin
Tp := ItemCoords(2);
RuneEssenceUsed := RuneEssenceUsed + 27;
end;
If(TiaraCheck)Then
begin
Tp := ItemCoords(1);
RuneEssenceUsed := RuneEssenceUsed + 28;
end;

AirRunesCreated := AirRunesCreated + GetAmount(Tp.x,Tp.y);
ExpGained := AirRunesCreated * 5;
numRuns := numRuns + 1;


wait(1000+random(500));
If (ClickPortal) Then
begin
wait(3000+random(1000));
writeln('We are out of the Altar, heading back to bank');
end;
//wait(1500+random(1000));
end;
end;

Procedure ProgressReport;
begin
Writeln('//////////////////////////////////////////////////////////////');
Writeln('Thanks for using mrpickle"s AirCrafter');
Writeln('Script has been Running for ' + inttostr(TimeFromMark(MarkStart) div 1000) + ' Seconds');
Writeln('You have used '+ inttostr(RuneEssenceUsed) + ' Rune Essences');
Writeln('You"ve created '+ inttostr(AirRunesCreated) + ' Air Runes');
Writeln('You"ve gained '+ inttostr(ExpGained) + ' Experience');
Writeln('You have made '+ inttostr(numRuns) + ' runs to the altar');
Writeln('//////////////////////////////////////////////////////////////');
end;


Procedure BookMarkMain;
begin
end;

var ClearDebugCounter:Integer;
begin
setupSRL;
activateClient;
DeclarePlayers;

LoadBitmapsDTMs

MarkTime(MarkStart);
ClearDebugCounter := 0;
// setupRuneCrafting;
ExpGained := 0;
AirRunesCreated := 0;
NumRuns := 0;
RuneEssenceUsed := 0;

InitializePlayer;

repeat //SetCompass(True,0);
wait(1000+random(500));
StartGridFromBank;
FlagWait(500);
ToAltar;
AirAltar;
TryingToKeepYouUnBanned;
ToBank;
ProgressReport;
If(Bank(RuneEssence))Then
writeln('Another load we go!');
SetCompass(True,0);
TryingToKeepYouUnBanned;
If(ClearDebugCounter > 20)Then
begin
ClearDebug;
ClearDebugCounter := 0;
end;
until (False)
end.

~RM

Town

2010-08-04 14:27:41

Unreadable Notes:

no initial description

MouseAroundForUpTextEx little random, reminds me of the old FindObj

keep your standards consistent- uppercase/lowercase, indention

WaitForBitmap- search is after time check, may cause problems. if it breaks the loop it found the bitmap, don't check again. break loops if logged out.

Function DTMexistsInv(DTM:Integer):Boolean;
begin
If(FindDTM(DTM,x,y,549,206,737,463))then
begin
result := True;
end else
begin
result := False;
end;
end;

Function DTMexistsInv(DTM:Integer):Boolean;
begin
If(FindDTM(DTM,x,y,549,206,737,463))then
result := True;
else
result := False;
end;

unnecesary function, could have made constants if those numbers are actually that important

in InitializePlayer you use FindDTM instead of DTMexistsInv with the same coordinates. pick one.

end else
begin
Writeln('Air Talisman found in Slot 1');
end;

end else
Writeln('Air Talisman found in Slot 1');

check loggedin in loops. organize functions better. InitializePlayer is very long.

If(Withdraw(x, y, 99))Then could be random

If(FindDTM(RuneEssence,x,y,24, 83,479, 292))then
begin
TP := MSTPointToBankPoint(Point(x,y));
x := TP.x;
y := TP.y;
// Index := BankPointToBankIndex(TP);
If(Withdraw(x, y, 99))Then
begin

writeln('We have gotten New Rune Essence');
CloseBank;
Mouse(650,180,12,14,true); // Gametab(25);
EssReady := True;

end;
end;
If(EssReady)Then
begin
writeln('Player Ready To go for first Run');
end else
begin
writeln('Player failed….');
terminateScript;
end;
end;

no failsafe

Procedure StartNextPlayer;
var i:integer;
begin
logout;
Players[CurrentPlayer].Active := False;
repeat
If((HowManyPlayers - 1) > (CurrentPlayer + i ))Then
begin
If(Players[CurrentPlayer].Active = True)Then
begin
writeln('Player ' + inttoStr(CurrentPlayer) + ' is up');
TiaraCheck := False;
TalismanCheck := False;
InitializePlayer;
end;
end;
inc(i);
Until (AllPlayersInactive);
end;

break this loop?

0..13 : Wait(1); useless. i see your intention, though.

If(FindBitmapToleranceIn(WestBankTree1,x,y,550,80,665,125,15) xor FindBitmapToleranceIn(WestBankTree2,x,y,550,80,665,125,15) xor FindBitmapToleranceIn(WestBankTree3,x,y,550,80,665,125,15) xor FindBitmapToleranceIn(WestBankTree4,x,y,550,80,665,125,15)xor FindBitmapToleranceIn(WestBankTree5,x,y,550,80,665,125,15)xor FindBitmapToleranceIn(WestBankTree6,x,y,550,80,665,125,15))Then

wasted time.

Mouse(627,85+6*PixelInGrid,0,0,true); random failsafe

Bank(Bitmap:Integer) - bitmap never called

infinite loop in EnterAlter

xRand := random(10);
yRand := random(5);
Mouse(182,327,xRand,yRand,true);

unnecessary variables, random click

MMouse(304,5,111,85); random, chance

repeat
wait(500+random(400));
MMouse(304,5,111,85);
If(IsUpText('ltar'))then
break;
inc(Cnt);
If (Cnt > 30) Then
begin
writeln('Timed out…Check Internet');
StartNextPlayer;
end;
until (False);

infinite loop

Procedure BookMarkMain;
begin
end;

bitmaps, dtms not freed

ClearDebugCounter := 0;
// setupRuneCrafting;
ExpGained := 0;
AirRunesCreated := 0;
NumRuns := 0;
RuneEssenceUsed := 0;

automatic

infinite main loop

Integers[1] never referenced


Technique: 45/100.

All loops are repeat/until. Too many global variables. Many random mouse movements and clicks. Many unused variables and functions. Technique should be more precise and deliberate. Measure twice, move once.

Individuality: 65/100.

The attempt was there. Many SRL functions were converted to suit your needs. However, the implementation was imperfect.

Follow all SRL rules: 40/100.

Several infinite loops. DTMs/Bitmaps were not freed. Unnecessary global variables. Multiplayer implementation was unsuccessful. Loops and functions were not broken on logout.

Creativity: 70/100.

Ideas are unique. Grid walking was a nice addition. That was probably the highlight of the script, assuming it actually works 80% of the time.

Efficiency: 35/100.

Often unnecessary code. Unused functions and variables. Infinite loops. Repeated code that could have been replaced with a function. Bitmaps overused. Code could be shortened in most cases.

Presentation: 40/100.

Code was hard to follow. Standards were not consistent. Capitalisation and indentation were off. Long functions. Sporadic function description. No instructions or introduction.

Meeting all Requirements: 80/100.

Multiplayer was attempted but was unsuccessful. Everything else seems to be there.

Added Extras: 0/100.

Nothing special.

Cigue

2010-08-05 21:54:40

1. Technique (45/100)

Starting at 100: The lack of TPA use is a big turnoff (-30). It's sad to see the part that you lost dedication to learn this! Your script structure is excellent, meaning that with the right tools you could make a great script. I didn't like the lack of failsafes (-15). Your flag procedure will occasionally fail because sometimes the flag doesn't disappear even if you have reached your destination (-10).

2. Individuality (65/100)

Starting at 0 : You made up for the lack of TPA by using optimized functions such as FindGrid(+30). I wish you'd used DTMs instead of Bitmaps, they are so much more versatile ! I've seen a few functions I didn't think of, such as SpiralMouse and your well thought-out MouseAroundForUptext(+30). You have a knack for creating efficient functions, i just wish you used the most efficient tools you have at your disposal ! On second reading, I also liked the fact that you created custom antiban procedures (+15) but they don't look incredibly efficient (-10). Lack of a custom bank function (-10).

3. Follow all SRL rules (45/100)
At least one infinite loop (-15). You used a custom progress instead of the one provided with the include (-10). You could have used GetAmount instead of those weird procedures you used to count rune essences and runes made (-10). Multiplayer wasn't working, why didn't you use NextPlayer?

4. Creativity (65/100)

I rated this one with individuality. Not sure there is much to say.

5. Efficiency (25/100)

Unused functions and many, many global variables (-40). Also, this particular function which was many kinds of HURR DURR :

Function DTMexistsInv(DTM:Integer):Boolean;
begin
If(FindDTM(DTM,x,y,549,206,737,463))then
begin
result := True;
end else
begin
result := False;
end;
end;

Could have been replaced with (if you really wanted to)

Function DTMexistsInv(DTM:Integer):Boolean;
begin
Result := (FindDTM(DTM,x,y,MIX1,MIY1,MIX2,MIY2))
end;

That's a -20.

If(not(GetCurrentTab = 25))Then ////// To Inventory
begin
Mouse(650,180,12,14,true); //GameTab(25) // GameTab has a delay that I dont like.
wait(750+random(500));
end;

The delay from GameTab(25) is partly because it is already checking for the tab. (-10)

A few more functions I won't name and the lack of end..else in places they would have been helpful take away another 15 points.

6. Presentation (45/100)
Your standards aren't too bad, however capitalization and variable names are very hard to understand, which you haven't made any better by not adding any commentaries (-35). Also, no script instructions make it very hard to understand what it is about or how to use it (-25). The order of the functions is pretty hard to follow, plus there is no indexing or anything to help us understand the program flow. The function breakdown is pretty low for a 900 lines script, why not make this into more functions? That would be way easier to read and understand, possibly to update too.

7. Meeting all Requirements (75/100)
Multiplayer failed. Why not use NextPlayer or RandomNextPlayer ?

8. Added Extras (25/100)
Starting at 50 : I'm too scared to run this without supervision (-25).

Heavenguard

2010-08-06 08:24:21

Entry #3, Let this one be as good if not better then the others.
I will write my thoughts on each procedure/function before scoring.

Opening: The opening, I like the fact that the credits were nicely given, but where are the instructions? I would add the instructions and known errors right underneath the credits since you have the room there.

Procedure DeclarePlayers; Great job on commenting out the extra players to help the users. Might want to use a with..do loop for your players to make it look more efficient. Don't see many player arrays being used but its fine, you got the loads in there so thats all that matters ^^. Good Job.

Procedure SetCompass(High : Boolean, Degrees : Integer); Nice, a compass fixer. I like the fact you check the degrees to see if there already matched, but I would have done the same for the High just to make it look good.

Procedure LoadBitmapsDTMs; A procedure that loads up all your handy dtm's and bitmaps. I like ^^. I would have probably made a case statement with the procedure itself, but the way you did it is fine. Nicely done.

Function MouseAroundForUpTextEx(UpText:String; WaitMs, NumTrials, x1, y1, x2, y2: Integer; Click :Boolean): Boolean; A little creative thing you got going on here ^^. I would have just used simple mmouse() and waituptext(), but hey it looks nice. I would have changed the procedures x1, y1, x2, y2 to x, y, rx, ry instead. I like the idea of using the slope as a randomness =]. Good job.

Function WaitForBitmap(Bitmap, SearchRate, TimeBeforeStop: Integer) : Boolean; Oh nice, a function that searches for a bitmap with player settings =]. Nice job, however I would have freed the bitmap at the end of the function even if the result was false. I would have also used milliseconds or actual seconds for the timer, and incorporate it with a while..do loop. Good job on it though ^^.

Function DTMexistsInv : Boolean; Im not going to say that this function is not needed, but it does seem too simple. Also while theres nothing wrong with searching the co-ords of the inventory area, I would have used ExistsItemDTM(); Also remember to FreeDTM() whenever your finished, tther then that I guess its alright, good job.

Procedure InitializePlayer; Awesome, a procedure that makes sure the player is actually ready to do the script. I would have made a with..do loop with the air talisman / tiara. Then a for..to..do loop with the rest of the procedure. I would have also failsafed the bank opening with other srl bank functions, such as OpenBankFast(); You also should add in a pinscreen check. Imho, I think TPA's would have been perfect for you to use and demonstrate in this procedure, and it would have looked much better then what your doing with Count. Good Job so far though ^^.

Procedure StartNextPlayer; Now I like the fact your taking the time to make sure players are setup accordingly, but I think you could have waited to put this near the end of the script, and used it as a tasklisk for the next player to come. Other then that, this procedure is basically SRL's NextPlayer; function that also resets some global variables. You did ok with it =].

Procedure TryingToKeepYouUnBanned; I like the name you gave this procedure =], but lets keep it short and small with a simple name of "Antiban" next time. It looks decent ^^ nice job.

Function StartGridsFromBank : Grids; Oh la la, a new type. Nice job with making it. Good job with making it find so many bitmaps. The way you used the loops in the function could have helped you, such as a repeat..until while increasing the bitmap tolerance as well as repositioning.

Function MoveGrids(MoveXGrid, MoveYGrid:Integer) : Grids; I must admit your going great with your creativeness. Can't say much about what your doing though, im a bit clueless.

Procedure FlagWait(MilliSeconds : Integer); I like this procedure, but it could have been looped better. A while..do loop would have been great for waiting for the flag to dissapear. Good job though.

Procedure ToAltar; Heres where you use your grids =] it looks interesting. Although, this procedure has no failsafes at all, and making a simple radialwalk or DDTM for each point or [grid] would have been helpful. Also the WaitAmount doesn't look like it had much thought put into it, which probably means that you would have had a better outcome just using Flag; Overall its an ok procedure. I would take out the findnormalrandoms and place it to happen whenever you call antiban. Then put antiban in for findnormalrandoms.

Procedure ToBank; Same thing, nice use of your grid method, however no failsafes. Could have used TPA's to get this job done.

Function Bank(Bitmap : Integer) : Boolean; Nice, but first off, you should have at least used the Integer you have in the function itself. I would have used TPA's to open the bank. Also some failsafes[from the bank include] and looping[for.to.do/repeat.until] would not have hurt. Make it check for the pinkscreen, and try not to log the player out if you know he/she is in the bank. Instead try another method to open the bank. TPA's would have been a perfect example here =]. Good job though.

Function EnterAltar : Boolean; This function needs some repairing. It doesn't seem clear what methods your trying to use. Why not keep it simple and use MMouse() and waituptext instead of spiralmouse. Also you dont break out of the repeat..until loop after your result is set to false. Good job, but it needs a lot of work.

Function ClickAirStone : Boolean; I dont like the fact that your using statics for finding the altar. That could prove to have tons of errors. I would of used TPA's, or maybe even a simple FindColorSpiralTolerance() just to ensure that the altar is there.

Function ClickPortal : Boolean; Statics again, Not good. I love the fact your using Uptext as an advantage, but please try not to use it excessively, as it can make you look very bot-like. The Failsafe for this function is another static. Not so good imo. Try to work on it ^^.

Procedure AirAltar; We get to see you increase some nice variables. I like that your using ItemCoords but that could also be pretty static, I would suggest trying to find the dtm for the item in the inventory and using that point. I also don't see you using that tpoint =/. Its alright. Good job.

Procedure ProgressReport; Its good, and its simple. I would say that you could add a report for each individual player rather then the entire script runtime. Good job using the global variables. You could have probably posted the amount of Loads the player managed to finished at least. Overall not-so-bad =].

Mainloop: You have an Endless loop going on, I would break out if this, or use your player array.

—————————————————————–
Overall Summary

Technique (44 / 100)
+ If..Then Statements and Repeat..Until Loops
- Not much of any other loop / statement.

Individuality (15 / 100)
+ Bitmaps and DTM's
- Static-Coordinate Movements / UpText Checking

Follow All SRL Rules (60 / 100)
- Did not break out of infinite loops(-20).
- Does not check if player is logged in or not(-20).

Creativity (100 / 100)
+ Grid Method.

Efficiency (20 / 100)
- Most of your procedures/functions could be simplified by a simple SRL procedure/function.
- Did not free dtm and bitmaps correctly.
- Loop usage could have been much better.

Presentation (30 / 100)
+ Title Page (+5).
+ Progress Report (+10).
+ Scripting Standards (+15).
- Commented Procedures/Functions: No (+0 pts).

Meeting All Requirements (90 / 100)
+ Looks like it will not run if things are not done correctly.

Added Extras (40 / 100)
+ Talisman Checker (+20 pts).
+ Air Tiara Checker (+20 pts).

Summary: Your script is pretty disappointing [to me] as a whole to be honest. It does not have decent failsafes, you failed at incorporating any type of solid method in your functions/procedures besides dtm and bitmap finding. Your script searches alot with static co-ordinates, and it constantly checks for uptext before continuing. Certain Variables [such as AirTalisman] could have implemented into the player array for easier and clear understanding. Your looping was very off and could have been more versatile, and it seemed that you did not notice that some of your loops had a possibility of infinitely continuing. Overall the script is not really organized, and Im not going to edge you on that, because it happens. However simple methods that could have been used were left out of the script for no apparent reason, these simple methods that we use all the time [especially while learning] could have given this script a huge boost.

Total Score (399 / 800) = 49.88%

Thanks for Reading :D
Third Time Judging - Heavenguard