BUMPTaken into account
all Feedback, I spent a few hours (3) rewriting the script. I won't update my
public thread with this version, but thought I'd post it here to show your feedback has not gone to waste.
In this rewrite I have:- Improved my overall standards - thanks to those who fixed certain functions
- Fixed the empty value in the Antiban
- Removed unnecessary semicolons in my MiniBreak procedure
- Renamed functions to fit their purpose
- Added more than one line in ScriptTerminate procedure
- Fixed unnecessary begins in the Proggy
- Removed the capitals in the If…Then statement
- Removed begin and ends for one line statements, with the exception of one
- Changed FindPortal from a FindObjCustom into a TPA function
- Added failsafes in correct places
- Removed excessive use of brackets in Proggy
- I kept one FindObjectCustom function as it works flawlessly
- Finally, instead of having ObjectDTM's as bakup paths, I added RadialRoadWalk and RadialWalk methods as backup walking functionsHere is the script, I added comments in most of the places where I made changes - with the exception of spamming 'improved standards':
program Abu_jwkaAirKrafter; /// 100% ORGINAL NAME!! (lol:p)
{$DEFINE SMART}
{$i srl\srl.simba}
{$i ObjectDTM\ObjDTMInclude.simba}
Var
x, y, StartTime, OriginalXP, CurrentXP: Integer;
XPGain, LoadsDone, TimeGone, Runes: Array of Integer;
XPPerHour, LoadsPerHour, RunesPerHour: Array of Integer;
Procedure DeclarePlayers;
begin
HowManyPlayers := 2;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name := '';
Pass := '';
Nick := ''; // use four characters from your username
Pin := '';
Active := True;
end;
with Players[1] do
begin
Name := '';
Pass := '';
Nick := 'N/A.'; //use four characters from your username
Pin := '';
Active := False; // Set to True if you want to use!
end;
end;
//-- AntiBan Procedure -- \\
procedure Antiban;
begin
case Random(18) of
1: RandomRClick;
2: HoverSkill(Skill_Runecrafting, False);
3: HoverSkill(Skill_Crafting, False);
4: PickUpMouse;
5: ExamineInv;
7: MissMouse(100,100);
9: ExamineInv;
end; // removed empty 10: value
end;
//-- MiniBreak --\\
procedure BreakText;
begin
SMART_DrawText(100,200,UpCharsEx,'Dont Worry, Just Taking A Human-Like Break...',clAqua);
end;
procedure MiniBreak;
begin
case(Random(70))of
1: begin BreakText; Wait(15000 + random(7900)) end; // removed unnecessary semicolons..
2: begin BreakText; Wait(20500 + random(8550)) end;
3: begin BreakText; Wait(35040 + random(6759)) end;
4: begin BreakText; Wait(60000 + random(12549)) end;
end;
end;
//--Bank, Ruins, Altar and Portal Locations--\\
function IsAtBank: Boolean;
begin
if not LoggedIn then Exit; //added failsafe here rather than later on
Result := ObjDTM_InArea('80:80:7:10:7:58:75:10:7:101:55:10:7:101:47:10:7:58:59:10:7:58:51:10:7:58:67:10:7:101:63:4:58:25:60:99:104:98:101:25', True) or
ObjDTM_InArea('80:80:5:10:7:103:49:10:7:103:57:10:7:56:87:10:7:56:78:10:7:56:70:4:54:27:56:97:112:101:110:26', True);
end;
function IsAtRuins: Boolean;
begin
if not LoggedIn then Exit; //added failsafe here rather than later on
Result := ObjDTM_InArea('80:80:6:1:7:103:71:1:7:57:106:1:7:98:115:1:7:54:53:3:7:108:96:3:7:43:70:7:71:63:56:73:45:86:50:112:94:115:101:89:97:70', True);
end;
function IsAtAltar: Boolean;
begin
if not LoggedIn then Exit; //added failsafe here rather than later on
Result := ObjDTM_InArea('80:80:6:1:7:105:122:1:7:89:122:1:7:74:125:1:7:43:102:1:7:35:86:1:7:32:71:4:53:52:124:54:123:101:56:104', True) or
ObjDTM_InArea('80:80:5:1:7:124:125:1:7:108:125:1:7:91:125:1:7:28:71:1:7:28:54:4:47:58:50:114:128:106:126:57', True) or
ObjDTM_InArea('80:80:6:1:7:34:110:1:7:26:94:1:7:23:78:1:7:65:134:1:7:81:130:1:7:97:131:4:45:44:111:43:113:114:45:117', True);
end;
//-- Listen to Music --\\
function WaitTill70Energy: Boolean; // renamed to fit purpose
begin
Result := RunEnergy(70);
end;
function ListenToMusic: Boolean;
var
TPAA: T2DPointArray;
TPA: TPointArray;
CTS, I, Retry: Integer;
begin
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 10322521, MSX1, MSY1, MSX2, MSY2, 30);
ColorToleranceSpeed(CTS);
TPAA := TPAToATPAEx(TPA, 5, 5);
SortATPASize(TPAA, True);
for I := 0 to High(TPAA) do //removed capitalised block letters
if GetArraylength(TPAA[i]) > 5 then // here also...
begin
repeat
inc(Retry);
Writeln('Finding Musician');
MiddleTPAEx(TPAA[i], X, Y);
MMouse(X, Y, 3, 3);
Wait(500);
if (IsUpTextMultiCustom(['musi', 'cian'])) then
begin
Result := True;
GetMousePos(X, Y);
Mouse(x,y,3,3,false);
Wait(100 + random(200));
ChooseOption('isten');
Writeln('Found Musician, listening to music');
Wait(5000 + random(1000));
Break;
end;
until (Retry = 7);
WaitFunc(@WaitTill70Energy, 10 + Random(15), 15000);
Break;
end;
end;
// -- Walking to Ruins and Walking to Bank --\\
function GetRoadColor: Integer; // made this myself because SRL RoadColor...
var // and srl_VarrockRoadColor don't work
x, y: Integer;
begin
if(FindColorTolerance(x, y, 8949387, MMX1, MMY1, MMX2, MMY2, 10))then
Result:= GetColor(x, y);
end;
function GetGrassColor: Integer;
var
TPA: TPointArray;
begin
if(FindColorsTolerance(TPA, 2056030, MMX1, MMY1, MMX2, MMY2, 15))then
Result:= GetColor(TPA[0].X, TPA[0].Y);
end;
function GetAltarColors: Integer;
var
TPA: TPointArray;
begin
if(FindColorsTolerance(TPA, 2312782, MMX1, MMY1, MMX2, MMY2, 15))then
Result:= GetColor(TPA[0].X, TPA[0].Y);
end;
procedure WalkToRuins; // added RadialRoadWalk and RadialWalk methods
begin // fixed standards
if not LoggedIn then Exit;
Antiban;
SetRun(True);
if not ObjDTM_Walk('63:133:4:1:7:23:122:10:7:42:98:10:7:42:90:10:7:42:82:4:77:125:79:138:39:140:37:124', 0, 100, 5, True) then
begin
Writeln('Using Backup Path');
RadialRoadWalk(GetRoadColor, 180, 190, 72, 99, 99);
end;
FFlag(0);
if not ObjDTM_Walk('37:95:5:10:7:54:70:10:7:54:58:1:7:34:76:10:7:98:32:10:7:99:24:5:43:78:11:78:15:105:56:104:66:80', 0, 100, 5, True) then
begin
Writeln('Using Backup Path');
RadialRoadWalk(GetRoadColor, 240, 280, 40, 99, 99);
end;
FFlag(0);
if not ObjDTM_Walk('34:103:5:1:7:78:63:1:7:47:102:10:7:97:59:10:7:97:47:10:7:97:40:4:18:90:23:124:57:108:57:78', 0, 100, 5, True) then
begin
Writeln('Using Backup Path');
RadialRoadWalk(GetRoadColor, 200, 240, 40, 99, 99);
end;
FFlag(0);
if not ObjDTM_Walk('26:107:4:1:7:70:99:1:7:94:82:1:7:58:111:1:7:106:103:5:13:91:19:122:47:122:54:106:43:80', 0, 100, 5, True) then
begin
Writeln('Using Backup Path');
RadialRoadWalk(GetRoadColor, 180, 270, 60, 99, 99);
end;
FFlag(0);
if not ObjDTM_Walk('40:116:5:1:7:66:63:1:7:46:67:1:7:42:99:1:7:114:83:5:7:57:46:5:24:100:27:132:56:132:64:99:50:81', 0, 100, 5, True) then
begin
Writeln('Using Backup Path');
RadialWalk(GetGrassColor, 200, 270, 50, 99, 99);
end;
FFlag(0);
repeat
if not ObjDTM_Walk('80:80:2:1:7:91:103:3:7:101:83:4:74:77:73:98:92:97:91:77', 0, 100, 80, True) then
RadialWalk(GetAltarColors, 280, 260, 50, 99, 99);
until IsAtRuins;
end;
procedure WalkToBank; // added RadialRoadWalk and RadialWalk methods
begin // fixed standards
if not IsAtRuins then Exit;
if not ObjDTM_Walk('115:40:6:1:7:90:98:1:7:123:83:1:7:123:66:1:7:110:54:1:7:94:54:3:7:100:79:4:99:23:98:59:129:56:128:22', 0, 100, 5, True) then
begin
Writeln('Using Backup Path');
RadialWalk(GetGrasscolor, 20, 90, 60, 99, 99);
end;
FFlag(0);
if not ObjDTM_Walk('122:64:6:1:7:86:54:1:7:69:50:1:7:65:71:1:7:82:87:1:7:107:49:5:7:97:32:4:98:41:101:76:149:75:143:40', 0, 100, 5, True) then
begin
Writeln('Using Backup Path');
RadialRoadWalk(GetRoadColor, 45, 90, 72, 99, 99);
end;
FFlag(0);
if ObjDTM_Walk('108:66:3:1:7:128:88:1:7:78:67:5:7:69:49:4:94:41:94:68:129:69:129:41', 0, 100, 15, True) then
repeat
Wait(1500);
ClickNorth(1);
ListenToMusic;
SetRun(True);
until True;
if not ObjDTM_Walk('124:76:5:1:7:74:71:1:7:53:76:1:7:126:91:1:7:138:77:1:7:49:109:4:104:59:106:97:150:95:142:51', 0, 100, 5, True) then
begin
Writeln('Using Backup Path');
RadialRoadWalk(GetRoadColor, 60, 100, 40, 99, 99);
end;
FFlag(0);
if not ObjDTM_Walk('118:57:5:1:7:88:101:1:7:100:87:1:7:126:68:1:7:101:113:1:7:118:107:4:101:49:103:82:143:80:130:42', 0, 100, 5, True) then
begin
Writeln('Using Backup Path');
RadialRoadWalk(GetRoadColor, 60, 45, 60, 99, 99);
end;
FFlag(0);
if not ObjDTM_Walk('107:66:5:1:7:66:114:1:7:92:95:1:7:105:118:1:7:84:135:1:7:126:52:4:90:48:90:81:129:76:131:40', 0, 100, 5, True) then
begin
Writeln('Using Backup Path');
ObjDTM_Walk('105:61:3:1:7:118:51:1:7:98:111:1:7:86:90:5:92:56:90:72:126:74:120:40:104:41', 0, 100, 80, True);
end;
FFlag(0);
if not ObjDTM_Walk('118:86:5:1:7:70:113:1:7:104:70:10:7:126:36:10:7:126:45:10:7:126:28:5:122:73:90:72:90:96:138:95:140:78', 0, 100, 5, True) then
begin
Writeln('Using Backup Path');
ObjDTM_Walk('119:87:3:1:7:82:31:1:7:98:75:1:7:78:135:4:101:80:99:97:143:91:144:75', 0, 100, 80, True);
end;
FFlag(0);
repeat
if not ObjDTM_Walk('98:48:4:1:7:55:71:10:7:117:28:10:7:117:36:10:7:74:41:4:72:13:74:65:122:65:121:13', 0, 100, 5, True) then
begin
Writeln('Using Backup Path');
ObjDTM_Walk('83:50:4:1:7:26:27:1:7:38:71:0:7:71:15:10:7:102:26:4:65:26:65:61:102:61:101:24', 0, 100, 10, True);
end;
until IsAtBank;
if IsAtBank then
begin
Wait(100);
if not RunEnergy(50) then
begin
RestUntil(70);
end;
end;
end;
///////------ Crafting Process ------\\\\\\\
//--Click Ruins, then Altar, then Portal--\\
function FindClickRuins: Boolean;
var
TPAA: T2DPointArray;
TPA: TPointArray;
CTS, I, Retry: Integer;
begin
if not IsAtRuins then Exit;
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 16631693, MSX1, MSY1, MSX2, MSY2, 40);
ColorToleranceSpeed(CTS);
TPAA := TPAToATPAEx(TPA, 5, 5);
SortATPASize(TPAA, True);
for I := 0 to High(TPAA) do
if GetArraylength(TPAA[i]) > 5 then
begin
repeat
inc(Retry);
MiddleTPAEx(TPAA[i], X, Y);
MMouse(X, Y, 3, 3);
Wait(500);
if (IsUpTextMultiCustom(['yste', 'uins'])) then
begin
Result := True;
GetMousePos(X, Y);
Mouse(x,y,0,0,True);
Wait(100 + random(200));
Writeln('Found Ruins, clicking Ruins');
Break;
end;
until (Retry = 7);
Break;
end;
end;
function FindAltarTwo: Boolean; // kept as FindObjCustom - works fine
var
Runes1: Integer;
Text, Text1: String;
begin
if not IsAtAltar then Exit;
if FindObjCustom(x, y, ['raft', 'rune', 'ltar'], [5591379, 5722966], 3) then
begin
MMouse(x, y, 2, 2); // removed MMouse, but then portal wasn't being found
Mouse(x, y, 2, 2, True); //added randomness
WaitInvMaxCount(1, 6000);
Writeln('Crafted Runes');
Inc(LoadsDone[CurrentPlayer]);
Text := GetTextAtExWrap(560,210,582,222,0,0,0,65535,5,'StatChars');
if (Text<>'') then
begin
Text1 := Replace(Text,' ',''); // needed to keep the begin..end
end else // because it wouldn't compile.
Text1 := '0';
Runes1 := StrToInt(Text1);
IncEx(Runes[CurrentPlayer],Runes1);
Result := True;
end;
end;
function FindPortal: Boolean; //replaced previous FindObjCustom function
var
TPAA: T2DPointArray;
TPA: TPointArray;
CTS, I, Retry: Integer;
begin
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 5080969, MSX1, MSY1, MSX2, MSY2, 10);
ColorToleranceSpeed(CTS);
TPAA := TPAToATPAEx(TPA, 5, 5);
SortATPASize(TPAA, True);
for I := 0 To High(TPAA) do
If GetArraylength(TPAA[i]) > 5 Then
begin
repeat
inc(Retry);
Writeln('Finding Portal');
MiddleTPAEx(TPAA[i], X, Y);
MMouse(X, Y, 3, 3);
Wait(500);
if (IsUpTextMultiCustom(['nter', 'orta'])) then
begin
Result := True;
GetMousePos(X, Y);
Mouse(x, y, 3, 3, True);
Wait(100 + random(200));
Writeln('Found Portal');
Wait(5000 + random(1000));
Break;
end;
until (Retry = 7);
Break;
end;
end;
//-- Proggy --\\
procedure ProggyTest; //removed unnecessary begins - thanks to cut em2 it
var
i: Integer;
begin
if LoadsDone[CurrentPlayer] mod 5=0 then
ClearDebug;
CurrentXP := GetXPBar(1);
TimeGone[CurrentPlayer] := (GetTimeRunning/1000);
XPGain[CurrentPlayer] := (CurrentXP - OriginalXP);
XPPerhour[CurrentPlayer] :=(3600 * XPGain[CurrentPlayer]) / TimeGone[CurrentPlayer]; //removed...
LoadsPerhour[CurrentPlayer] :=(3600 * LoadsDone[CurrentPlayer]) / TimeGone[CurrentPlayer]; //excessive..
RunesPerHour[CurrentPlayer] := (3600 * Runes[CurrentPlayer]) / TimeGone[CurrentPlayer];//use of brackets
ClearDebug;
Writeln('******************************************************************');
Writeln('*/////////---------- Abu''s''AirKrafter Version 2 ----------\\\\\\\*');
Writeln('*/////////----------____________________________----------\\\\\\\*');
Writeln('******************************************************************');
Writeln('');
for i := 0 to HowManyPlayers - 1 do
begin
Writeln('*/////////--------- Proggy for the player: ' + Players[i].Nick + ' --------\\\\\\\\\*');
Writeln('*/////////We have done: ' + IntToStr(LoadsDone[i]) + ' Loads / Thats ' + IntToStr(LoadsPerHour[i]) + ' loads per hour');
Writeln('*/////////We have gained: ' + IntToStr(XPGain[i]) + ' xp / Thats ' + IntToStr(XPPerHour[i]) + ' xp per hour');
Writeln('*/////////We have crafted ' + IntToStr(Runes[i]) + ' Runes / Thats ' + IntToStr(RunesPerHour[i]) + ' Runes Per Hour');
Writeln('');
end;
end;
procedure SetArrayLengths; //renamed to fit purpose
begin
SetLength(TimeGone,HowManyPlayers);
SetLength(XPPerHour,HowManyPlayers);
SetLength(LoadsPerHour,HowManyPlayers);
SetLength(XPGain,HowManyPlayers);
SetLength(LoadsDone,HowManyPlayers);
SetLength(Runes,HowManyPlayers);
SetLength(RunesPerHour,HowManyPlayers);
end;
procedure ScriptTerminate;
begin
ProggyTest;
Writeln('Thank you for using Abu''s''AirKrafter Version 2'); //added a line
end;
begin //standards in mainloop fixed by masterbb
ClearDebug;
Smart_Server := 16;
Smart_Members := False;
Smart_Signed := False;
Smart_SuperDetail := False;
SetUpSRL;
ObjDTM_Setup;
ObjDTM_Debug := True;
StartTime := GetSystemTime;
ActivateClient;
DeclarePlayers;
SetArrayLengths;
if not LoggedIn then
begin
LogInPlayer;
WaitFunc(@LoggedIn, 10 + Random(15), 15000);
FindNormalRandoms;
end;
OriginalXP := GetXPBar(1);
repeat
repeat
if IsAtBank then
begin
if InvCount < 28 then
begin
if not (BankScreen) then
begin
ClickNorth(0);
OpenBankFast('vwb');
end else
begin
DepositAll;
if (Withdraw(0,0,0)) then
begin
Sleep(1000);
MiniBreak;
if (InvCount < 28) then
begin
Logout;
Break
end;
end;
end;
end else
if (InvCount = 28) then
begin
WalkToRuins;
Wait(1000);
end;
end;
if IsAtRuins then
if (InvCount = 28) then
begin
ClickNorth(0);
FindClickRuins;
Wait(1000);
end
else if (InvCount = 1) then
begin
Wait(500);
WalkToBank;
ProggyTest;
end;
if IsAtAltar then
if (InvCount = 28) then
begin
if FindAltarTwo then
begin
Wait(3200 + Random(500));
FindPortal;
WaitFunc(@IsAtRuins, 10 + Random(15), 4000);
end;
end
else if (InvCount = 1) then
begin
FindPortal;
WaitFunc(@IsAtRuins, 10 + Random(15), 4000);
end;
until False;
NextPlayer(Players[CurrentPlayer].Active = False);
until AllPlayersInactive;
ScriptTerminate;
end.
Thank you for all the help guys, hopefully that script is now 'fixed' :p
Well the voting seems to be 60/40 which means it can still go either way, but don't worry, if all fails…
I'll be back … ooohoohoohh yes … I'll definitely be back :stirthepot:
Special Thanks to:Cut em2 it and
masterbb for all their help and feedback
EDIT: Regarding the issue about my longevity:
From: Daniel
Daniel's Guide to SRL Members
Important requirements needed…..
skipping
skipping
ah yess….
Longevity:
This is least important as so many people have little regard for it, or will only take this into account if the user applying is submitting his/her application immediately after registration, or within the same month of registering on the forums. If however, you are well known, helpful and active, then longevity won't really matter regardless of your duration here at the forums.
Just to confirm, I've been here longer than one month