Mclarenvj
02-06-2009, 05:23 PM
I've used it and works awesome...
Would like to know how i can get it to work with s.m.a.r.t i changed the script like added the smart stuff but once it starts and opens the wnidow it just stays there and doesn't do anything....
here use mine
{*********** <<--Shuttleu-->> ***********
Ultra Chop n Bank Lite
V1.83
Requires Scar 3.15b & SRL 28
Description
Chops the yews just south of edgeville and then banks them.
Chops the Magic Tree near the Tree Gnome Stronghold
and either a Magic or Yew Tree in your Farming Tree Patch Bank
Deals with all currently solvable randoms & has
an efficient Anti-Ban system.
Chop Yew Trees West of Catherby and Banks Them.
Instructions
Fill in all relevant options below. Make sure
windows display settings are set to 32bit, put
axe anywhere in your backpack or hand, make sure
your players are in the Edgeville, Tree Gnome
Stronghold or Catherby Bank.
and run the script. Simple! Enjoy :)
valid location arguments are as follows :
CY - If you type CY you place your player in Catherby bank for chopping yews (Members)
EY - If you type EY you place your player in Edgevile bank for chopping yews
GM - If you type GM you place you player in Tree Gnome Stronghold bank for cutting magic trees (Members)
*********** <<--Shuttleu-->> ***********}
program Ultra_Cut_n_Bank;
{.Include SRL\SRL\Misc\SMART.SCAR}
{.Include SRL\SRL.SCAR}
{.include SRL/SRL/skill/WoodCutting.scar}
{.include srl/srl/misc/users.scar}
{************************************************* ******************************
* Do not alter anything in this section unless you really know what your doing *
* Move on and enter the Players Details, you will then be ready to start. *
************************************************** *****************************}
const
DebugOn = false;
BankCashierColour = 195836; // Colour of Bank Cashier in Mini Map. The Yellow Dot. You Should not have to change this.
UCBversion = 'V1.83'; // Version of this script
var
locations: Array of String;
NestSeedDTM, NestRingDTM, NestEggDTM, YewDTM, MagicDTM: integer;
FirstDeposit, x, y: integer;
CIBReason, DumpVar, CurentVer: String;
KeepPlayer, CIBTrue, bank: boolean;
tpa: TPointArray;
TMaxLoads, TMaxLogs, TMaxTime, PMaxLoads, PMaxLogs, PMaxTime, SessLoads, i : integer;
SessTime, SleepTime : integer;
SaveDebugFile, UseResponder : boolean;
HideScar, SRL_ID, SRL_PASS, section : string;
words:array [1..19] of string;
MinChatTim, MaxChatTim, RespPerPlay, RespondTim, RanErrChance : integer;
{************************************************* ******************************
* Thats it all options have been set you may now Start the Script! *
************************************************** ******************************
************************************************** ******************************
************************************************** ******************************
************************************************** ******************************
* Do not alter anything in below here unless you really know what your doing *
************************************************** *****************************}
var
// InitForm variables.
frmDesign : TForm;
OverallMax : TLabel;
OverallLoadsText : TLabel;
PlayerMax : TLabel;
PlayerMaxLoadsText : TLabel;
OverallLogsText : TLabel;
PlayerMaxLogsText : TLabel;
PlayerSwitch : TLabel;
PlayerLoadsText : TLabel;
PlayerTimeText : TLabel;
TotalTimeText : TLabel;
MaxTimeText : TLabel;
PlayerBreakText : TLabel;
Label1 : TLabel;
Label2 : TLabel;
Label3 : TLabel;
Label4 : TLabel;
Label5 : TLabel;
Label6 : TLabel;
RespondTimText : TLabel;
RanErrChanceText : TLabel;
RespPerPlayText : TLabel;
MinChatTimText : TLabel;
MaxChatTimText : TLabel;
OverallLoads : TEdit;
PlayerMaxLoads : TEdit;
PlayerLoads : TEdit;
OverallLogs : TEdit;
PlayerMaxLogs : TEdit;
PlayerTime : TEdit;
TotalTime : TEdit;
MaxTime : TEdit;
PlayerBreak : TEdit;
PlayButton : TButton;
SRL_ID1 : TEdit;
SRL_PASS1 : TEdit;
HideScars : TEdit;
Debug : TCheckBox;
Responder : TCheckBox;
RespondTim1 : TEdit;
RanErrChance1 : TEdit;
RespPerPlay1 : TEdit;
MinChatTim1 : TEdit;
MaxChatTim1 : TEdit;
procedure ClickButton(sender: TObject); // Adding Buttons and Interactivity
begin
SRL_ID:= SRL_ID1.Text;
SRL_PASS:= SRL_PASS1.Text;
HideScar:= HideScars.Text;
SaveDebugFile:= Debug.Checked;
UseResponder:= Responder.Checked;
TMaxLoads:= strtoint(OverallLoads.Text);
TMaxLogs:= strtoint(OverallLogs.Text);
TMaxTime:= strtoint(TotalTime.Text);
PMaxLoads:= strtoint(PlayerMaxLoads.Text);
PMaxLogs:= strtoint(PlayerMaxLogs.Text);
PMaxTime:= strtoint(MaxTime.Text);
SessLoads:= strtoint(PlayerLoads.Text);
SessTime:= strtoint(PlayerTime.Text);
SleepTime:= strtoint(PlayerBreak.Text);
MinChatTim:= strtoint(MinChatTim1.Text);
MaxChatTim:= strtoint(MaxChatTim1.Text);
RespPerPlay:= strtoint(RespPerPlay1.Text);
RespondTim:= strtoint(RespondTim1.Text);
RanErrChance:= strtoint(RanErrChance1.Text);
words[1]:= OverallLoads.Text;
words[2]:= OverallLogs.Text;
words[3]:= TotalTime.Text;
words[4]:= PlayerMaxLoads.Text;
words[5]:= PlayerMaxLogs.Text;
words[6]:= MaxTime.Text;
words[7]:= PlayerLoads.Text;
words[8]:= PlayerTime.Text;
words[9]:= PlayerBreak.Text;
words[10]:= SRL_ID1.Text;
words[11]:= SRL_PASS1.Text;
words[12]:= HideScars.Text;
words[13]:= BoolToStr(Debug.Checked);
words[14]:= BoolToStr(Responder.Checked);
words[15]:= MinChatTim1.Text;
words[16]:= MaxChatTim1.Text;
words[17]:= RespPerPlay1.Text;
words[18]:= RespondTim1.Text;
words[19]:= RanErrChance1.Text;
for i:=1 to 19 do
begin
if i>0 then
section:= 'time';
if i>9 then
section:= 'srl';
if i>11 then
section:= 'scar';
if i>12 then
section:= 'other';
if i>14 then
section:= 'respond';
Writeini(section, inttostr(i), words[i], AppPath+'Scripts\UCB.Shuttleu');
end;
frmDesign.Caption:= frmDesign.Caption + '.';
frmDesign.ModalResult:= mrOk;
end;
procedure InitForm;
begin
for i:=1 to 19 do
begin
if i>0 then
section:= 'time';
if i>9 then
section:= 'srl';
if i>11 then
section:= 'scar';
if i>12 then
section:= 'other';
if i>14 then
section:= 'respond';
words[i]:= ReadINI(section, IntToStr(i), AppPath+'Scripts\UCB.Shuttleu');
end;
frmDesign := CreateForm;
with frmDesign do
begin
Position := poScreenCenter;
BorderStyle := bsSingle;
BorderIcons := [biSystemMenu];
FormStyle := fsStayOnTop;
ClientWidth := 505;
ClientHeight := 643;
Caption := 'frmDesign';
Color := clBtnFace;
Font.Color := clWindowText;
Font.Height := -11;
Font.Name := 'MS Sans Serif';
Font.Style := [];
PixelsPerInch := 96;
end;
OverallMax := TLabel.Create(frmDesign);
with OverallMax do
begin
Parent := frmDesign;
Left := 16;
Top := 64;
Width := 130;
Height := 20;
Caption := 'Overall max values';
Font.Color := clWindowText;
Font.Height := -16;
Font.Name := 'MS Sans Serif';
Font.Style := [];
end;
OverallLoadsText := TLabel.Create(frmDesign);
with OverallLoadsText do
begin
Parent := frmDesign;
Left := 16;
Top := 104;
Width := 56;
Height := 13;
Hint := 'Total loads for the script to do';
Caption := 'Total Loads';
ParentShowHint := False;
ShowHint := True;
end;
PlayerMax := TLabel.Create(frmDesign);
with PlayerMax do
begin
Parent := frmDesign;
Left := 192;
Top := 64;
Width := 125;
Height := 20;
Caption := 'Player max values';
Font.Color := clWindowText;
Font.Height := -16;
Font.Name := 'MS Sans Serif';
Font.Style := [];
end;
PlayerMaxLoadsText := TLabel.Create(frmDesign);
with PlayerMaxLoadsText do
begin
Parent := frmDesign;
Left := 192;
Top := 104;
Width := 56;
Height := 13;
Caption := 'Total Loads';
end;
OverallLogsText := TLabel.Create(frmDesign);
with OverallLogsText do
begin
Parent := frmDesign;
Left := 16;
Top := 168;
Width := 50;
Height := 13;
Caption := 'Total Logs';
end;
PlayerMaxLogsText := TLabel.Create(frmDesign);
with PlayerMaxLogsText do
begin
Parent := frmDesign;
Left := 192;
Top := 168;
Width := 50;
Height := 13;
Caption := 'Total Logs';
end;
PlayerSwitch := TLabel.Create(frmDesign);
with PlayerSwitch do
begin
Parent := frmDesign;
Left := 368;
Top := 64;
Width := 94;
Height := 20;
Caption := 'Player Switch';
Font.Color := clWindowText;
Font.Height := -16;
Font.Name := 'MS Sans Serif';
Font.Style := [];
end;
PlayerLoadsText := TLabel.Create(frmDesign);
with PlayerLoadsText do
begin
Parent := frmDesign;
Left := 368;
Top := 104;
Width := 61;
Height := 13;
Caption := 'Player Loads';
end;
PlayerTimeText := TLabel.Create(frmDesign);
with PlayerTimeText do
begin
Parent := frmDesign;
Left := 368;
Top := 168;
Width := 55;
Height := 13;
Caption := 'Player Time';
end;
TotalTimeText := TLabel.Create(frmDesign);
with TotalTimeText do
begin
Parent := frmDesign;
Left := 16;
Top := 232;
Width := 50;
Height := 13;
Caption := 'Total Time';
end;
MaxTimeText := TLabel.Create(frmDesign);
with MaxTimeText do
begin
Parent := frmDesign;
Left := 192;
Top := 232;
Width := 50;
Height := 13;
Caption := 'Total Time';
end;
PlayerBreakText := TLabel.Create(frmDesign);
with PlayerBreakText do
begin
Parent := frmDesign;
Left := 368;
Top := 232;
Width := 43;
Height := 13;
Caption := 'Break for';
end;
Label1 := TLabel.Create(frmDesign);
with Label1 do
begin
Parent := frmDesign;
Left := 72;
Top := 8;
Width := 360;
Height := 38;
Caption := 'Player and script settings';
Font.Color := clWindowText;
Font.Height := -33;
Font.Name := 'MS PGothic';
Font.Style := [];
end;
Label2 := TLabel.Create(frmDesign);
with Label2 do
begin
Parent := frmDesign;
Left := 152;
Top := 296;
Width := 202;
Height := 38;
Caption := 'Other settings';
Font.Color := clWindowText;
Font.Height := -33;
Font.Name := 'MS PGothic';
Font.Style := [];
end;
Label3 := TLabel.Create(frmDesign);
with Label3 do
begin
Parent := frmDesign;
Left := 24;
Top := 352;
Width := 35;
Height := 13;
Caption := 'SRL ID';
end;
Label4 := TLabel.Create(frmDesign);
with Label4 do
begin
Parent := frmDesign;
Left := 16;
Top := 376;
Width := 52;
Height := 13;
Caption := 'SRL PASS';
end;
Label5 := TLabel.Create(frmDesign);
with Label5 do
begin
Parent := frmDesign;
Left := 16;
Top := 416;
Width := 47;
Height := 13;
Caption := 'Hide Scar';
end;
Label6 := TLabel.Create(frmDesign);
with Label6 do
begin
Parent := frmDesign;
Left := 88;
Top := 456;
Width := 330;
Height := 37;
Caption := 'Autoresponder settings';
Font.Color := clWindowText;
Font.Height := -33;
Font.Name := 'MS Sans Serif';
Font.Style := [];
end;
RespondTimText := TLabel.Create(frmDesign);
with RespondTimText do
begin
Parent := frmDesign;
Left := 32;
Top := 520;
Width := 69;
Height := 13;
Caption := 'Respond Time';
end;
RanErrChanceText := TLabel.Create(frmDesign);
with RanErrChanceText do
begin
Parent := frmDesign;
Left := 16;
Top := 544;
Width := 105;
Height := 13;
Caption := 'Random Error Chance';
end;
RespPerPlayText := TLabel.Create(frmDesign);
with RespPerPlayText do
begin
Parent := frmDesign;
Left := 16;
Top := 568;
Width := 103;
Height := 13;
Caption := 'Responses per Player';
end;
MinChatTimText := TLabel.Create(frmDesign);
with MinChatTimText do
begin
Parent := frmDesign;
Left := 32;
Top := 592;
Width := 68;
Height := 13;
Caption := 'Min Chat Time';
end;
MaxChatTimText := TLabel.Create(frmDesign);
with MaxChatTimText do
begin
Parent := frmDesign;
Left := 32;
Top := 616;
Width := 71;
Height := 13;
Caption := 'Max Chat Time';
end;
OverallLoads := TEdit.Create(frmDesign);
with OverallLoads do
begin
Parent := frmDesign;
Left := 16;
Top := 128;
Width := 121;
Height := 21;
Hint := 'How many loads to do before script finishes';
ParentShowHint := False;
ShowHint := True;
TabOrder := 8;
Text := words[1];
end;
PlayerMaxLoads := TEdit.Create(frmDesign);
with PlayerMaxLoads do
begin
Parent := frmDesign;
Left := 192;
Top := 128;
Width := 121;
Height := 21;
Hint := 'How many loads to do before switching player';
ParentShowHint := False;
ShowHint := True;
TabOrder := 9;
Text := words[4];
end;
PlayerLoads := TEdit.Create(frmDesign);
with PlayerLoads do
begin
Parent := frmDesign;
Left := 368;
Top := 128;
Width := 121;
Height := 21;
Hint := 'How many loads to do before script switches player';
ParentShowHint := False;
ShowHint := True;
TabOrder := 10;
Text := words[7];
end;
OverallLogs := TEdit.Create(frmDesign);
with OverallLogs do
begin
Parent := frmDesign;
Left := 16;
Top := 192;
Width := 121;
Height := 21;
Hint := 'How many logs for the script to do';
ParentShowHint := False;
ShowHint := True;
TabOrder := 11;
Text := words[2];
end;
PlayerMaxLogs := TEdit.Create(frmDesign);
with PlayerMaxLogs do
begin
Parent := frmDesign;
Left := 192;
Top := 192;
Width := 121;
Height := 21;
Hint := 'How many logs for the player to do';
ParentShowHint := False;
ShowHint := True;
TabOrder := 12;
Text := words[5];
end;
PlayerTime := TEdit.Create(frmDesign);
with PlayerTime do
begin
Parent := frmDesign;
Left := 368;
Top := 192;
Width := 121;
Height := 21;
Hint := 'How many minuites to run for before switching player';
ParentShowHint := False;
ShowHint := True;
TabOrder := 13;
Text := words[8];
end;
TotalTime := TEdit.Create(frmDesign);
with TotalTime do
begin
Parent := frmDesign;
Left := 16;
Top := 256;
Width := 121;
Height := 21;
Hint := 'How long to run the script for';
ParentShowHint := False;
ShowHint := True;
TabOrder := 14;
Text := words[3];
end;
MaxTime := TEdit.Create(frmDesign);
with MaxTime do
begin
Parent := frmDesign;
Left := 192;
Top := 256;
Width := 121;
Height := 21;
Hint := 'How long for each player to run for';
ParentShowHint := False;
ShowHint := True;
TabOrder := 15;
Text := words[6];
end;
PlayerBreak := TEdit.Create(frmDesign);
with PlayerBreak do
begin
Parent := frmDesign;
Left := 368;
Top := 256;
Width := 121;
Height := 21;
Hint := 'How many minuites to break for between each player';
ParentShowHint := False;
ShowHint := True;
TabOrder := 16;
Text := words[9];
end;
PlayButton := TButton.Create(frmDesign);
with PlayButton do
begin
Parent := frmDesign;
Left := 320;
Top := 560;
Width := 75;
Height := 25;
Caption := 'Play';
TabOrder := 17;
end;
SRL_ID1 := TEdit.Create(frmDesign);
with SRL_ID1 do
begin
Parent := frmDesign;
Left := 80;
Top := 352;
Width := 121;
Height := 21;
Hint := 'Enter you srl id';
ParentShowHint := False;
ShowHint := True;
TabOrder := 18;
Text := words[10];
end;
SRL_PASS1 := TEdit.Create(frmDesign);
with SRL_PASS1 do
begin
Parent := frmDesign;
Left := 80;
Top := 376;
Width := 121;
Height := 21;
Hint := 'Enter your srl pass';
ParentShowHint := False;
ShowHint := True;
TabOrder := 19;
Text := words[11];
end;
HideScars := TEdit.Create(frmDesign);
with HideScars do
begin
Parent := frmDesign;
Left := 80;
Top := 416;
Width := 121;
Height := 21;
Hint := 'Put what you want scar to be hidden as';
ParentShowHint := False;
ShowHint := True;
TabOrder := 20;
Text := words[12];
end;
Debug := TCheckBox.Create(frmDesign);
with Debug do
begin
Parent := frmDesign;
Left := 280;
Top := 352;
Width := 97;
Height := 17;
Hint := 'Save the proggy';
Caption := 'Save Debug';
State := cbChecked;
Checked := StrToBool(words[13]);
ParentShowHint := False;
ShowHint := True;
TabOrder := 21;
end;
Responder := TCheckBox.Create(frmDesign);
with Responder do
begin
Parent := frmDesign;
Left := 280;
Top := 400;
Width := 97;
Height := 17;
Hint := 'Use the responder';
Caption := 'Use Responder';
State := cbChecked;
Checked := StrToBool(words[14]);
ParentShowHint := False;
ShowHint := True;
TabOrder := 22;
end;
RespondTim1 := TEdit.Create(frmDesign);
with RespondTim1 do
begin
Parent := frmDesign;
Left := 136;
Top := 520;
Width := 121;
Height := 17;
Hint := 'Time to wait before any response is made';
ParentShowHint := False;
ShowHint := True;
TabOrder := 23;
Text := words[15];
end;
RanErrChance1 := TEdit.Create(frmDesign);
with RanErrChance1 do
begin
Parent := frmDesign;
Left := 136;
Top := 544;
Width := 121;
Height := 17;
Hint := 'Percentage of errors in typing (0 = none, 100 = everytime)';
ParentShowHint := False;
ShowHint := True;
TabOrder := 24;
Text := words[16];
end;
RespPerPlay1 := TEdit.Create(frmDesign);
with RespPerPlay1 do
begin
Parent := frmDesign;
Left := 136;
Top := 568;
Width := 121;
Height := 17;
Hint := 'Number of responses per individual player (0 = infinate)';
ParentShowHint := False;
ShowHint := True;
TabOrder := 25;
Text := words[17];
end;
MinChatTim1 := TEdit.Create(frmDesign);
with MinChatTim1 do
begin
Parent := frmDesign;
Left := 136;
Top := 592;
Width := 121;
Height := 17;
Hint := 'Amount of time between talking to individual players';
ParentShowHint := False;
ShowHint := True;
TabOrder := 26;
Text := words[18];
end;
MaxChatTim1 := TEdit.Create(frmDesign);
with MaxChatTim1 do
begin
Parent := frmDesign;
Left := 136;
Top := 616;
Width := 121;
Height := 17;
Hint := 'Amount of time before dropping a player due to them not talking';
ParentShowHint := False;
ShowHint := True;
TabOrder := 27;
Text := words[19];
end;
PlayButton.OnClick := @ClickButton;
end;
procedure SafeInitForm;
var
v : TVariantArray;
begin
SetArrayLength(v, 0);
ThreadSafeCall('InitForm', v);
end;
procedure ShowInitFormModal;
begin
frmDesign.ShowModal;
end;
procedure SafeShowInitFormModal;
var
v : TVariantArray;
begin
SetArrayLength(v, 0);
ThreadSafeCall('ShowInitFormModal', v);
end;
procedure MainInitForm;
begin
try
SafeInitForm;
SafeShowInitFormModal;
finally
FreeForm(frmDesign);
except
WriteLn('An error seems to have occurred in: InitForm');
end;
end;
{************************************************* ******************************
function CoordsToDegrees(x, y: integer): integer;
By: PriSoner
Description: Returns the direction in degrees (0 to 359) to a set of coordinates
relative to your players position on the screen and North.
(degrees are in reverse to the convention to stay compatible with
MakeCompass etc i.e. 0 = N, 90 = W, 180 = S & 270 = E)
************************************************** *****************************}
function CoordsToDegrees(x, y: integer): integer;
var d: double;
begin
x := x - 260;
y := y - 160;
d := ArcTan2(y, x) * (180 div Pi) + 90;
if d < 0 then d := d + 360;
result := round(abs(d - 360) + rs_GetCompassAngleDegrees);
if result >= 360 then result := result - 360;
end;
procedure SaveDebug;
var FileNum: integer;
begin
if not SaveDebugFile then
Exit;
FileNum := RewriteFile(ScriptPath+'ultra cut n bank Proggy.txt',True);
if( FileNum < 0 )then
WriteLn('@@@ Error with save: File Error.');
WriteFileString(FileNum, GetDebugText);
CloseFile(FileNum);
end;
{************************************************* ******************************
procedure SetupAutoResponder;
By: Nava2
Description: Sets up the AutoResponder.
************************************************** *****************************}
procedure SetupAutoResponder;
var
HowManyQuestions, RespPerPlayer, MinChatTime, MaxChatTime : integer;
UseSmartRespond : Boolean;
begin
UseRespond := True;
RespondTime := RespondTim; // Time to wait before any response is made. (Minutes)
RandomErrorChance := RanErrChance; // Add Random Typos to text? 0 is NO Errors, the lower the number the more errors.
UseSmartRespond := True;
RespPerPlayer := RespPerPlay; // Number of responders per individual player. 0 is infinite.
MinChatTime := MinChatTim; // Amount of time to wait between talking to individual players. (Minutes)
MaxChatTime := MaxChatTim; // Amount of time to wait before dropping a player due to them not talking. (Minutes)
HowManyQuestions := 3;
SetArrayLength(QnR, HowManyQuestions);
QnR[0][0] := ['Wc lvl', 'woodcutting?', 'wc?', 'wc lvls', 'wc lvl', 'Wc Lvs?', 'Wc']; //Questions
QnR[0][1] := ['84 =]', 'My Woodcutting Level is 84.']; //Answers to Previous Questions
QnR[1][0] := ['hi', 'hey', 'hiya', 'hello', 'elo', 'wassup', 'sup']; //Questions
QnR[1][1] := ['hey', 'hello', 'hi', 'hiya', 'ello', 'helo']; //Answers to Previous Questions
QnR[2][0] := ['bye', 'bibi', 'cya', 'm goin', 'm leavin']; //Questions
QnR[2][1] := ['bibi', 'cya', 'bye', 'okay', 'see ya', 'later']; //Answers to Previous Questions
SetupSmartRespond(UseSmartRespond, RespPerPlayer, MinChatTime, MaxChatTime);
end;
function ItemCoordsDtm(area: string; dtm: Integer): TPointArray;
var
startx, starty, rowsize, colsize, colnumber, rownumber, col, row: Integer;
x1, y1, x2, y2: Integer;
itemx, itemy: Integer;
i: Integer;
begin
SetArrayLength(Result, 0);
if (CheckArea(area)) then
begin
AreaInfo(area, startx, starty, rowsize, colsize, colnumber, rownumber);
for row := 0 to rownumber - 1 do
for col := 0 to colnumber - 1 do
begin
x1 := startx + col * colsize;
y1 := starty + row * rowsize;
x2 := x1 + colsize;
y2 := y1 + rowsize;
if (FindDTM(dtm, itemx, itemy, x1, y1, x2, y2)) then
begin
i := GetArrayLength(Result);
SetArrayLength(Result, i + 1);
Result[i].x := x1;
Result[i].y := y1;
end;
end;
end;
end;
procedure MyFFlag(dist : Integer);
var
x, y, T : integer;
begin
MarkTime(T);
repeat
if (not LoggedIn) then Exit;
if FindColor(x, y, 255, MMX1, MMY1, MMX2, MMY2) then
begin
if (dist >= FlagDistance) then
exit;
if (TimeFromMark(T)>=30000) then
begin
if FindColor(x, y, 255, MMX1, MMY1, MMX2, MMY2) then
Mouse(x, y, 0, 0, True);
end;
end;
until (not(FindColor(x, y, 255, MMX1, MMY1, MMX2, MMY2)));
end;
function Banking(Location: String): Boolean;
var
x, y, i, l, c, z: Integer;
Info: TIntegerArray;
Booths, t: TPointArray;
begin
Wait(400);
case LowerCase(Location) of
'cb', 'catherby': Info := [MSCX, MSCY, 737623, 5, 1];
else
begin
srl_Warn('Banking', 'Unknown bank: '+Location, warn_AllVersions);
Exit;
end;
end;
MakeCompass('n');
SetAngle(true);
z := GetColorToleranceSpeed;
ColorToleranceSpeed(Info[4]);
FindColorsSpiralTolerance(Info[0], Info[1], Booths, Info[2], MSX1, MSY1, MSX2, MSY2, Info[3]);
ColorToleranceSpeed(z);
SetArrayLength(t, 0);
t := Booths;
SetArrayLength(Booths, 0);
Booths := ReArrangeAndShortenArray(t, 14);
l := GetArrayLength(Booths) -1;
for i := 0 to l do
begin
if (not LoggedIn) or BankScreen or PinScreen then
Break;
MMouse(Booths[i].X, Booths[i].Y, 3, 3);
Wait(75 + Random(75));
if IsUpText('ooth') Then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, False);
Wait(70 + Random(75));
if ChooseOption('uickly') then
begin
FFLag(0);
MarkTime(c);
repeat
Wait(100);
until (BankScreen) or (PinScreen) or (TimeFromMark(c) > 3000);
if (Length(Players) > 0) then
if (Players[CurrentPlayer].Pin <> '') then
InPin(Players[CurrentPlayer].Pin);
end;
end;
end;
Result := (BankScreen) or (PinScreen);
end;
function CountItemsDtm(area: string; dtm: Integer): Integer;
var
coords: TPointArray;
begin
coords := ItemCoordsDtm(area, dtm);
Result := GetArrayLength(coords);
end;
{************************************************* ******************************
procedure MakeCompassCoords(x, y: integer);
By: PriSoner
Description: Moves Compass so that target x & y coordinates are directly north
of your player.
************************************************** *****************************}
procedure MakeCompassCoords(x, y: integer);
begin
MakeCompass(IntToStr(CoordsToDegrees(x, y)));
end;
{************************************************* ******************************
function DigitGroup(MyNumber: integer) string;
By: PriSoner
Description: Formats an integer into groups of 3 seperated by commas and returns
a formatted string. i.e "1234567" would become "1,234,567".
I know there is probably an easier way of doing this and probably
an existing function. i just can not remember it!
************************************************** *****************************}
function DigitGroup(MyNumber: integer): string;
var b: integer;
a, c: string;
begin
a := IntToStr(MyNumber);
b := length(a) + 1;
c := ',';
if b > 4 then
repeat
b := b - 3;
if b > 1 then insert(c, a, b);
until b < 3;
result := a;
end;
{************************************************* ******************************
function Find2TPApoints(TPA1, TPA2: TPointArray; w, h: Integer): TPointArray;
By: PriSoner
Description: Small function to find two points within different TPA arrays that
fall within a defined distance from each other.
Returns the mid value between every pair of points that match.
TPA1: First TPoint Array
TPA2: Second TPoint Array
w: Width (Maximum Distance points can be apart on the x axis)
h: Height(Maximum Distance points can be apart on the y axis)
************************************************** *****************************}
function Find2TPApoints(TPA1, TPA2: TPointArray; w, h: Integer): TPointArray;
var i1, i2, l1, l2, r: LongInt;
begin
l1 := High(TPA1);
l2 := High(TPA2);
r := 0;
for i1 := 0 to l1 do
begin
for i2 := 0 to l2 do
begin
if (ABS(TPA1[i1].x - TPA2[i2].x) <= w) and (ABS(TPA1[i1].y - TPA2[i2].y) <= h) then
begin
Inc(r);
SetLength(Result, r + 1);
result[r].x := ((TPA1[i1].x + TPA2[i2].x) div 2);
result[r].y := ((TPA1[i1].y + TPA2[i2].y) div 2);
end;
end;
end;
end;
{************************************************* ******************************
function CheckAxe: boolean;
By: PriSoner
Description: Small function to check if part of the phrase:
You do not have an axe which you have the woodcutting level to use.
is present as the last black message in the chat box. It does this
as it is quicker and less system intensive than parsing for dtms
or bitmaps. Use this function immediately after clicking a tree.
Returns True if Axe is Present and False if No Axe is Present.
************************************************** *****************************}
function CheckAxe: boolean;
begin
if Pos('an axe', GetBlackChatMessage) = 17 then
begin
writeln('You do not have a suitable axe....');
result := false;
end else result := true;
end;
{************************************************* ******************************
procedure EndAllPlayers;
By: PriSoner
Description: Sets all players to inactive.
************************************************** *****************************}
procedure EndAllPlayers;
var i: integer;
begin
for i := 0 to Length(Players) - 1 do
begin
Players[i].Active := false;
end;
end;
{************************************************* ******************************
function FindObjOld(var cx, cy: Integer; Text: String; color, tolerance: Integer): Boolean;
By: Stupid3ooo and modified by Ron.
Description: Finds Object.
************************************************** *****************************}
function FindObjOld(var cx, cy: Integer; Text: string; color, tolerance: Integer): Boolean;
var
a, c, i, x1, y1, x2, y2: Integer;
begin
x1 := 245;
y1 := 165;
x2 := 277;
y2 := 185;
repeat
if (not (Loggedin)) then
Break;
a := a + 1;
if (a = 1) or (a = 3) then
c := c + 1;
for i := 1 to c do
begin
if (a = 1) then
begin
x1 := x1 + 30;
x2 := x2 + 30;
end else
if (a = 2) then
begin
y1 := y1 - 20;
y2 := y2 - 20;
end else
if (a = 3) then
begin
x1 := x1 - 30;
x2 := x2 - 30;
end else
if (a = 4) then
begin
y1 := y1 + 20;
y2 := y2 + 20;
end;
if (x1 = 485) and (x2 = 517) then
x2 := x2 - 2;
if (y1 = 325) and (y2 = 345) then
y2 := y2 - 7;
if (x2 > 515) then
Break;
if (FindColorTolerance(cx, cy, color, x1, y1, x2, y2, tolerance)) then
begin
MMouse(cx, cy, 0, 0)
Wait(50+Random(50));
if (IsUpText(Text)) then
begin
Result := True;
Break;
end;
end;
end;
if (a = 4) then
a := 0;
until (x2 > 515) or (Result = True);
end;
{************************************************* ******************************
function FindBirdsNestN2(var fx, fy: Integer):Bolean;
By: Nava2
Description: Attempts to a Find Birds Nest when called.
************************************************** *****************************}
function FindBirdsNestN2(var fx, fy: Integer): Boolean;
var
arP, arAP: TPointArray;
arC, arUC: TIntegerArray;
ararP: T2DPointArray;
tmpCTS, i, j, arL, arL2: Integer;
P: TPoint;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.10, 0.40);
if not(FindColorsTolerance(arP, 2832187, MSX1, MSY1, MSX2, MSY2, 11)) then
begin
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
arC := GetColors(arP);
arUC := arC;
ClearSameIntegers(arUC);
arL := High(arUC);
arL2 := High(arC);
for i := 0 to arL do
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 1.06) and (X <= 8.30) and (Y >= 1.14) and (Y <= 8.78) and (Z >= 0.81) and (Z <= 5.83) then
begin
for j := 0 to arL2 do
begin
if (arUC[i] = arC[j]) then
begin
SetLength(arAP, Length(arAP) + 1);
arAP[High(arAP)] := arP[j];
end;
end;
end;
end;
SortTPAFrom(arAP, Point(MSCX, MSCY));
ararP := SplitTPAEx(arAP, 10, 10);
arL := High(ararP);
for i := 0 to arL do
begin
if (Length(ararP[i]) < 5) then Continue;
P := MiddleTPA(ararP[i]);
MMouse(P.x - 4, P.y - 4, 9, 9);
Wait(100 + Random(100));
if (IsUpText('Take Bird')) then
begin;
Result := True;
Break;
end;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
GetMousePos(fx, fy);
end;
{************************************************* ******************************
function MyFindBirdsNest: boolean;
By: Nava2
Description: Attempts to a Find Birds Nest if one is dropped & Pick it up.
If it can not find one within 90 seconds it exits as Fallen Birds
Nests do not last that long. beta version Records a failure to
find the birds nest.
************************************************** *****************************}
function MyFindBirdsNest : Boolean;
var
x, y, SAngle, TAngle, T : Integer;
begin
Result := False;
if Pos('nest falls', GetBlackChatMessage) = 10 then
begin
Writeln('PickUpBirdsNest : Bird''s Nest has dropped, searching.');
SetAngle(True);
if FindBirdsNestN2(x, y) then
begin
Mouse(x, y, 0, 0, True);
Result := True;
Flag;
end else
begin
SAngle := Round(rs_GetCompassAngleDegrees);
TAngle := SAngle;
MarkTime(T);
repeat
TAngle := TAngle + RandomRange(40, 60);
if TAngle > (SAngle + 360) then
SetAngle(False);
if TAngle > (SAngle + 360 * 2) then
TAngle := SAngle;
MakeCompass(IntToStr(TAngle));
if FindBirdsNestN2(x, y) then
begin
Mouse(x, y, 0, 0, True);
Flag;
Result := True;
Break;
end;
Wait(RandomRange(200, 300));
until (TimeFromMark(T) > 90000) or Result;
if (TimeFromMark(t) > 90000) and not Result then
Writeln('PickUpBirdsNest : Could not find Bird''s nest in 90 seconds.');
MakeCompass(IntToStr(SAngle));
end;
end;
if Result then Writeln('PickUpBirdsNest : Found and picked up Birds Nest.');
end;
{************************************************* ******************************
function MyObjectFinder(var x, y: Integer; UpTxt: String; objcol, objsize, offsetx, offsety, ax1, ay1, ax2, ay2: integer): Boolean;
By: PriSoner
Description: My object finder in beta..
************************************************** *****************************}
function MyObjectFinder(var x, y: Integer; UpTxt: String; objcol, objsize, offsetx, offsety, ax1, ay1, ax2, ay2: integer): Boolean;
var objTPA: TpointArray;
ATPA: T2DPointArray;
h, i, cx, cy: integer;
begin
cx := ((ax2 - ax1) div 2);
cy := ((ay2 - ay1) div 2);
FindColorsSpiralTolerance(cx, cy, objTPA, objcol, ax1, ay1, ax2, ay2, 4);
if Length(objTPA) > 0 then
begin
ATPA := SplitTPAEx(objTPA, objsize, objsize);
h := High(ATPA);
if Length(ATPA) > 0 then
begin
for i := 0 to h do
begin
MiddleTPAEx(ATPA[i], x, y);
x := x + offsetx;
y := y + offsety;
MMouse(x, y, 1, 1);
wait(600 + Random(600));
if IsUpText(UpTxt) or (UpTxt = 'none') then
begin
result := true;
exit;
end;
i := i + 1;
wait(500 + Random(500));
end;
end;
end;
writeln('Could not find Object');
end;
{************************************************* ******************************
function FindTree(var a, b: Integer; Treetype : String): Boolean;
By: Negaal (Slightly modded for this script)
Description: Finds Trees and returns x & y coords.
Treetype: tree, yew, oak, willow, all
************************************************** *****************************}
function FindTree(var a, b: Integer; Treetype : String): Boolean;
var
TPA : TpointArray;
ATPA: T2DPointArray;
i, C, CTS, Count, treecol: integer;
Uptext : String;
Colors : Array of integer;
SortedTPA : TPointArray;
x, y, z, h, s, l : extended;
begin
Case lowercase(TreeType) of
'tree' : begin
Uptext := 'ree';
treecol:= 2774862;
end;
'oak' : begin
UpText := 'ak';
treecol:= 2446923;
end;
'willow' : begin
UpText := 'illo';
treecol:= 6326395;
end;
'maple' : begin
UpText := 'aple';
treecol:= 3363208;
end;
'yew' : begin
UpText := 'ew';
treecol:= 5013108;
end;
'magic' : begin
UpText := 'agic';
treecol:= 6202776;
end;
'all' : begin
UpText := 'hop d';
treecol:= 2446923;
end;
end;
CTS := GetColorToleRanceSpeed;
ColorToleranceSpeed(2);
SetColorspeed2Modifiers(0.15, 0.5);
FindColorsSpiralTolerance(mscx, mscy, TPA, treecol, msx1, msy1, msx2, msy2, 20);
ColorToleranceSpeed(CTS);
SetColorspeed2Modifiers(0.2, 0.2);
TPA:=ReArrangeandShortenArrayEx(TPA, 5, 5);
Colors := GetColors(TPA);
SetLength(SortedTPA, Length(TPA));
Count := 0;
for C := 0 to High(TPA) do
begin
colortoxyz(colors[i], x, y, z);
if(x > 1)and(x < 22)and(y > 0)and(y < 11)and(z > 1)and(z < 28)then
begin
colortohsl(colors[i], h, s, l);
if (h > 17)and(h < 22)and(s > 23)and(s < 62)and(l > 7)and(l < 45) then
begin
SortedTPA[Count] := TPA[C];
Count := Count + 1;
end;
end;
end;
SetLength(SortedTPA, Count);
SortedTPA := TPA;
begin
ATPA := SplitTPAEx(SortedTPA, 12, 12);
SortATPAFrom(ATPA, IntToPoint(mscx, mscy));
for i := 0 to High(ATPA) do
if Length(ATPA[i]) >= 50 then
begin
MiddleTPAEx(ATPA[i], a, b);
MMouse(a-10, b-10, 21, 21);
Wait(50 + random(50));
if IsUpText(UpText)then
begin
Result := True;
Getmousepos(a, b);
Exit;
end;
end;
end;
end;
{************************************************* ******************************
procedure DropUnwanted;
By: PriSoner
Description: Just a small little procedure to drop unwanted items..
ongoing depends on what other low value items I get given
************************************************** *****************************}
procedure DropUnwanted;
var x, y, i, DTMa2z: integer;
UnwantedDTM: Array of Integer;
begin
SetLength(UnwantedDTM, 11);
UnwantedDTM[0] := DTMFromString('78DA63E4656060E0624001F764EF3070006 94' + // Security Book
'620FE0F048C4C408610031A60442281340F906021A0460A48 7010' +
'50230C24C4F1AB0100A6DF0671');
UnwantedDTM[1] := DTMFromString('78DA631461606010604001CB26C73370006 94' + // Baguette
'620FE0F048CEC408604031A60442281B434906021420D1F01 3502' +
'84ED020096E3065E');
UnwantedDTM[2] := DTMFromString('78DA631460606010624001FC45CE0C1C409 A1' + // Frog Token
'188FF0301232B90C1C4800618914820AD00245808A8910312 0A04' +
'D480EC91C3AF06000AB00582');
UnwantedDTM[3] := DTMFromString('78DA63E46160601067400117CF9B31B0026 94' + // Strength Potion (2)
'620FE0F048C1C40060F031A60442281343F906025A0461848 C812' +
'50C34A580D00B1530683');
UnwantedDTM[4] := DTMFromString('78DA63E4606060006124505815CCC006A41 98' + // Spinach Roll
'1F83F103082E49918D000231209A4F98850C30324B809A861 2252' +
'8D207E3500026305B3');
UnwantedDTM[5] := DTMFromString('78DA631467606010624001B37A3C1858813 42' + // Triangle Sandwich
'310FF0702466E20839F010D302291405A0948701050230724 2409' +
'A81101122AF8D500008613065A');
UnwantedDTM[6] := DTMFromString('78DA6314646060E0614001829D620C6C409 A1' + // Kebab
'188FF0301233F90C1CC800618914820CD0224F809A8E10212 9204' +
'D44813360700F2D80550');
UnwantedDTM[7] := DTMFromString('78DA63E46560601064400197E74931B0026 94' + // Beer
'620FE0F048C2C40063F031A60442281B414116A40763113A1 4686' +
'801A3620C14A408D109090C2AF0600467D066B');
UnwantedDTM[8] := DTMFromString('78DA63E4656060E06140017545D60C6C409 A1' + // Bread Roll
'188FF0301230790C1C68006189148202D4C841A7120C14D40 0DC8' +
'3D4204D4B0020901FC6A000D0605D5');
UnwantedDTM[9] := DTMFromString('78DA6314626060E0614001930A5D18D8803 42' + // Pie
'310FF070246901A660634C0884402692520C147408D309010 27A0' +
'861548F0E35703005E7D05F9');
UnwantedDTM[10]:= DTMFromString('78DA63E4656060E061400173BA231958813 42' + // Square Sandwich
'310FF0702460120439C010D302291405A02D31C0C35FC4082 9580' +
'1A7620C149400DC80C21FC6A005AC00632');
GameTab(4);
for i := 0 to High(UnwantedDTM) do
begin
DTMa2z := UnwantedDTM[i]
if FindDTM(DTMa2z, x, y, 546, 203, 737, 466) then
begin
mouse(x, y, 2, 2, false);
wait(500 + Random(500));
ChooseOption('rop');
wait(1000 + Random(1000));
end;
FreeDTM(DTMa2z);
end;
{ if CoinAmount('Inv') > 0 and CoinAmount('Inv') < 299 then // Drop Coins if less than 299 (Not Working Yet)
begin
coinbmp := loadcoinbmp;
FindBitmapToleranceIn(coinbmp, x, y, 546, 203, 737, 466, 1);
writeln(IntToStr(x) + ' ' + IntToStr(y));
mouse(x, y, 3, 3, false);
wait(500 + Random(500));
ChooseOption('rop');
wait(1000 + Random(1000));
FreeBitmap(coinbmp);
end; }
end;
{************************************************* ******************************
function MyInPin(pin: String): Boolean;
by: RSN / Starblaster100 (Modded by PriSoner to cope if incorrect pin has been entered.)
Description: Puts in bank pin. Results True if XXX
************************************************** *****************************}
function MyInPin(pin: string): Boolean;
var
iNumber, i, i2, i3: Integer;
begin
i := 0;
i3 := 0;
result := true;
repeat
for iNumber := 1 to Length(pin) do
begin
MMouse(395, 175, 10, 10);
Wait(500 + Random(500));
ClickText(pin[iNumber], upchars, 1, 1, 512, 336, True);
Wait(200 + Random(200));
end;
i2 := 0;
i3 := i3 + 1;
while not BankScreen or (i2 <= 3) do
begin
if (Pos('ncorrect', lowercase(GetTalkingNPCName)) > 10) or (Pos('t know', lowercase(GetTalkingNPCName)) > 4) then
begin
i := i + 1;
if i <= 3 then ClickContinue(true, true) else
begin
writeln('Wrong Pin Entered 3 times. Logging Out');
LogOut;
result := false;
exit;
end;
end else wait(800);
i2 := i2 + 1
end;
Wait(100);
if i3 >= 3 then
begin
writeln('Wrong Pin Entered 3 times. Logging Out');
result := false;
exit;
end;
until BankScreen or not LoggedIn;
end;
{************************************************* ******************************
function PTimeRunning: String;
By: from Phalanxs script/RsN (Slighted Modded by PriSoner for Player Time)
Description: Returns Time since ST (Script StartTime).
************************************************** *****************************}
function PTimeRunning: String;
var
RHours, Minutes, Seconds, RMinutes, RSeconds: LongInt;
Time: string;
begin
Seconds := ((GetSystemTime div 1000) - PlayerStartTime);
Minutes := Seconds div 60;
RHours := Minutes div 60;
Time := IntToStr(Seconds) + ' Seconds';
if Minutes <> 0 then
begin
RSeconds := Seconds mod (Minutes * 60);
Time := IntToStr(Minutes) + ' Minutes and ' + IntToStr(RSeconds) +
' Seconds';
end;
if RHours <> 0 then
begin
RMinutes := Minutes mod (RHours * 60);
RSeconds := Seconds mod (Minutes * 60);
Time := IntToStr(RHours) + ' Hours, ' + IntToStr(RMinutes) +
' Minutes and ' + IntToStr(RSeconds) + ' Seconds';
end;
Result := Time;
end;
{************************************************* ******************************
procedure FinalUCBReport;
By: PriSoner
Description: Displays the final report.
************************************************** *****************************}
procedure FinalUCBReport;
var i, TLoads, TYews, TMagic, TXP, TBSeeds, TBRings, TBEggs, TRands: integer;
trstring: string;
begin
for i := 0 to Length(Players) - 1 do
begin
TLoads := TLoads + Players[i].Banked;
TYews := TYews + Players[i].Integers[4];
TMagic := TMagic + Players[i].Integers[8];
TXP := TXP + Players[i].Integers[3];
TBSeeds := TBSeeds + Players[i].Integers[5];
TBRings := TBRings + Players[i].Integers[6];
TBEggs := TBEggs + Players[i].Integers[7];
TRands := TRands + Players[i].Integers[9];
end;
writeLn('######################################### ##########################');
writeLn(' Ultra Cut n Bank ' + UCBversion);
writeLn(' Final Report');
writeLn(' Ran for: ' + TimeRunning);
writeLn(' Total Players: ' + IntToStr(Length(Players)));
writeLn(' Total Banks: ' + DigitGroup(TLoads));
if TYews > 0 then writeLn(' Total Yew Logs Banked: ' + DigitGroup(TYews));
if TMagic > 0 then writeLn(' Total Magic Logs Banked: ' + DigitGroup(TMagic));
if TBSeeds > 0 then writeLn(' Birds Nests (Seeds) Banked: ' + DigitGroup(TBSeeds));
if TBRings > 0 then writeLn(' Birds Nests (Rings) Banked: ' + DigitGroup(TBRings));
if TBEggs > 0 then writeLn(' Birds Nests (Eggs) Banked: ' + DigitGroup(TBEggs));
if TRands > 0 then writeLn(' Random Event Items Banked: ' + DigitGroup(TRands));
writeLn(' Total XP earned: ' + DigitGroup(TXP));
writeLn('######################################### ##########################');
for i := 0 to Length(Players) - 1 do
begin
if Players[i].Active then trstring := 'Yes' else trstring := 'no';
writeln('Player' + IntToStr(i) + ' Still Active? ' + trstring + '. earned: ' + IntToStr(Players[i].Integers[3]) + ' XP. reason ended: ' + Players[i].Strings[3]);
end;
SaveDebug;
SendSRLReport;
end;
{************************************************* ******************************
procedure UCBPlayerReport(ReasonPlayerEnded: String; DebugImage, LoggedInFail: boolean);
By: PriSoner
Description: Displays Report when called on current totals.
Quits and Saves/Displays a Debug image when appropriate.
ReasonPlayerEnded: String explaing why, when, where it UCBPlayerReport was called. Enter None if Not Ended
DebugImage: Boolean, If true will save & display a screen capture of moment script ended.
LoggedInFail: Bolean, Checks to see if script is being called because of "not LoggedIn" being called
LoggedIn ocasionally reports the wrong status, with this option enabled it will wait
and re-check a few times before either continuing or returning.
************************************************** *****************************}
procedure UCBPlayerReport(ReasonPlayerEnded: String; DebugImage, LoggedInFail: boolean);
var i: integer;
d: string;
b: boolean;
begin
if Players[CurrentPlayer].Booleans[3] and DebugImage then SaveScreenshot('UCBDebug.bmp');
if LoggedInFail then
begin
if DebugOn then SaveScreenshot('UCBLogin-Debug.bmp');
for i := 1 to 5 do
begin
// writeln('LogggedIn Returned "False", Retry ' + IntToStr(i) + ' of 10');
wait(2000);
if LoggedIn then
begin
writeln('LoggedIn Failure Recovered..');
ReasonPlayerEnded := 'none';
exit;
end;
end;
end;
if LoggedIn then
begin
Players[CurrentPlayer].Integers[3] := (GetXP('woodcutting') - Players[CurrentPlayer].Integers[1]);
Players[CurrentPlayer].Integers[2] := GetSkillInfo('woodcutting',false);
Players[CurrentPlayer].Integers[12]:= XpTillNextLevel('woodcutting');
wait(500 + Random(600));
end;
ClearDebug;
// I did want to have the GetSkillInfo Check in CheckIfBank procedure however it created
// a conflict with CountItemDTM constantly switching between GameTabs..
writeLn('######################################### ##########################');
writeLn(' Ultra Cut n Bank ' + UCBversion);
writeLn(' Player Report for: ' + Players[CurrentPlayer].Name);
writeln(' Location: ' + Players[CurrentPlayer].Strings[2]);
writeLn(' Ran for: ' + PTimeRunning);
writeLn(' Loads Banked: ' + DigitGroup(Players[CurrentPlayer].Banked));
if Players[CurrentPlayer].Integers[4] > 0 then writeLn(' Yew Logs Banked: ' + DigitGroup(Players[CurrentPlayer].Integers[4]));
if Players[CurrentPlayer].Integers[8] > 0 then writeLn(' Magic Logs Banked: ' + DigitGroup(Players[CurrentPlayer].Integers[8]));
if Players[CurrentPlayer].Integers[5] > 0 then writeLn(' Birds Nests (Seeds) Banked: ' + DigitGroup(Players[CurrentPlayer].Integers[5]));
if Players[CurrentPlayer].Integers[6] > 0 then writeLn(' Birds Nests (Rings) Banked: ' + DigitGroup(Players[CurrentPlayer].Integers[6]));
if Players[CurrentPlayer].Integers[7] > 0 then writeLn(' Birds Nests (Eggs) Banked: ' + DigitGroup(Players[CurrentPlayer].Integers[7]));
if Players[CurrentPlayer].Integers[9] > 0 then writeLn(' Random Event Items Banked: ' + DigitGroup(Players[CurrentPlayer].Integers[9]));
if (PMaxLoads > 0) and (PMaxLoads <= Players[CurrentPlayer].Banked) then
begin
ReasonPlayerEnded := 'Total Player Loads Banked Limit Reached.';
if LoggedIn then LogOut;
KeepPlayer := false;
end;
b := true;
if (ReasonPlayerEnded <> 'none') then
begin
writeLn(' Reason Player Ended: ' + ReasonPlayerEnded);
Players[CurrentPlayer].Strings[3] := ReasonPlayerEnded;
if LoggedIn then LogOut;
if not Players[CurrentPlayer].Booleans[2] then KeepPlayer := false;
b := false;
end;
if (SessLoads > 0) and (Players[CurrentPlayer].Integers[11] >= SessLoads) and b then
begin
Players[CurrentPlayer].Booleans[2] := true;
writeLn(' Reason Player Ended: Maximum Loads Banked this session...');
end;
if Players[CurrentPlayer].Integers[2] > Players[CurrentPlayer].level[20] then d := 'now' else d := 'still';
writeLn(' Player ' + Players[CurrentPlayer].Name + ' Started at Level ' + IntToStr(Players[CurrentPlayer].level[20]) + ' and is ' + d + ' at Level ' + IntToStr(Players[CurrentPlayer].Integers[2]));
writeLn(' You earned ' + DigitGroup(Players[CurrentPlayer].Integers[3]) + ' xp This session with ' + DigitGroup(Players[CurrentPlayer].Integers[12]) + ' xp to the next Level');
writeLn(' Overall Running Time: ' + TimeRunning);
writeLn('######################################### ##########################');
SaveDebug;
CIBTrue := false;
SRLRandomsReport;
SendSRLReport;
end;
{************************************************* ******************************
function CheckIfBank: Boolean;
By: PriSoner
Description: Returns True if any condition that may require banking is met.
************************************************** *****************************}
function CheckIfBank: Boolean;
var i, TLoads, TLogs, TXP: integer;
begin
if not LoggedIn then exit;
result := true;
if CIBTrue then exit;
result := false;
GameTab(4);
if InvFull then
begin
DropUnwanted;
wait(500);
if InvFull then result := true;
end;
CIBReason := 'none';
for i := 0 to Length(Players) - 1 do
begin
TLoads := TLoads + Players[i].Banked;
TLogs := TLogs + Players[i].Integers[4] + Players[i].Integers[8];
TXP := TXP + Players[i].Integers[3];
end;
if (TMaxTime > 0) and (TMaxTime <= ((GetTimeRunning div 1000) div 60)) then
begin
writeLn('Maximum Overall Time Limit Reached....');
result := true;
CIBTrue := true;
CIBReason := 'Maximum Overall Time Limit Reached.';
EndAllPlayers;
exit;
end;
if (TMaxLogs > 0) and (TMaxLogs <= TLogs) then
begin
writeLn('Total Logs Banked limit reached....');
result := true;
CIBTrue := true;
CIBReason := 'Total Logs Banked limit reached.';
EndAllPlayers;
exit;
end;
if (TMaxLoads > 0) and (TMaxLoads <= TLoads) then
begin
writeLn('Total Loads Banked limit reached.....');
result := true;
CIBTrue := true;
CIBReason := 'Total Loads Banked limit reached.';
EndAllPlayers;
exit;
end;
if (PMaxTime > 0) and (PMaxTime <= (((GetSystemTime - Players[CurrentPlayer].Integers[10]) div 1000) div 60)) then
begin
writeLn('Maximum Total Time Limit for this player has been reached....');
result := true;
CIBTrue := true;
CIBReason := 'Maximum Time Limit for this player has been reached.';
exit;
end;
if (SessTime > 0) and (SessTime <= (((GetSystemTime div 1000) - PlayerStartTime) div 60)) then
begin
writeLn('Maximum Time reached for this session...');
result := true;
CIBTrue := true;
CIBReason := 'Maximum Time reached for this session... Changing Player.';
Players[CurrentPlayer].Booleans[2] := true;
exit;
end;
if (PMaxLogs > 0) and (PMaxLogs <= Players[CurrentPlayer].Integers[4] +
Players[CurrentPlayer].Integers[8] + CountItemsDtm('inv', YewDTM) + CountItemsDtm('inv', MagicDTM)) then
begin
writeLn('Maximum Logs for player reached');
result := true;
CIBTrue := true;
CIBReason := 'Total Player Logs Cut Limit Reached.';
exit;
end;
end;
{************************************************* ******************************
function ExistsItemCustom(i: Integer): Boolean;
By: WT-Fakawi Slightly Modded to avoid GameTab Warnings.
Description: Checks if item in inventory at specified position exists
************************************************** *****************************}
function ExistsItemCustom(i: Integer): Boolean;
var
x, y:Integer;
TB: TBox;
begin
TB := InvBox(i);
Result := FindColor(x, y, 65536, TB.x1 + 5, TB.y1 + 5, TB.x2 - 5, TB.y2 - 5);
end;
{************************************************* ******************************
Function GetInvItemBoundsCustom(InvSpot: Integer; T: TBox): Boolean;
By: Wizzup? Slightly Modded to avoid GameTab Warnings.
Description: If item exists, returns TBox of the item, else returns the normal InvBox.
************************************************** *****************************}
Function GetInvItemBoundsCustom(InvSpot: Integer; Var T: TBox): Boolean;
Var
TPA: TPointArray;
Begin
T := InvBox(InvSpot);
FindColorsTolerance(TPA, 65536, T.x1, T.y1, T.x2, T.y2, 0);
If Length(TPA) = 0 Then
Begin
Result := False;
T := InvBox(InvSpot);
Exit;
End;
Result := True;
T := GetTPABounds(TPA);
End;
{************************************************* ******************************
procedure MMouseItemCustom(i: Integer);
By: WT-Fakawi Slightly Modded to avoid GameTab Warnings.
Description: Moves mouse to specified inventory spot
************************************************** *****************************}
procedure MMouseItemCustom(i: Integer);
var
TB: TBox;
x, y: integer;
begin
GetInvItemBoundsCustom(I, TB);
MouseBox(TB.X1 + 4, TB.Y1 + 4, TB.X2 - 4, TB.Y2 - 4, 3);
GetMousePos(x, y);
Mouse(x, y, 0, 0, false);
end;
{************************************************* ******************************
procedure DepositCustom(slot, toslot, vType: Integer);
by: WT-Fakawi/PPLSUQBAWLZ/Stupid3ooo/Town Slightly Modded to avoid GameTab Warnings.
Description: Deposits from Slot to ToSlot.
vType True = Deposit All. vType False = Deposit one by one.
Any integer is deposit with Deposit X. (except for 5 and 10)
************************************************** *****************************}
Procedure DepositCustom(SlotFrom, SlotTo: Integer; vType: Variant);
Var
DepositX: Boolean;
All: Variant;
I, T, x, y: Integer;
Begin
If Not BankScreen Then
Exit;
If vType = 2 Then
srl_Warn('Deposit', '2 now means store per 2, not ''All''', 15);
DepositX := False;
Case VarType(vType) Of
3: Begin
DepositX := Not InIntArray([1, 5, 10], vType);
If vType = 1 Then
All := False
Else
All := True;
End;
11: All := vType;
End;
For I := SlotFrom To SlotTo Do
Begin
If Not ExistsItemCustom(I) Then
Continue;
MMouseItemCustom(I);
If DepositX Then
Begin
ChooseOption('Deposit-X');
T := GetSystemTime;
While (Not FindColor(x, y, 8388608, MCX1, MCY1, MCX2, MCY2)) And (GetSystemTime - T < 3000) Do
Wait(100);
TypeSend(vType);
End Else If VarType(vType) = 3 Then
ChooseOption('Deposit-' + vType)
Else
ChooseOption('Deposit-All');
Wait(RandomRange(200, 300));
T := GetSystemTime;
While ExistsItemCustom(I) And (GetSystemTime - T < 2000) Do
Wait(50);
End;
End;
{************************************************* ******************************
procedure CountBankedItems;
By: PriSoner
Description: Add all items in the back pack to a running total before banking.
************************************************** *****************************}
procedure CountBankedItems;
var a, b, c, d, e, f, i: integer;
begin
if not LoggedIn then exit;
a := 0;
for i := 1 to 28 do if (ExistsItemCustom(i)) then a := a + 1;
b := CountItemsDtm('inv', YewDTM);
c := CountItemsDtm('inv', NestSeedDTM);
d := CountItemsDtm('inv', NestRingDTM);
e := CountItemsDtm('inv', NestEggDTM);
f := CountItemsDtm('inv', MagicDTM);
Players[CurrentPlayer].Integers[4] := (Players[CurrentPlayer].Integers[4] + b);
Players[CurrentPlayer].Integers[5] := (Players[CurrentPlayer].Integers[5] + c);
Players[CurrentPlayer].Integers[6] := (Players[CurrentPlayer].Integers[6] + d);
Players[CurrentPlayer].Integers[7] := (Players[CurrentPlayer].Integers[7] + e);
Players[CurrentPlayer].Integers[8] := (Players[CurrentPlayer].Integers[8] + f);
Players[CurrentPlayer].Integers[9] := (Players[CurrentPlayer].Integers[9] + (a - b - c - d - e - f));
Players[CurrentPlayer].Integers[11] := (Players[CurrentPlayer].Integers[11] + 1);
Players[CurrentPlayer].Banked := (Players[CurrentPlayer].Banked + 1);
// SRL Stats Reporting
ReportVars[0] := (ReportVars[0] + b); // Yews Banked Reported to SRL Stats
ReportVars[1] := (ReportVars[1] + (c + d + e)); // Birds Nests Banked Reported to SRL Stats
ReportVars[2] := (ReportVars[2] + (a - b - c - d - e - f)); // Randoms Items Banked Reported to SRL Stats
ReportVars[3] := (ReportVars[3] + 1); // Loads Banked Reported to SRL Stats
ReportVars[4] := (ReportVars[4] + f); // Magic Logs Banked Reported to SRL Stats
Banks := (Banks + 1); // Official Banked Stats for Global SRL Report
end;
function AutoRockColor: Integer;
var
GC, a, l, TestColor: integer;
var
P:array of Tpoint;
begin
GC := 6444639;
Flag;
FindColorsSpiralTolerance(MMCX,MMCY, P, GC, MMX1,MMY1,MMX2,MMY2, 75);
l:=GetArrayLength(P);
for a:= 0 to l-1 do
begin
TestColor := GetColor(P[a].x,P[a].y);
if (GetColor(P[a].x-1,P[a].y)=TestColor-723980) then
begin
Result := TestColor;
WriteLn('Rock Color = ' + IntToStr(TestColor));
Exit;
end;
end;
WriteLn('Could not find Rock Color!');
Result := 0;
end;
{************************************************* ******************************
function AutoTreeSymb: Integer;
By: PriSoner and ACA2
Description: Finds colour of Tree Symbol.
************************************************** *****************************}
function AutoTreeSymb: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
R, G, B: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.23, 1.71);
if not (FindColorsTolerance(arP, 822033, MMX1, MMY1, MMX2, MMY2, 9)) then
begin
Writeln('Failed to find the tree symbol by AutoColour.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);
for i := 0 to arL do
begin
if (rs_OnMinimap(arP[i].x, arP[i].y)) then
begin
ColorToRGB(arC[i], R, G, B);
if (R >= 0) and (R <= 41) and (G >= 108) and (G <= 164) and (B >= 0) and (B <= 35) then
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 5.47) and (X <= 13.91) and (Y >= 10.93) and (Y <= 26.59) and (Z >= 1.83) and (Z <= 5.93) then
begin
Result := arC[i];
Break;
end;
end;
end;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then Writeln('AutoColor failed to find the Tree Symbol colour.');
end;
{************************************************* ******************************
function AutoShopSymb: Integer;
By: PriSoner and ACA2
Description: Finds colour of Tree Symbol.
************************************************** *****************************}
function AutoShopSymb: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
R, G, B: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.23, 2.72);
FindColorsSpiralTolerance(MMCX, MMCY, arP, 1526686, MMX1, MMY1, MMX2, MMY2, 6);
if (Length(arP) = 0) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);
for i := 0 to arL do
begin
ColorToRGB(arC[i], R, G, B);
if (R >= 138) and (R <= 170) and (G >= 59) and (G <= 95) and (B >= 6) and (B <= 44) then
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 12.87) and (X <= 20.29) and (Y >= 9.34) and (Y <= 16.35) and (Z >= 1.28) and (Z <= 4.36) then
begin
Result := arC[i];
Break;
end;
end;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
Writeln('AutoColor failed in finding the shop symbol color.');
end;
{************************************************* ******************************
function AutoBankSymb: Integer;
By: PriSoner and ACA2
Description: Finds colour of Bank Symbol.
************************************************** *****************************}
function AutoBankSymb: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
R, G, B: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.10, 1.45);
if not (FindColorsTolerance(arP, 3002600, MMX1, MMY1, MMX2, MMY2, 13)) then
begin
Writeln('Failed to find the bank symbol by AutoColour.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);
for i := 0 to arL do
begin
if (rs_OnMinimap(arP[i].x, arP[i].y)) then
begin
ColorToRGB(arC[i], R, G, B);
if (R >= 205) and (R <= 255) and (G >= 181) and (G <= 227) and (B >= 0) and (B <= 96) then
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 42.74) and (X <= 68.56) and (Y >= 46.79) and (Y <= 75.55) and (Z >= 7.39) and (Z <= 21.44) then
begin
Result := arC[i];
Break;
end;
end;
end;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then Writeln('AutoColor failed in finding the bank symbol color.');
end;
function BankSymbColor: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
R, G, B: Integer;
H, S, L: Extended;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(1);
FindColorsSpiralTolerance(MMCX, MMCY, arP, 2478835, MMX1, MMY1, MMX2, MMY2, 36);
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
ColorToRGB(arC[i], R, G, B);
if (R >= 229) and (R <= 256) and (G >= 187) and (G <= 233) and (B >= 12) and (B <= 61) then
begin
ColorToHSL(arC[i], H, S, L);
if (H >= 13.21) and (H <= 14.88) and (S >= 80.22) and (S <= 100.02) and (L >= 48.02) and (L <= 61.78) then
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 51.23) and (X <= 70.56) and (Y >= 53.31) and (Y <= 79.17) and (Z >= 8.00) and (Z <= 14.87) then
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
end;
end;
end;
ColorToleranceSpeed(tmpCTS);
if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;
{************************************************* ******************************
function FindMMTPA(var x, y: integer; color, tol, cts, ObjWidth, ObjHeight, minCount :Integer): Boolean;
By: Wizzup? Modded by PriSoner for use in MiniMap
Description: Finds object using WizzyPlugin functions.
Starts with a Spiral from x and y.
Put in the color, Tolerance and ColorToleranceSpeed.
If you dont know what colortolerancespeed to choose, put in -1.
ObjWidth and ObjHeight are the parameters TPAToATPAEx uses, thus filtering
the MSs FindColorsSpiralTolerance points in boxes defined by
ObjWidth and ObjHeigth.
minCount is the amount of colors it should at least find in a Object box.
************************************************** *****************************}
function FindMMTPA(var x, y: integer; color, tol, cts, ObjWidth, ObjHeight, minCount :Integer): Boolean;
var
I, tcts: Integer;
myPoint: TPoint;
Points: TPointArray;
aPoints: T2DPointArray;
begin
tcts := GetColorToleranceSpeed;
if not (cts >= 0) and (cts <= 2) then
cts := 1; // Standard.
ColorToleranceSpeed(cts);
FindColorsSpiralTolerance(x, y, Points, Color, MMX1, MMY1, MMX2, MMY2, Tol);
aPoints := TPAtoATPAEx(Points, ObjWidth, ObjHeight);
SetLength(Points, 0);
for I := 0 to Length(aPoints) - 1 do
begin
if Length(aPoints[I]) < minCount then
Continue;
myPoint := MiddleTPA(aPoints[I]);
ColorToleranceSpeed(1);
x := myPoint.X;
y := myPoint.Y;
Result := True;
ColorToleranceSpeed(tcts);
ColorToleranceSpeed(cts);
end;
ColorToleranceSpeed(tcts);
end;
{************************************************* ******************************
function GetIconColours: boolean;
By: PriSoner
Description: Gets Current Colour of Bank and Tree Icons in Mini Map
************************************************** *****************************}
function GetIconColours: boolean;
var sf, i: integer;
begin
result := false;
if not LoggedIn then
begin
UCBPlayerReport('Not Logged in During Procedure: GetIconColours.', false, true);
exit;
end;
MarkTime(sf);
i := 0;
repeat
if TimeFromMark(sf) >= 15000 then
begin
i := i + 1;
writeLn('Cannot Find Bank Icon.. Logging Out and In Again to Change Icon Position.');
if i >= 5 then
begin
UCBPlayerReport('Could Not Find Bank Icon After 5 Login Attempts.', false, false);
exit;
end;
Logout;
LoginPlayer;
MarkTime(sf);
SetRun(true);
end;
if AutoBankSymb > 0 then
begin
Players[CurrentPlayer].Integers[15] := AutoBankSymb;
writeln('Found Bank Symbol by AutoColour, Colour is: ' + IntToStr(Players[CurrentPlayer].Integers[15]));
Break;
end else if FindSymbol(x, y, 'tree') then
begin
Players[CurrentPlayer].Integers[15] := GetColor(x + 1, y);
writeln('Found Bank by Symbol, Bank Symbol Colour is: ' + IntToStr(Players[CurrentPlayer].Integers[15]));
Break;
end;
writeln('Please make sure your players location is set correctly and you are in the correct bank.');
writeln('Trying to find bank symbol again...');
writeln(' ');
wait(5000 + Random(3000));
until Players[CurrentPlayer].Integers[15] > 0;
MarkTime(sf);
i := 5;
repeat
if TimeFromMark(sf) >= 15000 then
begin
writeLn('Cannot Find Tree Icon.. moving position and trying again.');
If FindColor(x, y, Players[CurrentPlayer].Integers[15], 550, 7, 682, 161) then
begin
mouse(x - 3, y + i, 6, 3, true);
flag;
wait(500);
i := i + 30;
end else mouse(625, 85 + i, 6, 3, true);
end;
if i >= 70 then
begin
UCBPlayerReport('Could Not Find Tree Icon After 3 attempts to reposition.', false, false);
exit;
end;
if AutoTreeSymb > 0 then
begin
Players[CurrentPlayer].Integers[16] := AutoTreeSymb;
writeln('Found Tree Symbol by AutoColour, Colour is: ' + IntToStr(Players[CurrentPlayer].Integers[16]));
end else if FindSymbol(x, y, 'tree') then
begin
Players[CurrentPlayer].Integers[16] := GetColor(x + 2, y);
writeln('Found Tree by Symbol, Tree Symbol Colour is: ' + IntToStr(Players[CurrentPlayer].Integers[16]));
end;
wait(50);
until Players[CurrentPlayer].Integers[16] > 0;
result := true;
end;
{************************************************* ******************************
function FindTheAxe(var AxePos: integer; var TypeOfAxe: string; AxeInInv: boolean): boolean;
By: PriSoner
Description: Attempts to find an axe in the players inventory or hand.
If an axe is found it checks to see if the player can use it for
woodcutting and checks to see if it can be wielded. If an axe has to be
in the inventory it always moves it to slot 1 if it isn;t already there.
AxeInInv: Set to True and it will move axe from hand to inventory slot 1 if it can.
Set to False and it will move axe from inventory to hand.
AxePos: Returns 0 if no axe is found, 1 if Axe is in hand & 2 if axe is in inventory.
It does this because even if you have Set AxeInv to False it is still
possible that the axe may not be wieldable. Usefull to know if depositing in bank etc.
TypeOfAxe: Return the Type of Axe Being used or 'None Found' if no axe is present.
FindTheAxe returns True if a usable axe is found.
************************************************** *****************************}
type AllAxes = record
AxeDTM: integer;
AxeName: string;
MinLvl: integer;
AttLvl: integer;
end;
function FindTheAxe(var AxePos: integer; var TypeOfAxe: string; AxeInInv: boolean): boolean;
var ax, ay, SklWood, SklAtt, ctab, DTMAxe: integer;
i: integer;
AxeList: Array of AllAxes;
begin
SetLength(AxeList, 8);
AxeList[0].AxeDTM := DTMFromString('78DA633CCAC4C0C0C0C8800C924479197E4 14' +
'5FF0301E376A01A015435205939249D8C9B816AC408A8390E 54C3' +
'4540CD19A01A16026A8E01D5FC66C0AFE600500D2B7E73006 DD70' +
'CD3'); // DTM thanks to Kingoscorm
AxeList[0].AxeName := 'Dragon Axe';
AxeList[0].AttLvl := 60;
AxeList[0].MinLvl := 61;
AxeList[1].AxeDTM := DTMFromString('78DA639CC3C4C0C0C0C8800CDC62D319B8A 0A' +
'2FF8180B10FA88617550D48960B4927588D280135F3816A58 08A8' +
'990D54F38701BF9A4940358C04CC990254C38E5F0D0058F20 AB7'); // DTM thanks to Kingoscorm
AxeList[1].AxeName := 'Rune Axe';
AxeList[1].AttLvl := 40;
AxeList[1].MinLvl := 41;
AxeList[2].AxeDTM := DTMFromString('78DA632C626260F8CF80025CC35C19B8803 42' +
'310FF0702C614A01A1E4654454059981A302F1DA8869F809A 6CA0' +
'1A16026A8A816A5809A82900AAF9C3805F4D0613120FBB1A0 05BF' +
'F0A5C'); // DTM thanks to Kingoscorm
AxeList[2].AxeName := 'Adamant Axe';
AxeList[2].AttLvl := 30;
AxeList[2].MinLvl := 31;
AxeList[3].AxeDTM := DTMFromString('78DA63F460626060606440064ECE890C5C5 0D' +
'1FF40C0680D54C385AA0624CB85A493D106A84698801A47A0 1A16' +
'026ABC806A5809A8F104AAF9C3805F8D1DA6BFD0D50000CA5 9084' +
'4'); // DTM thanks to Kingoscorm
AxeList[3].AxeName := 'Mithril Axe';
AxeList[3].AttLvl := 20;
AxeList[3].MinLvl := 21;
AxeList[4].AxeDTM := DTMFromString('78DA633CCAC4C0708B0105888B8A3270016 94' +
'620FE0F048C3B816A9E31A00146B81A306F3750CD6B026AF6 03D5' +
'3C20A0E63850CD4322D4DC20A0660F50CD1DFC6A001ADB100 8'); // DTM thanks to Kingoscorm
AxeList[4].AxeName := 'Black Axe';
AxeList[4].AttLvl := 10;
AxeList[4].MinLvl := 6;
AxeList[5].AxeDTM := DTMFromString('78DA639CC3C4C0709B0105D496963070016 94' +
'620FE0F048C3D4035EF19D000235C0D983711A8E635013553 816A' +
'1E1250338F08352037DF20A0661250CD1DFC6A0086921010' ); // DTM thanks to Kingoscorm
AxeList[5].AxeName := 'Steel Axe';
AxeList[5].AttLvl := 5;
AxeList[5].MinLvl := 6;
AxeList[6].AxeDTM := DTMFromString('78DA632C646260B8CD8002C2020218B8803 42' +
'310FF0702C614A09A170C688011AE06CC4B03AA7947404D16 50CD' +
'13026A8A816A1E12505300547383809A74A09AFBF8D500007 9D10' +
'E77'); // DTM thanks to Kingoscorm
AxeList[6].AxeName := 'Iron Axe';
AxeList[6].AttLvl := 1;
AxeList[6].MinLvl := 1;
AxeList[7].AxeDTM := DTMFromString('78DA63F4646260B8CD8002FC6C5519B8803 42' +
'310FF0702464BA09A570C6880118904D2364035EF30D57021 AB71' +
'04AA7940400DC83D0F09A87107AAB941408D1D50CD1DFC6A0 0903' +
'60D00'); // DTM thanks to Kingoscorm
AxeList[7].AxeName := 'Bronze Axe';
AxeList[7].AttLvl := 1;
AxeList[7].MinLvl := 1;
ctab := GetCurrentTab;
SklWood := GetSkillInfo('woodcutting',False);
SklAtt := GetSkillInfo('attack', False);
for i := 0 to High(AxeList) do
begin
GameTab(4);
DTMAxe := AxeList[i].AxeDTM;
if FindDTM(DTMAxe, ax, ay, 546, 203, 737, 466) then
begin
if (SklWood < AxeList[i].MinLvl) then
begin
writeLn('Found ' + AxeList[i].AxeName + ' but you do not have a high enough Woodcutting level to use it.');
writeLn('You Need to be Woocutting Level ' + IntToStr(AxeList[i].MinLvl) + ' or higher.');
writeLn('Looking for another axe..........');
end else
begin
if (SklAtt >= AxeList[i].AttLvl) and not AxeInInv then
begin
writeLn('Found a ' + AxeList[i].AxeName + ' and moving it into your players hand.');
Mouse(ax, ay, 10, 4, true);
wait(600 + Random(600));
AxePos := 1;
AxeInInv := false;
end else
begin
if (ax < 600) and (ay < 245) then writeLn('Found a ' + AxeList[i].AxeName + '.') else
begin
writeLn('Found a ' + AxeList[i].AxeName + 'and moving it to slot 1.');
MMouse(ax, ay, 0, 0);
HoldMouse(ax, ay, true);
wait(600 + Random(600));
MMouse(575, 230, 0, 0);
ReleaseMouse(575, 230, true);
end;
AxePos := 2;
AxeInInv := true;
end;
wait(500 + Random(400));
result:= true;
FreeDTM(DTMAxe);
GameTab(ctab);
TypeOfAxe := AxeList[i].AxeName;
exit;
end;
end;
end;
for i := 0 to High(AxeList) do
begin
GameTab(5);
DTMAxe := AxeList[i].AxeDTM;
if FindDTM(DTMAxe, ax, ay, 568, 285, 603, 321) then
begin
AxePos := 1;
if AxeInInv then
begin
writeLn('Found a ' + AxeList[i].AxeName + ' in your players hand. Moving to slot 1 of inventory.');
Mouse(ax, ay, 1, 1, true);
wait(700 + random(700));
GameTab(4);
wait(700 + random(700));
FindDTM(DTMAxe, ax, ay, 546, 203, 737, 466);
if not (ax < 600) and (ay < 245) then
begin
MMouse(ax, ay, 0, 0);
HoldMouse(ax, ay, true);
wait(600 + Random(600));
MMouse(575, 230, 0, 0);
ReleaseMouse(575, 230, true);
end;
AxePos := 2;
end else writeLn('Found a ' + AxeList[i].AxeName + ' in your players hand.');
result:= true;
FreeDTM(DTMAxe);
GameTab(ctab);
TypeOfAxe := AxeList[i].AxeName;
exit;
end;
end;
AxePos := 0;
result:= false;
TypeOfAxe := 'None Found';
FreeDTM(DTMAxe);
GameTab(ctab);
end;
{************************************************* ******************************
function FindBothYews: boolean;
By: PriSoner
Description: Find Both Tree Icons in Mini Map
************************************************** *****************************}
function FindBothYews: boolean;
var x2, y2, y3: integer;
begin
if not LoggedIn then
begin
UCBPlayerReport('Not Logged in During Procedure: FindBothYews.', false, true);
if not KeepPlayer then exit;
end;
MakeCompass('N');
SetAngle(true);
x2:= 626; y2:= 25; y3:= 140;
if FindColorSpiral(x2, y2, Players[CurrentPlayer].Integers[16], 550, 7, 703, 161) then
begin
if FindColorSpiral(x2, y3, Players[CurrentPlayer].Integers[16], 550, 7, 703, 161) then
begin
if y3 - y2 > 25 then
begin
result:= true
exit;
end else result:= false;
end else result:= false;
end else result:= false;
UCBPlayerReport('Could Not Find Both Yew Symbols (Function: FindBothYews)', true, false);
end;
{************************************************* ******************************
function FindTopYew: integer;
By: PriSoner
Description: Find Top Yew Based on Icon Colour and Area of Map..
Needs Tweaking Searches whole of Mini Map instead of small area
************************************************** *****************************}
function FindTopYew: integer;
var y2: integer;
begin
x:= 626; y:= 25; y2:= y;
if FindColorSpiral(x, y, Players[CurrentPlayer].Integers[16], 550, 7, 703, 161) then
begin
result:= y - y2;
end else result:= -1;
end;
{************************************************* ******************************
function FindBottomYew integer;
By: PriSoner
Description: Find Bottom Yew Based on Icon Colour and Area of Map..
Needs Tweaking Searches whole of Mini Map instead of small area
************************************************** *****************************}
function FindBottomYew: integer;
var y2: integer;
begin
x:= 626; y:= 140; y2:= y;
if FindColorSpiral(x, y, Players[CurrentPlayer].Integers[16], 550, 7, 703, 161) then
begin
result:= y2 - y;
end else result:= -1;
end;
{************************************************* ******************************
function BankItems: boolean;
By: PriSoner
Description: Banks all items once bank is open and returns true if successful.
************************************************** *****************************}
function BankItems: boolean;
begin
if not LoggedIn then exit;
Wait(600 + Random(500));
if PinScreen then
begin
if not MyInPin(Players[CurrentPlayer].Strings[0]) then
begin
UCBPlayerReport('BankItems: Failed to enter correct pin after 3 attempts.', false, false);
exit;
end;
end;
wait(500 + Random(500));
if BankScreen then result := true else exit;
CountBankedItems;
DepositCustom(FirstDeposit,28,true);
wait(500 + Random(1000));
DepositCustom(FirstDeposit,28,true); // Just as a Double Check because, although it rarely happens, it does occasionally fail to bank all items.
wait(500 + Random(1000));
CloseBank;
UCBPlayerReport(CIBReason, false, false);
CIBTrue := false;
end;
{************************************************* ******************************
procedure AntiBan;
Description: Basic AntiBan Proceedure.
************************************************** *****************************}
procedure AntiBan;
var OriginalDegrees: integer;
begin
case random(6) of
0: begin
OriginalDegrees := Round(rs_GetCompassAngleDegrees);
RandomMovement;
MakeCompass(IntToStr(OriginalDegrees));
SetAngle(true);
end;
1: begin
Players[CurrentPlayer].Integers[12]:= XpTillNextLevel('woodcutting');
Players[CurrentPlayer].Integers[2] := GetSkillInfo('woodcutting',false);
Players[CurrentPlayer].Integers[3] := (GetXP('woodcutting') - Players[CurrentPlayer].Integers[1]);
end;
2: PickUpMouse;
3: begin
OriginalDegrees := Round(rs_GetCompassAngleDegrees);
BoredHuman;
MakeCompass(IntToStr(OriginalDegrees));
SetAngle(true);
end;
4: begin
OriginalDegrees := Round(rs_GetCompassAngleDegrees);
RandomMovement;
MakeCompass(IntToStr(OriginalDegrees));
SetAngle(true);
end;
5: begin
OriginalDegrees := Round(rs_GetCompassAngleDegrees);
BoredHuman;
MakeCompass(IntToStr(OriginalDegrees));
SetAngle(true);
end;
end;
end;
{************************************************* ******************************
function StrangePlantFinder: Boolean;
By: PriSoner
Description: Tries to detect the presence of a Strange Plant and pick it if found.
this function is in beta testing please report back any problems..
StrangePlantFinder: Returns true if it finds a plant.
************************************************** *****************************}
function StrangePlantFinder: Boolean;
var l, spx, spy, StartSPF, FruitCount, FruitDTM: integer;
TPA1, TPA2, TPA3: TPointArray;
Begin
if not LoggedIn then exit;
result := false
spx := MSCX;
spy := MSCY;
if FindColorTolerance(spx, spy, 945749, MSCX - 100, MSCY - 110, MSCX + 100, MSCY + 90, 4) and FindColorTolerance(spx, spy, 743503, MSCX - 100, MSCY - 110, MSCX + 100, MSCY + 90, 4) then
begin
FindColorsSpiralTolerance(spx, spy, TPA1, 945749, MSX1, MSY1, MSX2, MSY2, 4);
FindColorsSpiralTolerance(spx, spy, TPA2, 743503, MSX1, MSY1, MSX2, MSY2, 4);
SetLength(TPA1, High(TPA1) + 1);
SetLength(TPA2, High(TPA2) + 1);
TPA3 := Find2TPApoints(TPA1, TPA2, 18, 18);
l := High(TPA3);
if l >= 0 then
begin
if FindObjTPA(spx, spy, 945749, 4, -1, 18, 18, 4, ['trange']) then
begin
writeln('Found Strange Plant attempting to Pick fruit.');
FruitDTM := DTMFromString('78DA63E4646060E0654001B30A8E30B0016 94' +
'620FE0F048CDC400633031A60442281B40090E026A0860748 8812' +
'50C30A244408A861C67433BA1A008467066B');
FruitCount := CountItemsDtm('inv', FruitDTM);
Result := True;
MarkTime(StartSPF);
repeat
if FindObjTPA(spx, spy, 945749, 4, -1, 18, 18, 4, ['trange']) then
begin
MMouse(spx, spy, 1, 1);
wait(250 + Random(250));
if IsUpText('trange') then
begin
wait(250 + Random(250));
Mouse(spx, spy, 1, 1, false);
wait(250 + Random(250));
ChooseOption('ick');
wait(500 + Random(600));
if Pos('ready to', GetBlackChatMessage) > 5 then wait(2000 + Random(1000)) else //Text: The fruit isn't ready to be picked yet...
if (Pos('fruit from', GetBlackChatMessage) > 5) or (CountItemsDtm('inv', FruitDTM) > FruitCount) then //Text: You pick the fruit from the plant.
begin
result := true;
writeln('Picked Fruit From Strange Plant.. Waiting for plant to die...');
FreeDTM(FruitDTM);
repeat
BoredHuman;
wait(2000 + random(1000));
until not FindObjTPA(spx, spy, 945749, 4, -1, 18, 18, 4, ['trange']) or FindFight;
Plants := Plants + 1;
SRLRandomsReport;
exit;
end else if Pos('unable', GetBlackChatMessage) > 5 then //Text: You're unable to pick the fruit.
begin
result := false;
writeln('The plant is not after you.. Waiting for plant to go...');
FreeDTM(FruitDTM);
repeat
BoredHuman;
wait(2000 + random(1000));
until not FindObjTPA(spx, spy, 945749, 4, -1, 18, 18, 4, ['trange']) or FindFight;
exit;
end;
end;
end else break;
until (TimeFromMark(StartSPF) > 120000) or FindFight;
writeln('Failed to Pick Fruit From Strange Plant');
FreeDTM(FruitDTM);
end;
end;
end;
end;
procedure CustomEdRunAway(WaitTime: integer); forward;
{************************************************* ******************************
function CheckForAllRandoms: boolean;
By: PriSoner
Description: checks for combination of standard and cutom randoms. ongoing...
************************************************** *****************************}
function CheckForAllRandoms: boolean;
begin
if Pos('tch sp', lowercase(GetTalkingNPCName)) > 0 then ClickContinue(true, true);
if FindNormalRandoms then result := true;
if FindInventoryRandoms then result := true;
if FindNonInventoryRandoms then result := true;
if FindTalk then result := true;
if Pos('arnav', lowercase(GetTalkingNPCName)) > 0 then
begin
UCBPlayerReport('CheckForAllRandoms: Capt Arnav, unsolvable random.', false, false);
result := false;
exit;
end;
if StrangePlantFinder then result := true;
if FindFight then
begin
Case lowercase(Players[CurrentPlayer].Strings[2]) of
'edgeville' : CustomEdRunAway((Random(9000) + 3000));
'tree gnome stronghold - magic' : RunAway('E', true, 1, 3000);
'catherby yews' : RunAway('E', true, 1, 3000);
end;
end;
end;
{************************************************* ******************************
procedure CutTillDown(treetype: string);
By: PriSoner
Description: Calls CheckForAllRandoms, Re-Clicks On Tree & Calls AntiBan functions
until Tree has Been Fully Cut Down. will not work without FindTree Function.
************************************************** *****************************}
procedure CutTillDown(treetype: string);
var cdx, cdy, sc, RandWait: integer;
treetxt: string;
begin
treetype := lowercase(treetype);
treetxt := capitalize(treetype);
delete(treetxt,4,20);
cdx := MSCX;
cdy := MSCY;
if FindTree(cdx, cdy, treetype) then
begin
FindEnt(cdx, cdy, true);
MakeCompassCoords(cdx, cdy);
flag;
MyFindBirdsNest;
CheckForAllRandoms;
if CheckForAllRandoms then if FindTree(cdx, cdy, treetype) then
begin
if not KeepPlayer then exit;
If not FindEnt(cdx, cdy, false) then Mouse(cdx - 2, cdy - 2, 4, 4, true);
MakeCompassCoords(cdx, cdy);
flag;
end;
wait(1500 + Random(500));
if not CheckAxe then UCBPlayerReport('CutTillDown: Unable to cut down tree. CheckAxe = False', false, false);
if not KeepPlayer then exit;
MarkTime(sc);
RandWait := (12000 + Random(30000));
if (lowercase(Players[CurrentPlayer].Strings[2]) = 'draynor willows') then
begin
cdx := ((MSCX - 10) + Random(15));
cdy := ((MSCY - 74) + Random(8));
end else
begin
cdx := ((MSCX - 7) + Random(15));
cdy := ((MSCY - 94) + Random(8));
end;
CheckForAllRandoms;
repeat
if not LoggedIn then
begin
UCBPlayerReport('CutTillDown: Not Logged In. Lost Connection or Unsolveable Random?', true, true);
if not KeepPlayer then exit;
end;
FindEnt(cdx, cdy, true);
if TimeFromMark(sc) > RandWait then
begin
if not FindEnt(cdx, cdy, true) then
begin
if CheckForAllRandoms then if FindTree(cdx, cdy, treetype) then
begin
if not KeepPlayer then exit;
If not FindEnt(cdx, cdy, false) then Mouse(cdx - 2, cdy - 2, 4, 4, true);
MakeCompassCoords(cdx, cdy);
wait(500 + Random(500));
CheckForAllRandoms;
flag;
end;
if random(100) >= 90 then
begin
AntiBan;
cdx := ((MSCX - 3) + Random(7));
cdy := ((MSCY - 95) + Random(7));
mmouse(cdx, cdy, 0, 0);
end else
begin
if FindTree(cdx, cdy, treetype) then
begin
Mouse(cdx - 3, cdy - 3, 6, 6, true);
MakeCompassCoords(cdx, cdy);
wait(random(500));
mmouse(cdx - 2, cdy - 2, 4, 4);
cdx := ((MSCX - 7) + Random(15));
cdy := ((MSCY - 94) + Random(8));
wait(1000 + Random(2000));
mmouse(cdx, cdy, 0, 0);
flag;
CheckForAllRandoms;
if not CheckAxe then
begin
UCBPlayerReport('CutTillDown: Unable to cut down tree, possible broken axe. CheckAxe = False', false, false);
if not KeepPlayer then exit;
end;
end else exit;
end;
end;
MarkTime(sc);
RandWait := (12000 + Random(30000));
end;
if CheckForAllRandoms or MyFindBirdsNest then if FindTree(cdx, cdy, treetype) then
begin
if not KeepPlayer then exit;
If not FindEnt(cdx, cdy, false) then Mouse(cdx - 3, cdy - 3, 6, 6, true);
MakeCompassCoords(cdx, cdy);
CheckForAllRandoms;
wait(500 + Random(500));
flag;
end;
CheckForAllRandoms;
wait(800);
until not IsUpText('down ' + treetxt) or CheckIfBank;
end;
end;
{************************************************* ******************************
procedure LoadAllDTM(LoadIntoMemory: boolean);
By: PriSoner
Description: Set to true to load all DTMs into memory or false to unload.
************************************************** *****************************}
procedure LoadAllDTM(LoadIntoMemory: boolean);
begin
if LoadIntoMemory then
begin
YewDTM := DTMFromString('78DA6314666060E06740017ED65C6021462 0F' +
'E0F048C9C40061B031A60442281B434906026A04611D32E0C 3562' +
'404282801A907BC4F1AB0100B63D057D');
MagicDTM := DTMFromString('78DA631466606010644001C5598E0CAC409 A1' +
'188FF0301231790C1C58006189148202D0324D808A8510212 E204' +
'D488010919026A388184347E3500250B061A');
NestSeedDTM := DTMFromString('78DA6314646060E0614001FE11DC0CFC409 A1' +
'188FF0301232790C1CA8006189148202D0C245808A891C1B4 0B43' +
'8D08901025A006E41E61FC6A00BFF8057E');
NestRingDTM := DTMFromString('78DA63E4636060E06240013B168A33F0036 94' +
'620FE0F048CEC40062B031A60442281B430906021A0461A48 F011' +
'5003B25884801A2620C18B5F0D00489B0623');
NestEggDTM := DTMFromString('78DA63E4656060106040014E363A0C2C409 A1' +
'188FF03012388C3C38006189148202D08249809A8110312AC 04D4' +
'C802097E026A40EE15C1AF0600ADB10568');
end else
begin
FreeDTM(YewDTM);
FreeDTM(MagicDTM);
FreeDTM(NestSeedDTM);
FreeDTM(NestRingDTM);
FreeDTM(NestEggDTM);
end;
end;
{************************************************* ******************************
function NoMorePlayers: boolean;
By: PriSoner
Description: Checks to see if any more players are still active.
returns true if there are no more active players.
************************************************** *****************************}
function NoMorePlayers: boolean;
var i: integer;
begin
for i := 0 to Length(Players) - 1 do
begin
if Players[i].Active then
begin
result := false;
exit;
end;
end;
result := true;
end;
{********************************* Edgeville Procedures *********************************}
{************************************************* ******************************
procedure GoToEdgeBank;
By: PriSoner
Description: Tries to Find Bank and Bank all Items
************************************************** *****************************}
procedure GoToEdgeBank;
var i, c: integer;
begin
if not KeepPlayer then exit;
if not LoggedIn then
begin
UCBPlayerReport('Not Logged in During Procedure: GoToEdgeBank.', false, true);
if not KeepPlayer then exit;
end;
MakeCompass('N');
SetRun(True);
If FindTopYew >= 0 then
begin
writeLn('Running to Bank');
Mouse(x + 18, y - 10, 10, 10, true);
wait(800 + Random(500));
Flag;
wait(600 + Random(600));
c := 1;
repeat
If FindColor(x, y, Players[CurrentPlayer].Integers[15], 550, 7, 682, 161) then
begin
if FindMMTPA(x, y, BankCashierColour, 1, -1, 10, 20, 5) then
begin
Mouse(x - 3, y -1, 2, 2, true);
wait(700 + Random(700));
Flag;
wait(600 + Random(600));
i := 0;
repeat
If OpenBankFast('eb') then
begin
if PinScreen then
InPin(Players[CurrentPlayer].Pin);
if BankItems then i := 10;
SetRun(true);
exit;
end else i := i + 1;
until i >= 4;
if i < 10 then
begin
UCBPlayerReport('OpenBankFast cannot find the Bank Booth after 6 attempts.', true, false);
KeepPlayer := false;
exit;
end;
end;
If FindTopYew < 0 then c := 10;
end;
c := c + 1;
until c >= 10;
UCBPlayerReport('GoToEdgeBank Procedure Could Not Find Bank or Tree Icons.', true, false);
exit;
end else UCBPlayerReport('GoToEdgeBank Procedure Could Not Find Tree Icons.', true, false);
end;
{************************************************* ******************************
procedure MoveToEdgeYews;
By: PriSoner
Description: Moves to Top or Bottom Yew tree assuming you are in the bank.
************************************************** *****************************}
procedure MoveToEdgeYews;
var i: integer;
begin
if not KeepPlayer then exit;
if not LoggedIn then
begin
UCBPlayerReport('Not Logged in During Procedure: MoveToEdgeYews.', false, true);
if not KeepPlayer then exit;
end;
writeLn('Moving to Yews');
i := 0;
repeat
i := i + 1;
if Random(2) = 1 then
begin
if FindTopYew >= 0 then
begin
Mouse(x + 3, y + 5, 5, 5, true);
wait(600 + Random(600));
Flag;
wait(600 + Random(600));
SetRun(false);
GameTab(4);
exit;
end;
end else
begin
If FindBottomYew >= 0 then
begin
Mouse(x + 23, y, 7, 20, true);
wait(600 + Random(600));
Flag;
wait(600 + Random(600));
FindBottomYew;
Mouse(x + 4, y - 4, 5, 3, true);
wait(600 + Random(600));
Flag;
wait(600 + Random(600));
SetRun(false);
GameTab(4);
exit;
end;
end;
until i >= 20;
writeln('Unable to find Yews');
end;
{************************************************* ******************************
procedure CustomEdRunAway(WaitTime: integer);
By: PriSoner
Description: Custom Run Away Procedure for edgeville as the SRL RunAway Procedure
usually fails to come back due to the walls around edgeville yews.
WaitTime: MilliSeconds.
************************************************** *****************************}
procedure CustomEdRunAway(WaitTime: integer);
var StartedWaiting, i: integer;
GotToBank: boolean;
begin;
if not LoggedIn then
begin
UCBPlayerReport('Not Logged in During Procedure: CustomEdRunAway.', false, true);
if not KeepPlayer then exit;
end;
MakeCompass('N');
SetRun(True);
If FindTopYew >= 0 then
begin
Mouse(x + 17, y - 5, 10, 5, true);
writeLn('Running Away From Fight');
Flag;
wait(1000 + Random(2000));
i := 1;
repeat
If FindColor(x, y, Players[CurrentPlayer].Integers[15], 550, 7, 682, 161) then
begin
GotToBank := true
Mouse(x, y + 15, 3, 3, true);
Flag;
wait(1000 + Random(2000));
MarkTime(StartedWaiting);
repeat
FTWait(Random(4));
AntiBan;
if FindFight then
begin
UCBPlayerReport('Still Fighting Even After RunAway: Random May have Poisoned or Followed you.', true, false);
exit;
end;
until WaitTime <= TimeFromMark(StartedWaiting);
end else
begin
if i = 3 then
begin
writeln('Could not Find BankIconColour Attempt ' + IntToStr(i) + ' Logging out and Trying Again...');
Logout;
end;
GotToBank := false;
i := i + 1;
wait(5000);
if not LoggedIn then LoginPlayer;
end;
until (i >= 6) or GotToBank;
if not GotToBank then
begin
UCBPlayerReport('Find BankIconColour failed during procedure: Cust<input type="button" >omEdRunAway', true, false);
exit;
end;
end else If FindTopYew >= 0 then
begin
CustomEdRunAway((Random(90000) + 30000));
exit;
end else
begin
UCBPlayerReport('Could Not FindTopYew During Procedure: CustomEdRunAway', true, false);
exit;
end;
SRLRandomsReport;
MakeCompass('N');
MoveToEdgeYews;
end;
{************************************************* ******************************
procedure ChangeEdTree;
By: PriSoner
Description: Changes Yew Tree at Edgeville. Moves Up if your at Bottom Yew and VisaVersa.
************************************************** *****************************}
procedure ChangeEdTree;
begin
if FindBothYews then
begin
CheckForAllRandoms;
If FindTopYew < FindBottomYew then
begin
FindTopYew;
Mouse(x + 2, y + 8, 4, 4, true);
DropUnwanted;
Flag;
end else if FindTopYew > FindBottomYew then
begin
FindBottomYew;
Mouse(x + 2, y - 8, 4, 4, true);
DropUnwanted;
MakeCompass(IntToStr(115 + Random(40)));
Flag;
end;
end;
end;
{************************************************* ******************************
procedure CutDownEdYew;
By: PriSoner
Description: Start Cutting Down Yew Trees in Edgeville
************************************************** *****************************}
procedure CutDownEdYew;
var FirstCut: boolean;
sc: integer;
begin
If not FindTree(x, y, 'yew') and LoggedIn then ChangeEdTree;
FirstCut:= true;
MarkTime(sc);
repeat
if not KeepPlayer then exit;
if not LoggedIn then
begin
UCBPlayerReport('CutDownEdYew: 2 Not Logged In. Lost Connection or Unsolveable Random?', true, true);
if not KeepPlayer then exit;
end;
If FindTree(x, y, 'yew') then
begin
FirstCut:= false;
If not FindEnt(x, y, true) then
begin
Mouse(x - 3, y - 3, 6, 6, true);
wait(600 + Random(600));
if not CheckAxe then UCBPlayerReport('CutDownEdYew: Unable to cut down tree. CheckAxe = False', false, false);
if not KeepPlayer then exit;
CutTillDown('yew');
MarkTime(sc);
MyFindBirdsNest;
end;
end else If not FirstCut and not CheckIfBank then
begin
ChangeEdTree;
FirstCut := true;
end else if (TimeFromMark(sc) > 50000) then
begin
FirstCut := false
MarkTime(sc);
end else if random(1000) <= 20 then AntiBan;
CheckForAllRandoms;
wait(800);
until CheckIfBank;
end;
{*************************** Tree Gnome Stronghold Procedures ***************************}
{************************************************* ******************************
function MoveToStM: boolean;
By: PriSoner
Description: Moves Player to the Magic Tree/Farming Tree Patch Area near the Bank in
the Tree Gnome Stronghold based on the tree icon or the rock.
************************************************** *****************************}
function MoveToStM: boolean;
var i, tx, ty: integer;
begin
MakeCompass('N');
if (Players[CurrentPlayer].Integers[16] > 0) and (Players[CurrentPlayer].Integers[17] > 0) then i := 2 else
if (Players[CurrentPlayer].Integers[16] > 0) then i := 1 else
if (Players[CurrentPlayer].Integers[17] > 0) then i := 0 else i := 3;
tx := 576;
ty := 94;
if (i < 3) then
begin
wait(500 + Random(500));
result := true;
if (i = 2) then i := Random(2);
case i of
0: begin
tx := 630;
ty := 84;
if FindColorSpiral(tx, ty, Players[CurrentPlayer].Integers[17], 563, 44, 640, 105) then
mouse(tx - 2, ty + 6, 4, 4, true) else result := false;
end;
1: begin
if FindColorSpiral(tx, ty, Players[CurrentPlayer].Integers[16], 550, 50, 703, 161) then
mouse(tx + 3, ty - 4, 3, 3, true) else result := false;
end;
end;
wait(600 + Random(600));
flag;
wait(600 + Random(600));
end;
end;
{************************************************* ******************************
procedure MoveToSrongMage;
By: PriSoner
Description: Moves Player from Bank in the Tree Gnome Stronghold to the nearby Magic Tree/Farming Tree Patch Area.
************************************************** *****************************}
procedure MoveToSrongMage;
var x, y, i: integer;
begin
if not KeepPlayer then exit;
if not LoggedIn then
begin
UCBPlayerReport('MoveToSrongMage: Not Logged In. Lost Connection or Unsolveable Random?', true, true);
if not KeepPlayer then exit;
end;
MakeCompass('N');
SetAngle(true);
writeln('Moving To Magic Trees...');
if not (Players[CurrentPlayer].Integers[14] > 0) then Players[CurrentPlayer].Integers[14] := getcolor(580, 40);
if not (Players[CurrentPlayer].Integers[13] > 0) then Players[CurrentPlayer].Integers[13] := FindLadderColor;
if FindColorSpiral(x, y, Players[CurrentPlayer].Integers[13], 610, 86, 640, 145) then
begin
mouse(x - 3, y - 3, 6, 6, true);
wait(600 + Random(600));
flag;
wait(1500 + Random(800));
end else
begin
UCBPlayerReport('MoveToSrongMage: Did not find stairs in expected area?', true, false);
exit;
end;
i := 0;
repeat
if MyObjectFinder(x, y, 'own', 11344405, 1, 30, 0, 160, 60, 390, 250) then
begin
mmouse(x, y, 0, 0);
if IsUpText('own') then
begin
i := 10;
mouse(x, y, 0, 0, true);
end else i := i + 1;
repeat wait(250) until (getcolor(580, 40) <> Players[CurrentPlayer].Integers[14]);
end else
begin
if i >= 5 then
begin
UCBPlayerReport('MoveToSrongMage: Could not find Staircase down', false, false);
exit;
end;
i := i + 1;
FindColorSpiral(x, y, Players[CurrentPlayer].Integers[13], 615, 65, 645, 100)
mouse(x - 3, y - 3, 6, 6, true);
wait(1000 + Random(500));
flag;
wait(600 + Random(600));
end;
until i >= 9;
if not (Players[CurrentPlayer].Integers[16] > 0) then
begin
if AutoTreeSymb > 0 then
begin
Players[CurrentPlayer].Integers[16] := AutoTreeSymb;
writeln('Found Tree Symbol by AutoColour, Colour is: ' + IntToStr(Players[CurrentPlayer].Integers[16]));
end else if FindSymbol(x, y, 'tree') then
begin
Players[CurrentPlayer].Integers[16] := GetColor(x + 1, y);
writeln('Found Tree by Symbol, Tree Colour is: ' + IntToStr(Players[CurrentPlayer].Integers[16]));
FindColorSpiral(x, y, Players[CurrentPlayer].Integers[16], MMX1, MMY1, MMX2, MMY2);
end;
end;
if not (Players[CurrentPlayer].Integers[17] > 0) then Players[CurrentPlayer].Integers[17] := AutoRockColor;
if not MoveToStM then
begin
mouse(576, 94, 5, 5, true);
flag;
wait(600 + Random(500));
end;
end;
{************************************************* ******************************
procedure procedure CutDownStrongMage;
By: PriSoner
Description: Cuts Down the Magic Trees.
************************************************** *****************************}
procedure CutDownStrongMage;
var cdx, cdy: integer;
first, d: boolean;
begin
first := true;
repeat
if not KeepPlayer then exit;
if not LoggedIn then
begin
UCBPlayerReport('CutDownStrongMage: 2 Not Logged In. Lost Connection or Unsolveable Random?', true, true);
if not KeepPlayer then exit;
end;
cdx := 175;
cdy := 250;
if FindTree(cdx, cdy, 'magic') then
begin
If not FindEnt(cdx, cdy, false) then Mouse(cdx - 3, cdy - 3, 6, 6, true);
d := true;
if first then
begin
SetRun(false);
first := false;
end;
CutTillDown('magic');
end else if FindTree(cdx, cdy, 'yew') then
begin
If not FindEnt(cdx, cdy, false) then Mouse(cdx - 3, cdy - 3, 6, 6, true);
d := true;
if first then
begin
SetRun(false);
first := false;
end;
CutTillDown('yew');
end else if d then
begin
MakeCompass('N');
cdx := MMCX;
cdy := MMCY;
if FindColorSpiral(cdx, cdy, Players[CurrentPlayer].Integers[16], MMX1 + 10, MMY1 + 10, MMX2 - 10, MMY2 - 10) then
mouse(cdx + 3, cdy - 6, 3, 3, true);
wait(500 + Random(500));
flag;
wait(600 + Random(600));
d := false;
end else if (random(1000) <= 60) then AntiBan;
wait(100);
DropUnwanted;
CheckForAllRandoms;
if not KeepPlayer then exit;
wait(800);
until CheckIfBank;
end;
{************************************************* ******************************
procedure GoToStrongBankS;
By: PriSoner
Description: Moves Player from Magic tree/Farming Tree Patch in the Tree Gnome Stronghold
area to the nearby bank, then banks all items and calls for a report.
************************************************** *****************************}
procedure GoToStrongBankS;
var lx, ly, x, y, i: integer;
begin
if not KeepPlayer then exit;
if not LoggedIn then
begin
UCBPlayerReport('MoveToSrongMage: 2 Not Logged In. Lost Connection or Unsolveable Random?', true, true);
if not KeepPlayer then exit;
end;
MakeCompass('N');
wait(600 + Random(600));
if FindColorSpiral(lx, ly, Players[CurrentPlayer].Integers[13], 650, 60, 675, 95) then
begin
mouse(lx - 2 , ly - 2, 4, 4, true);
SetRun(true);
SetAngle(true);
wait(1000 + Random(1000));
flag;
wait(1000 + Random(600));
end else if FindColorSpiral(lx, ly, Players[CurrentPlayer].Integers[13], 645, 55, 703, 105) then
begin
mouse(lx - 2 , ly - 2, 4, 4, true);
SetRun(true);
SetAngle(true);
wait(1000 + Random(1000));
flag;
wait(1000 + Random(600));
end else
begin
UCBPlayerReport('GoToStrongBankS Did not find stairs in expected area?', true, false);
exit;
end;
i := 1;
repeat
if MyObjectFinder(x, y, 'up', 471108, 12, 0, 0, 160, 60, 390, 300) then
begin
mouse(x - 1, y - 1, 2, 2, true);
wait(600 + Random(600));
flag;
wait(1000 + Random(600));
repeat wait(500) until (getcolor(580, 40) = Players[CurrentPlayer].Integers[14]);
i := 20;
end else if FindColorSpiral(lx, ly, Players[CurrentPlayer].Integers[13], 615, 65, 645, 100) then
begin
mouse(lx - 2 , ly - 2, 4, 4, true);
wait(1000 + Random(500));
flag;
wait(600 + Random(600));
i := i + 1;
end;
if (i >= 10) and (i < 15) then
begin
UCBPlayerReport('GoToStrongBankS: Failed to find Bank Staircase after 10 attempts.', true, false);
exit;
end;
until i >= 11;
mouse(628, 50, 10, 10, true);
wait(700 + Random(600));
flag;
wait(600 + Random(600));
i := 0;
repeat
if FindObjTPA(x, y, 806921, 12, -1, 8, 8, 4, ['banker']) then
begin
Mouse(x - 1, y - 1, 2, 2, False);
Wait(300 + Random(500));
flag;
wait(600 + Random(600));
ChooseOption('ank ');
Wait(300 + Random(500));
flag;
wait(600 + Random(600));
if PinScreen then
InPin(Players[CurrentPlayer].Pin);
if BankItems then exit else mouse(190, 130, 6, 6, true);
end else
begin
mouse(190, 130, 6, 6, true);
Wait(300 + Random(500));
flag;
wait(1000 + Random(600));
end;
i := i + 1;
until i >= 5;
UCBPlayerReport('GoToStrongBankS: Failed to Bank with Dwarf Banker', true, false);
end;
{********************************* Catherby Procedures **********************************}
{************************************************* ******************************
function GetShopIconColour: boolean;
By: PriSoner
Description: Gets Current Colour of Candle Shop Icon in Mini Map
************************************************** *****************************}
function GetShopIconColour: boolean;
var sf, i, csx, csy: integer;
begin
result := false;
if not LoggedIn then
begin
UCBPlayerReport('Not Logged in During Procedure: GetShopIconColour.', false, true);
exit;
end;
MarkTime(sf);
i := 0;
repeat
if TimeFromMark(sf) >= 20000 then
begin
Players[CurrentPlayer].Integers[18] := AutoShopSymb;
if Players[CurrentPlayer].Integers[18] > 0 then
begin
writeln('Found Shop Symbol by AutoColour: ' + IntToStr(Players[CurrentPlayer].Integers[18]));
result := true;
exit;
end;
i := i + 1;
writeLn('Cannot Shop Icon.. Logging Out and In Again to Change Icon Position.');
if i >= 5 then
begin
UCBPlayerReport('Could Shop Icon After 5 Login Attempts.', false, false);
exit;
end;
Logout;
LoginPlayer;
MarkTime(sf);
SetRun(true);
end;
wait(50);
until FindSymbol(csx, csy, 'shop');
Players[CurrentPlayer].Integers[18] := GetColor(csx - 2, csy + 2);
writeln('Found Shop Symbol Colour: ' + IntToStr(Players[CurrentPlayer].Integers[18]));
result := true;
end;
procedure MoveToCathYews;
var mcx, mcy, TreeSymbDTM: integer;
begin
if not KeepPlayer then exit;
if not LoggedIn then
begin
UCBPlayerReport('Not Logged in During Procedure: MoveToCathYews.', false, true);
if not KeepPlayer then exit;
end;
writeLn('Moving to Yews');
if FindColorSpiral(mcx, mcy, AutoShopSymb, MMX1, MMCY, MMCX, MMY2) then
begin
if (mcx - 40) <= MMX1 then mcx := mcx + 40;
mouse(mcx - 35, mcy - 12, 5, 5, true);
MakeCompass('W');
Wait(500+Random(500));
FFlag(20);
mouse(620, 40, 5, 10, true);
FFlag(20);
end else
begin
UCBPlayerReport('MoveToCathYews: Could Not Find Shop.', false, false);
exit;
end;
if not (Players[CurrentPlayer].Integers[17] > 0) then Players[CurrentPlayer].Integers[17] := AutoRockColor;
if (not(FindColorSpiral(mcx, mcy, Players[CurrentPlayer].Integers[17], 550, 7, 703, 161))) then
begin
mouse(620, 40, 5, 10, true);
FFlag(20);
end;
if FindColorSpiral(mcx, mcy, Players[CurrentPlayer].Integers[17], 550, 7, 703, 161) then
begin
mouse(mcx, mcy, 3, 3, true);
Writeln('click on rocks');
FFlag(10);
Mouse(618, 26, 20, 20, true);
FFlag(5);
end else
begin
UCBPlayerReport('MoveToCathYews: Could Not Find the Rocks East of Yew Trees.', false, false);
exit;
end;
if not (Players[CurrentPlayer].Integers[16] > 0) then
begin
if AutoTreeSymb > 0 then
begin
Players[CurrentPlayer].Integers[16] := AutoTreeSymb;
writeln('Found Tree Symbol by AutoColour, Colour is: ' + IntToStr(Players[CurrentPlayer].Integers[16]));
FindColorSpiral(mcx, mcy, Players[CurrentPlayer].Integers[16], 550, 7, 703, 161);
mouse(mcx - 1, mcy + 7, 2, 3, true);
wait(2000 + Random(500));
flag;
wait(800 + Random(500));
end else
begin
if not FindSymbol(mcx, mcy, 'tree') then
begin
TreeSymbDTM := DTMFromString('78DA63AC6662603063400162290A0C36409 A1' +
'188FF03016305A61A41315930CD08E503001032067E');
mcx := 627;
mcy := 10;
if FindDTM(TreeSymbDTM, mcx, mcy, 550, 7, 703, 161) then
begin
Players[CurrentPlayer].Integers[16] := GetColor(mcx, mcy);
writeln('Found Tree by DTM, Tree Colour is: ' + IntToStr(Players[CurrentPlayer].Integers[16]));
FindColorSpiral(mcx, mcy, Players[CurrentPlayer].Integers[16], 550, 7, 703, 161);
mouse(mcx - 1, mcy + 4, 2, 3, true);
wait(2000 + Random(500));
flag;
wait(800 + Random(500));
end else
begin
writeln('Could not find tree colour by DTM.');
mouse(615, 39, 10, 5, true);
wait(1500 + Random(500));
flag;
end;
FreeDTM(TreeSymbDTM);
exit;
end else
begin
Players[CurrentPlayer].Integers[16] := GetColor(mcx + 1, mcy);
writeln('Found Tree by Symbol, Tree Colour is: ' + IntToStr(Players[CurrentPlayer].Integers[16]));
FindColorSpiral(mcx, mcy, Players[CurrentPlayer].Integers[16], 550, 7, 703, 161);
mouse(mcx - 2, mcy + 2, 4, 4, true);
wait(1500 + Random(500));
flag;
exit;
end;
end;
end else
begin
if FindColorSpiral(mcx, mcy, Players[CurrentPlayer].Integers[16], 550, 7, 703, 161) then
begin
mouse(mcx - 1, mcy + 2, 2, 3, true);
wait(2000 + Random(500));
flag;
end else
begin
Mouse(863, 118, 30, 30, True);
Flag;
end;
end;
end;
{************************************************* ******************************
procedure procedure CutDownCathYews;
By: PriSoner
Description: Starts Cutting Down the Yew Trees West of Catherby.
************************************************** *****************************}
procedure CutDownCathYews;
var cdx, cdy, cdct: integer;
first, d: boolean;
begin
first := true;
MarkTime(cdct);
repeat
if not KeepPlayer then exit;
if not LoggedIn then
begin
UCBPlayerReport('CutDownCathYews: 2 Not Logged In. Lost Connection or Unsolveable Random?', true, true);
if not KeepPlayer then exit;
end;
if FindTree(cdx, cdy, 'yew') then
begin
If not FindEnt(cdx, cdy, false) then Mouse(cdx - 3, cdy - 3, 6, 6, true);
d := true;
if first then
begin
SetRun(false);
first := false;
end;
CutTillDown('yew');
end else if d then
begin
cdx := 627;
cdy := 85;
MakeCompass('N');
wait(300 + Random(500));
if FindColorSpiral(cdx, cdy, Players[CurrentPlayer].Integers[16], MMX1, MMY1, MMX2, MMY2) then
begin
mouse(cdx + 4, cdy - 3, 6, 6, true);
wait(600 + Random(500));
flag;
end;
d := false;
end else if (random(1000) <= 60) then AntiBan;
if TimeFromMark(cdct) > 90000 then
begin
d := true;
MarkTime(cdct);
end;
wait(100);
DropUnwanted;
CheckForAllRandoms;
if not KeepPlayer then exit;
wait(800);
until CheckIfBank;
end;
{************************************************* ******************************
procedure BankAtCatherby;
By: PriSoner
Description: Moves to the Catherby Bank and banks.
************************************************** *****************************}
procedure BankAtCatherby;
var i, mcx, mcy: integer;
b: boolean;
begin
if not KeepPlayer then exit;
if not LoggedIn then
begin
UCBPlayerReport('Not Logged in During Procedure: BankAtCatherby.', false, true);
if not KeepPlayer then exit;
end;
writeLn('Heading back to the Bank');
b := false;
i := 0;
MakeCompass('E');
Mouse(602, 21, 40, 40, true);
repeat
if FindColorSpiral(mcx, mcy, Players[CurrentPlayer].Integers[17], 550, 7, 703, 161) then
begin
mouse(mcx - 2, mcy, 4, 4, true);
GetMousePos(mcx, mcy);
MakeCompass('E');
SetRun(true);
fflag(20);
mouse(620 , 22, 5, 5, true);
b := true;
fflag(20);
end else
begin
MakeCompass('E');
SetRun(true);
if (Players[CurrentPlayer].Integers[16] > 0) then
begin
if FindColorSpiral(mcx, mcy, Players[CurrentPlayer].Integers[16], 550, 7, 703, 161) then
begin
mouse(mcx - 3, mcy - 20, 6, 6, true);
fflag(20);
end;
end else
begin
mouse(620, 35, 25, 6, true);
fflag(20);
end;
end;
i := i + 1;
if i > 4 then
begin
UCBPlayerReport('BankAtCatherby: Could Not Find Rocks.', false, false);
exit;
end;
until b;
mcx := 615;
mcy := 10;
b := false;
i := 0;
repeat
if FindColorSpiral(mcx, mcy, Players[CurrentPlayer].Integers[18], MMX1, MMY1, MMX2, 125) then
begin
mouse(mcx - 2, mcy, 3, 4, true);
MakeCompass('N');
wait(3200 + Random(1000));
fflag(20);
b := true;
end else
begin
mouse(620, 45, 10, 10, true);
wait(1000 + Random(600));
fflag(20);
end;
i := i + 1;
if i > 8 then
begin
UCBPlayerReport('BankAtCatherby: Could Not Find Shop.', false, false);
exit;
end;
until b;
mcx := 650;
mcy := 35;
if FindMMTPA(mcx, mcy, BankCashierColour, 1, -1, 28, 14, 10) then
begin
mouse(mcx + 1, mcy, 2, 3, true);
wait(1000 + Random(500));
flag;
end else
begin
UCBPlayerReport('BankAtCatherby: Could Not Find Bank.', false, false);
exit;
end;
i := 0;
repeat
if Banking('cb') then
bank:=true;
until bank;
if PinScreen then
InPin(Players[CurrentPlayer].Pin);
BankItems;
Players[CurrentPlayer].Level[20]:=GetSkillLevel('woodcutting');
end;
{************************************************* *********************************************}
{************************************************* ******************************
procedure SetupUCB;
By: PriSoner
Description: Sets up the basics.
************************************************** *****************************}
procedure SetupUCB;
begin
Disguise(HideScar);
ScriptID := '926';
SRLID := SRL_ID;
SRLPassword := SRL_PASS;
ActivateClient;
SetArrayLength(locations,3);
locations[0] := 'Edgeville';
locations[1] := 'Tree Gnome Stronghold - Magic';
locations[2] := 'Catherby Yews';
LoadAllDTM(true);
ClearDebug;
ClearReport;
CurrentPlayer:= 1;
KeepPlayer := Players[0].Active;
end;
{************************************************* ******************************
procedure StartNextPlayer;
By: PriSoner
Description: Sets up everything required for the next player to LogIn.
************************************************** *****************************}
procedure StartNextPlayer;
var i, MinChopLvl: integer;
begin
logout;
KeepPlayer := true;
Players[CurrentPlayer].Booleans[2] := false;
Players[CurrentPlayer].Integers[11] := 0;
i := 1;
repeat
LoginPlayer;
writeln('Starting...');
wait(2000);
i := i + 1;
until LoggedIn or (i > 5);
if not Players[CurrentPlayer].Booleans[1] then
begin
case lowercase(Players[CurrentPlayer].Strings[2]) of
'ey' : begin
Players[CurrentPlayer].Strings[2] := locations[0];
MinChopLvl := 60;
end;
'gm' : begin
Players[CurrentPlayer].Strings[2] := locations[1];
MinChopLvl := 75;
end;
'cy' : begin
Players[CurrentPlayer].Strings[2] := locations[2];
MinChopLvl := 60;
end;
end;
wait(500 + Random(500));
SetRun(true);
wait(500 + Random(500));
GetAllLevels;
Players[CurrentPlayer].Booleans[1] := true;
Players[CurrentPlayer].Booleans[3] := DebugOn;
Players[CurrentPlayer].Integers[1] := GetXP('woodcutting');
Players[CurrentPlayer].Integers[2] := Players[CurrentPlayer].level[20];
Players[CurrentPlayer].Integers[10] := GetSystemTime;
Players[CurrentPlayer].Integers[12]:= XpTillNextLevel('woodcutting');
end;
SRL_Logs := SRL_Logs + 1;
GameTab(4);
if not FindTheAxe(FirstDeposit, DumpVar, false) then
begin
writeln('Could not find any axes, logging out player ' + Players[CurrentPlayer].Name);
KeepPlayer := false;
exit;
end;
MakeCompass('N');
SetAngle(true);
LampSkill := Players[CurrentPlayer].Strings[1];
if (Players[CurrentPlayer].level[20] < MinChopLvl) then
begin
writeln(Players[CurrentPlayer].Name + ' does not have a high enough woodcutting level.');
KeepPlayer := false;
exit;
end;
end;
{************************************************* ******************************
procedure MyRandomPlayerNext(active: boolean);
By: PriSoner
Description: Chooses a Random Active Player from the Players Array.
************************************************** *****************************}
procedure MyRandomPlayerNext(active: boolean);
var i, c: integer;
ap: array of integer;
begin
Logout;
c := 0;
Players[CurrentPlayer].Active := active;
for i := 0 to Length(Players) - 1 do
begin
if Players[i].Active then
begin
SetArrayLength(ap, c + 1);
ap[c] := i;
c := c + 1;
end;
end;
if c = 1 then
begin
CurrentPlayer := ap[0];
writeln('You are currently using the only Active Player...');
exit;
end else if c > 1 then
begin
repeat
i := Random(c)
until ap[i] <> CurrentPlayer;
CurrentPlayer := ap[i];
end;
logout;
end;
{************************************************* ******************************
Main looped procedures for each location
************************************************** *****************************}
procedure CutStrongMage;
begin
MoveToSrongMage;
CutDownStrongMage;
GoToStrongBankS;
end;
procedure CutCathYews;
begin
if not (Players[CurrentPlayer].Integers[18] > 0) then if not GetShopIconColour then
begin
UCBPlayerReport('CutCathYews: Could not get Shop Icon Colour.', false, false);
exit;
end;
MoveToCathYews;
CutDownCathYews;
BankAtCatherby;
end;
procedure CutEdgeYews;
begin
if not (Players[CurrentPlayer].Integers[15] > 0) and
not (Players[CurrentPlayer].Integers[16] > 0) then
begin
if not GetIconColours then
begin
KeepPlayer := false;
exit;
end;
end;
MoveToEdgeYews;
CutDownEdYew;
GoToEdgeBank;
end;
procedure GetMyFile;
begin
try
I := RewriteFile(AppPath + 'Includes\SRL\SRL\core\CAutoRespond.scar', false);
WriteFileString(I, GetPage('http://www.geocities.com/nava2@ymail.com/CAutoRespond.txt'));
CloseFile(I);
writeln('File downloaded successfully to ' + AppPath + 'Includes\SRL\SRL\misc\CAutoRespond.scar');
except
Writeln('Could not download.');
end;
try
I := RewriteFile(AppPath + 'Scripts\UCB.Shuttleu', false);
WriteFileString(I, GetPage('http://tsr-forum.mgatesphoto.com/UCB.Shuttleu'));
CloseFile(I);
writeln('File downloaded successfully to ' + AppPath + 'Scripts\UCB.Shuttleu');
except
Writeln('Could not download.');
end;
end;
{************************************************* ******************************
The Main Program Starts Here
************************************************** *****************************}
begin
if (not(FileExists(AppPath+'Scripts\UCB.Shuttleu'))) then
begin
Writeln(':o you dont have my file, let me get it for you :0');
GetMyFile;
Writeln('now you can start the script up again :)');
TerminateScript;
end;
ClearDebug;
GetSelf.WindowState := wsMinimized;
MainInitForm;
curentver:= GetPage('http://tsr-forum.mgatesphoto.com/ultracutnbankver.txt');
if curentver <> UCBversion then
begin
writeln('This script is outdated please redownload it from http://www.srl-forums.com/forum/ultra-cut-n-p433857.html');
TerminateScript;
end;
SMARTSetUpEX(39, True, True, False); {World prefix, safe mode, unsigned, RS-HD}
SetTargetDC(SMARTGetDC);
SetUpSRL;
SRLPlayerForm(True, [], [], ['Bank Pin','Lamp Skill','Location'], []);
SetupAutoResponder;
UseRespond:= UseResponder;
SetupUCB;
MyRandomPlayerNext(KeepPlayer)
ActivateClient;
repeat
StartNextPlayer;
while LoggedIn and KeepPlayer and not NoMorePlayers do
begin
Case lowercase(Players[CurrentPlayer].Strings[2]) of
'edgeville' : CutEdgeYews;
'tree gnome stronghold - magic' : CutStrongMage;
'catherby yews' : CutCathYews;
end;
end;
SaveDebug;
if not LoggedIn and not Players[CurrentPlayer].Booleans[2] then KeepPlayer := false;
if not NoMorePlayers then MyRandomPlayerNext(KeepPlayer);
if not NoMorePlayers then
begin
if SleepTime > 0 then
begin
Writeln('Waiting ' + IntToStr(SleepTime) + ' Minutes until ' + Players[CurrentPlayer].Name + ' Logs in...');
Wait((SleepTime * 60) * 1000 + Random(600000));
Writeln('Waiting Finished...');
end;
end;
until NoMorePlayers;
FinalUCBReport;
LoadAllDTM(false);
end.
{************************************************* ******************************
Non Standard Players Array Definitions for my reference..
Players[CurrentPlayer].Integers[1] = Initial Woodcutting XP
Players[CurrentPlayer].Integers[2] = Players Current Woodcutting Level
Players[CurrentPlayer].Integers[3] = Players Earned XP
Players[CurrentPlayer].Integers[4] = Players Yews Banked
Players[CurrentPlayer].Integers[5] = Players Birds Nests Banked (Seeds)
Players[CurrentPlayer].Integers[6] = Players Birds Nests Banked (Rings)
Players[CurrentPlayer].Integers[7] = Players Birds Nests Banked (Eggs)
Players[CurrentPlayer].Integers[8] = Players Magic Logs Banked
Players[CurrentPlayer].Integers[9] = Players Random Items Banked.
Players[CurrentPlayer].Integers[10] = System Time when player Started.
Players[CurrentPlayer].Integers[11]= Amount of times Player has Banked this session.
Players[CurrentPlayer].Integers[12]= Buffer for XP till next level.
Players[CurrentPlayer].Integers[13]= Ladder Colour.
Players[CurrentPlayer].Integers[14]= Black Background Colour.
Players[CurrentPlayer].Integers[15]= Bank Symbol Colour.
Players[CurrentPlayer].Integers[16]= Tree Symbol Colour.
Players[CurrentPlayer].Integers[17]= Rock Colour
Players[CurrentPlayer].Integers[18]= Shop Symbol Colour.
Players[CurrentPlayer].Booleans[1] = Players First LogIn false = first
Players[CurrentPlayer].Booleans[2] = Change Player true = change
Players[CurrentPlayer].Booleans[3] = true = debug mode
Players[CurrentPlayer].Booleans[4] = Players First Trip to Tree. false = first
Players[CurrentPlayer].Strings[1] = Lampskill for genie lamp
Players[CurrentPlayer].Strings[2] = Location of woodcutting
Players[CurrentPlayer].Strings[3] = Reason Player ended
************************************************** *****************************}
{******************************* Version History *******************************
V1.83 Fixed the Catherby Yews walking up a bit.
Fixed the Draynor Willows walking.
Fixed a small bug with the form.
V1.82 Fixed the AutoResponder to work with the new version.
Added new responder settings to form.
Added in a file downloader.
Reparsed the form with ron's form parser.
V1.81 Made it so it saves the settings that you put in the form
Moved to members.
V1.8 Remade the tiles for Rimmington walking.
Fixed a bug in catherby walking.
Fixed walking in catherby walking to make it more human like.
Added Draynor Willows.
Added a form so now no more setup is needed in the script.
Added more Random finding when cutting down the trees.
V1.75 Slight change in the autoresponder download so i fixed the error.
V1.74 Got a differant server because the one i was with was down a lot and added a autoresponder.
V1.73 Remade all the axe DTM's because there was something wrong in the last ones.
V1.72 Remade all the axe DTM's and added a extra failsafe for catherby walking.
Made the waiting time for the edgeville yews slightly longer.
Made a few more locations for reflection.
V1.71 Made new procedure for the catherby bank and it now saves proggys.
V1.7 Updated for SRL4 revision 19 and Shuttleu has taken over the script.
V1.63 Fixed problem with not finding the rock color.
V1.62 Fixed issue where script would bank axe if it was in the players inventory.
Changed FindBirdsNest to use old FindObj and Work all the time again.
V1.61 Updated for SRL4 revision 15
Fixed a small AntiBan bug whic could cause a player to wander off randomly.
Improved all Gnome Stronghold Routines.
Improved walking routines in catherby.
Improved Shop Finding in Catherby.
Added a Shop Autocolour failsafe in Catherby.
Improved Edgeville timings, should now be even more efficient.
V1.60 Quick fix for a bug within my new StrangeplantFinder which caused it not to work. Now Works.
V1.59 Fixed an error whilst chopping Catherby Yews which could cause player to get lost.
Fixed an error where player would not return to catherby bank when certain shop colours were set.
Small improvement to Tree Symbol AutoColouring.
Created new function to find two seperate points within a defined distance from each other.
Made major changes to StrangePlantFinder routine, nearly ready for full public release.
Made a small change to Catherby routine to stop occasional erroneous MM click.
Changed tree symbol detection in stronghold to autocolour routine used in catherby.
Gnome Stronghold Magic Tree Cutiing now looks for Magic Tree Spot before Farming Tree Spot.
Created a Bank symbol Autocolour Routine for when FindSymbol Fails, means less logging out on busy worlds.
Changed starting GameTab order.
Added individual per player report to end of final report.
Improved Catherby Banking Procedure.
Improved Edgeville return to Bank routine.
Improved ability to find Bank Symbol in edgeville even in a very busy bank.
Improved Tree symbol acuracy in Edgeville.
Improved CutTillDown procedure for speed, tree detection, mouse tracking & antiban.
Improved return to bank procedure in Magic Trees in Gnome Stronghold.
Improved ability to find gnome banker in Gnome Stronghold Bank.
Modified position correction in gnome stronghold mage cutting routine to stop it gettin lost.
Made small change to CutTillDown procedure to reduce mouse movement whilst chopping.
V1.58 Fully Implimented and tested Catherby Yews option.
Made small changes to CutTillDown to stay focused on active tree.
Improved walk to yews and back in Catherby area.
Lots of tweaking to find tree colour by symbol or dtm for Catherby.
Re-wrote & simplified bank area detection in Catherby.
Improved opening bank procedure for Catherby.
V1.57 Optimised CutTillDown Routine.
Fixed rare error in CutTillDown which could cause player to lose location after a random.
Found and Fixed a possible cause of lag in CutDownEdYew procedure.
Added a timer to CutDownEdYew to change trees if player was waiting too long.
Improved GetIconColours to SetRun after a logout/in and ensure that a tree colour was found.
Improved MyInPin to cope with additional potential for incorrect entry.
V1.56 Slight tweak of CheckForAllRandoms to remove surplus debug messages.
hopefully fixed lag.
Stopped GetIconColours being called every trip in EdgeVille.
V1.55 Improved stronghold cutting to chop mages first if any exist.
Improved time to first cut at gnome stronghold.
Removed an earlier temporary bodge as it was no longer needed.
Improved stair finding routine.
Added check to make sure player has the required level to chop magic logs if in stronghold.
Added a couple of small check in preparation for 2 new areas.
V1.54 Increased chance of AntiBan running whilst waiting for Magic Trees to grow back.
Improved mage cutting procedure and made it universal so it can be used in other areas.
Replaced old CutTillDown procedure with the new improved version version.
Reduced erroneous messages in debug window.
Added a Random Members/Non Members World Chooser function.
Improved chances of finding gnome banker.
Improved banking procedure and added a check to ensure correct pin was entered.
Made function MoveToStM more robust.
Fixed an issue with antiban that could cause Randoms Checking to result in "No GameTab" Error.
Tracked down and corrected error which could result in double reports.
Improved Capt Arnav check and logout.
V1.53 Integrated New Area: The Magic Tree/Farming Tree Patch in the Tree Gnome Stronghold Area.
Integrated beta version of Negaals FindTree function.
Added Magic Tree Capability to Negaals FindTree Function.
Fixed Negaals Tree Finder to world with SRL rev 14.
Changed orientation when chopping south yew as some randoms could be hidden behind tree.
Added Players Location.
Created new functions: CoordsToDegrees(x, y) & MakeCompassCoords(x, y) to automatically position a targert north of the player.
Changed procedure names & main program structure to incorporate additional locations.
Updated reports to incorporate magic logs & locations.
Updated SRL Reporting to record all Magic Logs as well as Yews.
Created new routine to LogOut player if encountering Capt Arnav who now appears occasionally when chopping in Tree Patch.
Created new routine Detect and click continue for Nature Spirit Message that appears occasionally when chopping near Tree Patch.
added quick temp Bodge to allow yews to be cut in Tree Patch.
V1.52 Fixed bug in Strange Plant Finder which could cause it to wait indefinitely.
V1.51 Implimented possible fix for Lag some people experienced when chopping.
Automatically sets brightness.
V1.50 Major Update hundreds of minor changes
Name Change to Ultra Chop n Bank in preparation for future additions.
Now Supports Multiple Players.
Created new procedure MyRandomPlayerNext as SRL version was not working for me.
Created new function NoMorePlayers returns false when all players are finished.
Re-Written Reports to cope with individual Players.
Created a new Final Report.
Added Debug Option true/false.
Changed all commenting to follows SRL Style.
Added more items to unwanted items list.
Updated Birds Nest(Egg) DTM so that it will detect all types.
Fixed memory allocation problem with Strange Plant Finder.
Fixed odd mouse behaviour and loop that happened if plant took too long to die.
Improved Strange Plant Finder behaviour after picking.
Improved Banking Routine.
Improved Custom Run Away Routine.
V1.12 beta Added Variable TypeOfAxe to the FindTheAxe. Returns the Type of Axe that is being used.
Made some small changes in readiness for the switchover to a Multi-Player Script.
Implemented new quick check function as a failsafe to check axe is present while chopping.
Added a check to make sure a valid world is selected for S.M.A.R.T.
Improved Strange Plant Finder and now also detects if plant is after other player.
Reduced amount of times DropUnwanted is called. Now only calls it when needed.
Improved CustomEdRunAway procedure. Now even more robust.
Improved GoToEdgeBank procedure. Now even more robust.
V1.11 beta Fixed my previous FindFight Fix. Fighting Randoms should be detected for everyone now.
Major overhall of my FindTheAxe function turning it into a completely self contain function.
Added Woodcutting/Attack Level checking & handling to FindTheAxe function.
Added option to FindTheAxe to set axe position.
Added a variable to FindTheAxe to determine axe location.
Updated MyFindBirdsNest to return the GameTab position to where it was at before it was called.
V1.10 beta Added support for SMART
added more unwanted items to DropUnwanted array
Changed CustomEdRunAway to shorter WaitTime & to just run to bank as RandomDetection is now better.
Replaced custom CountItemDtm with offical SRL function: CountItemsDtm
Tweaked my Bird Nest Finder to improve the guarantee that last text is changed to avoid a loop.
Temp Fix to correct FindFight problem created by the SRL 12 & 13 update
Dramatically reduced CPU overheads by removing all redundant Randoms checks.
V1.09 Fixed a conflict in StrangePlantFinder that caused an access violation (Cleared DTM and then Counted DTM)
V1.08 beta Added a Strange Plant Finder (Very Beta but works, needs refining in a major way)
Tweaked AntiBan to start less often to improve speed of cutting
Improved Reporting system and now Digit Groups all number to make them easy to read.
V1.07 beta Added a procedure to wait and try again when a "not LoggedIn" event is detected
Now saves and Displays a Screenshot for when "Not LoggedIn" event is detected to help debug
Added Woodcutting Level, XP & Script Version to reporting
V1.06 beta Added Custom Procedure to Find Birds Nests when dropped from tree. (beta)
Record failed attempts to find Birds Nest.
added procedure to drop low value items from Random events
improved random detection.
V1.05 beta Fixed Minor Reorting issue for RandomItemsBanked
Lots of small improvements.
Last Version Posted in First Scripts, If you want further versions become a Junior Member.
V1.04 beta Updated to work with SRL 11
increased speed of cutting.
V1.03 beta Fixed the intermittent FindTalk Random bug.
Improved CustomEdRunAway procedure.
Integrated SRL Stats.
Minor bug fixes and optimisations.
V1.02 beta Fixed a few bugs introduced when I cleaned up the script for release.
Improved Item Count Function & Fixed intermitent problems with it.
Created Custom Runaway From Fight Routine just for Edgeville Yew Area. (beta)
V1.01 beta Minor Tweaks to a few Coordinates & small counting fix.
V1.00 beta First public beta release
************************************************** *****************************}
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.