here it is:
program Hoi;
{.include smart.scar}
{.include srl/srl.scar}
{
Nameless smither by Raymond aka Mastaraymond
Instructions:
1) Start in Varrock West bank
2) Fill in the consts below
3) Fill in the player array
4) Make sure they all have got a hammer in invetory\bank
5) Run ^^
Smithsets, if it is set to True. The script will, if your level
is high enough, make 2 sets each load.
Loads, the script will add a random number of loads on top of this number
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Nameless Smither by Raymond
Time running: 3 Hours, 17 Minutes and 13 Seconds
Total loads: 172 rate 52 loads/hr
Total bars: 4531 rate 1378 bars/hr
Active players : 1
Potential levels gained : 21
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ }
Const
Loads = 5;
StartPlayer = 0;
CustomItem = 'nails';
SmithSets = False;
Procedure DeclarePlayers;
begin;
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
RCMaster := '';
RCLoc := '';
SRLID := '193';
SRLPassword := 'notmypassword';
Players[0].Name :='markiemannie';
Players[0].Pass :='IWontGiveYouMyMainsPass;)';
Players[0].Nick :='arki';
Players[0].Active:=True;
end;
var
Hammer : Integer;
CHandle : HDC;
GlobalBar,TotalLoads,TotalBars,TotalLevels : integer;
CurrentBar : String;
SmithingMask,ContinueMask,AnvilMask : TMaskRay;
BarDTMs : Array[0..7] of Integer;
SetParts : Array of String;
procedure DrawTPA(TPA : TPointArray); //Put in a TPA, and it returns you a debug image with the found points :-)
var
TempBitmap,I,LengthA : integer;
Size : TBox;
begin;
Size := GetTPABounds(TPA);
TempBitmap := BitmapFromString(Size.x2-Size.x1+1,Size.y2-Size.y1+1,'');
CopyClientToBitmap(TempBitmap,Size.x1,Size.y1,Size.x2,Size.y2);
LengthA := High(TPA);
For I:= 0 to LengthA do
FastSetPixel(TempBitmap,TPA[I].x-Size.x1,TPA[I].y-Size.y1,clred);
DisplayDebugImgWindow(Size.x2-Size.x1+1,Size.y2-Size.y1+1);
SafeDrawBitmap(TempBitmap,GetDebugCanvas,0,0);
FreeBitmap(TempBitmap);
end;
Procedure ScriptTerminate;
begin;
Writeln('STOPPING ;)');
FreeSearchingBitmap;
end;
Function RandomRandom( Num : integer) : integer;
begin;
Result := Random(num);
if Random(2) = 0 then
Result := -Result;
end;
Function MakeDDTM(TheDDTM: TIntegerArray): integer;
var
TempLength,i:integer;
DDTM:TDTM;
begin;
TempLength:= (Length(TheDDTM) div 6)
DDTM.MainPoint.x:= TheDDTM[0];
DDTM.MainPoint.y:= TheDDTM[1];
DDTM.MainPoint.AreaSize:= TheDDTM[2];
DDTM.MainPoint.AreaShape:= TheDDTM[3];
DDTM.MainPoint.Color:= TheDDTM[4];
DDTM.MainPoint.Tolerance:= TheDDTM[5];
SetArrayLength(DDTM.SubPoints, 0);
for i := 0 to TempLength -2 do
begin
SetArrayLength(DDTM.SubPoints, Length(DDTM.SubPoints) +1);
DDTM.SubPoints[Length(DDTM.SubPoints) -1].x:= TheDDTM[(I+1)*6 + 0];
DDTM.SubPoints[Length(DDTM.SubPoints) -1].y:= TheDDTM[(I+1)*6 + 1];
DDTM.SubPoints[Length(DDTM.SubPoints) -1].AreaSize:= TheDDTM[(I+1)*6 + 2];
DDTM.SubPoints[Length(DDTM.SubPoints) -1].AreaShape:= TheDDTM[(I+1)*6 + 3];
DDTM.SubPoints[Length(DDTM.SubPoints) -1].Color:= TheDDTM[(I+1)*6 + 4];
DDTM.SubPoints[Length(DDTM.SubPoints) -1].Tolerance:= TheDDTM[(I+1)*6 + 5];
end;
Result := AddDTM(DDTM);
end;
Function MaxBar ( Level : Integer) : String;
begin;
if Level >= 85 then
Result := 'runite'
else if Level >= 70 then
Result := 'adamant'
else if level >= 50 then
Result := 'mithril'
else if Level >= 40 then
Result := 'gold'
else if Level >= 30 then
Result := 'steel'
else if level >= 20 then
Result := 'silver'
else if level >= 15 then
Result := 'iron'
else if Level >= 8 then
Result := 'blurite'
else
Result := 'bronze';
end;
Function MaxBars ( Level : integer) : Array of String;
var
LengthBar : Integer;
begin;
Result := ['bronze','iron','silver','steel','gold', 'mithril','adamant','runite'];
LengthBar := Length(Result);
if Level >= 85 then
Exit
else if Level >= 70 then
Dec(LengthBar)
else if level >= 50 then
DecEx(LengthBar,2)
else if Level >= 40 then
DecEx(LengthBar,3)
else if Level >= 30 then
DecEx(LengthBar,4)
else if level >= 20 then
DecEx(LengthBar,5)
else if level >= 15 then
DecEx(LengthBar,6)
else if Level >= 1 then
DecEx(LengthBar,7)
SetLength(result,LengthBar);
end;
Function SmithLevel (Bar : String) : Integer;
begin;
Case LowerCase(bar) of
'bronze' : Result := 1;
'blurite': Result := 8;
'iron' : Result := 15;
'silver' : Result := 20;
'steel' : Result := 30;
'gold' : Result := 40;
'mithril': Result := 50;
'adamant': Result := 70;
'runite' : Result := 85;
end;
end;
Function BestItem (Level : integer; Bar : String): string;
var
Lev : integer;
begin;
Lev := SmithLevel(bar);
if Lev > Level then Exit;
Lev := Level - Lev;
if Lev >= 18 then
Result := 'platebody'
else if Lev >= 16 then
Result := 'platelegs'
else if Lev >= 12 then
Result := 'kiteshields'
else if lev >= 7 then
Result := 'full helm'
else if lev >= 5 then
Result := 'scimitar'
else
Result := 'axe'
end;
Function BestItemAmount(Level,Amount : integer; Bar : String): string;
var
Lev : integer;
begin;
if Amount < 1 then exit;
Lev := SmithLevel(bar);
if Lev > Level then Exit;
Lev := Level - Lev;
if (Lev >= 18) and (Amount >= 5) then
Result := 'platebody'
else if (Lev >= 16) and (Amount >= 3) then
Result := 'platelegs'
else if (Lev >= 12) and (Amount >= 3) then
Result := 'kiteshield'
else if (lev >= 7) and (Amount >= 2) then
Result := 'full helm'
else if (lev >= 5) and (Amount >= 2) then
Result := 'scimitar'
else
Result := 'axe'
end;
Function GetItemBars(Item: String) : Integer;
begin
case lowercase(Item) of
'dagger','axe','mace','med helm','medium helm','wire',
'crossbow bolts','sword','arrow tips',
'throwing knife','nails','crossbow limbs': Result := 1;
'longsword','scimitar','full helm', 'square shield': Result:= 2;
'warhammer','plateskirt', 'battleaxe','chainbody', 'kiteshield', '2h', 'platelegs': Result:= 3;
'platebody': Result := 5;
end;
end;
//By bullzeye95!
procedure GetItem(Item: String; var x, y: Integer; var GoDown: Boolean);
var
R, C: Integer;
begin
case lowercase(Item) of
'dagger', 'axe', 'mace', 'med helm': R:= 1;
'crossbow bolts', 'sword', 'nails': R:= 2;
'wire', 'arrow tips', 'scimitar', 'crossbow limbs': R:= 3;
'longsword', 'throwing knife', 'full helm', 'square shield': R:= 4;
'warhammer', 'battleaxe': R:= 5;
'chainbody', 'kiteshield', '2h': R:= 6;
'plateskirt', 'platelegs', 'platebody': R:= 7;
end;
case Lowercase(Item) of
'dagger', 'crossbow bolts', 'wire', 'longsword', 'chainbody', 'plateskirt': C:= 1;
'axe', 'sword', 'arrow tips', 'throwing knife', 'kiteshield', 'platelegs': C:= 2;
'mace', 'scimitar', 'full helm', 'warhammer', 'platebody': C:= 3;
'med helm', 'nails', 'crossbow limbs', 'square shield', 'battleaxe', '2h': C:= 4;
end;
GoDown:= R > 5;
x:= 47 + ((C - 1) * 117);
if(GoDown)then R:= R - 2;
y:= 81 + ((R - 1) * 52);
if Godown then y := y - 10;
end;
Function GetBarDTM(Bar : String) : integer;
var
Color : integer;
begin;
Case LowerCase(Bar) of
'bronze' : Color := 2374733;
'blurite': Color := 12217450;
'iron' : Color := 5066067;
'silver' : Color := 9866123;
'steel' : Color := 7368825;
'gold' : Color := 1544882;
'mithril': Color := 6176832;
'adamant': Color := 4346434;
'runite' : Color := 6576708;
end;
Result := MakeDDTM([281, 188,0,0,Color,25,
271, 192,0,0,65536,0,
269, 197,0,0,65536,0,
288, 199,0,0,65536,0,
296, 191,0,0,65536,0,
284, 203,0,0,65536,0]);
end;
Function GetBarDTMArray( Level : integer): TIntegerArray;
var
Arr : Array of String;
I,Len : integer;
begin;
Arr := MaxBars(Level);
SetLength(Result,Length(Arr));
Len := High(Arr);
For I := 0 to Len do
Result[I] := BarDTMs[I];
end;
Function FindAnvil: Boolean;
var
ATPA : TPointArrayArray;
TPA,TPA2 : TPointArray;
I,II,III,Len,x,y : integer;
begin
Players[CurrentPlayer].loc := 'Finding t3h anvil!';
Writeln('Click t3h anvil!');
Result := False;
ColorToleranceSpeed(1);
if Not LoggedIn Then exit;
FindColorsCMYK(TPA,5197910,MSX1,MSY1,MSX2,MSY2,0,0.5,1.6,6.5,CHandle);
ATPA := FloodFillTPADistance(3,TPA);
CleanATPA(80,240,ATPA);
ATPA := SortATPADistFirstPoint(MSCX,MSCY,ATPA);
Len := High(ATPA);
For II := 0 to 1 do
begin;
For III := 0 to 1 do
For I := 0 to Len do
begin;
CenterTPAEx(x,y,ATPA[I]);
MMouse(x, y, 2, 2);
if III = 0 then
begin;
Wait(150+random(50));
if pos('nvil',rs_GetUpText) < 1 then
Continue;
end;
GetMousePos(x,y);
Mouse(x,y,0,1,false);
Wait(350 + random(150));
if FindMaskTolRay(x - 35,y,x + 250,y + 175,0,30,False, AnvilMask,CHandle,x,y ) then
begin;
Mouse(x - Random(10),y,10,5,True);
Result := True;
Exit;
end;
end;
FindColorsCMYK(TPA,5066066,MSX1,MSY1,MSX2,MSY2,0,1,1,10,CHandle);
FindColorsHSL(TPA2,5066323,MSX1,MSY1,MSX2,MSY2,3,0.5,8,CHandle);
TPA := FindCommonPoint([TPA,TPA2]);
ATPA := FloodFillTPADistance(3,TPA);
CleanATPA(120,360,ATPA);
Len := High(ATPA);
end;
end;
Function DepositExceptDTMs( DTMs : Array of Integer) : Boolean;
var
I,II,Len,x,y : integer;
Box : TBox;
DepositBool : Boolean;
begin;
Result := False;
if Not LoggedIn Then exit;
Len := High(DTMs);
For I := 1 to 28 do
begin;
Box := InvBox(I);
if FindColor(x, y, 65536, Box.x1, Box.y1, Box.x2, Box.y2)=false then
Continue;
DepositBool := True;
For II := 0 to Len do
if FindDTM(DTMs[II],x,y,Box.x1,Box.y1,Box.x2,Box.y2) then
begin;
DepositBool := False;
Break;
end;
if DepositBool then
begin;
Mouse(Box.x1 + ((Box.x2 - Box.x1) shr 1) - 4 ,Box.y1 + ((Box.y2 - Box.y1) shr 1) - 4,6,6,False);
Wait(50+random(75));
II := 0;
if ChooseOption('All') then
begin;
Repeat
Wait(Random(100)+40);
II := II + 1;
if II > 30 then Break;
until (not FindColor(x, y, 65536, Box.x1, Box.y1, Box.x2, Box.y2) and not FindColor(x, y, 1777444, Box.x1, Box.y1, Box.x2, Box.y2))
Result := True;
end;
end;
end;
end;
Function HammerCheckBank: Boolean;
var
Box : TBox;
x,y : Integer;
Label
FailzOr;
begin;
Result := False;
if Not LoggedIn Then exit;
if Bankscreen=False then exit;
DepositExceptDTMs([Hammer]);
FixBank;
if not FindDTM(Hammer, x,y, MIX1,MIY1,MIX2,MIY2) then
if not FindDTM(Hammer,x,y, MSX1,MSY1,MSX2,MSY2) then
begin;
FailzOr:
Writeln('Couldn'#39't find a hammer.');
Exit;
end else
begin;
MMouse(x,y,3,3);
Wait(100+random(50))
if Pos('amme', rs_GetUpText) < 1 then
Goto FailZor;
GetMousePos(x,y);
Mouse(x,y,0,0,false);
Wait(250+Random(650));
if not ChooseOption('Withdraw 1') then
Goto FailZor;
Wait(Round( 6.0469*6.0469*6.0469*6.0469) + random(Round( 6.0469*6.0469*6.0469*6.0469)));
if not FindDTM(Hammer, x,y, MIX1,MIY1,MIX2,MIY2) then
Goto FailzOr;
end;
Result := True;
Box := InvBox(1);
if not PointInBox(Point(x,y),Box) then
begin;
MMouse(x,y,0,0);
Wait(100+random(50));
if Pos('amme',rs_getUpText) < 1 then
Goto FailzOr;
HoldMouse(x,y,true);
Wait(Random(150));
MMouse((Box.x2 + Box.x1) shr 1,(Box.y2 + Box.y1) shr 1, 5,5);
Wait(Random(150));
GetMousePos(x,y);
ReleaseMouse(x,y,true);
end;
end;
Function WithDrawDTM( DTMs : Array of Integer; var Num : Integer) : boolean;
var
x, y : integer;
I,Count, Len,II : integer;
begin;
Players[CurrentPlayer].loc := 'Withdrawing!..';
Writeln('WITHDRAWING!!!');
Result := False;
if Not LoggedIn Then exit;
if Bankscreen = False then Exit;
Len := High(DTMs);
Count := InvCount;
Wait(1000 + Random(250));
for I := 0 to Len do
if FindDTM(DTMs[I],x,y,MSX1,MSY1,MSX2,MSY2) then
begin;
Mouse(x,y,2,2,false);
if ChooseOption('All') then
begin;
II := 0;
Repeat
Inc(II);
Wait(Random(50) + 137);
until (II > 45) or (InvCount <> Count);
Num := I;
Result := True;
Exit;
end;
end;
end;
Function FindBankers(MinBankers, TargetX,TargetY,SortTox,SortToY:Integer; var x,y : integer) : Boolean;
var
ATPA : TPointArrayArray;
Degree : Extended;
Dist,DistS : Extended;
MAngle : Extended;
SAngle : extended;
begin;
Players[CurrentPlayer].loc := 'Finding bankers..';
Result := False;
if Not LoggedIn Then exit;
SetLength(ATPA,1);
FindColorsRGB(ATPA[0],60909,0,0,0,MMX1,MMY1,MMX2,MMY2,CHandle);
ATPA := SortTPaToATPADist(15,ATPA[0]);
CleanATPA(MinBankers,50,ATPA);
if Length(ATPA) < 1 then exit;
Degree := Degrees(ArcTan2(SortToY - MMCY, MMCX - SortToX));
if Degree < -90 then
Degree := Degree + 360;
Dists := Distance(MMCX,MMCY,SortToX,SortToY);
SAngle := Radians(180 - rs_GetMinimapAngle + Degree);
SortToX := MMCX + Round(DistS * Cos(SAngle));
SortToY := MMCY + round(-DistS * Sin(SAngle));
ATPA := SortATPADistFirstPoint(SortToX,SortToY,ATPA);
Degree := Degrees(ArcTan2(TargetY - MMCY, MMCX - TargetX));
if Degree < -90 then
Degree := Degree + 360;
Dist := Distance(MMCX,MMCY,TargetX,TargetY);
MAngle := Radians(180 - rs_GetMinimapAngle + Degree);
ATPA[0] := SortTPADistance(MMCX,MMCY,ATPA[0]);
if High(ATPA) > 0 then
begin;
x := ATPA[0][1].x;
y := ATPA[0][1].y;
end else
begin;
x := ATPA[0][0].x;
y := ATPA[0][0].y;
end;
x := x + Round(Dist * Cos(MAngle));
y := y + round(-Dist * Sin(MAngle));
result := True;
end;
Function OpenVWBank : boolean;
var
ATPA : TPointArrayArray;
TPA : TPointArray;
X,Y , I,C: Integer;
Timer : INteger;
begin;
Players[CurrentPlayer].loc := 'Opening t3h bank!';
Writeln('OPEN THE GODDANMNET BANK');
if Not LoggedIn Then exit;
Result := Bankscreen;
if Result then
Exit;
For I := 0 to 3 do
begin;
SetLength(ATPA,1);
FindColorsHSL(ATPA[0],5255742,MSX1,MSY1,MSX2,MSY2,1,5,8.5,CHandle);
ATPA := SortTPAToATPA(30,30,ATPA[0]);
CleanATPA(5,5000,ATPA);
if Length(ATPA) >= 3 then
Break;
if I = 3 then
Exit;
FindBankers(3,MMCX-15,MMCY,MMCX + 70,MMCY,x,y);
Mouse(x,y,1,1,True);
FFLag(0);
Wait(1000+random(750));
FindNormalRandoms;
end;
ATPA := SortATPADistFirstPoint(MSCX,MSCY,ATPA);
For C := 0 to 1 do
begin;
For I:= 0 to High(ATPA) do
begin;
CenterTPAEx(x,y,ATPA[I]);
FindColorsHSL(TPA,4342342,x-80,y-80,x+80,y+80,1.8,0.8,3,CHandle);
if Length(TPA) < 5 then
Continue;
TPA := SortTPADistance(x,y,TPA);
x := TPA[0].x;
y := Tpa[0].y;
MMouse(x,y,1,1);
Wait(150+Random(50));
if (Pos('ank',rs_GetUpText) > 0) = false then
Continue;
GetMousePos(x,y);
Mouse(x,y,0,0,False);
Wait(150+Random(50));
if ChooseOption('uick') = false then
Continue;
Timer := GetSystemTime;
While Bankscreen = false do
begin
if ((GetSystemTime - Timer) > 6500) then
Break;
Wait(250+random(250));
end
if not Bankscreen then
Continue;
Timer := GetSystemTime;
Repeat
Result := FindColor(x,y,65536,58, 62,442, 258);
if ((GetSystemTime - Timer) > 6500) then
Break;
Until Result
if Result then
exit;
end;
SetLength(ATPA,1);
FindBankers(3,MMCX-15,MMCY,MMCX + 70,MMCY,x,y);
FindNormalRandoms;
Mouse(x,y,1,1,True);
FFLag(0);
Wait(1000+random(750));
FindNormalRandoms;
FindColorsHSL(ATPA[0],5255742,MSX1,MSY1,MSX2,MSY2,1,5,8.5,CHandle);
ATPA := SortTPAToATPA(30,30,ATPA[0]);
CleanATPA(5,5000,ATPA);
if Length(ATPA) < 3 then
Exit;
end;
end;
Function SmithingScreen : boolean;
var
x,y : integer;
begin;
Result := False;
if Not LoggedIn Then exit;
Result := FindMaskTolRay(126, 11,383, 61,0,30,False,SmithingMask,CHandle,x,y);
end;
Function ClickContinueRay : boolean;
var
x,y,sx,sy : integer;
begin;
Result := False;
if Not LoggedIn Then exit;
Result := FindMaskTolRay(6, 343,515, 473,0,30,False, ContinueMask,CHandle,x,y);
if Result then
begin;
GetMousePos(sx,sy);
if not IntInBox(sx,sy, IntToBox(x,y,iAbs(x + ContinueMask.width - 5), iAbs(y + ContinueMask.Height - 2))) then
Mouse(x,y, ContinueMask.Width, ContinueMask.Height,True)
else
Mouse(sx,sy,0,0,true);
Wait(100+random(150));
end;
end;
Function VWBToAnvil : Boolean;
var
x,y : integer;
ATPA : TPointArrayArray;
TPA : TPointArray;
I : Integer;
Tries : Integer;
Label
Restart;
begin;
Players[CurrentPlayer].loc := 'Trying to walk to the anvil..';
Writeln('To t3h anvil!');
Result := False;
Restart:
MakeCompass('n');
if Not LoggedIn Then exit;
Tries := Tries + 1;
if Tries > 3 then Exit;
if FindColorsRGB(TPA,65536,0,0,0,MMX1,MMY1,MMX2,MMY2,CHandle) < 20 then
Exit;
ATPA := FloodFillTPADistance(2,TPA);
I := LargestTPAInATPA(ATPA);
if Length(ATPA[I]) > 15 then
begin;
CenterTPAEx(x,y,ATPA[i]);
if (MMCY - y) > 20 then
begin;
Result := True;
Exit;
end;
y := y + 30;
While rs_OnMinimap(x-5,y)=false do
Y := Y - 5;
Mouse(x-10,y,2,2,true);
FindNormalRandoms;
FFlag(Random(3)+2);
FindNormalRandoms;
Goto restart;
end else
Exit;
end;
Function AnvilToVWB : Boolean;
var
x,y,xx,yy : integer;
Bool : Boolean;
ATPA : TPointArrayArray;
TPA : TPointArray;
I : Integer;
Label
FailzOr,SecondFailzOr;
begin;
Players[CurrentPlayer].loc := 'Back to the bank!..';
Writeln('To t3h bank!');
Result := False;
Bool := False;
if Not LoggedIn Then exit;
MakeCompass('n');
if FindColorsRGB(TPA,65536,0,0,0,MMX1,MMY1,MMX2,MMY2,CHandle) < 20 then
begin;
FailzOr:
if not FindBankers(3,MMCX-10,MMCY,MMCX + 70,MMCY,x,y) then
begin;
FindNormalRandoms;
MakeCompass('n');
Mouse(631, 51,0,0,true);
FFlag(0);
FindNormalRandoms;
if not FindBankers(3,MMCX-10,MMCY,MMCX + 70,MMCY,x,y) then
Exit
else
Goto FailzOr;
end else
Begin;
if Distance(x,y,MMCX,MMCY) > 6 then
Mouse(x,y,1,1,True);
FFlag(0);
Wait(750+Random(750));
FindNormalRandoms;
Result := True;
Exit;
end;
end;
ATPA := FloodFillTPADistance(2,TPA);
I := LargestTPAInATPA(ATPA);
if Length(ATPA[I]) > 15 then
begin;
SecondFailzOr:
CenterTPAEx(x,y,ATPA[i]);
xx := x;
yy := y;
if FindColorSpiral(xx,yy,60909,x - 15,y - 20,x + 15,y) then
if rs_OnMinimap(xx,yy) then
begin;
Mouse(xx - 10,yy - 7, 2,1,true);
FFlag(Random(3));
FindNormalRandoms;
Result := True;
Exit;
end;
if y > 105 then
Goto FailzOr;
Mouse(x-20,y,2,2,true);
FFlag(Random(3));
FindNormalRandoms;
if not bool then
if FindColorsRGB(TPA,65536,0,0,0,MMX1,MMY1,MMX2,MMY2,CHandle) > 20 then
begin;
ATPA := FloodFillTPADistance(2,TPA);
I := LargestTPAInATPA(ATPA);
Bool := True;
Goto SecondFailzOr;
end;
Goto FailzOr;
end else
Goto FailzOr;
end;
Procedure FillMem;
var
I : Integer;
Timer : integer;
Bars : Array of String;
Bmp : integer;
begin;
Bars := MaxBars(99);
For I := 0 to 7 do
BarDTMs[I] := GetBarDTM(Bars[I]);
Timer := GetSystemTime;
Bmp := CreateBitmapMaskFromText('mithing',UpChars);
SmithingMask := CreateMaskFromBMP(GetBitmapDC(BMP));
FreeBitmap(BMP);
Bmp := CreateBitmapMaskFromText('ontinue',NpcChars);
ContinueMask := CreateMaskFromBMP(GetBitmapDC(BMP));
FreeBitmap(BMP);
Bmp := CreateBitmapMaskFromText('Anvil',UpChars);
AnvilMask := CreateMaskFromBMP(GetBitmapDC(BMP));
FreeBitmap(BMP);
Hammer := DTMFromString('78DA637460626078CA8002226CB8193480342' +
'310FF07024677A09AFB0C6880118904D2CE4035D708A8F103AAB9' +
'4D408D0550CD47026A6C816A3E1050E30A54F398801A4FA09AEB4' +
'4D8F514BF1A00A2CF0F3D');
GlobalBar := DTMFromString('78DA639CC1C4C0F0980105C47AE8301C62646' +
'0002286FF40C03815A8E636031A6044228134C89C0F04D42C01AA' +
'7940404D2750CD6B026AA600D5BC27A0663E50CD4B026A6603D5D' +
'C21A0A60FA8E6117E3500BB69131A');
SetParts := ['platebody','platelegs','kiteshield','full helm'];
end;
Function IsLoading : boolean;
begin;
Result := ((GetColor(6,6) = Clwhite) and (GetColor(7,7) = 0));
end;
Function GameTabFKeys( Tab : Integer) : boolean;
var
I : integer;
begin;
Result := ( Tab <> GetCurrentTab);
if not Result then
Exit;
Result := GameTab(Tab);
For I := 0 to 9 do
begin;
Result := (GetCurrentTab = Tab);
if Result then Exit;
Wait(250 + Random(150));
end;
{ Result := False;
if Not LoggedIn Then exit;
Case tab of
1,2,3,8,9 : I := VK_F1 + Tab - 1;
4 : i := VK_ESCAPE;
5,6,7,11,12,13,14 : I := Vk_f1 + tab - 2;
15 : I := vk_f7;
10 : begin;
Result := GameTab(10);
Exit;
end;
end;
Result := (I > 0) and (GetCurrentTab <> tab);
if Result = False then
Exit;
KeyDown(I);
Wait(20+random(40));
KeyUp(I);
For I := 0 to 9 do
begin;
Result := (GetCurrentTab = Tab);
if Result then Exit;
Wait(250 + Random(150));
end;
}
end;
Function MyGetLevels : Boolean;
begin;
Result := False;
if Not LoggedIn Then exit;
if TabExists(2) and TabExists(4) then
if GameTabFKeys(2) then
begin;
GetAllLevels;
Wait(500 + random(500));
if GameTabFKeys(4) then
Result := true;
end;
end;
Procedure Setupscript;
var
Num : Integer;
begin;
SetupSRL;
CreateSearchingBitmap(700,700);
FillMem;
DeclarePlayers;
ScriptID := '540';
if SRLID = '' then
Writeln('Please sign up for the SRL Stats!');
CHandle := GetClientCanvas.Handle;
For Num := 0 to HowManyPlayers - 1 do
Players[Num].Loc := 'Bank';
if LoggedIn then Logout;
CurrentPlayer := StartPlayer;
LoginPlayer;
Repeat
Wait(Random(500));
until not IsLoading;
if not MyGetLevels then
NextPlayer(false);
MakeCompass('n');
For Num := 1 to 2 do
begin;
KeyDown(Vk_Up);
Wait(2500 + Random(250));
KeyUp(Vk_Up);
end;
SetRun(True);
SetRun(True);
GameTabFKeys(4);
end;
Function PlayerCount : integer;
var
I : integer;
Begin;
Result := 0;
For I := 0 to HowManyPlayers - 1 do
if Players[I].Active then
Inc(Result);
end;
Function CountDTMInvetory(DTM : Integer) : Integer;
var
I,x,y : integer;
Box : TBox;
begin;
Result := 0;
For I := 1 to 28 do
begin;
Box := InvBox(I);
if FindDTM(DTM,x,y,Box.x1,Box.y1,Box.x2,Box.y2) then
Inc(result);
end;
end;
Procedure Proggie_Yeah_Baby_Thats_Totally_True;
var
rate,sec:integer;
I : integer;
F : Char;
begin
Sec:= GetTimeRunning div 1000+1;
Rate:= 3600*TotalLoads/Sec;
WriteLn('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');
WriteLn('Nameless Smither by Raymond');
WriteLn('');
Writeln('Time running: ' + TimeRunning);
WriteLn('Total loads: '+inttostr(TotalLoads) + ' rate ' + inttostr(Rate) + ' loads/hr ');
WriteLn('Total bars: '+inttostr(TotalBars) + ' rate ' + inttostr(3600*TotalBars/Sec) + ' bars/hr ');
WriteLn('Active players : '+inttostr(PlayerCount));
WriteLn('Potential levels gained : ' + inttostr(TotalLevels));
Writeln('');
WriteLn('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');
WriteLn('');
For I := 0 to HowManyPlayers - 1 do
Begin;
if Players[I].Active = True then
F := 'T'
else
F := 'F';
Writeln(inttostr(I) + ') ' + Players[I].nick + ' - ' + F +
' - ' + Players[I].loc + ' - Time: ' + IntToStr(Players[I].Worked) + ' - Rand: ' + Players[I].rand + ' - ' + inttostr(Players[I].Integers[0])
+ ' Loads'+ ' - Smithing lvl : ' + IntToStr(Players[I].Level[16]));
End;
WriteLn('');
WriteLn('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');
SRLRandomsReport;
end;
Procedure AntiBored;
var
x, y : integer;
begin;
Case Random(5) of
0,3 : Begin;
if Random(2) = 0 then
GameTab(Random(15) + 1)
else
GameTabFKeys(Random(15) + 1);
Wait(Round( 6.0469*6.0469*6.0469*6.0469) + Random(Round( 6.0469*6.0469*6.0469*6.0469)));
if Random(2) = 0 then
GameTab(4)
else
GameTabFKeys(4);
end;
1,4 : begin;
RandomRClick;
Wait(Random(500));
FTWait(random(4));
GetMousePos(x,y);
MMouse(x+50+Random(100),Y+45+Random(100),20,20);
GetMousePos(x,y);
MMouse(x-random(100),Y-Random(100),20,20);
end;
2: HoverSkill('smithing', false);
end;
end;
Function SmithLoop : boolean;
var
Count,TempCount,StartCount : Integer;
x,y,xx,yy,Timer,LastClick,TotalTimer : integer;
Item,Option : String;
GoDown : Boolean;
SmithingSets : Boolean;
CurrentPart,Fails : Integer;
begin;
TotalTimer := GetSystemTime;
Players[CurrentPlayer].Loc := 'Anvils';
SmithingSets := (SmithSets And (CountDTMInvetory(GlobalBar) >= 26) And (BestItem(Players[CurrentPlayer].level[16],CurrentBar) ='platebody'));
if CustomItem <> '' then
Option := 'All'
else
if SmithingSets then
begin;
CurrentPart := 3;
Option := 'Make X';
end else
Option := 'All';
Fails := 0;
Repeat
if Fails > 5 then Exit;
if not LoggedIn then exit;
if FindDTM(GlobalBar,x,y, MIX1,MIY1,MIX2,MIY2) then
begin;
if not FindColor(xx,yy,clwhite,x - 43,y - 43,x + 43, y + 43) then
Mouse(x,y,5,5,true);
if FindAnvil then
begin;
Timer := GetSystemTime;
Repeat
Wait(Random(250) + 100);
FindTalk;
until SmithingScreen or ((GetSystemTime - Timer) > 10000)
if SmithingScreen then
begin;
Count := CountDTMInvetory(Globalbar);
if Count > 0 then
begin;
if (CustomItem <> '') and (GetItemBars(CustomItem) <= Count) then
Item := CustomItem
else
if SmithingSets then
begin;
Item := SetParts[CurrentPart];
Dec(CurrentPart);
if CurrentPart < 0 then
begin;
SmithingSets := False;
Option := 'All';
end;
end else
Item := BestItemAmount(Players[CurrentPlayer].Level[16],Count, CurrentBar);
Writeln(Item);
GetItem(Item,x,y,GoDown);
if GoDown then
While FindColor(xx,yy,1646629,492, 290,503, 303)=True do
begin;
Mouse(499, 285,5,5,True);
Wait(500 + Random(500));
end;
Mouse(x,y,5,5,False);
Wait(250 + Random(150));
if ChooseOption(Option) then
Begin;
Timer := GetSystemTime;
Lastclick := GetSystemTime + RandomRandom(15000);
if SmithingSets then
begin;
While FindColor(xx,yy,8388608,213, 412,292, 454) = False do
begin;
Wait(50+random(50));
if GetSystemTime - Timer > 5000 then Break;
end;
TypeSend('2');
Timer := GetSystemTime;
end;
Result := True;
StartCount := Count;
Repeat
FindNormalRandoms;
Wait(250 + random(250));
FindTalk;
if (LastClick - GetSystemTime) > 15000 then
begin;
AntiBored;
Lastclick := GetSystemTime + RandomRandom(15000);
end;
TempCount := CountDTMInvetory(Globalbar);
if TempCount <> Count then
begin;
Count := TempCount;
Timer := GetSystemTime;
end;
FindNormalRandoms;
if ClickContinueRay then
begin;
Inc(TotalLevels);
FindNormalRandoms;
While ClickContinueRay = True do
Wait(1000 + Random(760));
Break;
end;
until (Count < 1) or ((GetSystemTime - Timer) > 3500)
StartCount := (StartCount - Count) div GetItemBars(Item);
Case Item of
'platebody' : ReportVars[2] := ReportVars[2] + StartCount;
'platelegs' : ReportVars[3] := ReportVars[3] + StartCount;
'kiteshield': ReportVars[4] := ReportVars[4] + StartCount;
'full helm' : ReportVars[5] := ReportVars[5] + StartCount;
'axe' : ReportVars[6] := ReportVars[6] + StartCount;
end;
end;
end else
Exit;
end;
end else
Inc(Fails);
end;
until (Not FindDTM(GlobalBar,x,y,MIX1,MIY1,MIX2,MIY2)) or ((GetsystemTime - TotalTimer) > 350000)
end;
Procedure Mainloop;
var
PlayerTrue : Boolean;
Bars : Array of String;
CurrLoads,LoadsNow,Num : integer;
Arr : Array of Integer;
begin;
Bars := MaxBars(99);
Repeat
CurrLoads := Loads + Random(2);
LoadsNow := 0;
PlayerTrue := False;
FindNormalRandoms;
Players[CurrentPlayer].Loc := 'Bank';
Proggie_Yeah_Baby_Thats_Totally_True;
if OpenVWBank then
if HammerCheckBank then
Repeat
PlayerTrue := False;
Arr := GetBarDTMArray(Players[CurrentPlayer].level[16]);
if OpenVWBank then
if WithDrawDTM(Arr, Num) then
begin;
CurrentBar := Bars[Num];
Num := CountDTMInvetory(GlobalBar)
TotalBars := TotalBars + Num;
ReportVars[1] := ReportVars[1] + Num;
if VWBToAnvil then
if SmithLoop then
if AnvilToVWB then
if MyGetLevels then
if OpenVWBank then
if DepositExceptDTMs([Hammer]) then
begin;
Players[CurrentPlayer].loc := 'Bank';
PlayerTrue := True;
Inc(LoadsNow);
Inc(TotalLoads);
ReportVars[0] := ReportVars[0] + 1;
end;
end;
Proggie_Yeah_Baby_Thats_Totally_True;
until (Currloads = LoadsNow) or Not PlayerTrue;
Players[CurrentPlayer].Integers[0] := Players[CurrentPlayer].Integers[0] + LoadsNow;
CloseBank;
NextPlayer(PlayerTrue);
Repeat
Wait(Random(500));
until not IsLoading;
MakeCompass('n');
SetRun(True);
MyGetLevels;
until PlayerCount < 1;
end;
begin
Setupscript;
Mainloop;
end.
Lags like hell at my old computer, so I just smith legit.
Smithing 43 atm, and 3k bars to go. I'll end up 50 smithing if I smith them all, according to tip.it