bud_wis_er_420
2013-04-06 13:27:07
How Long have You Played Runescape?
9 Year(s)
Are you affilated in anyway with Jagex LTD?
No
Were you Referred to SRL?
What is your general programming knowledge?
Pascal only
Are you a member of any other communities?
No, unless you count joining powerbot.org a few days ago for the dung bot
Tell us about yourself…
This is my Ultimate Smelter which can be found here: http://villavu.com/forum/showthread.php?t=99965&p=1208230#post1208230
Please show us one (or multiple) of your scripts.
9 Year(s)
Are you affilated in anyway with Jagex LTD?
No
Were you Referred to SRL?
What is your general programming knowledge?
Pascal only
Are you a member of any other communities?
No, unless you count joining powerbot.org a few days ago for the dung bot
Tell us about yourself…
From: bud_wis_er_420
Been around awhile, old schoolers might remember me from back in rscheat.net days when srl first came out. I was the one that built the guild miner before Anton did. Anyways I'm completely self taught. Been on and off over the years. You know life and all.
Well I applied once before and failed to get it because most ppl didn't know me and the script I applied with was lacking in SRL stuff. Well I'm back again, hope this time I make it. Hope you all like my script.
This is my Ultimate Smelter which can be found here: http://villavu.com/forum/showthread.php?t=99965&p=1208230#post1208230
Please show us one (or multiple) of your scripts.
////////////////////////////////////////////////////////////////////////////////
///////////////// Bud_wis_er_420 Ultimate Smelter ver 1.8 //////////////////////
////////////////////////////////////////////////////////////////////////////////
// //
// Features: //
// * Smelt almost all items that can be made at a furnace //
// * Support for Coal bag //
// * Antiban plus chat detection //
// * Breaking //
// * 6 hr restart //
// * Progress Report //
// * Auto claims Spin Tickets //
// * World switching //
// * Auto Updater //
// //
// Requirements: //
// * Must have mould in toolbelt if one is needed for your task //
// * Must have SPS and ODTM installed //
// * Must start inside the bank //
// * If using Coal bag, have it in first inv slot //
// //
// Notes: //
// * CannonBallLong = Make steel bars then Cannonballs //
// * CannonBallShort = Make Cannonballs from SteelBars //
// //
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
program UltimateSmelter;
{$DEFINE SMART}
{$I SRL/SRL.Simba}
{$I SPS/SPS.simba}
{$i ObjectDTM\ObjDTMInclude.simba}
//var SRLStats_Username, SRLStats_Password: string;
Const
{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}
{*}{*}{*}{*}{*}{*}{*}{*}{*}{ SCRIPT SETUP }{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}
{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}
{*}ScriptVersion = '1.8'; {*}
{*} {*}
{*}{ -Smelting List- }{*}
{*}{ BronzeBar, IronBar, SilverBar, GoldBar, SteelBar, MithrilBar, }{*}
{*}{ AdamantBar, RuneBar, CannonBallLong, CannonBallShort, GoldRing, }{*}
{*}{ SapphireRing, EmeraldRing, RubyRing, DimondRing, DragonStoneRing, }{*}
{*}{ OnyxRing, GoldNecklace, SapphireNecklace, EmeraldNecklace, }{*}
{*}{ RubyNecklace, DimondNecklace, DragonStoneNecklace, OnyxNecklace, }{*}
{*}{ GoldBracelet, SapphireBracelet, EmeraldBracelet, RubyBracelet, }{*}
{*}{ DimondBracelet, DragonStoneBracelet, OnyxBracelet, GoldAmulet }{*}
{*}{ SapphireAmulet, EmeraldAmulet, RubyAmulet, DimondAmulet, }{*}
{*}{ DragonStoneAmulet, OnyxAmulet, HolySymbol, UnholySymbol, Sickle, }{*}
{*}{ Tiara }{*}
{*} {*}
{*}{ -Location List- }{*}
{*}{ Edgeville, AlKharid, Falador, Neitiznot }{*}
{*} {*}
{*}{ * What and where to Smelt * }{*}
{*} Location = 'Falador'; {*}
{*} SmeltingWhat = 'GoldNecklace'; {*}
{*} CoalBag = False; // True = On, False = Off {*}
{*} {*}
{*}{ * Setup Break Time * }{*}
{*} BreakOn = False; // True = On, False = Off {*}
{*} BreakWhenMax = 100; // Max min till break {*}
{*} BreakWhenMin = 50; // Min min till break {*}
{*} BreakForMax = 30; // Max to take a break for {*}
{*} BreakForMin = 15; // Min to take a break for {*}
{*} {*}
{*}{ * Check for player text and plays a sound to warn you * }{*}
{*} CheckTextType = 0; // 0 = off, 1 = Any Text, 2 = Nick and common {*}
{*} ChooseSound = 'C:\Windows\Media\Windows Critical Stop.wav'; {*}
{*} {*}
{*}{ * Setup World Hop * }{*}
{*} WorldHop = False; // Hop after breaks {*}
{*} HopForChat = False; // Hop to the set chat settings above {*}
{*} {*}
{*}{ * Turn Debug text and paint on/off * }{*}
{*} Debug = False; // True = on, False = off {*}
{*} DebugWait = False; // True = On, False = Off {*}
{*} UseAutoUpdateChecker = True; // Turn Auto Updater on/off {*}
{*} TakeBugScreens = False; // Take screenshots of bugs {*}
{*} {*}
{*}{*}{*}{*}{*}{*}{*}{*}{*}{ USER SETUP }{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}Procedure DeclarePlayers; begin
{*} {SRLStats_Username := '';} //SRLStats not working {*}
{*} {SRLStats_Password := '';} {*}
{*} {*}
{*} HowManyPlayers := 1; {*}
{*} CurrentPlayer := 0; {*}
{*} SetLength(Players, HowManyPlayers); {*}
{*} {*}
{*} Players[0].Name := ''; {*}
{*} Players[0].Pass := ''; {*}
{*} Players[0].Nick := ''; {*}
{*} Players[0].Pin := ''; {*}
{*} Players[0].Member := True; {*}
{*} Players[0].Active := True; {*}
{*} {*}
{*} {*}
{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}
{*}{*}{*}{*}{*}{*}{*}{*}{*}{ END SCRIPT SETUP }{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}
{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}
end;
type
Item = record
Color, Tol, Bmp, Dtm, Amount, BankLoc: Integer;
Hue, Sat: Extended;
UpText: TStringArray;
end;
Bank = record
color, Tol, Dtm: Integer;
Hue, Sat: Extended;
SPSPoints: TPointArray;
PosBox: TBox;
Loc, QuickPoint: TPoint;
end;
Furnace = record
color, Tol, Dtm: Integer;
Hue, Sat: Extended;
SPSPoints: TPointArray;
PosBox: TBox;
Loc, QuickPoint: TPoint;
end;
var
// Item Type Vars
CopperOre, TinOre, IronOre, SilverOre, CoalOre, GoldOre, MithrilOre,
AdamantOre, RuneOre, SilverBar, SteelBar, GoldBar, CutSapphire, CutEmerald,
CutRuby, CutDiamond, CutDragonStone, CutOnyx: Item;
// Bank Type Vars
EdgevilleBank, AlKharidBank, FaladorBank,
NeitiznotBank: Bank;
// Furnace Type Vars
EdgevilleFurnace, AlKharidFurnace, FaladorFurnace,
NeitiznotFurnace: Furnace;
//Global vars
var
SpinT, BankkColor, BankTol, BankDTM, FurnaceColor, FurnaceTol, FurnaceDTM,
ItemCount, StartingExperience, StartingXP, LastXPCount, BreakFor, BreakWhen,
CurrentLevel, LevelsGained, XPTL, BreakStartTime, FoundTime: Integer;
XpType: string;
ItemsNeed: TStringArray;
Restart, Bug, SetupBreak: Boolean;
BankHue, BankSat, FurnaceHue, FurnaceSat: Extended;
BankPosBox, FurnacePosBox: TBox;
BankPoints, FurnacePoints: TPointArray;
BankLoc, FurnaceLoc, BankQuickPoint, FurnaceQuickPoint: TPoint;
StartTime, CurrentTime: Int64;
// By RJJ95
function OpenReportFile(): integer;
var
fileName,Bot_SavePath: string;
begin
Bot_SavePath := AppPath + 'Scripts\UltimateSmelterBug\';
if (not directoryExists(Bot_SavePath)) then
forceDirectories(Bot_SavePath);
fileName := 'UltimateSmelterBug.txt';
fileName := Bot_SavePath + fileName;
try
if (fileExists(fileName)) then
result := appendFile(fileName)
else
result := createFile(fileName);
except
writeln('OpenSRLLogFile: '+exceptionToString(exceptionType, exceptionParam));
end;
end;
// By RJJ95
procedure AddReport(s: string);
var
tmpFile: integer;
begin
writeln(s);
tmpFile := OpenReportFile();
if (tmpFile >= 0) then
try
writeFileString(tmpFile, '['+msToTime(getTimeRunning(), TIME_BARE)+']: '+s+#13+#10);
except
writeln('Error writing File');
finally
closeFile(tmpFile);
end;
end;
// By Ollybest
Function rs_TakeScreen(s: string): Integer;
var
tpa: TPointArray;
TIA, TIA2, TIA3: TIntegerArray;
w, h: Integer;
ATPA: T2DPointArray;
begin
GetClientDimensions(w, h);
Result := BitmapFromClient(MSX1, MSY1, w, h);
setBitmapSize(Result, w, h);
setLength(ATPA, 3);
//Removes Char from pic
TPAFromBoxWrap(IntToBox(MSCX - 13, MSCY - 20, MSCX + 13, MSCY + 20), ATPA[1]);
//Removes Char name at bottom of chat from pic
TPAFromBoxWrap(IntToBox(MSCX - 13, MSCY - 20, MSCX + 13, MSCY + 20), ATPA[1]);
//Removes total xp from pic
TPAFromBoxWrap(IntToBox(MSCX - 13, MSCY - 20, MSCX + 13, MSCY + 20), ATPA[1]);
//Removes lvls from pic
TPAFromBoxWrap(IntToBox(MSCX - 13, MSCY - 20, MSCX + 13, MSCY + 20), ATPA[1]); //Health
TPAFromBoxWrap(IntToBox(MSCX - 13, MSCY - 20, MSCX + 13, MSCY + 20), ATPA[1]); //Prayer
TPAFromBoxWrap(IntToBox(MSCX - 13, MSCY - 20, MSCX + 13, MSCY + 20), ATPA[1]); //Summon
//Writes to pic
TPAFromTextWrap(s, statchars, w, h, ATPA[2]);
GetColorsWrap(ATPA[0], TIA);
TIA2 := ColorsFromTPA(ATPA[1], clRed);
TIA3 := ColorsFromTPA(ATPA[2], clRed);
OffsetTPA(ATPA[0], Point(-35, -6));
OffsetTPA(ATPA[2], Point(2, +336))
MergeATPAWrap(ATPA, TPA);
try
fastSetPixels(Result, TPA, TIA+TIA2+TIA3);
except
writeln('rs_TakeScreen: Failed to set pixels, prehaps TakePic reason is too long!');
end;
end;
// By Ollybest
Procedure rs_SaveScreenshot(reason, savePath: string);
var
bmp, x: Integer;
begin
if (not(loggedIn)) then
Exit;
bmp := rs_TakeScreen(reason);
if FileExists(savePath + ' [' + ToStr(x) +']' + '.png') then
while FileExists(savePath + ' [' + ToStr(x) + ']' + '.png') do
Inc(x);
try
SaveBitmap(bmp, savePath + ' [' + ToStr(x) + ']' + '.png');
except
writeln('rs_TakeScreenshot: Failed saving screenshot');
finally
FreeBitmap(bmp);
end;
end;
// By Ollybest
Procedure TakePic(s: string);
var
path, dat: string;
begin
if TakeBugScreens then
begin
path := AppPath + 'Scripts\UltimateSmelterBug\';
dat := TheDate(Date_Day)+ ' ';
if not DirectoryExists(Path) then
CreateDirectory(Path);
rs_SaveScreenshot(s, Path + 'TakePic - ' + dat);
//WriteFileString((Path + s +' DebugLog - ' + dat + '.txt'), GetDebugText);
end;
end;
{*******************************************************************************
Function AutoupdateMe;
By: Shuttleu & Harry
Edited By: Ashaman88
Description: Autoupdates Script.
*******************************************************************************}
procedure AutoUpdateMe;
var Neifile:integer;
OnlineVersion, NewScript, NeiFeilNennen:string;
begin
if UseAutoUpdateChecker then
begin
writeln('Checking for script updates...');
OnlineVersion := GetPage('http://scriptupdates.googlecode.com/git/UltimateSmelter.txt');
writeln(OnlineVersion);
writeln(ScriptVersion)
if (trim(OnlineVersion) > ScriptVersion) then
begin
writeln('Newer script version online!');
writeln('Autoupdating to newer version.');
NewScript := GetPage('http://scriptupdates.googlecode.com/git/UltimateSmelter.simba');
NeiFeilNennen := ScriptPath+ 'Ultimate Smelter '+ OnlineVersion+' by Bud_wis_er_420.simba';
Neifile := Rewritefile(NeiFeilNennen, true);
try
WriteFileString(Neifile, NewScript);
except
begin
writeln('Fatal error writing to '+NeiFeilNennen+'!!');
terminatescript;
end;
end;
CloseFile(Neifile);
writeln('New script downloaded to '+NeiFeilNennen+'!! Please use this one!!');
TerminateScript;
end else
writeln('You have the latest version of the script!');
end else
writeln('!!!!! Not checking for latest version, you may be outdated!');
end;
//by LeJingle!!!
Procedure ConvertTime64(timeMS:int64; var YEAR, MONTH, WEEK, DAY, HOUR, MINUTE, SECOND:Integer);
var
x: int64;
begin
x := timeMS;
(* Better to do the calculations in my opinion (especially for year) now,
* trying at run time usually Results in breaking/miscalculation.
* Hence, commented out [equilavent] expressions
*)
YEAR := x div (31536000000); // 1000 * 60 * 60 * 24 * 365 (1 year or 365 days)
x := x mod (31536000000);
MONTH := x div (2592000000); // 1000 * 60 * 60 * 24 * 30 (1 month or 30 days)
x := x mod (2592000000);
WEEK := x div (604800000); // 1000 * 60 * 60 * 24 * 7 (1 week or 7 days)
x := x mod (604800000);
DAY := x div (86400000); // 1000 * 60 * 60 * 24 (1 day or 24 hours)
x := x mod (86400000);
HOUR := x div (3600000); // 1000 * 60 * 60 (1 hour or 60 minutes)
x := x mod (3600000);
MINUTE := x div (60000); // 1000 * 60 (1 minute or 60 seconds)
x := x mod (60000);
SECOND := x div (1000); // 1000 (1 second, is in MS format now)
x := x mod (1000);
end;
//by LeJingle!!!
Function MsToTime64(MS: int64): string;
var
STA: TVariantArray;
Time: array [0..6] of Integer;
i: Integer;
begin
Result := '';
STA := [' Years, ', ' Months, ', ' Weeks, ', ' Days, ', ' Hours, ',
' Minutes and ', ' Seconds', 0];
ConvertTime64(MS, Time[0], Time[1], Time[2], Time[3], Time[4], Time[5], Time[6]);
for i := 0 to 6 do
if (Time[i] > 0) or (STA[7]) or (i = 6) then
Result := Result + PadZ(IntToStr(Time[i]), STA[7]) + STA[i];
end;
Procedure WriteDebug(txt: string);
begin
if Debug then
AddReport(txt);
end;
//By Bandland100, modified by Ashaman, then me
Procedure SuperWindMouse(xs, ys, xe, ye, gravity, wind, minWait, maxWait, maxStep, targetArea: extended);
Var
veloX,veloY,windX,windY,veloMag,dist,randomDist,lastDist,step: extended;
lastX,lastY,MSP,W: integer;
sqrt2,sqrt3,sqrt5: extended;
Begin
MSP := MouseSpeed;
sqrt2:= sqrt(2);
sqrt3:= sqrt(3);
sqrt5:= sqrt(5);
While hypot(xs - xe, ys - ye) > 1 Do
Begin
dist:= hypot(xs - xe, ys - ye);
wind:= minE(wind, dist);
If dist >= targetArea Then
Begin
windX:= windX / sqrt3 + (random(round(wind) * 2 + 1) - wind) / sqrt5;
windY:= windY / sqrt3 + (random(round(wind) * 2 + 1) - wind) / sqrt5;
End Else
Begin
windX:= windX / sqrt2;
windY:= windY / sqrt2;
If (maxStep < 3) Then
Begin
maxStep:= random(3) + 3.0;
End Else
Begin
maxStep:= maxStep / sqrt5;
End;
End;
veloX:= veloX + windX;
veloY:= veloY + windY;
veloX:= veloX + gravity * (xe - xs) / dist;
veloY:= veloY + gravity * (ye - ys) / dist;
if hypot(veloX, veloY) > maxStep then
Begin
randomDist:= maxStep / 2.0 + random(round(maxStep) div 2);
veloMag:= sqrt(veloX * veloX + veloY * veloY);
veloX:= (veloX / veloMag) * randomDist;
veloY:= (veloY / veloMag) * randomDist;
End;
lastX:= Round(xs);
lastY:= Round(ys);
xs:= xs + veloX;
ys:= ys + veloY;
Case Random(50) Of
1..25: W := (MSP + (Random((MSP/4))));
26..50: W := (MSP - (RandomRange((MSP/2), MSP-1)));
End;
If (W < 1) Then
W := 1;
If (lastX <> Round(xs)) Or (lastY <> Round(ys)) Then
MoveMouse(Round(xs), Round(ys));
step:= hypot(xs - lastX, ys - lastY);
W := round((maxWait - minWait) * (step / maxStep) + minWait);
wait(W);
lastdist:= dist;
End;
If (Round(xe) <> Round(xs)) or (Round(ye) <> Round(ys)) Then
MoveMouse(Round(xe), Round(ye));
MouseSpeed := MSP;
End;
// Ripped MMouse but with Bandland100 SuperwindMouse
Procedure ABMouse(eX, eY, ranX, ranY: Integer);
Var
randSpeed: extended;
c, X,Y,X2,Y2,j,Dist,MP: integer;
Begin
j := MouseSpeed;
GetMousePos(X, Y);
Dist := Distance(X, Y, eX, eY);
MP := Round(Dist/150);
If MP < 0 Then
MP := 1;
randSpeed := (random(MouseSpeed) / 2.0 + MouseSpeed) / 10.0;
c := random(8);
if (c = 4) then
begin
X2 := RandomRange(eX-(j*MP), eX+(j*MP));
Y2 := RandomRange(eY-(j*MP), eY+(j*MP));
SuperWindMouse(X, Y, X2, Y2, 11, 8, 10.0 / randSpeed, 12.0 / randSpeed, 10.0 * randSpeed, 10.0 * randSpeed);
GetMousePos(X, Y);
MMouse(eX, eY, ranX, ranY);
end else
begin
SuperWindMouse(X, Y, eX, eY, 11, 8, 10.0 / randSpeed, 12.0 / randSpeed, 10.0 * randSpeed, 10.0 * randSpeed);
MMouse(eX, eY, ranX, ranY);
end;
MouseSpeed := j;
End;
// Ripped MouseBox but with Bandland100 SuperwindMouse
procedure ABMouseBox(x1, y1, x2, y2: Integer; Action: Integer);
var
fx, fy: Integer;
begin
GaussBox(fx, fy, x1, y1, x2, y2);
if InRange(Action, mouse_Right, mouse_move) then
begin
ABMouse(fx, fy, 0, 0);
case Action of
0: ClickMouse2(0);
1: ClickMouse2(1);
end;
end else srl_Warn('MouseBox', 'ClickType is NOT a valid number!', warn_AllVersions);
end;
// Ripped InvMouse but with Bandland100 SuperwindMouse
function ABInvMouse(InvSlot, Action: Byte) : boolean;
var
TB: TBox;
CurrPT : TPoint;
begin
result := false;
if (not InRange(Action, 0, 3)) then
begin
srl_Warn('InvMouse', 'Action #' + IntToStr(Action) + ' is not a valid action', warn_AllVersions);
Exit;
end;
if (not InRange(InvSlot, 1, 28)) then
begin
srl_Warn('InvMouse', 'Inventory slot #' + IntToStr(InvSlot) + ' is not a valid slot', warn_AllVersions);
Exit;
end;
GameTab(tab_inv);
Result := true;
TB := InvBox(InvSlot);
GetMousePos(CurrPT.x,CurrPT.y);
if PointInBox(CurrPT,TB) then
ABMouseBox(Max(CurrPT.x-random(2),TB.x1),Max(CurrPT.y-random(2),TB.y1),
Min(CurrPT.x+random(2),TB.x2),Min(CurrPT.y+random(2),TB.y2),Action) //LOL Pro-human much!
else
ABMouseBox(TB.X1, TB.Y1, TB.X2, TB.Y2, Action);
end;
// Ripped MouseBankSlot but with Bandland100 SuperwindMouse
procedure ABMouseBankSlot(BankSlot, Action: integer);
var
Box: TBox;
X, Y: Integer;
begin
Box := BankIndexToMSBox(BankSlot);
GetMousePos(X, Y);
if not PointInBox(Point(X, Y), Box) then
begin
ABMouseBox(Box.X1, Box.Y1, Box.X2, Box.Y2, Action);
case Action of
0: ClickMouse2(0);
1: ClickMouse2(1);
end;
end else
begin
case Action of
0: ClickMouse2(0);
1: ClickMouse2(1);
end;
end;
end;
// Waits for menu option to exist
function WaitOptionExist(S: TStringArray; Time: Integer): Boolean;
var
T: Integer;
begin
Result := False;
T := GetSystemTime + Time;
while (GetSystemTime < T) do
begin
Result := OptionsExist( S, False);
Wait(20 + Random(10));
end;
end;
// Randomly switches worlds
procedure SwitchWorlds;
begin
WaitFunc(@ExitToLobby, RandomRange(1000, 1200), RandomRange(8000, 10000));
ChangeWorld(RandomWorld(True,False));
WaitFunc(@loggedin, RandomRange(1000, 1200), RandomRange(1000, 30000));
while not ExitSquealOfFortune do
begin
wait(100);
end;
end;
(*
Looks Chat text.
Returns true if found.
*)
procedure CheckForText(TT: integer; WH: Boolean);
var
text,Captext,Lowertext,Alltext: TStringArray;
x, y, next, CTime: Integer;
begin
CTime := (GetSystemTime - FoundTime);
if(CTime > 120000)then
begin
//Checks for text
if (TT = 1) then
begin
if FindColor(x, y, 16711680, 8, 345, 490, 456) or
FindColor(x, y, 8388736, 8, 345, 490, 456) then
begin
WriteDebug('Text Found');
TakePic('Chat text Found');
FoundTime := GetSystemTime;
playsound(ChooseSound);
if (WH = True) then
SwitchWorlds;
Exit;
end;
end;
//Checks for nick and common chat
if(TT = 2)then
begin
text := ['hello', 'bot', 'sup', 'hi', 'dude',
'hay', 'hey', 'lvl', 'level', Players[CurrentPlayer].Nick];
SetLength(Captext, high(text)+1);
SetLength(Lowertext, high(text)+1);
SetLength(Alltext, (high(text)+1) * 2);
for next := 0 to high(text) do
Captext[next] := Capitalize(text[next]);
for next := 0 to high(text) do
Lowertext[next] := Lowercase(text[next]);
Alltext := Captext + Lowertext;
for next := 0 to high(Alltext) do
begin
if IsChatBoxTextAnyLine(Alltext[next], clBlue) then
begin
WriteDebug('Text Found');
TakePic('Chat text Found');
playsound(ChooseSound);
FoundTime := GetSystemTime;
if (WH = True) then
begin
SwitchWorlds;
Break;
end;
end;
end;
end;
end;
end;
function CheckLogin: Boolean;
begin
Result := False;
if not loggedin then
begin
if not loginplayer then
begin
Restart := True;
Result := True;
end;
SetAngle(SRL_ANGLE_HIGH);
end;
while not ExitSquealOfFortune do
begin
wait(100);
end;
if bug then Result := True;
end;
procedure CheckPin;
begin
if CheckLogin then Exit;
if(PinScreen)then
begin
WriteDebug('Found Pin Screen');
if(Players[CurrentPlayer].Pin = '')then
begin
WriteDebug('We are at the pin screen and you didn''t enter a pin');
if (Debug = False) then Logout;
Bug := True;
Exit;
end;
InPin(Players[CurrentPlayer].Pin);
if WaitFunc(@BankScreen, RandomRange(200, 220), RandomRange(1000, 1200)) then
WriteDebug('Bank Screen found');
end;
end;
procedure CheckForBreak;
var
TimeFromLastBreak: Integer;
begin
if (BreakOn = True) then
begin
if (SetupBreak = False) then
begin
BreakWhen := (60000 * (random(BreakWhenMax - BreakWhenMin) + BreakWhenMin)) - random(60000) + random(120000);
BreakFor := (60000 * (random(BreakForMax - BreakForMin) + BreakForMin)) - random(60000) + random(120000);
SetupBreak := True;
end;
TimeFromLastBreak := GetSystemTime - BreakStartTime;
if (TimeFromLastBreak > BreakWhen) then
begin
ToStr(MsToTime64(CurrentTime))
WriteDebug('Breaking for ' + ToStr(MsToTime64(BreakFor)) + ', Logging out');
Logout;
wait(BreakFor);
if (WorldHop = True) then
SwitchWorlds;
SetupBreak := False;
CheckLogin;
ClickNorth(SRL_ANGLE_HIGH);
BreakStartTime := GetSystemTime;
end;
end;
end;
procedure ProgressReport;
var
XP, XPC, lvl, TimeToNextBreak: Integer;
ItemPH, XPH: Extended;
ItemName: String;
begin
if Debug then ClearDebug;
//if (debug = False) then ClearDebug;
XP := GetXPBarTotal - StartingExperience;
XPH := Round(XP * (3600.0 / (GetTimeRunning / 1000.0)));
ItemPH := Round((ItemCount * (3600.0 / (GetTimeRunning / 1000.0))));
//Checks for 99 Smithing or crafting
if CurrentLevel < 99 then
begin
if (StartingXP - XP) < 0 then
begin
if (XpType = 'Smelt') then
begin
StartingXP:= (XpTillNextLevel(SKILL_SMITHING)+XP);
writeln('Gained a Smithing level!!');
lvl := 1;
LevelsGained := LevelsGained + 1;
end else
begin
StartingXP:= (XpTillNextLevel(SKILL_CRAFTING)+XP);
writeln('Gained a Crafting level!!');
lvl := 1;
LevelsGained := LevelsGained + 1;
end;
end;
end;
if XPH < 1000 then
XPH:=1000.0;
XPTL:= Round(((StartingXP - XP) / (XPH / 1000.0)) * 3600.0);
if (Lowercase(SmeltingWhat) = 'cannonballlong') or (Lowercase(SmeltingWhat) = 'cannonballshort') then
ItemName := 'CannonBall'
else ItemName := SmeltingWhat;
CheckForBreak;
TimeToNextBreak := BreakWhen - (GetSystemTime - BreakStartTime);
writeln('======== Bud''s Ultimate Smelter ver ' + ScriptVersion + ' ========');
writeln(XpType + 'ing ' + ItemName + 's in ' + Location);
writeln('Time Running: ' + ToStr(MsToTime64(GetTimeRunning)));
writeln(ItemName + 's ' + XpType + 'ed ' + IntToStr(ItemCount));
writeln('TTL: ' + MsToTime(XPTL, Time_Formal)+ ' Levels Gained: ' + IntToStr(LevelsGained));
writeln(XpType + 'ing Experience Earned: ' + ToStr(XP));
writeln('Experience/Hour: ' + ToStr(XPH)+ ' SpinTickets Found: ' + ToStr(SpinT));
if (BreakOn = True) then
writeln('Taking a ' + ToStr(MsToTime64(BreakFor)) + ' break in ' + ToStr(MsToTime64(TimeToNextBreak)))
else WriteDebug('Breaking is off');
writeln('=========================================================');
XPC := GetXPBarTotal - LastXPCount;
LastXPCount := GetXPBarTotal;
{if (XpType = 'Smelt') then
begin
Stats_IncVariable('Smithing EXP (Gained)', XPC);
Stats_IncVariable('Smithing Levels (Gained)', lvl);
end else
begin
Stats_IncVariable('Crafting EXP (Gained)', XPC);
Stats_IncVariable('Crafting Levels (Gained)', lvl);
end;
Stats_Commit;}
end;
//Looks uptext using 4 different methods. Returns True if found
Function IsUpTextAdv(Text: TStringArray): Boolean;
var
TP : TPoint;
begin
Result := FindTextEx(TP.x,TP.y,Text,['UpChars'],MSX1,MSY1,MSX1+300,MSY1+30) or
FindTextEx(TP.x,TP.y,Text,['UpChars_s'],MSX1,MSY1,MSX1+300,MSY1+30) or
FindTextEx(TP.x,TP.y,Text,['UpCharsEx'],MSX1,MSY1,MSX1+300,MSY1+30) or
IsUpTextMultiCustom(Text);
end;
//Looks for both uptext and mouseover text. Returns True if found
function FindTextAdv(Text: TStringArray): Boolean;
var
x, y: Integer;
begin
Result := False;
//Looks for uptext
if IsUpTextAdv(Text) then
begin
Result := True;
end else
begin
//Looks for Mouseover text
if FindTextEx(x, y, Text, ['UpCharsEx'], MSX1, MSY1, MIX2, MIY2) then
begin
Result := True;
end;
end;
end;
//Finds a spinticket by going thru each inv slot with CT2
Procedure FindSpinTicketACA;
var
x, y, i, w, h: Integer;
box: TBox;
SpinTicketColor: TAutoColorInfo;
begin
with SpinTicketColor do
begin
Name := 'SpinTicket Color';
MinCount := 100;
Color := 4088717;
HueMod := 0.11;
SatMod := 0.60;
LumTol := 2;
MinR := 136; MaxR := 146;
MinG := 95; MaxG := 103;
MinB := 59; MaxB := 66;
MinX := 15.036; MaxX := 17.689;
MinY := 13.736; MaxY := 16.206;
MinZ := 5.996; MaxZ := 7.349;
end;
GetClientDimensions(w, h);
for i := 1 to 28 do
begin
box := InvBox(i);
if ExistsItem(i) or FindObjRecordEx(x, y, SpinTicketColor, box.x1, box.y1, box.x2, box.y2, False, True) then
begin
if FindObjRecordEx(x, y, SpinTicketColor, box.x1, box.y1, box.x2, box.y2, False, True) then
begin
ABInvMouse(i, 2);
if IsUpTextAdv(['Clai','im sp','spin']) then
begin
WriteDebug('TicketUpText was found with UpText');
ClickMouse2(1);
inc(SpinT);
end else
begin
WriteDebug('Did not find TicketUpText with UpText, trying Mouseover Text');
if FindTextEx(x, y, ['Clai','im sp','spin'], ['UpCharsEx'], 0, 0, w, h) then
begin
WriteDebug('TicketUpText was found with Mouseover Text');
ClickMouse2(1);
inc(SpinT);
end else
begin
WriteDebug('Did not Find TicketUpText');
end;
end;
end;
end;
end;
end;
//Finds spin ticket and clicks on it
procedure CheckForSpinTicket;
var
x, y: Integer;
begin
if FindSpinTicketObj(x, y) then
begin
ABMouse(x -5, y- 3, 10, 6);
if IsUpTextAdv(['Clai','im sp','spin']) then
begin
WriteDebug('TicketUpText was found with UpText');
ClickMouse2(1);
inc(SpinT);
end else
begin
WriteDebug('Did not find TicketUpText with UpText, trying Mouseover Text');
if FindTextEx(x, y, ['Clai','im sp','spin'], ['UpCharsEx'], MSX1, MSY1, MIX2, MIY2) then
begin
WriteDebug('TicketUpText was found with Mouseover Text');
ClickMouse2(1);
inc(SpinT);
Exit;
end else
begin
WriteDebug('Did not Find TicketUpText');
end;
end;
end;
WriteDebug('SRL function didn''t find a ticket, trying my way');
FindSpinTicketACA;
end;
//Paints a cross at x,y and a color of your choice
Procedure PaintCross(x,y,col: Integer);
var
CTPA ,HighTPA, i, c: Integer;
TP: Tpoint;
TPA, NewTPA: TPointArray;
begin
SetLength(TPA, 104);
SetLength(NewTPA, Length(TPA));
//Draw right
TP := Point(x, y);
for CTPA:= 0 to 9 do
begin
TPA[CTPA] := TP;
TP := point(TP.x + 1, TP.y);
end;
TP := Point(x, y - 1);
for CTPA := 10 to 17 do
begin
TPA[CTPA] := TP;
TP := point(TP.x + 1, TP.y);
end;
TP := Point(x, y + 1);
for CTPA:= 18 to 25 do
begin
TPA[CTPA] := TP;
TP := point(TP.x + 1, TP.y);
end;
//Draw down
TP := Point(x, y);
for CTPA := 26 to 35 do
begin
TPA[CTPA] := TP;
TP := point(TP.x, TP.y + 1);
end;
TP := Point(x + 1, y);
for CTPA := 36 to 43 do
begin
TPA[CTPA] := TP;
TP := point(TP.x, TP.y + 1);
end;
TP := Point(x - 1, y);
for CTPA := 44 to 51 do
begin
TPA[CTPA] := TP;
TP := point(TP.x, TP.y + 1);
end;
//Draw left
TP := Point(x, y);
for CTPA := 52 to 61 do
begin
TPA[CTPA] := TP;
TP := point(TP.x - 1, TP.y);
end;
TP := Point(x, y + 1);
for CTPA := 62 to 69 do
begin
TPA[CTPA] := TP;
TP := point(TP.x - 1, TP.y);
end;
TP := Point(x, y - 1);
for CTPA := 70 to 77 do
begin
TPA[CTPA] := TP;
TP := point(TP.x - 1, TP.y);
end;
//Draw up
TP := Point(x, y);
for CTPA:= 78 to 87 do
begin
TPA[CTPA] := TP;
TP := point(TP.x, TP.y - 1);
end;
TP := Point(x + 1, y);
for CTPA := 88 to 95 do
begin
TPA[CTPA] := TP;
TP := point(TP.x, TP.y - 1);
end;
TP := Point(x - 1, y);
for CTPA:= 96 to 103 do
begin
TPA[CTPA] := TP;
TP := point(TP.x, TP.y - 1);
end;
c := 0;
HighTPA := High(TPA)
for i := 0 to HighTPA do
begin
if not (TPA[i].x < MSX1 + 1) and
not (TPA[i].x > MSX2 - 1) and
not (TPA[i].y < MSY1 + 1) and
not (TPA[i].y > MSY2 - 1) then
begin
NewTPA[c] := TPA[i];
inc(c);
end;
end;
SetLength(NewTPA, c)
SMART_DrawDotsEx(False, NewTPA, col);
end;
//Like FindColorsTolerance but with CT2
function FindACA(Col, Tol: Integer; Hue, Sat: Extended; Uptext: TStringArray; x1, y1, x2, y2, Dist: Integer): Boolean;
var
i, TPAL, tmpCTS: integer;
P: TPoint;
TPA: TPointArray;
ATPA: T2DPointArray;
TVA: TVariantArray;
begin
if CheckLogin then Exit;
Result := False;
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(Hue, Sat);
if Debug then SMART_DrawBox(IntToBox(x1, y1, x2, y2));
if not FindColorsTolerance(TPA, Col, x1, y1, x2, y2, Tol) then
begin
WriteDebug('Failed to find color');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
SMART_ClearCanvas;
Exit;
end;
WriteDebug('Drawing on found colors');
if Debug then SMART_DrawDotsEx(False, TPA, clRed);
ATPA := SplitTPA(TPA, Dist);
SortATPAFrom(ATPA, Point(MSCX, MSCY));
SortATPAFromFirstPoint(ATPA, Point(MSCX, MSCY));
if Debug then SMART_DebugATPA(false, ATPA);
if DebugWait then
begin
WriteDebug('Waiting 2sec');
wait(2000);
end;
TPAL := High(ATPA);
for i := 0 to TPAL do
begin
P := MiddleTPA(ATPA[i]);
MMouse(P.x, P.y, 2, 2);
TVA := [Uptext]
if WaitFuncEx('FindTextAdv', TVA, RandomRange(100,150),RandomRange(900,1000)) then
begin;
Result := True;
Break;
end;
if Debug then PaintCross(P.x, P.y, clRed);
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if Debug then SMART_ClearCanvas;
end;
//Finds a TPA of DTMs and checks uptext for one we are looking for
function FindMyDTM(DTM: Integer; Uptext: TStringArray; x1, y1, x2, y2: Integer): Boolean;
var
i, TPAL: integer;
P: TPoint;
TPA: TPointArray;
TPAP: T2DPointArray;
TVA: TVariantArray;
begin
if CheckLogin then Exit;
Result := False;
if not(FindDTMs(DTM, TPA, x1, y1, x2, y2)) then
begin
WriteDebug('Failed to find DTM');
Exit;
end;
SortTPAFrom(TPA, Point(MSCX, MSCY));
TPAL := High(TPAP);
if Debug then SMART_DebugATPA(false, TPAP);
for i := 0 to TPAL do
begin
P := TPA[i];
if Debug then PaintCross(P.x, P.y, clRed);
ABMouse(P.x, P.y, 5, 5);
TVA := [Uptext]
if WaitFuncEx('FindTextAdv', TVA, RandomRange(100,150),RandomRange(900,1000)) then
begin;
Result := True;
if Debug then SMART_ClearCanvas;
Break;
end;
end;
end;
// Gets Mainscreen TP From SPS Minimap cords
function SPSMMtoMS(SPSPtX, SPSPtY, AjustX, AjustY: Integer): TPoint;
var
TP, SPSTP: TPoint;
begin
TP := IntToPoint(SPSPtX, SPSPtY);
SPSTP := SPS_PosToMM(TP);
Result := MMtoMSEx(AjustX, AjustY, SPSTP);
end;
// Makes box from MM cord without going outside MS
function SPSMMtoMSBox(X, Y, SizeX, SizeY: Integer): TBox;
var
TP: TPoint;
Box: TBox;
begin
TP := SPSMMtoMS(X, Y, 0, 0);
if ((TP.x - SizeX) < MSX1) then
Box.x1 := MSX1
else Box.x1 := TP.x - SizeX;
if ((TP.x + SizeX) > MSX2) then
Box.x2 := MSX2
else Box.x2 := TP.x + SizeX;
if ((TP.y - SizeY) < MSY1) then
Box.y1 := MSY1
else Box.y1 := TP.y - SizeY;
if ((TP.y + SizeY) > MSY2) then
Box.y2 := MSY2
else Box.y2 := TP.y + SizeY;
Result := Box;
end;
// Used to be called quickly and look for Furnace text
function OpenFurnaceQuick: Boolean;
begin
Result := False;
if FindTextAdv(['Smelt', 'Furnace', 'melt', 'urnac']) then
begin
WriteDebug('Think we found Furnace, Quick clicking');
ClickMouse2(0);
Result := True;
WaitOptionMulti(['Smelt', 'melt F', 'lt Furna'], RandomRange(900, 1200));
end;
if not FlagPresent then
begin
Result := True;
Exit;
end;
end;
// Used to be called quickly and look for Bank text
function OpenBankQuick: Boolean;
begin
Result := False;
if FindTextAdv(['Bank', 'Count', 'booth', 'ank']) then
begin
WriteDebug('Think we found Bank booth, Quick clicking');
ClickMouse2(0);
Result := True;
if WaitOptionExist(['Talk', 'alk-t', '-to Ba', 'anker', 'booth', 'Bank',
'ank b', 'Bank Counter', 'Count', 'unter'], RandomRange(900, 1200)) then
begin
if OptionsExist(['Talk', 'alk-t', '-to Ba', 'anker'], False) then
begin
if ChooseOptionMulti(['Bank Ba', 'ank Bak', 'nk Bank']) then
Exit;
end else
begin
if ChooseOptionMulti(['booth', 'Bank', 'ank b', 'nk Count', 'ank Coun', 'Count', 'unter']) then
Exit;
end;
end;
end;
if not FlagPresent then
begin
Result := True;
Exit;
end;
end;
//Calls one of the two functions above
function QuickFindText(Loc: string): Boolean;
begin
Result := False;
case Loc of
'Furnace' : if WaitFunc(@OpenFurnaceQuick,RandomRange(10, 20), RandomRange(12000,13000)) then Result := True;
'Bank' : if WaitFunc(@OpenBankQuick,RandomRange(10, 20), RandomRange(12000,13000)) then Result := True;
end;
end;
//Converts a SPS_MM Point to a MS Point and clicks on it
function QuickFind(SPSPtX, SPSPtY: Integer; UpText: TStringArray; Action: Integer): Boolean;
var
TP: TPoint;
TVA: TVariantArray;
begin
//WriteDebug('MMPos = (' + IntToStr(SPSPtX) + ', ' + IntToStr(SPSPtY) + ')');
TP := SPSMMtoMS(SPSPtX, SPSPtY, 3, 4);
if (TP.x < 0) or (TP.y < 0) then
begin
WriteDebug('Pos not on screen');
Exit;
end;
TVA := [UpText];
ABMouse(TP.x, TP.y, 0, 0);
if WaitFuncEx('FindTextAdv', TVA, RandomRange(10,15),RandomRange(1100,1300)) then
begin
case Action of
0: ClickMouse2(0);
1: ClickMouse2(1);
end;
WriteDebug('Found Quick');
Result := True;
end else WriteDebug('QuickFind Failed, didn''t find uptext');
end;
//My custon SPS_WalkPath, edited the Flagwait with my quick find
function SPS_WalkPathCustom(Path: TPointArray; TP: TPoint; loc: string): boolean;
var
I, H, T, D, Fails: integer;
P, MM, MMF: TPoint;
begin
if (not SPS_IsSetup) then
begin
WriteDebug('SPS ERROR: SPS_Setup was never called');
exit;
end;
H := High(Path);
T := GetSystemTime + 20000 + Random(5000);
Fails := 0;
while (not Result) and (GetSystemTime < T) and (Fails < 5) do
begin
if (not LoggedIn()) then
Exit;
RunEnergy(20);
P := SPS_GetMyPos();
for I := H downto 0 do
begin
MM := RotatePoint(Point(MMCX + Path[I].X - P.X, MMCY + Path[I].Y - P.Y),
0-rs_GetCompassAngleRadians, MMCX, MMCY);
if MM = MMF then
Inc(Fails);
D := Distance(MM.X, MM.Y, MMCX, MMCY);
if (D < 10) then
break
else
if (D < 70) then
begin
if (SPS_MultiMouse) then
MultiMouse(MM.X, MM.Y, 25, 3, false)
else
Mouse(MM.X, MM.Y, 5, 5, mouse_Left);
MMF := MM;
if (I = H) then
begin
MMouse(TP.x, TP.y, 5, 5);
if QuickFindText(loc) then
begin
Result := True;
Exit;
end;
end else FFlag(5 + (Integer(I <> H) * 15));
T := getSystemTime + 20000 + Random(1000);
Break;
end;
end;
Result := (I = H);
end;
end;
Procedure AntiBan;
var
i: Integer;
begin
if CheckLogin then Exit;
i := random(500)
CheckForText(CheckTextType, HopForChat);
case i of
59: begin
HoverMovingObject;
end;
99: begin
HoverSkill ('Smithing', False);
GameTab(tab_Inv);
end;
159:
begin
PickUpMouse;
end;
199:
begin
RandomRClick;
end;
259:
begin
ExamineInv;
end;
299:
begin
MMouseOffClient('random');
Wait(RandomRange(1000, 4000));
end;
359:
begin
RandomFKeys(True);
end;
399:
begin
MMouseOffClient('random');
Wait(RandomRange(5000, 8000));
end;
459:
begin
SmallRandomMouse;
end;
end;
end;
//Gets pos on MM with SPS and returns pos in a string
Function GetMyLocation: string;
var
MyPos: TPoint;
begin
if CheckLogin then Exit;
Result := 'Failed';
WriteDebug('Checking my position');
MyPos := SPS_GetMyPos();
// Furnace
if (MyPos.x > FurnacePosBox.x1) and (MyPos.x < FurnacePosBox.x2) and
(MyPos.y > FurnacePosBox.y1) and (MyPos.y < FurnacePosBox.y2) then
begin
WriteDebug('My position is the Furnace');
Result := 'Furnace';
Exit;
end;
// Bank
if (MyPos.x > BankPosBox.x1) and (MyPos.x < BankPosBox.x2) and
(MyPos.y > BankPosBox.y1) and (MyPos.y < BankPosBox.y2) then
begin
WriteDebug('My position is the Bank');
Result := 'Bank';
Exit;
end;
WriteDebug('Not at Bank or Furnace, My Postion is: ' + IntToStr(MyPos.x) + ', ' + IntToStr(MyPos.y));
end;
// Finds and opens door from SPS cords and CT2
function CheckDoor(DoorColor, Tol: Integer; Hue, Sat: Extended; SPSPtX, SPSPtY: Integer): Boolean;
var
TP, SPSTP: TPoint;
Box: TBox;
begin
if CheckLogin then Exit;
Result := False;
if QuickFind(SPSPtX, SPSPtY, ['Open door', 'Open'], 1) then
begin
WriteDebug('Door Found, opening it: Quick');
if WaitNotMoving(False) then WriteDebug('Not Moving');
Result := True;
Exit;
end;
TP := IntToPoint(SPSPtX, SPSPtY);
SPSTP := SPS_PosToMM(TP);
TP := MMtoMSEx(5, 5, SPSTP);
Box := IntToBox(TP.x - 30, TP.y - 40, TP.x + 30, TP.y + 40);
if Debug then SMART_DrawBox(Box);
if FindACA(DoorColor, Tol, Hue, Sat, ['Open door', 'Open'], Box.x1, Box.y1, Box.x2, Box.y2, 10) then
begin
WriteDebug('Door Found, opening it: 2nd');
ClickMouse2(1);
if WaitNotMoving(False) then WriteDebug('Not Moving');
Result := True;
Exit;
end;
if FindACA(DoorColor, Tol, Hue, Sat, ['Close door', 'Close'], Box.x1, Box.y1, Box.x2, Box.y2, 10) then
begin
WriteDebug('Door Found, but it is already opened');
Result := True;
end;
end;
//Waits for bankbooth or banker NPC uptext or MouseOver Text
function WaitBankOptions: Boolean;
begin
Result := False;
if WaitOptionExist(['Talk', 'alk-t', '-to Ba', 'anker', 'booth', 'Bank', 'ank b', 'Counter'], 1000) then
begin
if OptionsExist(['Talk', 'alk-t', '-to Ba', 'anker'], False) then
begin
if not ChooseOptionMulti(['Bank Ba', 'ank Bak', 'nk Bank']) then
begin
WriteDebug('Choose option Bank NPC found');
end else Result := True;
end else
begin
if not ChooseOptionMulti(['Bank Ba', 'ank Bak', 'nk Bank', 'ter >', 'nk Cou']) then
begin
WriteDebug('Choose option Bank Booth not found');
Exit;
end else Result := True;
end;
end else
begin
WriteDebug('Didn''t find bank options, musta misclicked');
MMouseOffClient('left');
Exit;
end;
end;
//Uses 3 dif methods to find Bank Item
function FindBankItem(var ItemLoc: Integer; Item: string; FindType: string): Boolean;
var
x, y, i, TPAL, ItemColor, ItemTol, ItemDtm, ItemBmp, tmpCTS: Integer;
TP: TPoint;
TPA: TPointArray;
ATPA: T2DPointArray;
Box: TBox;
TVA: TVariantArray;
ItemHue, ItemSat: Extended;
ItemUpText: TStringArray;
FoundItem: Boolean;
begin
Result := False;
if CheckLogin then Exit;
case Item of
'CopperOre' : begin
ItemColor := CopperOre.Color
ItemTol := CopperOre.Tol;
ItemHue := CopperOre.Hue;
ItemSat := CopperOre.Sat;
ItemDtm := CopperOre.Dtm;
ItemBmp := CopperOre.Bmp;
ItemUpText := CopperOre.UpText;
end;
'TinOre' : begin
ItemColor := TinOre.Color
ItemTol := TinOre.Tol;
ItemHue := TinOre.Hue;
ItemSat := TinOre.Sat;
ItemDtm := TinOre.Dtm;
ItemBmp := TinOre.Bmp;
ItemUpText := TinOre.UpText;
end;
'IronOre' : begin
ItemColor := IronOre.Color
ItemTol := IronOre.Tol;
ItemHue := IronOre.Hue;
ItemSat := IronOre.Sat;
ItemDtm := IronOre.Dtm;
ItemBmp := IronOre.Bmp;
ItemUpText := IronOre.UpText;
end;
'SilverOre' : begin
ItemColor := SilverOre.Color
ItemTol := SilverOre.Tol;
ItemHue := SilverOre.Hue;
ItemSat := SilverOre.Sat;
ItemDtm := SilverOre.Dtm;
ItemBmp := SilverOre.Bmp;
ItemUpText := SilverOre.UpText;
end;
'CoalOre' : begin
ItemColor := CoalOre.Color
ItemTol := CoalOre.Tol;
ItemHue := CoalOre.Hue;
ItemSat := CoalOre.Sat;
ItemDtm := CoalOre.Dtm;
ItemBmp := CoalOre.Bmp;
ItemUpText := CoalOre.UpText;
end;
'GoldOre' : begin
ItemColor := GoldOre.Color
ItemTol := GoldOre.Tol;
ItemHue := GoldOre.Hue;
ItemSat := GoldOre.Sat;
ItemDtm := GoldOre.Dtm;
ItemBmp := GoldOre.Bmp;
ItemUpText := GoldOre.UpText;
end;
'MithrilOre' : begin
ItemColor := MithrilOre.Color
ItemTol := MithrilOre.Tol;
ItemHue := MithrilOre.Hue;
ItemSat := MithrilOre.Sat;
ItemDtm := MithrilOre.Dtm;
ItemBmp := MithrilOre.Bmp;
ItemUpText := MithrilOre.UpText;
end;
'AdamantOre' : begin
ItemColor := AdamantOre.Color
ItemTol := AdamantOre.Tol;
ItemHue := AdamantOre.Hue;
ItemSat := AdamantOre.Sat;
ItemDtm := AdamantOre.Dtm;
ItemBmp := AdamantOre.Bmp;
ItemUpText := AdamantOre.UpText;
end;
'RuneOre' : begin
ItemColor := RuneOre.Color
ItemTol := RuneOre.Tol;
ItemHue := RuneOre.Hue;
ItemSat := RuneOre.Sat;
ItemDtm := RuneOre.Dtm;
ItemBmp := RuneOre.Bmp;
ItemUpText := RuneOre.UpText;
end;
'SteelBar' : begin
ItemColor := SteelBar.Color
ItemTol := SteelBar.Tol;
ItemHue := SteelBar.Hue;
ItemSat := SteelBar.Sat;
ItemDtm := SteelBar.Dtm;
ItemBmp := SteelBar.Bmp;
ItemUpText := SteelBar.UpText;
end;
'SilverBar' : begin
ItemColor := SilverBar.Color
ItemTol := SilverBar.Tol;
ItemHue := SilverBar.Hue;
ItemSat := SilverBar.Sat;
ItemDtm := SilverBar.Dtm;
ItemBmp := SilverBar.Bmp;
ItemUpText := SilverBar.UpText;
end;
'GoldBar' : begin
ItemColor := GoldBar.Color
ItemTol := GoldBar.Tol;
ItemHue := GoldBar.Hue;
ItemSat := GoldBar.Sat;
ItemDtm := GoldBar.Dtm;
ItemBmp := GoldBar.Bmp;
ItemUpText := GoldBar.UpText;
end;
'CutSapphire' : begin
ItemColor := CutSapphire.Color
ItemTol := CutSapphire.Tol;
ItemHue := CutSapphire.Hue;
ItemSat := CutSapphire.Sat;
ItemDtm := CutSapphire.Dtm;
ItemBmp := CutSapphire.Bmp;
ItemUpText := CutSapphire.UpText;
end;
'CutEmerald' : begin
ItemColor := CutEmerald.Color
ItemTol := CutEmerald.Tol;
ItemHue := CutEmerald.Hue;
ItemSat := CutEmerald.Sat;
ItemDtm := CutEmerald.Dtm;
ItemBmp := CutEmerald.Bmp;
ItemUpText := CutEmerald.UpText;
end;
'CutRuby' : begin
ItemColor := CutRuby.Color
ItemTol := CutRuby.Tol;
ItemHue := CutRuby.Hue;
ItemSat := CutRuby.Sat;
ItemDtm := CutRuby.Dtm;
ItemBmp := CutRuby.Bmp;
ItemUpText := CutRuby.UpText;
end;
'CutDiamond' : begin
ItemColor := CutDiamond.Color
ItemTol := CutDiamond.Tol;
ItemHue := CutDiamond.Hue;
ItemSat := CutDiamond.Sat;
ItemDtm := CutDiamond.Dtm;
ItemBmp := CutDiamond.Bmp;
ItemUpText := CutDiamond.UpText;
end;
'CutDragonStone': begin
ItemColor := CutDragonStone.Color
ItemTol := CutDragonStone.Tol;
ItemHue := CutDragonStone.Hue;
ItemSat := CutDragonStone.Sat;
ItemDtm := CutDragonStone.Dtm;
ItemBmp := CutDragonStone.Bmp;
ItemUpText := CutDragonStone.UpText;
end;
'CutOnyx' : begin
ItemColor := CutOnyx.Color
ItemTol := CutOnyx.Tol;
ItemHue := CutOnyx.Hue;
ItemSat := CutOnyx.Sat;
ItemDtm := CutOnyx.Dtm;
ItemBmp := CutOnyx.Bmp;
ItemUpText := CutOnyx.UpText;
end;
end;
Box := IntToBox(MBX1, MBY1, MBX2, MBY2);
if Debug then SMART_DrawBox(Box);
case FindType of
'Bmp' : begin
if not FindBitmapsSpiralTolerance(ItemBmp, x, y, TPA, MBX1, MBY1, MBX2, MBY2, 20) then
begin
WriteDebug('Did''t find any matching Bmp''s on whole bank screen');
if Debug then SMART_ClearCanvas;
end;
end;
'Dtm' : begin
if not FindDTMs(ItemDtm, TPA, MBX1, MBY1, MBX2, MBY2) then
begin
WriteDebug('Did''t find any matching DTM''s on whole bank screen');
if Debug then SMART_ClearCanvas;
end;
end;
'ACA' : begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(ItemHue, ItemSat);
if not FindColorsTolerance(TPA, ItemColor, MBX1, MBY1, MBX2, MBY2, ItemTol) then
begin
WriteDebug('Did''t find any matching Colors on whole bank screen');
if Debug then SMART_ClearCanvas;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
end;
end;
ATPA := SplitTPAEx(TPA, 10, 10);
TPAL := High(ATPA);
if Debug then SMART_DebugATPA(false, ATPA);
TVA := [ItemUpText];
WriteDebug('Checking TPA''s for Item');
for i := 0 to TPAL do
begin
TP := MiddleTPA(ATPA[i]);
ABMouse(TP.x - 2, TP.y - 2, 4, 4);
if WaitFuncEx('FindTextAdv', TVA, RandomRange(100,150),RandomRange(900,1000)) then
begin
WriteDebug('Item found with ' + FindType +' on whole screen');
ItemLoc := BankPointToBankIndex(MSTPointToBankPoint(TPA[i]));
WriteDebug('Found item in bank location: ' + IntToStr(ItemLoc));
Result := True;
if Debug then SMART_ClearCanvas;
Exit;
end;
end;
WriteDebug('Did''t find Bmp on whole bank screen, trying single slot checker');
FoundItem := False;
for i := 1 to 40 do
begin
Box := BankIndexToMSBox(i);
if Debug then SMART_ClearCanvas;
if Debug then SMART_DrawBox(Box);
case FindType of
'Bmp' : begin
if FindBitmapToleranceIn(ItemBmp, x, y, Box.x1, Box.y1, Box.x2, Box.y2, 50) then
begin
WriteDebug('Found matching Bmp in slot ' + IntToStr(i));
FoundItem := True;
if Debug then SMART_ClearCanvas;
end;
end;
'Dtm' : begin
if FindDTM(ItemDtm, x, y, Box.x1, Box.y1, Box.x2, Box.y2) then
begin
WriteDebug('Found matching Dtm in slot' + IntToStr(i));
FoundItem := True;
if Debug then SMART_ClearCanvas;
end;
end;
'ACA' : begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(ItemHue, ItemSat);
if FindColorTolerance(x, y, ItemColor, Box.x1, Box.y1, Box.x2, Box.y2, ItemTol) then
begin
WriteDebug('Found matching Color in slot' + IntToStr(i));
FoundItem := True;
if Debug then SMART_ClearCanvas;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
end;
end;
if (FoundItem = True) then
begin
ABMouseBankSlot(i, 2);
if WaitFuncEx('FindTextAdv', TVA, RandomRange(100,150),RandomRange(900,1000)) then
begin
WriteDebug('Item found using single slot checker');
ItemLoc := BankPointToBankIndex(MSTPointToBankPoint(TPA[i]));
Result := True;
if Debug then SMART_ClearCanvas;
Exit;
end;
end;
end;
WriteDebug('Did''t find Item using single slot checker');
if Debug then SMART_ClearCanvas;
end;
//Uses the above function to try to find the bank item 3 diff ways
function FindItemInBank(Item: string; var ItemLoc: Integer): Boolean;
begin
if CheckLogin then Exit;
//Tries to find Item with Bmp
if FindBankItem(ItemLoc, Item, 'Bmp') then
begin
WriteDebug('Found ' + Item + ' with Bmp');
Result := True;
Exit;
end;
//Tries to find Item with DTM
if FindBankItem(ItemLoc, Item, 'Dtm') then
begin
WriteDebug('Found ' + Item + ' with Dtm');
Result := True;
Exit;
end;
//Tries to find Item with Color Tol 2
if FindBankItem(ItemLoc, Item, 'ACA') then
begin
WriteDebug('Found ' + Item + ' with ACA');
Result := True;
Exit;
end;
end;
//Gets stored item or stores an item and returns its slot number
function StoreBankItem(Item: string): Integer;
var
ItemLoc: Integer;
begin
if CheckLogin then Exit;
case Item of
'CopperOre' : ItemLoc := CopperOre.BankLoc;
'TinOre' : ItemLoc := TinOre.BankLoc;
'IronOre' : ItemLoc := IronOre.BankLoc ;
'SilverOre' : ItemLoc := SilverOre.BankLoc;
'CoalOre' : ItemLoc := CoalOre.BankLoc;
'GoldOre' : ItemLoc := GoldOre.BankLoc;
'MithrilOre' : ItemLoc := MithrilOre.BankLoc;
'AdamantOre' : ItemLoc := AdamantOre.BankLoc;
'RuneOre' : ItemLoc := RuneOre.BankLoc;
'SteelBar' : ItemLoc := SteelBar.BankLoc ;
'SilverBar' : ItemLoc := SilverBar.BankLoc;
'GoldBar' : ItemLoc := GoldBar.BankLoc;
'CutSapphire' : ItemLoc := CutSapphire.BankLoc;
'CutEmerald' : ItemLoc := CutEmerald.BankLoc;
'CutRuby' : ItemLoc := CutRuby.BankLoc;
'CutDiamond' : ItemLoc := CutDiamond.BankLoc;
'CutDragonStone' : ItemLoc := CutDragonStone.BankLoc;
'CutOnyx' : ItemLoc := CutOnyx.BankLoc;
end;
if not(ItemLoc = 0) then
begin
WriteDebug('Found stored ' + Item + ' in slot ' + IntToStr(ItemLoc));
Result := ItemLoc;
end else
begin
Status('Storing Item Location');
WriteDebug(Item + ' Not stored yet');
if FindItemInBank(Item, ItemLoc) then
begin
case Item of
'CopperOre' : CopperOre.BankLoc := ItemLoc;
'TinOre' : TinOre.BankLoc := ItemLoc;
'IronOre' : IronOre.BankLoc := ItemLoc;
'SilverOre' : SilverOre.BankLoc := ItemLoc;
'CoalOre' : CoalOre.BankLoc := ItemLoc;
'GoldOre' : GoldOre.BankLoc := ItemLoc;
'MithrilOre' : MithrilOre.BankLoc := ItemLoc;
'AdamantOre' : AdamantOre.BankLoc := ItemLoc;
'RuneOre' : RuneOre.BankLoc := ItemLoc;
'SteelBar' : SteelBar.BankLoc := ItemLoc ;
'SilverBar' : SilverBar.BankLoc := ItemLoc;
'GoldBar' : GoldBar.BankLoc := ItemLoc;
'CutSapphire' : CutSapphire.BankLoc := ItemLoc;
'CutEmerald' : CutEmerald.BankLoc := ItemLoc;
'CutRuby' : CutRuby.BankLoc := ItemLoc;
'CutDiamond' : CutDiamond.BankLoc := ItemLoc;
'CutDragonStone': CutDragonStone.BankLoc := ItemLoc;
'CutOnyx' : CutOnyx.BankLoc := ItemLoc;
end;
WriteDebug(Item + ' stored in bank slot ' + IntToStr(ItemLoc));
Result := ItemLoc;
end else
begin
WriteDebug(Item + ' not found in bank');
WriteDebug('Item storage failed');
TakePic('Item storage failed');
if (Debug = False) then Logout;
Bug := True;
Exit;
end;
end;
end;
//Withdraws itme from bank
function WithdrawFromBank(Item: string; ItemLoc, Amount: Integer): Boolean;
var
amtS: string;
amtI, c: Integer;
TSA: TStringArray;
begin
Result := False;
if CheckLogin then Exit;
if not BankScreen then
begin
WriteDebug('Not at bankScreen');
Exit;
end;
// Check we have more than withdraw amount in bank.
amtI := GetBankIndexItemAmount(ItemLoc);
if (Amount > amtI) then
begin
WriteDebug('You only have ' + IntToStr(amtI) + ' items in bank slot ' + IntToStr(ItemLoc) + ' and you need ' + IntToStr(Amount));
TakePic('Not enough items');
Bug := True;
Exit;
end;
//Rightclick Bankslot
WriteDebug('Withdrawing ' + Item + ' from slot ' + IntToStr(ItemLoc));
ABMouseBankSlot(ItemLoc, 0);
// Loop: wait till find uptext or repeated 4 times
TSA := ['ithdr', 'Withd', 'thdra'];
C := 0;
while not WaitOptionExist(TSA, RandomRange(900, 1000)) or (c >= 4) do
Begin
Inc(c);
WriteDebug('Withdraw options not found, re-clicking');
MMouseOffClient('random');
MouseBankSlot(ItemLoc, 0);
end;
// Ends script if withdraw option not foud after 4 tries
if (c >= 4) then
begin
WriteDebug('Couldn''t find Withdraw options, ending script');
TakePic('Withdraw options not found');
bug := True;
Exit;
end;
// Withdraws option all if item is coal
if (Item = 'CoalOre') then
begin
ChooseOption('All');
Result := True;
Exit;
end;
// Looks for amount numbers in the option menu
amtS := IntToStr(Amount)
WriteDebug('Looking for numbers: ' + amtS);
if OptionsExist([amtS], False) then
begin
WriteDebug('Withdrawing ' + amtS);
if ChooseOption(amtS) then
begin
WriteDebug('Withdrawing ');
Result := True;
Exit;
end;
end;
//Didn't find numbers, now will look for X option
WriteDebug('Didn''t Find number: ' + amtS);
if ChooseOption('X') then
begin
WriteDebug('Withdrawing ' + amtS)
wait(RandomRange(1000, 1500));
TypeSend(amtS);
wait(RandomRange(500, 1000));
Result := True;
Exit;
end;
WriteDebug('WithdrawFromBank item failed');
end;
//Gets item from bank
function GetBankItem(Item: string; Amount: Integer): Boolean;
var
ItemLoc, c: Integer;
begin
if CheckLogin then Exit;
Result := False;
ItemLoc := StoreBankItem(Item); //Gets Item location
c := 0;
//Tries to withdraw item 3 times before it fails.
repeat
if WithdrawFromBank(Item, ItemLoc, Amount) then
begin
WriteDebug('Withdrawed item');
Result := True;
Exit;
end;
if bug then Exit;
MMouseOffClient('random');
wait(RandomRange(500, 700));
Inc(c);
Until (c >= 3)
WriteDebug('GetBankItem item failed');
end;
//Finds the bank
function FindTheBank: Boolean;
var
Box: TBox;
begin
if CheckLogin then Exit;
Result := False;
WriteDebug('Trying to find bank');
if BankScreen then
begin
WriteDebug('Already inside bank');
Result := True;
Exit;
end;
//Uses SPSMMtoMS to find the bank booth cords
if QuickFind(BankLoc.x, BankLoc.y, ['Bank booth', 'Bank Counter', 'Bank Co', 'nk Coun', 'Bank b', 'ank bo'], 1) then
begin
WriteDebug('Bank Found, opening it: Quick');
WaitNotMoving(False);
If WaitFunc(@BankScreen, RandomRange(200, 300), RandomRange(2500, 3000)) or
WaitFunc(@PinScreen, RandomRange(200, 300), RandomRange(2500, 3000)) then
begin
if PinScreen then
CheckPin;
WriteDebug('Bank found with Quick Bank');
Result := True;
Exit;
end;
end else WriteDebug('Quick Bank failed');
if BankScreen then
begin
WriteDebug('Already inside bank');
Result := True;
Exit;
end;
//Searching for bank with ACA
Box := SPSMMtoMSBox(BankLoc.x, BankLoc.y, 200, 200);
WriteDebug('Searching for bank with ACA');
if Debug then SMART_DrawBoxEx(false, false, Box, clRed);
if FindACA(BankkColor, BankTol, BankHue, BankSat, ['Talk', 'alk-t', '-to Ba', 'anker', 'booth', 'Bank', 'ank b', 'Counter'],
Box.x1, Box.y1, Box.x2, Box.y2, 10)then
begin
ClickMouse2(0);
if WaitBankOptions then
begin
if WaitNotMoving(False) then WriteDebug('Not Moving');
If WaitFunc(@BankScreen, RandomRange(200, 300), RandomRange(1500, 2000)) or
WaitFunc(@PinScreen, RandomRange(200, 300), RandomRange(1500, 2000)) then
begin
if PinScreen then
CheckPin;
WriteDebug('Bank found with ACA');
Result := True;
if Debug then SMART_ClearCanvas;
Exit;
end;
end else WriteDebug('Bank options not found');
end;
//Searching for bank with DTM
WriteDebug('Didn''t find bank with ACA, trying DTM');
if Debug then SMART_DrawBoxEx(false, false, Box, clRed);
if FindMyDTM(BankDTM, ['Talk', 'alk-t', '-to Ba', 'anker', 'booth', 'Bank', 'ank b', 'Counter'],
Box.x1, Box.y1, Box.x2, Box.y2)then
begin
ClickMouse2(0);
if WaitBankOptions then
begin
if WaitNotMoving(False) then WriteDebug('Not Moving');
If WaitFunc(@BankScreen, RandomRange(200, 300), RandomRange(2000, 3000)) or
WaitFunc(@PinScreen, RandomRange(200, 300), RandomRange(2000, 3000)) then
begin
WriteDebug('Bank found with DTM');
Result := True;
if Debug then SMART_ClearCanvas;
Exit;
end;
end;
end;
WriteDebug('Could not find Bank');
end;
// My custom Deposit for when Deposit() fails
function MDeposit(InvStart, InvEnd: integer): Boolean;
var
ItemFound: Boolean;
i, c, x, y: integer;
begin
ItemFound := False;
Deposit(InvStart, InvEnd, True);
for i := InvStart to InvEnd do
begin
if ExistsItem(i) then
begin
ItemFound := True;
WriteDebug('Deposit missed an item, manual depositing');
ABInvMouse(i, 0);
c := 0;
repeat
wait(RandomRange(100, 120));
inc(c);
until FindTextEx(x, y, ['epos', 'Depo', 'posi'], ['UpCharsEx'], MSCX, MSCY, MIX2, MIY2) or (c > 10)
if FindTextEx(x, y, ['it-A', 't-Al', 'All'], ['UpCharsEx'], MSCX, MSCY, MIX2, MIY2) then
begin
if ChooseOptionMulti(['it-A', 't-Al', 'All']) then
WriteDebug('Deposit All option found');
end else
begin
if ChooseOptionMulti(['epos', 'Depo', 'posi']) then
WriteDebug('Deposit option found');
end;
end;
end;
Result := True;
if (ItemFound = False) then Exit;
//second check
for InvStart := InvStart to InvEnd do
begin
if ExistsItem(i) then
begin
WriteDebug('Deposit missed an item, manual depositing one at a time');
ABInvMouse(i, 1);
end;
end;
for InvStart := InvStart to InvEnd do
begin
if ExistsItem(i) then
begin
Result := False;
WriteDebug('Deposit missed an item, Might be a SpinTicket');
end;
end;
end;
//Handles the whole of the banking depositing and withdrawing
function DoBanking: Boolean;
var
x, y, ItemL, i, amt: Integer;
TSA: TStringArray;
TVA: TVariantArray;
begin
if CheckLogin then Exit;
Result := False;
//Deposit all if not using coal bag or Deposit 2- 28 if using coal bag
if (CoalBag = False) then
begin
Status('Depositing All');
if not DepositAll then
begin
if not MDeposit(1, 28) then
begin
WriteDebug('Couldn''t Deposit Inv, looking for SpinTicket');
CloseBank;
CheckForSpinTicket;
if FindTheBank then
begin
if WaitNotMoving(False) then WriteDebug('Not Moving');
WriteDebug('Bank Found');
end;
end;
end;
end else
begin
Status('Depositing Inv slots 2 - 28');
if not MDeposit(2, 28) then
begin
WriteDebug('Couldn''t Deposit Inv, looking for SpinTicket');
CloseBank;
CheckForSpinTicket;
if FindTheBank then
begin
if WaitNotMoving(False) then WriteDebug('Not Moving');
WriteDebug('Bank Found');
end;
end;
end;
//Fill Coal Bag First
if (CoalBag = True) then
begin
Status('Withdrawing coal for Coal Bag');
if not GetBankItem('CoalOre', 27) then // Gets bank Item
begin
WriteDebug('Failed at getting item from bank');
Exit;
end;
ABInvMouse(1, 2);
if WaitFindColor(x, y, srl_outline_black, MIX1, 250, MIX2, MIY2, 0, RandomRange(2000, 2500)) then
begin
TSA := ['Coal bag', 'oal bag', 'al bag', 'Coal b'];
TVA := [TSA]
if WaitFuncEx('FindTextAdv', TVA, RandomRange(100,150),RandomRange(900,1000)) then
begin
Status('Filling Coal Bag');
ClickMouse2(0);
if WaitOptionExist(['Fill Coal', 'Fill Co', 'ill Coal', 'ill Coa'], 1000) then
ChooseOptionMulti(['Fill Coal', 'Fill Co', 'ill Coal', 'ill Coa']);
end;
if not WaitColorGoneIn(srl_outline_black, MIX1, 250, MIX2, MIY2, 0, RandomRange(2000, 2500)) then
begin
WriteDebug('Think bag is already full, cause Coal ore is still in inv');
WriteDebug('Redepositing Coal ore');
Status('Depositing Inv slots 2 - 28');
MDeposit(2, 28);
end;
end;
end;
//Gets the amount number for next item needed
ItemL := High(ItemsNeed);
for i := 0 to ItemL do
begin
case ItemsNeed[i] of
'CopperOre' : amt := CopperOre.Amount;
'TinOre' : amt := TinOre.Amount;
'IronOre' : amt := IronOre.Amount ;
'SilverOre' : amt := SilverOre.Amount;
'CoalOre' : amt := CoalOre.Amount;
'GoldOre' : amt := GoldOre.Amount;
'MithrilOre' : amt := MithrilOre.Amount;
'AdamantOre' : amt := AdamantOre.Amount;
'RuneOre' : amt := RuneOre.Amount;
'SteelBar' : amt := SteelBar.Amount ;
'SilverBar' : amt := SilverBar.Amount;
'GoldBar' : amt := GoldBar.Amount;
'CutSapphire' : amt := CutSapphire.Amount;
'CutEmerald' : amt := CutEmerald.Amount;
'CutRuby' : amt := CutRuby.Amount;
'CutDiamond' : amt := CutDiamond.Amount;
'CutOnyx' : amt := CutOnyx.Amount;
end;
Status('Withdrawing ' + ItemsNeed[i]);
if not GetBankItem(ItemsNeed[i], amt) then // Gets bank Item
begin
WriteDebug('Failed at getting item from bank');
Exit;
end;
end;
Result := True;
end;
//Opens the bank
function OpenTheBank: Boolean;
begin
if CheckLogin then Exit;
Result := False;
WriteDebug('Seaching for bank');
if BankScreen then
begin
WriteDebug('Already inside bank');
Result := True;
Exit;
end;
CheckForText(CheckTextType, HopForChat);
if FindTheBank then
begin
if WaitNotMoving(False) then WriteDebug('Not Moving');
WriteDebug('Bank Found');
Result := True;
end else
begin
WriteDebug('Didn''t find bank first time, trying one more time');
ClickNorth(SRL_ANGLE_HIGH);
if FindTheBank then
begin
if WaitNotMoving(False) then WriteDebug('Not Moving');
WriteDebug('Bank Found');
Result := True;
end;
end;
end;
//Goes to bank
function GoToBank: Boolean;
var
HPtsL: Integer;
SPSTP: TPoint;
begin
if CheckLogin then Exit;
Result := False;
if BankScreen then
begin
WriteDebug('Already inside bank');
Status('Inside Bank');
Result := True;
Exit;
end;
if (GetMyLocation = 'Bank') then
begin
if OpenTheBank then
begin
Result := True;
Status('At the Bank');
Exit;
end;
end else WriteDebug('Not at bank, walking to it');
Status('Going To Bank');
if SPS_WalkPathCustom(BankPoints, BankQuickPoint, 'Bank') then
begin
WaitNotMoving(False);
If WaitFunc(@BankScreen, RandomRange(200, 300), RandomRange(1500, 2000)) or
WaitFunc(@PinScreen, RandomRange(200, 300), RandomRange(1500, 2000)) then
begin
if PinScreen then
CheckPin;
WriteDebug('Found Bank Screen');
Status('Inside Bank');
Result := True;
Exit;
end;
if (GetMyLocation = 'Bank') then
begin
if OpenTheBank then
begin
Result := True;
Status('At the Bank');
Exit;
end;
end;
end else WriteDebug('SPS WalkPathCustom to bank failed');
WriteDebug('Didn''t make it to bank on fist try');
//Opens Door for Neitiznot location only
if (Lowercase(Location) = 'neitiznot') then
begin
WriteDebug('Checking for door');
Status('Checking for door');
if CheckDoor(2177591, 3, 0.30, 0.61, 6531, 2691) then
begin
if SPS_WalkPathCustom(BankPoints, BankQuickPoint, 'Bank') then
begin
WaitNotMoving(False);
If WaitFunc(@BankScreen, RandomRange(200, 300), RandomRange(1500, 2000)) or
WaitFunc(@PinScreen, RandomRange(200, 300), RandomRange(1500, 2000)) then
begin
if PinScreen then
CheckPin;
WriteDebug('Found Bank Screen');
Status('Inside Bank');
Result := True;
Exit;
end;
if (GetMyLocation = 'Bank') then
begin
if OpenTheBank then
begin
Result := True;
Status('At the Bank');
Exit;
end;
end;
end else WriteDebug('SPS walkpath failed, Neitiznot');
end;
end;
ClickNorth(SRL_ANGLE_HIGH);
//Check if symbol exists and try to go to SPS point
HPtsL := High(BankPoints);
SPSTP := SPS_PosToMM(BankPoints[HPtsL]);
ABMouse(SPSTP.x,SPSTP.y,1,1);
ClickMouse2(1);
WaitNotMoving(False);
if (GetMyLocation = 'Bank') then
begin
Status('At the Bank');
if QuickFind(BankLoc.x, BankLoc.y, ['Bank booth', 'Bank Co', 'Counter', 'nk Coun', 'Bank b', 'ank bo'], 0) then
begin
if WaitBankOptions then
begin
if WaitNotMoving(False) then WriteDebug('Not Moving');
Result := True;
WriteDebug('Found Bank and quick selected it');
Exit;
end;
end;
end;
WriteDebug('Checking if we made it to bank yet');
if (GetMyLocation = 'Bank') then
begin
if OpenTheBank then
begin
Status('Inside the Bank');
Result := True;
Exit;
end;
end;
WriteDebug('Trying to correct loction and use BlindWalk');
ClickNorth(SRL_ANGLE_HIGH);
SetAngle(SRL_ANGLE_HIGH);
Status('Going to bank');
if SPS_BlindWalk(BankPoints[HPtsL]) then
begin
if WaitNotMoving(False) then WriteDebug('Not Moving');
end else WriteDebug('SPS BlindWalk failed');
if (GetMyLocation = 'Bank') then
begin
if OpenTheBank then
begin
Result := True;
Status('At the Bank');
Exit;
end;
end else WriteDebug('Didn''t make it to bank with BlindWalk');
WriteDebug('SPS To bank failed, trying to find ObjDTM');
WriteDebug('SPS To bank failed, Ending char run');
WriteDebug('Note to self buld ObjDTM');
end;
function FindFurnace: Boolean;
var
x, y, i: Integer;
TVA: TVariantArray;
TSA: TStringArray;
Box: TBox;
begin
if CheckLogin then Exit;
Result := False;
TSA:= ['Smelt', 'Furnace', 'melt', 'urnac', 'elt Fur'];
if QuickFind(FurnaceLoc.x, FurnaceLoc.y, TSA, 1) then
begin
WaitNotMoving(False);
if WaitFindColor(x, y, 2929149, 497, 21, 506, 30, 0, RandomRange(2000, 2200)) then
begin
WriteDebug('Furnace Found: Quick');
Result := True;
Exit;
end;
end else
begin
WriteDebug('SPSMM to MS failed, trying quick find one more time');
ClickNorth(SRL_ANGLE_HIGH);
if QuickFind(FurnaceLoc.x, FurnaceLoc.y, TSA, 1) then
begin
WaitNotMoving(False);
if WaitFindColor(x, y, 2929149, 497, 21, 506, 30, 0, RandomRange(2000, 2200)) then
begin
WriteDebug('Furnace Found: Quick');
Result := True;
Exit;
end;
end;
end;
WriteDebug('Trying to find furnace with colored area');
Box := SPSMMtoMSBox(FurnaceLoc.x, FurnaceLoc.y, 200, 200);
if Debug then SMART_DrawBoxEx(false, false, Box, clRed);
if FindColoredAreaTolerance(x, y, 3289652,
Box.x1, Box.y1, Box.x2, Box.y2, 1600, 14) then
begin
if Debug then PaintCross(x, y, clred);
WriteDebug('Found a colored area, checking uptext');
ABMouse(x + 5, y + 20, 10, 10);
TVA := [TSA]
if WaitFuncEx('FindTextAdv', TVA, RandomRange(100,150),RandomRange(900,1000)) then
begin
WriteDebug('Furnace found with ColoredArea');
ClickMouse2(1);
WaitNotMoving(False);
if WaitFindColor(x, y, 2929149, 497, 21, 506, 30, 0, RandomRange(2000, 2200)) then
begin
if Debug then SMART_ClearCanvas;
Result := True;
Exit;
end;
end else WriteDebug('Didn''t find Furnace Text with ColoredArea');
end else WriteDebug('Didn''t find Furnace with ColoredArea');
WriteDebug('Trying to find Furnace with ACA');
if Debug then SMART_DrawBoxEx(false, false, Box, clRed);
if FindACA(FurnaceColor, FurnaceTol, FurnaceHue, FurnaceSat, TSA,
Box.x1, Box.y1, Box.x2, Box.y2, 5)then
begin
WriteDebug('Furnace found with ACA');
ClickMouse2(1);
WaitNotMoving(False);
if WaitFindColor(x, y, 2929149, 497, 21, 506, 30, 0, RandomRange(2000, 2200)) then
begin
if Debug then SMART_ClearCanvas;
Result := True;
Exit;
end;
end else WriteDebug('Didn''t find Furnace with ACA');
SetAngle(SRL_ANGLE_HIGH);
WriteDebug('Trying to find Furnace with ACA one more time');
if Debug then SMART_DrawBoxEx(false, false, Box, clRed);
if FindACA(FurnaceColor, FurnaceTol, FurnaceHue, FurnaceSat, TSA,
Box.x1, Box.y1, Box.x2, Box.y2, 5)then
begin
WriteDebug('Furnace found with ACA, 2nd try');
ClickMouse2(1);
WaitNotMoving(False);
if WaitFindColor(x, y, 2929149, 497, 21, 506, 30, 0, RandomRange(2000, 2200)) then
begin
if Debug then SMART_ClearCanvas;
Result := True;
Exit;
end;
end else WriteDebug('Didn''t find Furnace with ACA, 2nd try');
//Need to make better DTM's
WriteDebug('Trying to find Furnace with DTM, sloppy failsafe');
if Debug then SMART_DrawBoxEx(false, false, Box, clRed);
if FindMyDTM(FurnaceDTM, TSA, Box.x1, Box.y1, Box.x2, Box.y2)then
begin
WriteDebug('Furnace found with DTM');
ClickMouse2(1);
WaitNotMoving(False);
if WaitFindColor(x, y, 2929149, 497, 21, 506, 30, 0, RandomRange(2000, 2200)) then
begin
if Debug then SMART_ClearCanvas;
Result := True;
Exit;
end;
end else WriteDebug('Didn''t find Furnace with DTM');
WriteDebug('Trying last ditch effort to find the furnace');
WriteDebug('Rotating map while searching for ACA color');
Case Random(2) Of
0 : TSA := ['N', 'E', 'S', 'W'];
1 : TSA := ['W', 'S', 'E', 'N'];
end;
if Debug then SMART_DrawBoxEx(false, false, Box, clRed);
for i := 0 to 4 do
begin
MakeCompass(TSA[i]);
if FindACA(FurnaceColor, FurnaceTol, FurnaceHue, FurnaceSat, TSA,
Box.x1, Box.y1, Box.x2, Box.y2, 5)then
begin
WriteDebug('Furnace found with ACA, 3rd try');
ClickMouse2(1);
WaitNotMoving(False);
if WaitFindColor(x, y, 2929149, 497, 21, 506, 30, 0, RandomRange(2000, 2200)) then
begin
if Debug then SMART_ClearCanvas;
Result := True;
ClickNorth(SRL_ANGLE_HIGH);
Exit;
end;
end else WriteDebug('Didn''t find Furnace with ACA, Facing : ' + TSA[i]);
end;
if Debug then SMART_ClearCanvas;
WriteDebug('Could not find Furnace');
end;
procedure CheckSmelting(Bar: string; x1, y1, x2, y2: Integer);
var
x, y, c, OrangeOutline: Integer;
box: Tbox;
TP: TPoint;
begin
box := IntToBox(x1, y1, x2, y2);
if Debug then SMART_DrawBoxEx(false, false, box, clred);
case Bar of
'Up' : begin
// Looks if scroll bar is on Top
if not FindColorTolerance(x, y, 3779049, 226, 82, 234, 94, 14) then
begin
WriteDebug('Scroll bar is not on top, clicking scroll bar');
ABMouse(227,88,2,3); // Clicks scroll bar up
ClickMouse2(1);
end else WriteDebug('Scroll bar is on top');
end;
'Down':begin
// Looks if scroll bar is on bottom
if not FindColorTolerance(x, y, 3779049, 226, 283, 234, 290, 14) then
begin
WriteDebug('Scroll bar is not on bottom, clicking scroll bar');
ABMouse(227,278,2,3); // Clicks scroll bar down
ClickMouse2(1);
end else WriteDebug('Scroll bar is on bottom');
end;
end;
OrangeOutline := BitmapFromString(40, 40, 'meJzt2LENACAMAzB+6ML/HzDxFE' +
'egqh8wlMVRlNV7Yp1o79y5oz2lc7lcLpfL5XK5XC6Xy+Vy39wvP9I' +
'FZB0HZg==');
if FindBitmapToleranceIn(OrangeOutline, x, y, 17, 65, 222, 306, 10) then
begin
TP := IntToPoint(x1 + ((x2 - x1) / 2), y1 + ((x2 - x1) / 2));
box := IntToBox(x, y, x + 39, y + 38);
if debug then SMART_DrawBoxEx(True, True, Box, clRed);
if debug then PaintCross(TP.x, TP.y, clGreen);
if DebugWait then wait(RandomRange(5800, 6500));
// Looks for point in box
if PointInBox(TP,Box) then
WriteDebug('Item already selected on screen')
else
begin
if Debug then SMART_ClearCanvas;
c := 0;
// Tries 5 times to select the item icon
repeat
WriteDebug('Clicking box');
ABMouseBox(x1, y1, x2, y2, 1);
if debug then PaintCross(TP.x, TP.y, clGreen);
if DebugWait then wait(RandomRange(5800, 6500));
if FindBitmapToleranceIn(OrangeOutline, x, y, 17, 65, 222, 306, 10) then
begin
WriteDebug('Found new orange box location');
Box := IntToBox(x, y, x + 38, y + 38);
if debug then SMART_DrawBoxEx(True, True, Box, clRed);
end else WriteDebug('Did not find orange box');
Inc(c);
if DebugWait then wait(RandomRange(11800, 12500));
until PointInBox(TP,Box) or (c >= 5)
if (c >= 5) then
begin
WriteDebug('Didn''t find Point in box after 5 tries');
TakePic('Did not find Orange box');
end;
end;
end else
begin
WriteDebug('Didn''t find Orange box, trying to blindly select it and continue');
TakePic('Did not find Orange box');
ABMouseBox(x1, y1, x2, y2, 1);
end;
FreeBitmap(OrangeOutline);
if Debug then SMART_ClearCanvas;
end;
procedure FixSmeltingScreen;
begin
case Lowercase(SmeltingWhat) of
'goldring' : CheckSmelting('Up', 30, 86, 55, 112);
'sapphirering' : CheckSmelting('Up', 30, 136, 55, 160);
'emeraldring' : CheckSmelting('Up', 30, 186, 55, 210);
'rubyring' : CheckSmelting('Down', 30, 73, 55, 95);
'dimondring' : CheckSmelting('Down', 30, 123, 55, 145);
'dragonstonering' : CheckSmelting('Down', 30, 173, 55, 195);
'onyxring' : CheckSmelting('Down', 30, 223, 55, 245);
'goldnecklace' : CheckSmelting('Up', 80, 86, 105, 112);
'sapphirenecklace' : CheckSmelting('Up', 80, 136, 105, 160);
'emeraldnecklace' : CheckSmelting('Up', 80, 186, 105, 210);
'rubynecklace' : CheckSmelting('Down', 80, 73, 105, 95);
'dimondnecklace' : CheckSmelting('Down', 80, 123, 105, 145);
'dragonstonenecklace' : CheckSmelting('Down', 80, 173, 105, 195);
'onyxnecklace' : CheckSmelting('Down', 80, 223, 105, 245);
'goldbracelet' : CheckSmelting('Up', 130, 86, 155, 112);
'sapphirebracelet' : CheckSmelting('Up', 130, 136, 155, 160);
'emeraldbracelet' : CheckSmelting('Up', 130, 186, 155, 210);
'rubybracelet' : CheckSmelting('Down', 130, 73, 155, 95);
'dimondbracelet' : CheckSmelting('Down', 130, 123, 155, 145);
'dragonstonebracelet' : CheckSmelting('Down', 130, 173, 155, 195);
'onyxbracelet' : CheckSmelting('Down', 130, 223, 155, 245);
'goldamulet' : CheckSmelting('Up', 180, 86, 205, 112);
'sapphireamulet' : CheckSmelting('Up', 180, 136, 205, 160);
'emeraldamulet' : CheckSmelting('Up', 180, 186, 205, 210);
'rubyamulet' : CheckSmelting('Down', 180, 73, 205, 95);
'dimondamulet' : CheckSmelting('Down', 180, 123, 205, 145);
'dragonstoneamulet' : CheckSmelting('Down', 180, 173, 205, 195);
'onyxamulet' : CheckSmelting('Down', 180, 223, 205, 245);
'ironbar' : CheckSmelting('na', 132, 88, 155, 110);
'steelbar' : CheckSmelting('na', 30, 139, 52, 160);
'cannonballlong' : CheckSmelting('na', 30, 139, 52, 160);
end;
end;
procedure HandleSmelting;
var
x, y, STime, ETime: integer;
begin
// Checks for Blue Smelt/Craft button color
if not FindColorTolerance(x, y, 9858055, 288, 308, 437, 422, 37) then
begin
WriteDebug('Something went wrong, didn''t find Blue Smelt/Craft buttton');
TakePic('Smelt Button Not Found');
Exit;
end;
ABMouseBox(273, 307, 465, 318, 1); // Click Smelt Button
//Waits for X button color on Progress window
if WaitFindColor(x, y, 2929149, 415, 56, 422, 62, 0, RandomRange(1900, 2200)) then
begin
Status('Waiting for Smithing to complete');
WriteDebug('Waiting for Smithing to complete');
STime := GetSystemTime;
repeat
Antiban;
wait(RandomRange(500, 600));
ETime := GetSystemTime - STime;
//WriteDebug(IntToStr(ETime));
until not FindColor(x, y, 2929149, 415, 56, 422, 62) or
(ETime > 210000{3 min and 30sec})
Status('Smithing completed');
WriteDebug('Smithing completed');
CheckForText(CheckTextType, HopForChat);
end;
end;
procedure Smelt;
var
x, y, amt: integer;
begin
if CheckLogin then Exit;
//Check if Smelt screen is already opened
if WaitFindColor(x, y, 2929149, 497, 21, 506, 30, 0, RandomRange(3000, 3200)) then
begin
WriteDebug('Already at Smelt Screen');
Status('Selecting Options');
FixSmeltingScreen; //Selects the item to be smelted
HandleSmelting;
end else
begin
//Smelt screen was not found, so now will look for furnace
if (GetMyLocation <> 'Furnace') then
begin
WriteDebug('Can''t smelt, Not at Furnace');
Exit;
end;
WriteDebug('Looking for Furnace');
Status('Looking for Furnace');
if FindFurnace then
begin
if WaitFindColor(x, y, 2929149, 497, 21, 506, 30, 0, RandomRange(2900, 3200)) then
begin
Status('Selecting Options');
FixSmeltingScreen; //Selects the item to be smelted
HandleSmelting;
end else
begin
WriteDebug('Smelt screen not found, Trying to open Furnace again');
if FindFurnace then
begin
if WaitFindColor(x, y, 2929149, 497, 21, 506, 30, 0, RandomRange(2900, 3200)) then
begin
Status('Selecting Options');
FixSmeltingScreen; //Selects the item to be smelted
HandleSmelting;
end else
begin
WriteDebug('Smelt screen not found, Something went wrong');
TakePic('Smelt screen not found');
Exit;
end;
end else
begin
WriteDebug('Couldn''t find furnace, Something went wrong');
TakePic('Couldn not find furnace');
Exit;
end;
end;
end else
begin
WriteDebug('Couldn''t find furnace, Something went wrong');
TakePic('Couldn not find furnace');
Exit;
end;
end;
WriteDebug('Checking if we are smithing Cannon Balls');
if (Lowercase(SmeltingWhat) = 'cannonballlong') then
begin
WriteDebug('Smelting second time for Cannon Balls');
Status('Looking for Furnace');
if FindFurnace then
begin
if WaitNotMoving(False) then WriteDebug('Not Moving');
//Waits for cross exit botton color
if WaitFindColor(x, y, 2929149, 497, 21, 506, 30, 0, RandomRange(2900, 3200)) then
begin
Status('Selecting Options');
HandleSmelting;
end else
begin
WriteDebug('Smelt screen not found, Something went wrong');
TakePic('Smelt screen not found');
Exit;
end;
end;
end;
Status('Smelting/Crafting Competed');
//Calculates amt of items smithed for progress report
case ItemsNeed[0] of
'CopperOre' : amt := CopperOre.Amount;
'TinOre' : amt := TinOre.Amount;
'IronOre' : amt := IronOre.Amount ;
'SilverOre' : amt := SilverOre.Amount;
'GoldOre' : amt := GoldOre.Amount;
'MithrilOre' : amt := MithrilOre.Amount;
'AdamantOre' : amt := AdamantOre.Amount;
'RuneOre' : amt := RuneOre.Amount;
'SteelBar' : amt := SteelBar.Amount ;
'SilverBar' : amt := SilverBar.Amount;
'GoldBar' : amt := GoldBar.Amount;
'CutSapphire' : amt := CutSapphire.Amount;
'CutEmerald' : amt := CutEmerald.Amount;
'CutRuby' : amt := CutRuby.Amount;
'CutDiamond' : amt := CutDiamond.Amount;
'CutOnyx' : amt := CutOnyx.Amount;
end;
if (Lowercase(SmeltingWhat) = 'cannonballlong') or (Lowercase(SmeltingWhat) = 'cannonballshort') then
ItemCount := ItemCount + (amt * 4)
else ItemCount := ItemCount + amt;
end;
function GoToFurnace: Boolean;
var
x, y, HPtsL: Integer;
SPSTP: TPoint;
begin
if CheckLogin then Exit;
Result := False;
if (GetMyLocation = 'Furnace') then
begin
Result := True;
Status('At the Furnace');
WriteDebug('We are already at Furnace');
Exit;
end else WriteDebug('Not at Furnace, walking to it');
Status('Going to Furnace');
if SPS_WalkPathCustom(FurnacePoints, FurnaceQuickPoint, 'Furnace') then
begin
WaitNotMoving(False);
if WaitFindColor(x, y, 2929149, 497, 21, 506, 30, 0, RandomRange(1800, 2000)) then
begin
Result := True;
Exit;
end;
if (GetMyLocation = 'Furnace') then
begin
Result := True;
Status('At the Furnace');
Exit;
end;
end;
WriteDebug('Didn''t make it to furnace on fist try');
// Checks for Door if using the Neitiznot location
if (Lowercase(Location) = 'neitiznot') then
begin
Status('Searching for Door');
WriteDebug('Checking for door');
if CheckDoor(2177591, 3, 0.30, 0.61, 6531, 2691) then
begin
if SPS_WalkPathCustom(FurnacePoints, FurnaceQuickPoint, 'Furnace') then
begin
WaitNotMoving(False);
if (GetMyLocation = 'Furnace') then
begin
Result := True;
Status('At the Furnace');
Exit;
end;
end else WriteDebug('SPS walkpath failed, opening door');
end;
end;
ClickNorth(SRL_ANGLE_HIGH);
WriteDebug('Seeing how close we are to Furnace');
HPtsL := High(FurnacePoints);
SPSTP := SPS_PosToMM(FurnacePoints[HPtsL]);
ABMouse(SPSTP.x,SPSTP.y,1,1);
ClickMouse2(1);
WaitNotMoving(False);
if (GetMyLocation = 'Furnace') then
begin
Result := True;
Status('At the Furnace');
Exit;
end;
WriteDebug('Trying to correct loction');
ClickNorth(SRL_ANGLE_HIGH);
SetAngle(SRL_ANGLE_HIGH);
if SPS_BlindWalk(FurnacePoints[HPtsL]) then
begin
if WaitNotMoving(False) then WriteDebug('Not Moving');
end else WriteDebug('SPS walkpath failed');
if (GetMyLocation = 'Furnace') then
begin
Result := True;
Status('At the Furnace');
Exit;
end;
WriteDebug('SPS To bank failed, trying to find ObjDTM');
WriteDebug('SPS To bank failed, Ending char run');
WriteDebug('Note to self buld ObjDTM');
Status('Go to Furnace Failed');
end;
procedure MainLoop;
var
Retry: Integer;
begin
if CheckLogin then Exit;
CheckForSpinTicket;
WriteDebug('Going to Bank');
if not GoToBank then
begin
WriteDebug('Go to Bank Failed, Shutting Down');
Bug := True;
Exit;
end else
begin
if not DoBanking then
begin
WriteDebug('Banking Failed, Shutting Down');
Bug := True;
Exit;
end else
begin
WriteDebug('Going to Furnace');
if not GoToFurnace then
begin
WriteDebug('Go To Furnace Failed, Going back to bank');
Inc(Retry);
end else
begin
Retry := 0;
WriteDebug('Smelting');
Smelt;
ProgressReport;
end;
if (Retry >= 3) then
begin
WriteDebug('Go To Furnace Failed after 3 tries, Shutting Down');
Bug := True;
Exit;
end;
end;
end;
end;
procedure LoadGlobalVars(LoadBank: Bank; LoadFurnace: Furnace);
begin
BankPoints := LoadBank.SPSPoints;
FurnacePoints := LoadFurnace.SPSPoints;
BankkColor := LoadBank.color;
BankTol := LoadBank.Tol;
BankHue := LoadBank.Hue;
BankSat := LoadBank.Sat;
FurnaceColor := LoadFurnace.color;
FurnaceTol := EdgevilleFurnace.Tol;
FurnaceHue := EdgevilleFurnace.Hue;
FurnaceSat := EdgevilleFurnace.Sat;
BankDTM := LoadBank.Dtm;
FurnaceDTM := LoadFurnace.Dtm;
BankLoc := LoadBank.Loc;
FurnaceLoc := LoadFurnace.Loc;
FurnacePosBox := LoadFurnace.PosBox
BankPosBox := LoadBank.PosBox
BankQuickPoint := LoadBank.QuickPoint;
FurnaceQuickPoint := LoadFurnace.QuickPoint;
SetDTMName(BankDTM, 'BankDTM');
SetDTMName(FurnaceDTM, 'FurnaceDTM');
FreeDTM(LoadBank.DTM);
FreeDTM(LoadFurnace.DTM);
end;
procedure LoadInfo(LoadItemsNeeded: TStringArray; LoadLocation: string);
var
i: Integer;
begin
writeln('Items Needed list:');
for i := 0 to High(LoadItemsNeeded) do
writeln(IntToStr(I+1) + ': ' + LoadItemsNeeded[i]);
for i := 0 to High(LoadItemsNeeded) do
begin
writeln('Loading info: ' + LoadItemsNeeded[i]);
case LoadItemsNeeded[i] of
'CopperOre' :
begin
//Ore and bars
with CopperOre do
begin
color := 3367856;
Tol := 8;
Hue := 0.02;
Sat := 0.26;
UpText := ['Copper ore', 'pper or', 'per ore'];
Bmp := BitmapFromString(7, 8, 'meJzTsvVlYmAwNjYGkhreLfqRc40T' +
'VurY+8MFtfy7IYK6joFwQZ3gyRBBfZcwuKBe2AzDmEUmSWsN3SLgg' +
'gZR84HKzNI2m/knwwUNY5cYJ642Td1k6psIEdQxtgIyjOJXmCSvM/' +
'GORxaEIABTwyQ6');
Dtm := DTMFromString('78DA634C656060106664000108C9C0B03ED99' +
'44109CAFF0F048CB9408624449605979A28843930354E262A0C32' +
'48E632E603093E026A1281842C7E350004CF0F73');
SetBitmapName(CopperOre.Bmp, 'CopperOre.Bmp');
SetDTMName(CopperOre.Dtm, 'CopperOre.Dtm');
end;
end;
'TinOre' :
begin
with TinOre do
begin
color := 5921374;
Tol := 6;
Hue := 0.56;
Sat := 0.09;
UpText := ['Tin ore', 'in ore'];
Bmp := BitmapFromString(9, 9, 'meJxNzmsKwjAQBODiabSo/RFfRVot' +
'ESum6YsQQoi2pfT+V3BgYRGGJezHsIkzvU5fqygSQmDmedG2xlpvj' +
'Nvems1VMUn5JPJ+2BVdnGmmslRE4TNd2gVFpqpqmE7NvJeGqa47XH' +
'EufIf5qKfkYZn63mKPyjguIISJKiC0DmpAiJLzHQ/6HpF4h3+ioPg' +
'Dn+g1tw==');
Dtm := DTMFromString('78DA634C656060106664000108C9C0101715C' +
'52009E5FF0702C65C20431222CB824B4D14C21C981A2713150619' +
'247319F381041F013589404216BF1A00BFBE0EF7');
SetBitmapName(TinOre.Bmp, 'TinOre.Bmp');
SetDTMName(TinOre.Dtm, 'TinOre.Dtm');
end;
end;
'IronOre' :
begin
with IronOre do
begin
color := 1581111;
Tol := 2;
Hue := 0.20;
Sat := 0.38;
UpText := ['Iron ore', 'ron or', 'on ore'];
Bmp := BitmapFromString(10, 9, 'meJzTdQjUtvNjYmAwNjYGkoLi6qI' +
'yBmJyxuLypkBSzylY1yEQLiskqQWXlVC0sAxKAyqAy4pI6SLLWgSk' +
'6LuE4pI190sydAuHyyJLQWSBCFMWosDUNwGIILLaRpZABlAWrh0oZ' +
'eIdhywLQRBZoBQQGXvGQASBfod4AYIAcp8mHQ==');
Dtm := DTMFromString('78DA634C656060106664000108C9C060AE20C' +
'1C009E5FF0702C65C20431222CB824B4D14C21C981A2713150619' +
'247319F381041F013589404216BF1A00FB170D91');
SetBitmapName(IronOre.Bmp, 'IronOre.Bmp');
SetDTMName(IronOre.Dtm, 'IronOre.Dtm');
end;
end;
'SilverOre' :
begin
with SilverOre do
begin
color := 8090997;
Tol := 12;
Hue := 0.20;
Sat := 0.08;
UpText := ['Silver ore', 'lver or', 'ver ore'];
Bmp := BitmapFromString(10, 8, 'meJzTdwnTsffXtPZmYmAwNjYGkok' +
'xMaUFBfWVlS11dUYeUbqOgVq2vnDZ9KQkiGxHU5OJd7xlUDpQO1w2' +
'NyMDLmvmn2wRkKrnHAKXLc7Lqy4tbaqp6WppBsoCkb5LGFy2sri4o' +
'boaqLG3vR0oZeqbCERwWaBGoGxbQ0N3aytECmg7RFbbyBLIgDgYaD' +
'JQHIKQZSEIaDgAqCZCZQ==');
Dtm := DTMFromString('78DA634C656060106664000108C9C0505656C' +
'D600AE5FF0702C65C20431222CB824B4D14C21C981A2713150619' +
'247319F381041F013589404216BF1A003B8D0FD9');
SetBitmapName(SilverOre.Bmp, 'SilverOre.Bmp');
SetDTMName(SilverOre.Dtm, 'SilverOre.Dtm');
end;
end;
'CoalOre' :
begin
with CoalOre do
begin
color := 1646625;
Tol := 3;
Hue := 0.70;
Sat := 0.30;
UpText := ['Coal', 'oal'];
Bmp := BitmapFromString(9, 10, 'meJzTsvXVtPZmYmAwNjYGkgKioqI' +
'yMhLyCkCkY++vZesLlxKWlIRL6ToGAmUxpaSVlS2D0oGycCmgOFzK' +
'IiBVzzkEWQpiGlDKzD9Z3yUMLgUXh0gBEVYpU99EIIJI6RhbQWThU' +
'ibe8chSEASUAooDkbFXDEQE6EeIg4EIAO3UJEg=');
Dtm := DTMFromString('78DA634C656060106664000108C9C0A0A828C' +
'9C00BE5FF0702C65C20431222CB824B4D14C21C981A2713150619' +
'247319F381041F013589404216BF1A00E9310D71');
SetBitmapName(CoalOre.Bmp, 'CoalOre.Bmp');
SetDTMName(CoalOre.Dtm, 'CoalOre.Dtm');
end;
end;
'GoldOre' :
begin
with GoldOre do
begin
color := 1607851;
Tol := 6;
Hue := 0.03;
Sat := 0.16;
UpText := ['Gold o', 'old or', 'ld ore'];
Bmp := BitmapFromString(9, 9, 'meJzTsffXtPZmYmAwNjYGkgIJlSIl' +
'k0Xr5os1L9N1DNSy9YVLCaY1QKTE21ZaBKTq2PvDpYSyO+BSZv7Je' +
's4hcCnhwn7RqllijYvEO9ea+ibqu4TBpUTKp4nVLxRvXy3RvQEoBU' +
'RwKZAWoFTrComudSbe8UAEkdIxtgLJgp0HNBAobuwVgywFQUBnAMW' +
'ByMgjCiIC9AjQOxA2AEPAOHg=');
Dtm := DTMFromString('78DA633CC0C0C0F09F010C182114C39A0E090' +
'63928FF3F10306E41A86183AA0973D1679041D2C3B817487032E2' +
'57731A48FC2660CE0920C10AE1B1E0700F004A54146A');
SetBitmapName(GoldOre.Bmp, 'GoldOre.Bmp');
SetDTMName(GoldOre.Dtm, 'GoldOre.Dtm');
end;
end;
'MithrilOre' :
begin
with MithrilOre do
begin
color := 4468013;
Tol := 6;
Hue := 0.16;
Sat := 0.14;
UpText := ['Mithril ore', 'hril or', ' ril ore'];
Bmp := BitmapFromString(9, 9, 'meJzTsffXtPZmYmAwNjYGkibKSo7a' +
'2m76et5GhrqOgVq2vnApcxUVuJRlULqOvT9cykZDAy5lEZCq5xwCl' +
'7LX0nTW1fUwMPA1NjbzT9Z3CYNLwbUApUx9E4EILgXUgixl4h0Pkd' +
'I2sgQygFIQA4HiaFIQBNRo7BUDQRARoB8hDgYiAAAhKPE=');
Dtm := DTMFromString('78DA634C656060106664000108C9C0A0ABE7C' +
'2200EE5FF0702C65C20431222CB824B4D14C21C981A2713150619' +
'247319F381041F013589404216BF1A003EB20E0D');
SetBitmapName(MithrilOre.Bmp, 'MithrilOre.Bmp');
SetDTMName(MithrilOre.Dtm, 'MithrilOre.Dtm');
end;
end;
'AdamantOre' :
begin
with AdamantOre do
begin
color := 3489076;
Tol := 6;
Hue := 0.31;
Sat := 0.14;
UpText := ['Adamantite ore', 'ntite or', 'tite ore'];
Bmp := BitmapFromString(9, 10, 'meJxdzuEKwiAUBeDRqwyGNk2WZuq' +
'KMdaPQMbWGP2NiOj936ADFy4RHETOx/Uq2yzidVMU1lqcpSzN0SC4' +
'b8+jbDNTpSr07uT2sVHdBGUSRhD5zuv+BmWqm5oo9CEuHyiTdpopz' +
'O/dsDKhxxa8BvLTy1zuTOhpJA3pMD4RJvoAk8sPImXTr6L/IwroC2' +
'doLSM=');
Dtm := DTMFromString('78DA634C656060106664000108C9C060E168C' +
'12008E5FF0702C65C20431222CB824B4D14C21C981A2713150619' +
'247319F381041F013589404216BF1A004C3C0E25');
SetBitmapName(AdamantOre.Bmp, 'AdamantOre.Bmp');
SetDTMName(AdamantOre.Dtm, 'AdamantOre.Dtm');
end;
end;
'RuneOre' :
begin
with RuneOre do
begin
color := 5524800;
Tol := 4;
Hue := 0.27;
Sat := 0.16;
UpText := ['Rune ore', 'une or', 'ne ore'];
Bmp := BitmapFromString(9, 10, 'meJxdz9EKwjAMBdDh3zjn1NXZdav' +
'WOp1KKd2kDN9ERMT//wEvBPIghBJyuDTJTJg2bpIkQgi8UqSXVvpz' +
'405qbod065m0zIkGt8vbmJnAZOolUfT7On4RZLK6YFK3z+I4MnW2x' +
'C/hqkFV/151dyaOjOGwCS8UE0WwA1Hpn0SzQqGh9RDE/I+oQGv3oK' +
'IJDsE51P8Az+szUg==');
Dtm := DTMFromString('78DA634C656060106664000108C9C0E0E017C' +
'2C00FE5FF0702C65C20431222CB824B4D14C21C981A2713150619' +
'247319F381041F013589404216BF1A007FE60E83');
SetBitmapName(RuneOre.Bmp, 'RuneOre.Bmp');
SetDTMName(RuneOre.Dtm, 'RuneOre.Dtm');
end;
end;
'SteelBar' :
begin
with SteelBar do
begin
color := 7237236;
Tol := 6;
Hue := 0.47;
Sat := 0.05;
UpText := ['Steel bar', 'teel ba', 'eel bar'];
Bmp := BitmapFromString(12, 8, 'meJxLSEhNwIZqapvgiKACrGrQFAC' +
'RubklfgUQNciIPDVAwylXA1TQ0NAGAHk8c2A=');
Dtm := DTMFromString('78DA633CCCC8C0C00FC440002119185213121' +
'858A1FCFF40C07806C81280C83243D534D5D6C0D580F51E07B284' +
'09A8D90F6489A2AAB134374751030052730C49');
SetBitmapName(SteelBar.Bmp, 'SteelBar.Bmp');
SetDTMName(SteelBar.Dtm, 'SteelBar.Dtm');
end;
end;
'GoldBar' :
begin
with GoldBar do
begin
color := 1944280;
Tol := 1;
Hue := 0.05;
Sat := 0.43;
UpText := ['old ba', 'Gold b', 'ld bar'];
Bmp := BitmapFromString(11, 8, 'meJwTrZ4jioFkFp6GI/yyQMTjFoF' +
'HFqIAGdFfAdBVaAqQ1YDcvOwiAJJSaI4=');
Dtm := DTMFromString('78DA639CC5C8C0F08E0105DC582DC7C00AA48' +
'1320CFF8180711190F51622C70C557371990C5C0D0830CE03B23E' +
'E157030065270D89');
SetBitmapName(GoldBar.Bmp, 'GoldBar.Bmp');
SetDTMName(GoldBar.Dtm, 'GoldBar.Dtm');
end;
end;
//Gems
'CutSapphire' :
begin
with CutSapphire do
begin
color := 6295309;
Tol := 11;
Hue := 0.03;
Sat := 0.18;
UpText := ['Sapphire', 'Sapph', 'Sapp'];
Bmp := BitmapFromString(11, 8, 'meJxrFxVaBQMzW1vgCMjNEOADona' +
'YAmRZIILIAhF+WYgCPLJAhF8WTQGmLLICrLIG7Gw9YsJAhEsWiAA7' +
'L12A');
Dtm := DTMFromString('78DA637CC8C0C020CFC8000210928161FA8C4' +
'50CB250FE7F20607C0E6428406459A06A04456A184491F430DE07' +
'121A04D4DC0212CAF8D500007E230C31');
SetBitmapName(CutSapphire.Bmp, 'CutSapphire.Bmp');
SetDTMName(CutSapphire.Dtm, 'CutSapphire.Dtm');
end;
end;
'CutEmerald' :
begin
with CutEmerald do
begin
color := 1006604;
Tol := 10;
Hue := 0.03;
Sat := 0.13;
UpText := ['Emerald', 'Emera', 'Emer'];
Bmp := BitmapFromString(11, 8, 'meJwTqRNs3tMPRE27+qT26sERkMu' +
'fyAtEIjAFyLJABJEFIvyyEAV4ZIEIvyyaAkxZZAVYZdkN2USbhIAI' +
'lywQAQAhgkcp');
Dtm := DTMFromString('78DA637CC8C0C020CFC80002109281217E8F3' +
'F832794FF1F08189F03190A105916A81A8112210611243D8CF781' +
'84060135B78084327E35005B790BD2');
SetBitmapName(CutEmerald.Bmp, 'CutEmerald.Bmp');
SetDTMName(CutEmerald.Dtm, 'CutEmerald.Dtm');
end;
end;
'CutRuby' :
begin
with CutRuby do
begin
color := 659275;
Tol := 9;
Hue := 0.04;
Sat := 0.17;
UpText := ['Ruby', 'Rub'];
Bmp := BitmapFromString(10, 8, 'meJzjF82ZuWA7EM2Yvy0+eTUcAbn' +
'cAkH8MFlkKSACSgERHimILC4pIMIjhSaLJoUsiykFcrNYARBhlWJl' +
'VwMAcoxPAQ==');
Dtm := DTMFromString('78DA637CC8C0C020CFC800021092816163530' +
'D833694FF1F08189F03190A105916A89A24115E0641243D8CF781' +
'84060135B78084327E350062AF0BB7');
SetBitmapName(CutRuby.Bmp, 'CutRuby.Bmp');
SetDTMName(CutRuby.Dtm, 'CutRuby.Dtm');
end;
end;
'CutDiamond' :
begin
with CutDiamond do
begin
color := 7764351;
Tol := 22;
Hue := 0.34;
Sat := 0.09;
UpText := ['Diamond', 'Diamo', 'Diam'];
Bmp := BitmapFromString(10, 8, 'meJxbs2nLmk1bVm/YPH/+MjgCcsv' +
'KqoFoDVgWWQqIIFIQWVxSQIRHCk0WTQpZFlMKLotVytnZDY8UEAEA' +
'446BLg==');
Dtm := DTMFromString('78DA637CC8C0C020CFC8000210928161DDCA6' +
'50CFC50FE7F20607C0E6428406459A06A26F7F6326822E961BC0F' +
'243408A8B9052494F1AB010039980FAF');
SetBitmapName(CutDiamond.Bmp, 'CutDiamond.Bmp');
SetDTMName(CutDiamond.Dtm, 'CutDiamond.Dtm');
end;
end;
'CutDragonStone' :
begin
with CutDragonStone do
begin
color := 6494794;
Tol := 15;
Hue := 0.06;
Sat := 1.32;
UpText := ['Dragonstone', 'Dragons', 'Drago'];
Bmp := BitmapFromString(10, 8, 'meJwrFQhfPmUpEC2bvKTLphCOgCL' +
'RPC6lMFlkKSACSgERHimILC4pIMIjhSaLJoUsiykFRJWCUUCEVUqX' +
'TQ4At6RRuQ==');
Dtm := DTMFromString('78DA637CC8C0C020CFC80002109281A13B632' +
'6831994FF1F08189F03190A1059162C6AC07AEF03090D026A6E01' +
'0965FC6A0008DA0F29');
SetBitmapName(CutDragonStone.Bmp, 'CutDragonStone.Bmp');
SetDTMName(CutDragonStone.Dtm, 'CutDragonStone.Dtm');
end;
end;
'CutOnyx' :
begin
with CutOnyx do
begin
color := 1315861;
Tol := 5;
Hue := 0.00;
Sat := 0.49;
UpText := ['Onyx', 'Ony'];
Bmp := BitmapFromString(10, 8, 'meJyTk5PvnzwZgnw8PeEIyBUXl5C' +
'DySJLARFQCojwSEFkcUkBER4pNFk0KWRZTCkgUlBQBCKsUpycnAAP' +
'1zVl');
Dtm := DTMFromString('78DA637CC8C0C020CFC80002109281212F2F8' +
'FC11ECAFF0F048CCF810C05882C0B544D207F0E8318921EC6FB40' +
'4283809A5B404219BF1A0068740C50');
SetBitmapName(CutOnyx.Bmp, 'CutOnyx.Bmp');
SetDTMName(CutOnyx.Dtm, 'CutOnyx.Dtm');
end;
end;
end;
end;
//Furnace and Bank Setup
//Load Location Info
writeln('Loading Location: ' + LoadLocation);
case LoadLocation of
'Edgeville' :
begin
with EdgevilleBank do
begin
color := 3810090; //NPC color
Tol := 12;
Hue := 0.19;
Sat := 0.45;
Dtm := DTMFromString('mWAAAAHicY2FgYFBhZGBQB2ImIPYG4n4g3gDEU4F4GhBnpAQwrMvSANMgzAvUowrEvFAMVMLAhYRBAAChBQgO');
SPSPoints := [Point(4183, 2615)];
Loc := IntToPoint(4182, 2617);
PosBox := IntToBox(4170, 2603, 4197, 2630);
QuickPoint := IntToPoint(96, 310);
SetDTMName(EdgevilleBank.DTM, 'EdgevilleBank.DTM');
end;
with EdgevilleFurnace do
begin
color := 1450143;
Tol := 6;
Hue := 0.02;
Sat := 0.10;
Dtm := DTMFromString('78DA63B4676460E0016224305F519C4112488' +
'344FF0301A32B90C50151C382450D08307A00598204D4380259CC' +
'A86A4C4D8D19F890D5380359C204D47823DC8C4B0D00F5FD0ADC');
SPSPoints := [Point(4232, 2600)];
Loc := IntToPoint(4236, 2593);
PosBox := IntToBox(4218, 2583, 4244, 2612);
QuickPoint := IntToPoint(430, 110);
SetDTMName(EdgevilleFurnace.DTM, 'EdgevilleFurnace.DTM');
end;
SPS_Setup(runescape_surface,['10_6']);
LoadGlobalVars(EdgevilleBank, EdgevilleFurnace);
end;
'AlKharid' :
begin
with AlKharidBank do
begin
color := 2505755;
Tol := 4;
Hue := 0.11;
Sat := 0.33;
Dtm := DTMFromString('78DA63646764605005622080900C0CD7D64F6' +
'08081FF40C0F817C8D081C8B243C54B9242C16C981E4621204B97' +
'801A66208B0FC2E3828A49DBA8310822A9010016C80AD0');
SPSPoints := [Point(4899, 3899), Point(4879, 3926)];
Loc := IntToPoint(4879, 3922);
PosBox := IntToBox(4871, 3923, 4886, 3937);
QuickPoint := IntToPoint(81, 266);
SetDTMName(AlKharidBank.DTM, 'AlKharidBank.DTM');
end;
with AlKharidFurnace do
begin
color := 11519706;
Tol := 13;
Hue := 0.05;
Sat := 1.81;
Dtm := DTMFromString('78DA632C636060506064000108C9C070F9E87' +
'6060B28FF3F1030560019821059362C6AC07A538184240135F140' +
'4283809A09404293809A4E20214B404D3990D0C6AF060038101A0' +
'D');
SPSPoints := [Point(4907, 3871), Point(4896, 3849)];
Loc := IntToPoint(4886, 3844);
PosBox := IntToBox(4885, 3830, 4903, 3856);
QuickPoint := IntToPoint(68, 200);
SetDTMName(AlKharidFurnace.DTM, 'AlKharidFurnace.DTM');
end;
SPS_Setup(runescape_surface,['12_9']);
LoadGlobalVars(AlKharidBank, AlKharidFurnace);
end;
'Falador' :
begin
with FaladorBank do
begin
color := 5140621; // Booth color
Tol := 4;
Hue := 0.07;
Sat := 0.10;
Dtm := DTMFromString('78DA63146064608802622430A52C88811348C' +
'34419416A7C203C2EA898998909033BB21A3322D4BC6220ACC604' +
'C88A415583E19E3740221AB79AFF40C00862D5A0AA99ECEAC0208' +
'F6C8E229055855F0D00DF1E1259');
SPSPoints := [Point(3651, 3089), Point(3595, 3103), Point(3588, 3124)];
Loc := IntToPoint(3579, 3129);
PosBox := IntToBox(3563, 3114, 3598, 3135);
QuickPoint := IntToPoint(262, 308);
SetDTMName(FaladorBank.DTM, 'FaladorBank.DTM');
end;
with FaladorFurnace do
begin
color := 4085710;
Tol := 9;
Hue := 0.02;
Sat := 0.34;
Dtm := DTMFromString('78DA63CC60646030026224B04555924119488' +
'344FF0301630490A50251C3055563666CCC20085503028C314096' +
'1B0135B3802C11026A1601590E04D49411610E488D2B01350B802' +
'C4DFC6A00BE040F89');
SPSPoints := [Point(3595, 3099), Point(3619, 3079), Point(3658, 3094), Point(3679, 3127)];
Loc := IntToPoint(3700, 3120);
PosBox := IntToBox(3681, 3109, 3705, 3134);
QuickPoint := IntToPoint(400, 290);
SetDTMName(FaladorFurnace.DTM, 'FaladorFurnace.DTM');
end;
SPS_Setup(runescape_surface,['8_7','9_7']);
LoadGlobalVars(FaladorBank, FaladorFurnace);
end;
'Neitiznot' :
begin
with NeitiznotBank do
begin
color := 6453876; //Booth color
Tol := 4;
Hue := 0.35;
Sat := 0.64;
Dtm := DTMFromString('78DA637CC3C0C010CFC8800C82238DE0ECFF4' +
'0C0F804C80883A861858A97542732080269984EC6CF44A8790724' +
'4A213C2EA8D896136B184C90D40000CDDA0F49');
SPSPoints := [Point(6554, 2738)];
Loc := IntToPoint(6554, 2738);
PosBox := IntToBox(6537, 2725, 6564, 2742);
QuickPoint := IntToPoint(265, 300);
SetDTMName(NeitiznotBank.DTM, 'NeitiznotBank.DTM');
end;
with NeitiznotFurnace do
begin
color := 3493832;
Tol := 5;
Hue := 1.12;
Sat := 0.21;
Dtm := DTMFromString('78DA63946564609007622080900C0C4EF6F60' +
'C30F01F0818D581324110591EA8F8C1105B0669243D8CD140963B' +
'84C707152BAFCD6560435603328319BF1A0085F20ADC');
SPSPoints := [Point(6544, 2685)];
Loc := IntToPoint(6547, 2681);
PosBox := IntToBox(6527, 2675, 6552, 2692);
QuickPoint := IntToPoint(332, 36);
SetDTMName(NeitiznotFurnace.DTM, 'NeitiznotFurnace.DTM');
end;
SPS_Setup(runescape_surface,['16_6']);
LoadGlobalVars(NeitiznotBank, NeitiznotFurnace);
end;
end;
end;
procedure Load1Items(Name: string; var Item1: Integer; amt: Integer; XT: string);
var
i: Integer;
begin
SetArrayLength(ItemsNeed, 1);
XpType := XT;
ItemsNeed[0] := Name;
if (CoalBag = False) then
Item1 := amt
else
begin
WriteDebug('Can''t use a Coal Bag for making ' + SmeltingWhat);
TerminateScript;
end;
end;
procedure Load2Items(Name: TStringArray; Item0, Item1: Integer; amt: TIntegerArray; XT: string);
begin
XpType := XT;
SetArrayLength(ItemsNeed, 2);
ItemsNeed[0] := Name[0];
ItemsNeed[1] := Name[1];
if (CoalBag = False) then
begin
Item0 := amt[0];
Item1 := amt[1];
end else
begin
WriteDebug('Can''t use a Coal Bag for making ' + SmeltingWhat);
TerminateScript;
end;
end;
procedure LoadItemsWithBag(Name: TStringArray; var Item0, Item1: Integer; amt1, amt2: TIntegerArray; XT: string);
var
i: Integer;
begin
XpType := XT;
SetArrayLength(ItemsNeed, 2);
ItemsNeed[0] := Name[0];
ItemsNeed[1] := Name[1];
if (CoalBag = False) then
begin
Item0 := amt1[0];
Item1 := amt1[1];
end else
begin
Item0 := amt2[0];
Item1 := amt2[1];
end;
end;
procedure LoadStartingVars;
begin
SpinT := 0;
bug := false;
restart := false;
ItemCount := 0;
StartingExperience := GetXPBarTotal;
StartTime := GetSystemTime;
StartTime := GetSystemTime;
BreakStartTime := GetSystemTime;
SetupBreak := False;
CheckForBreak;
LevelsGained := 0;
FoundTime := GetSystemTime;
end;
procedure ScriptSetup;
begin
AutoUpdateMe;
{$IFDEF SMART}
{$IFDEF SIMBAMAJOR980}
Smart_Server := 10;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
{$ELSE}
SRL_SixHourFix := True;
Smart_FixSpeed := True;
{$ENDIF}
{$ENDIF}
SetUpSRL;
ObjDTM_Setup;
DeclarePlayers;
{if (SRLStats_Username = '') Then
SetupSRLStats(1318, 'Guild Fisher', 'password')
else
SetupSRLStats(1318, SRLStats_Username, SRLStats_Password);}
//Log In
while(not(RSReady()))do
Wait(9000);
if CheckLogin then Exit;
//Fix screen
SetAngle(SRL_ANGLE_HIGH);
ClearDebug;
SMART_ClearCanvas;
while not ExitSquealOfFortune do
begin
wait(100);
end;
GameTab(Tab_Inv);
ToggleXPBar(True);
if (CheckTextType > 0) Then
SetAllChats('filter', 'on', 'off', 'off', 'off', 'on', 'on')
else SetChat('filter', 0);
LoadStartingVars;
//Set up what Items and amounts are needed
case Lowercase(SmeltingWhat) of
//Load without Coal Bag
'bronzebar' : Load2Items(['CopperOre', 'TinOre'], CopperOre.Amount, TinOre.Amount, [14, 14], 'Smelt');
'ironbar' : Load1Items('IronOre', IronOre.Amount, 28, 'Smelt');
'silverbar' : Load1Items('SilverOre', SilverOre.Amount, 28, 'Smelt');
'goldbar' : Load1Items('GoldOre', GoldOre.Amount, 28, 'Smelt');
'cannonballshort' : Load1Items('SteelBar', SteelBar.Amount, 28, 'Smelt');
//Load with Coal Bag
'steelbar' : LoadItemsWithBag(['IronOre', 'CoalOre'], IronOre.Amount, CoalOre.Amount, [9, 18], [18, 9], 'Smelt');
'mithrilbar' : LoadItemsWithBag(['MithrilOre', 'CoalOre'], MithrilOre.Amount, CoalOre.Amount, [5, 20], [10, 13], 'Smelt');
'adamantbar' : LoadItemsWithBag(['AdamantOre', 'CoalOre'], AdamantOre.Amount, CoalOre.Amount, [4, 24], [7, 15], 'Smelt');
'runebar' : LoadItemsWithBag(['RuneOre', 'CoalOre'], RuneOre.Amount, CoalOre.Amount, [3, 24], [6, 21], 'Smelt');
'cannonballlong' : LoadItemsWithBag(['IronOre', 'CoalOre'], IronOre.Amount, CoalOre.Amount, [9, 18], [18, 9], 'Smelt');
//Load Gold Jewelry
'goldring', 'goldnecklace', 'goldbracelet', 'goldamulet' :
Load1Items('GoldBar', GoldBar.Amount, 28, 'Craft');
//Load Sapphire Jewelry
'sapphirering', 'sapphirenecklace', 'sapphirebracelet', 'sapphireamulet' :
Load2Items(['GoldBar', 'CutSapphire'], GoldBar.Amount, CutSapphire.Amount, [14, 14], 'Craft');
//Load Emerald Jewelry
'emeraldring', 'emeraldnecklace', 'emeraldbracelet', 'emeraldamulet' :
Load2Items(['GoldBar', 'CutEmerald'], GoldBar.Amount, CutEmerald.Amount, [14, 14], 'Craft');
//Load Ruby Jewelry
'rubyring', 'rubynecklace', 'rubybracelet', 'rubyamulet' :
Load2Items(['GoldBar', 'CutRuby'], GoldBar.Amount, CutRuby.Amount, [14, 14], 'Craft');
//Load Dimond Jewelry
'dimondring', 'dimondnecklace', 'dimondbracelet', 'dimondamulet' :
Load2Items(['GoldBar', 'CutDiamond'], GoldBar.Amount, CutDiamond.Amount, [14, 14], 'Craft');
//Load Dragonstone Jewelry
'dragonstonering', 'dragonstonenecklace', 'dragonstonebracelet', 'dragonstoneamulet' :
Load2Items(['GoldBar', 'CutDragonStone'], GoldBar.Amount, CutDragonStone.Amount, [14, 14], 'Craft');
//Load Onyx Jewelry
'onyxring', 'onyxnecklace', 'onyxbracelet', 'onyxamulet' :
Load2Items(['GoldBar', 'CutOnyx'], GoldBar.Amount, CutOnyx.Amount, [14, 14], 'Craft');
//Load Silver Jewelry
'holysymbol', 'unholysymbol', 'sickle', 'tiara' :
Load1Items('SilverBar', SilverBar.Amount, 28, 'Craft');
end;
// Loads Items needed info globally
LoadInfo(ItemsNeed, Location);
if (XpType = 'Smelt') then
StartingXP := (XpTillNextLevel(SKILL_SMITHING))
else StartingXP := (XpTillNextLevel(SKILL_CRAFTING));
if (XpType = 'Smelt') then
CurrentLevel:= GetSkillLevel(SKILL_SMITHING)
else CurrentLevel:= GetSkillLevel(SKILL_CRAFTING);
end;
Begin
ScriptSetup;
TakePic('Test');
repeat
repeat
bug:= False;
//Log In
while(not(RSReady()))do
Wait(9000);
CheckLogin;
//Fix screen
SetAngle(SRL_ANGLE_HIGH);
//ClearDebug;
SMART_ClearCanvas;
while not ExitSquealOfFortune do
begin
wait(100);
end;
GameTab(Tab_Inv);
ToggleXPBar(True);
//Main Loop
restart := False;
repeat
MainLoop;
until(restart = True) or (bug = True)
until(bug = True)
Players[CurrentPlayer].Active := False;
if (NextPlayerIndex() <> -1) then
begin
WriteDebug('Switching players!');
NextPlayer(Players[CurrentPlayer].Active);
bug := False;
end else
begin
WriteDebug('Ending Script');
TerminateScript;
end;
until(AllPlayersInactive)
End.