From: Rich
He has very few failsafes.
He has no uptext checks.
He is relying on co-ords to click on the range.
He relies on timing to wait for the fish to cook. Not counting the cooked/raw fish.
His three anti-ban procedures could easily be one.
Autocolour by ACA2.
No if not LoggedIn the Exit;
He edited the script after we told him what's wrong. I prefer judging on what they applied with. Not on what they applied with with all the additions by the Members.
And he's in?
People are saying it's becoming too easy to become a Member, and this is a perfect example.
Just for the sake of it, I dug up my old app.
(*************************************************)
(* __ __ __ ____ ____ *)
(* ( \/ ) /__\ ( _ \( ___) *)
(* ) ( /(__)\ )(_) ))__) *)
(* (_/\/\_)(__)(__)(____/(____) *)
(* ____ _ _ ____ _ _ ____ ____ _ _ *)
(* ( _ \( \/ ) (_ )( \/ )(_ _)( ___)( \/ ) *)
(* ) _ < \ / / /_ \ / )( )__) ) ( *)
(* (____/ (__) (____) (__) (__) (____)(_/\_) *)
(* *)
(*************************************************)
(* Smelts ores and bank bars in Al Kharid. *)
(* *)
(*************************************************)
(* Instructions. *)
(*************************************************)
(* 1. USE SCARSCAPE, Very Bright. *)
(* 2. Set your Screen to 32 bit TRUE color. *)
(* 3. Position your chars at Al Kharid bank. *)
(* 4. Make sure your Players have ores. *)
(*************************************************)
program ZytexSmelter;
{.include SRL/SRL.scar}
{.include SRL/SRL/Skill/Smithing.scar}
var
Barexp, Xp, XpMade : Extended; //DoSmelt, CalculateXp and GetBarInfo.
Bar, BarS, BarsMade, //DoSmelt, CalculateXp and GetBarInfo.
Rcactus, RunOut, SmeltX,
BankDTM, SmeltDTM, CounterDTM, LevelDTM : Integer; //DTM's.
x, y : Integer; //DTM Finding etc...
BBar : string; //Smelting
NextPlayer1 : Boolean; //For Nextplayer.
var
IronOre2, CoalOre2, MithrilOre2, GoldOre2, AdamantOre2,
TinOre2, CopperOre2, SilverOre2, RuniteOre2: Integer;
var
frmDesign : TForm;
BackGround, ExitLabel, StartLabel : TLabel; // For the Forms.
const
SetMouseSpeed = 10; //What mouse speed?
Ver = '1.0'; //The verision of this script. No need to touch.
procedure NP(Active : String); forward;
function CountItemDTM(dtm: Integer): Integer;
var
i, x, y: Integer;
TB: Tbox;
begin
if not Loggedin then Exit;
Wait(2000);
GameTab(4);
for i := 1 to 28 do
begin
TB := InvBox(i);
if ExistsItem(i) then
if FindDTM(dtm, x, y, TB.x1, TB.y1, TB.x2, TB.y2) then
Inc(Result);
end;
end;
procedure WithdrawDTM(dtm, Amount: Integer);
var
rx, ry: Integer;
begin
if not LoggedIn then Exit;
if (BankScreen) then
begin
if (Amount = 1) then
begin
if FindDTM(dtm, rx, ry, 4, 4, 515, 377) then
begin
Mouse(rx, ry, 0, 0, True);
Exit;
end;
end else
begin
if FindDTM(dtm, rx, ry, 4, 4, 515, 377) then
begin
Mouse(rx, ry, 0, 0, False);
if (Amount = 5) or (Amount = 10) then
begin
ChooseOption('Withdraw ' +IntToStr(Amount))
exit;
end else
if (Amount = 0) then
begin
ChooseOption('Withdraw All')
exit;
end else
begin
ChooseOption('Withdraw X');
Wait(1000 + Random(100));
TypeSend(IntToStr(Amount));
Exit;
end;
end;
end;
end;
Writeln('Did not found dtm...');
end;
function FurnaceScreen: Boolean;
begin
if (FindColorTolerance(x, y, 12217707, 1, 339, 317, 518, 479)) then
begin
Result := True;
end else
Result := False;
end;
function InBank: Boolean;
begin
Result := (FindDTM(BankDTM, x, y, 570, 5, 725, 166)) or
(FindDTM(CounterDTM, x, y, 570, 5, 725, 166));
end;
function InSmelt: Boolean;
begin
Result := (FindDTM(SmeltDTM, x, y, 570, 5, 725, 166)) or
(FindDTM(RCactus, x, y, 570, 5, 725, 166));
end;
function Lost: Boolean;
begin
if (not(InSmelt)) and (not(InBank)) then
begin
Result := True;
end;
end;
function DoBank: Boolean;
begin
if not Loggedin then Exit;
OpenBankFast('akb');
if BankScreen or PinScreen then
begin
if pinscreen then InPin(Players[CurrentPlayer].strings[1]);
wait(500+random(500));
Players[CurrentPlayer].Banked := Players[CurrentPlayer].Banked + CountItemDTM(Bar);
DepositAll;
Case BBar of
'Bronze' :
begin
WithDrawDTM(CopperOre2, 14)
wait(200+random(200));
if CountItemDTM(CopperOre2) = (14) then
begin
wait(70+random(20));
end else
begin
writeln('None ores at bank... Logging out.');
NextPlayer1 := true;
NP('F');
Exit;
end;
WithDrawDTM(TinOre2, 0)
wait(70+random(20));
if CountItemDTM(TinOre2) = (14) then
begin
wait(70+random(20));
Result := True;
end else
begin
writeln('None ores at bank... Logging out.');
NextPlayer1 := true;
NP('F');
Exit;
end;
end;
'Iron' :
begin
WithDrawDTM(IronOre2, 28);
wait(70+random(20));
if CountItemDTM(IronOre2) = (28) then
begin
wait(70+random(20));
Result := True;
end else
begin
writeln('None ores at bank... Logging out.');
NextPlayer1 := true;
NP('F');
Exit;
end;
end;
'Silver' :
begin
WithDrawDTM(SilverOre2, 28);
wait(70+random(20));
if CountItemDTM(SilverOre2) = (28) then
begin
wait(70+random(20));
Result := True;
end else
begin
writeln('None ores at bank... Logging out.');
NextPlayer1 := true;
NP('F');
Exit;
end;
end;
'Steel' :
begin
WithDrawDTM(IronOre2, 9)
wait(70+random(20));
if CountItemDTM(IronOre2) = (9) then
begin
wait(70+random(20));
end else
begin
writeln('None ores at bank... Logging out.');
NextPlayer1 := true;
NP('F');
Exit;
end;
WithDrawDTM(CoalOre2, 0);
wait(70+random(20));
if CountItemDTM(CoalOre2) = (19) then
begin
wait(70+random(20));
Result := True;
end else
begin
writeln('None ores at bank... Logging out.');
NextPlayer1 := true;
NP('F');
Exit;
end;
end;
'Gold' :
begin
WithDrawDTM(GoldOre2, 28);
wait(70+random(20));
if CountItemDTM(GoldOre2) = (28) then
begin
wait(70+random(20));
Result := True;
end else
begin
writeln('None ores at bank... Logging out.');
NextPlayer1 := true;
NP('F');
Exit;
end;
end;
'Mith' :
begin
WithDrawDTM(MithrilOre2, 5)
wait(70+random(20));
if CountItemDTM(MithrilOre2) = (5) then
begin
wait(70+random(20));
end else
begin
writeln('None ores at bank... Logging out.');
NextPlayer1 := true;
NP('F');
Exit;
end;
WithDrawDTM(CoalOre2, 0)
wait(70+random(20));
if CountItemDTM(CoalOre2) = (23) then
begin
wait(70+random(20));
Result := True;
end else
begin
writeln('None ores at bank... Logging out.');
NextPlayer1 := true;
NP('F');
Exit;
end;
end;
'Addy' :
begin
WithDrawDTM(AdamantOre2, 5)
wait(70+random(20));
if CountItemDTM(AdamantOre2) = (5) then
begin
wait(70+random(20));
end else
begin
writeln('None ores at bank... Logging out.');
NextPlayer1 := true;
NP('F');
Exit;
end;
WithDrawDTM(CoalOre2, 0)
wait(70+random(20));
if CountItemDTM(CoalOre2) = (23) then
begin
wait(70+random(20));
Result := True;
end else
begin
writeln('None ores at bank... Logging out.');
NextPlayer1 := true;
NP('F');
Exit;
end;
end;
'Rune' :
begin
WithDrawDTM(RuniteOre2, 3)
wait(70+random(20));
if CountItemDTM(RuniteOre2) = (3) then
begin
wait(70+random(20));
end else
begin
writeln('None ores at bank... Logging out.');
NextPlayer1 := true;
NP('F');
Exit;
end;
WithDrawDTM(CoalOre2, 0)
wait(70+random(20));
if CountItemDTM(CoalOre2) = (25) then
begin
wait(70+random(20));
Result := True;
end else
begin
writeln('None ores at bank... Logging out.');
NextPlayer1 := true;
NP('F');
Exit;
end;
end;
end;
wait(random(40));
end;
end;
Procedure ToBank;
begin
if not Loggedin then Exit;
if (FindDTM(RCactus, x, y, 570, 5, 725, 166)) then
begin
Mouse(x, y, 5, 5, True);
FFlag(0);
Wait(1000);
if (FindDTM(CounterDTM, x, y, 570, 5, 725, 166)) then
begin
Mouse(x+4, y, 5, 5, True);
FFlag(0);
Wait(2000);
end;
end;
end;
procedure SWait; forward;
function DoSmelt: Boolean;
var
Mark : LongInt;
begin
if not Loggedin then Exit;
FindObjCustom(x, y, ['Smelt', 'melt'], [2697516, 2967725], 10);
Mouse(x, y, 3, 3, true);
Wait(1000);
repeat
if not LoggedIn then Exit;
wait(200+random(40));
until(FurnaceScreen)
if (FurnaceScreen) then
begin
if (FindDTM(BarS, x, y, 1, 339, 518, 479)) then
begin
wait(100+random(40));
Mouse(x, y, 5, 5, false);
wait(100);
if (ChooseOption('melt X')) then
begin
Wait(800+random(500));
case random(16) of
0: TypeSend('55');
1: TypeSend('678');
2: TypeSend('123');
3: TypeSend('34');
4: TypeSend('75');
5: TypeSend('987');
6: TypeSend('55');
7: TypeSend('354');
8: TypeSend('61');
9: TypeSend('51');
10: TypeSend('651');
11: TypeSend('4654');
12: TypeSend('987');
13: TypeSend('654');
14: TypeSend('312');
15: TypeSend('321');
end;
MarkTime(Mark);
repeat
SWait;
if not LoggedIn then exit;
until(finddtm(RunOut, x, y, 1, 339, 518, 479)) or (TimeFromMark(Mark) > 60000);
Result := True;
wait(random(40));
exit;
end else
begin
if (FindDTM(SmeltX, x, y, 4, 4, 515, 377)) then
begin
Wait(100+random(20));
Mouse(x, y, 5, 5, true);
Wait(800+random(500));
case random(16) of
0: TypeSend('55');
1: TypeSend('678');
2: TypeSend('123');
3: TypeSend('34');
4: TypeSend('75');
5: TypeSend('987');
6: TypeSend('55');
7: TypeSend('354');
8: TypeSend('61');
9: TypeSend('51');
10: TypeSend('651');
11: TypeSend('4654');
12: TypeSend('987');
13: TypeSend('654');
14: TypeSend('312');
15: TypeSend('321');
end;
MarkTime(Mark);
repeat
SWait;
if not LoggedIn then Exit;
until(finddtm(RunOut, x, y, 1, 339, 518, 479)) or (TimeFromMark(Mark) > 60000);
Result := True;
wait(random(40));
exit;
end else
begin
writeln('Did not found furnace.');
Result := False;
wait(random(40));
end;
end;
BarsMade := BarsMade + CountItemDTM(Bar);
end;
end else
begin
writeln('Did not found furnace. Checking place...');
if (not(InSmelt))then
begin
Players[CurrentPlayer].Loc := 'Lost';
Result := False;
wait(random(40));
NextPlayer1 := true;
NP('F');
end else
begin
FindObj(x, y, 'Smelt', 2697257, 10);
Mouse(x, y, 3, 3, true);
wait(1500+random(200));
if (FurnaceScreen) then
begin
if (FindDTM(BarS, x, y, 1, 339, 518, 479)) then
begin
wait(100+random(40));
Mouse(x, y, 5, 5, false);
if (ChooseOption('melt X')) then
begin
Wait(250+random(500));
case random(16) of
0: TypeSend('55');
1: TypeSend('678');
2: TypeSend('123');
3: TypeSend('34');
4: TypeSend('75');
5: TypeSend('987');
6: TypeSend('55');
7: TypeSend('354');
8: TypeSend('61');
9: TypeSend('51');
10: TypeSend('651');
11: TypeSend('4654');
12: TypeSend('987');
13: TypeSend('654');
14: TypeSend('312');
15: TypeSend('321');
end;
MarkTime(Mark);
repeat
SWait;
if not LoggedIn then Exit;
until(finddtm(RunOut, x, y, 1, 339, 518, 479)) or (TimeFromMark(Mark) > 60000);
Result := True;
wait(random(40));
end;
end;
end;
end;
end;
end;
Procedure ToSmelt;
begin
if not Loggedin then Exit;
if (FindDTM(RCactus, x, y, 570, 5, 725, 166)) then
begin
Mouse(x, y, 5, 5, True); ;
FFlag(0);
if (FindSymbol(x, y, 'furnace')) then
begin
Mouse(x+(4), y, 3, 3, True); ;
FFlag(0);
end else
begin
if (FindColorTolerance(x, y, 1734910, 570, 5, 725, 166, 5)) then
begin
Mouse(x+4, y, 5, 5, True); ;
FFlag(0);
if (FindColorTolerance(x, y, 1724520, 4, 4, 515, 377, 5)) then
begin
MMouse(x, y, 0, 0);
if (IsUpText('Open')) then
begin
Mouse(x, y, 0, 0, True); ;
end else
begin
Mouse(609, 82, 5, 5, True); ;
end;
end;
end else
begin
Mouse(643, 34, 5, 5, True); ; //AAH!! COORD CLICKING!! :S
FFlag(0); //It is when finding furnacecolor fails anyway..
end;
end;
end else
begin
if (RadialWalk(7720655, 20, 70, 70, 2, 2)) then
begin
FFlag(0);
if (FindColorTolerance(x, y, 1724520, 4, 4, 515, 377, 5)) then
begin
MMouse(x, y, 0, 0);
if (IsUpText('Open')) then
begin
Mouse(x, y, 0, 0, True); ;
end else
begin
Mouse(609, 82, 5, 5, True); ;
end;
end;
end;
end;
Wait(3000);
end;
procedure SWait;
var
Mark, RX, RY : Integer;
begin
MarkTime(Mark);
repeat
if (FindDTM(LevelDTM, x, y, 1, 339, 518, 479)) then
begin
Wait(random(40));
Mouse(x, y, 40, 2, true);
Wait(200+random(100));
DoSmelt;
Break;
end else
begin
if (FindDTM(RunOut, x, y, 6, 429, 518, 479)) then
begin
Wait(random(40));
Break;
end else
begin
Wait(100);
RX := 4+Random(764);
RY := 4+random(502);
MMouse(RX, RY, 30, 30);
Wait(RX + RY + RY);
RX := 4+Random(764);
RY := 4+random(502);
MMouse(RX, RY, 30, 30);
Wait(RX + RY + RY);
end;
end;
until(TimeFromMark(mark) > 60000);
end;
procedure CalculateXp;
begin
if not Loggedin then Exit;
Xp := GetXp('Smithing');
XpMade := Xp + (BarExp * BarsMade);
GameTab(4)
end;
Procedure Load;
begin
RCactus := DTMFromstring('78DA635CC4C4C060C780024EEF2905D38C503' +
'EE334A01A5B54352D01BAA86A9602D5F8A1AAF12A3246510300A8' +
'51069F');
RunOut := DTMFromstring('78DA63E4666060D8CBC8800E58811824FA1F0' +
'81855808C43986A18A06AC0B433116A2280C461026AF288505306' +
'240E1250D344847BA61061CE1222DCB38B0873CE13760F00AC1B1' +
'165');
SmeltX := DTMFromstring('78DA634C62606058C08002FEFFFF0FA619A17' +
'CC66020318B809A7C20B188809A2020B19808736613505341847B' +
'6A8930A79608375710A1A60A48CCC3AF060080DC2871');
BankDTM := DTMFromString('78DA632C606260B0654001EF9E3C61E002D28' +
'C40FC1F0818276057C3005503A641E6141150338108350D403576' +
'F8D50000974615C5');
CounterDTM := DTMFromString('78DA630C676260486740015FBF426846289F1' +
'1A4269B0835F944A829C6AF060020E90AC9');
SmeltDTM := DTMFromString('78DA634C65626030634001EF9E3C61E002D28' +
'C40FC1F08185BB0AB6180AA01D3ED40354904D49403D594E25703' +
'00AF7B1219');
LevelDTM := DTMFromString('78DA6314656460D80BC428E03F988489325E6' +
'720AC269D087340761DC4AF060094CC086C');
CopperOre2 := DTMFromString('78DA638C656060F064400155EE0A609A11CA6' +
'70C0012DE0C688011554D34908826A02613480413509387E91E74' +
'3500EF4E045A');
TinOre2 := DTMFromString('78DA638C656060F0644001DE6E6E609A11CA6' +
'70C000932A001465435D140229A809A4C20114C404D1EA67BD0D5' +
'0000E8C30450');
IronOre2 := DTMFromString('78DA638C656060F06440012AE282609A11CA6' +
'70C0012DE0C688011554D34908826A02613480413509387E91E74' +
'3500927C03C5');
MithrilOre2 := DTMFromString('78DA638C656060F06440011A1AD6609A11CA6' +
'70C0012DE0C688011554D34908826A02613480413509387E91E74' +
'3500B9770404');
CoalOre2 := DTMFromString('78DA637466606028664001525242609A11CA6' +
'7340512E50C688011558D3D906825A0260048D411501382E91E74' +
'3500AD1A0410');
SilverOre2 := DTMFromString('78DA6374666060286640013131C9609A11CA6' +
'7340512E50C688011558D3D906825A0260048D411501382E91E74' +
'3500316504E5');
GoldOre2 := DTMFromString('78DA637466606028664001C571FC609A11CA6' +
'7340512E50C688011558D3D906825A0260048D411501382E91E74' +
'35000D2B04AA');
AdamantOre2 := DTMFromString('78DA6374666060E0626440063AE63A601A26C' +
'A6806247851D5C064E16AEC81840C013501404294809A104CF7A0' +
'AB010009300251');
RuniteOre2 := DTMFromString('78DA6374666060E062644006DA96F6601A26C' +
'A6806247851D5C064E16A405A6408A8090012A204D48460BA075D' +
'0D0015880265');
end;
procedure GetBarInfo(WhatBar: string);
begin
case WhatBar of
'Bronze' :
begin
Bar := DTMFromstring('78DA63FCC0C0C050C48002E23C75C0342394C' +
'FF80A48E4A3AAF1B3514555F3144814A3AA3154134751030090AD' +
'060A');
BarS := DTMFromstring('78DA633466606098C8C8800CFC6D5519B8803' +
'448F43F1030EA00197350D518AA8983699828A33590988EAA26CE' +
'5317450D002CC60861');
Barexp := 6.2;
end;
'Iron' :
begin
Bar := DTMFromstring('78DA637467606058CC800252E3E2C0342394C' +
'FE80224E6A2AA09F6F54555E3002416A1AA31373646510300541C' +
'055F');
BarS := DTMFromstring('78DA639CC5C0C0308991011984F8F93170016' +
'990E87F20609C0264CC455563616202A661A28C8B81C434543569' +
'F171286A00A70B0A59');
Barexp := 12.5;
end;
'Silver' :
begin
Bar := DTMFromstring('78DA63F462606038C4800256ADDA0AA619A17' +
'C461720B10F554D77CF3454350E40E228AA9AB8B854143500EB5C' +
'07F1');
BarS := DTMFromstring('78DA633CC3C0C03085910119F4F44C67E002D' +
'220D1FF40C07804C8988BAA262E2E0D4CC34419AF008999A86A56' +
'AFDE86A2060039740D1B');
Barexp := 13.5;
end;
'Steel' :
begin
Bar := DTMFromstring('78DA63F460606078CC8002267576806946289' +
'FD11548DC435553595880AAC601483C415513E0ED85A20600CDB4' +
'075B');
BarS := DTMFromstring('78DA6364626460980AC448A0AAB090810B488' +
'344FF0301E31F20632EAA9A406F6F300D1365E402B266A0AA99DC' +
'D989A20600ABED0ACC');
Barexp := 17.5;
end;
'Gold' :
begin
Bar := DTMFromstring('78DA63F460606060666440063737CA8069982' +
'8A30B320F02364D124755E304245850D59425F2A3A80100220C04' +
'C6');
BarS := DTMFromstring('78DA63346564609804C44860F36409062E200' +
'D12FD0F048C7A40D65C5435E54902601A26CA680564CD40557373' +
'932C8A1A0090A30A66');
Barexp := 22.5;
end;
'Mith' :
begin
Bar := DTMFromstring('78DA63F462606078CB8002FCFC8BC0342394C' +
'FE80A245EA1AA71708C4355E30024DEA3AAD1D2B64351030086FF' +
'061D');
BarS := DTMFromstring('78DA63CC646460980CC448C0D1319E810B488' +
'344FF0301631290350F558DB6B63D98868932160159D351D5F8FB' +
'17A3A8010076DA099F');
Barexp := 30.0;
end;
'Addy' :
begin
Bar := DTMFromstring('78DA63F4606060E063644006416941601A26C' +
'AE80A243851D538053BA1AAB10712FCA86A74CC7550D40000D3D0' +
'036C');
BarS := DTMFromstring('78DA639CC7C8C0301988918073B0330317900' +
'689FE0702C6E940D61C54353AE63A601A26CAB818C89A81AA2638' +
'3D18450D009E300A27');
Barexp := 37.5;
end;
'Rune' :
begin
Bar := DTMFromstring('78DA63F4626060D061644006C17955601A26C' +
'AE80C243451D5B844A7A0AAB1071206A86A746D9C50D40000074B' +
'0444');
BarS := DTMFromstring('78DA63BCCCC8C030198891806B742A0317900' +
'689FE0702C6D340D66C54357AB6CE601A26CA781BC89A81AA2624' +
'BF1A450D00E1CC0B43');
Barexp := 50.0;
end;
end;
BBar := WhatBar;
end;
Procedure DrawImages(Sender: TObject);
var
Picture : Integer;
Canvas : TCanvas;
Begin
picture := BitmapFromString(200, 177, '*SNIP*');
Canvas := GetBitmapCanvas(Picture);
CopyCanvas(Canvas, frmDesign.Canvas, 0, 0, 207, 200, 0, 0, 207, 200);
FreeBitmap(Picture);
end;
Procedure ButtonClick(Sender: TObject);
Begin
case Sender of
StartLabel : begin
frmDesign.ModalResult := mrOk;
wait(200);
SRLPlayerForm(True, [], ['Loads To Do'], ['Ore To Smelt', 'Bank PIN', 'SRL ID', 'SRL Password'], []);
end;
ExitLabel : begin
frmDesign.ModalResult := mrOk;
exit;
end;
end;
end;
Procedure InitForm;
Begin
frmDesign := CreateForm;
frmDesign.Left := 267;
frmDesign.Top := 126;
frmDesign.Width := 200;
frmDesign.Height := 177;
frmDesign.Caption := 'Al-Kharid Smelter';
frmDesign.Color := clBtnFace;
frmDesign.Font.Color := clWindowText;
frmDesign.Font.Height := -11;
frmDesign.Font.Name := 'MS Sans Serif';
frmDesign.Font.Style := [];
frmDesign.OnPaint := @DrawImages;
frmDesign.Visible := False;
frmDesign.PixelsPerInch := 96;
frmDesign.Borderstyle := bsNone;
BackGround := TLabel.Create(frmDesign);
BackGround.Parent := frmDesign;
BackGround.Left := 0;
BackGround.Top := 0;
BackGround.Width := 200;
BackGround.Height := 177;
BackGround.Cursor := crDefault;
BackGround.AutoSize := False;
ExitLabel := TLabel.Create(frmDesign);
ExitLabel.Parent := frmDesign;
ExitLabel.Left := 8;
ExitLabel.Top := 136;
ExitLabel.Width := 106;
ExitLabel.Height := 36;
ExitLabel.Cursor := crHandPoint;
ExitLabel.AutoSize := False;
ExitLabel.OnClick := @ButtonClick;
ExitLabel.Transparent := True;
StartLabel := TLabel.Create(frmDesign);
StartLabel.Parent := frmDesign;
StartLabel.Left := 72;
StartLabel.Top := 88;
StartLabel.Width := 118;
StartLabel.Height := 41;
StartLabel.Cursor := crHandPoint;
StartLabel.AutoSize := False;
StartLabel.OnClick := @ButtonClick;
StartLabel.Transparent := True;
end;
procedure SafeInitForm;
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('InitForm', v);
end;
procedure ShowFormModal;
begin
frmDesign.ShowModal;
end;
procedure SafeShowFormModal;
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('ShowFormModal', v);
end;
procedure PlayerReport;
var
Active : string;
P : Integer;
begin
for P := 0 to HowManyPlayers - 1 do
begin
if Players[P].Active = True then
Active := 'T'
else
Active := 'F';
WriteLn('| '+ (IntToStr(P)) +' : '+ Players[P].nick + ' = '+ Active +'. |');
if (Players[P].Banked > 0) then
Writeln('| Bars made = '+ IntToStr(Players[P].Banked) +'. |');
Writeln('| Loc = '+ Players[P].Loc +'. |');
end;
end;
procedure Proggie;
begin
ClearDeBug;
Writeln('/**************************\');
Writeln('| Zytexs AK Smelter! |');
Writeln('| Ver: '+ Ver +'. |');
Writeln('| Worked for: |');
Writeln('| '+ TimeRunning +'|');
Writeln('|**************************|');
PlayerReport;
Writeln('\**************************/');
end;
procedure NP(Active : string);
begin
if (NextPlayer1 = true) then
begin
if (HowManyPlayers = 1) then
begin
TerminateScript;
end;
if (Active = 'F') then
begin
NextPlayer(false);
end else
NextPlayer(true);
LogInPlayer;
GetBarInfo(Players[CurrentPlayer].strings[0]);
wait(2000+Random(100));
HighestAngle;
MouseSpeed := SetMouseSpeed;
SetChat('on',1);
SetChat('friends',3);
SetChat('off',2);
NextPlayer1 := false;
CalculateXp;
Proggie;
end;
end;
procedure SetUp;
var
i : Integer;
begin
Load;
SetupSRL;
SetupSmithing;
Disguise('Adobe Photoshop Elements - [Untitled-1 @ 66,7% (Layer 1, RG)]');
ClearDeBug;
ScriptId := '577';
GetApplication.BringToFront;
SafeInitForm;
SafeShowFormModal;
for i := 0 to HowManyPlayers - 1 do
if Not(Players[i].Strings[2] = '') then
Begin
SRLID := Players[i].Strings[2];
SRLPassword := Players[i].Strings[3];
Break;
end;
if (NextPlayer1 = true) then
begin
LogInPlayer;
GetBarInfo(Players[CurrentPlayer].strings[0]);
wait(2000+Random(100));
HighestAngle;
MouseSpeed := SetMouseSpeed;
SetChat('on',1);
SetChat('friends',3);
SetChat('off',2);
NextPlayer1 := false;
CalculateXp;
Proggie;
end;
end;
begin
NextPlayer1 := true;
SetUp;
Proggie;
repeat
repeat
if InBank then
if DoBank then
ToSmelt;
if InSmelt then
if DoSmelt then
ToBank;
if (Lost) then
begin
Players[CurrentPlayer].Loc := 'Lost';
Proggie;
NextPlayer1 := true;
NP('F');
end;
if (Players[CurrentPlayer].Loc = 'Lost') then
begin
LogOut;
Proggie;
NextPlayer1 := true;
NP('F');
end;
until(false)//(Players[CurrentPlayer].Banked mod Players[CurrentPlayer].Integer[0] = 0) //MUST FIX
NextPlayer1 := true;
NP('A');
until(false) //All players false. need to fix to.
FreeSmithingBitMaps;
end.
I too used few uptext checks, not many failsafes at all, and I used DTMs for walking! (Note; no DDTM, DTM.)
Take a look at my DoBank and DoSmelt procedures. It could easily be edited so that they would take up 1/3 of the amount of lines they do now, and the only arrays I use is the ones from the SRL include. I don't even think I knew about arrays at the time. I didn't use TPA for objet finding (I used SRL's FindObjectTPA, but I don't remember if I actually knew how it worked. TomTuff obviously do. Post #20).
EDIT: And please note that I wrote "USE SCARSCAPE" at the top because I didn't bother to add tolerance to stuff / fix the compass shifting.
Still I got in.
I absolutely agree with WT-Fakawi. TomTuff deserves the SRL Member title, and I'm glad he got it.