mastaraymond
2007-12-22 13:43:12
[LEFT]Im 'proud' to present my first RS script :D.
To run this script, you need to install my plugin..
I included it as attachment. You need to place it the Plugins folder : ScarPath \ Plugins.
The code is made out of various technique's, it might be worth looking at when your bored.
The walking, (Yeah there almost isn't any walking), sometimes screws up.. I hope I fixed it, otherwise I'll rewrite it..
It also includes an function called "SmithSets" when you set this to True. It will smith 2 sets a load.. So for example, if it picks bronze bars. It will make 2 sets (Kite, Legs, Plate and Full helm) And as last item an Axe.. If you set this to false, it will smith Plate's (or the highest part you can smith) and if it has got bars over, it will smith an full helm..
It takes the bars out of the bank with the lowest level.. So it starts searching for Bronze, then Iron etc…
It will not try to make things you can't handle yet ;).
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) Fill in your SRLId & Password.. If you dont have then make an account @ SRL Stats ^^
6) 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 numberPost feedback?
~Raymond
And for those who care, a list of procedures in my plugin.. (Please notice some are test functions and therefore aren't working).
Function RemoveTPADistEachother(Dist : Integer; TPA : TPointArray) : TPointArray;
Function FindRocksOld(PointsDist,BoxDist,LastBoxDist : Integer;var Points : TPointArray) : Boolean;
Function FindColorsRay(var Points : TPointArray;const Color,RTol,GTol,BTol: integer; xs, ys : integer; const xe, ye : Integer;const DC : LongWord) : Integer;
Function GetHBitmap(CanvasHandle : LongWord) : LongWord;
Procedure ChangeSize(Width,Height : integer);
Procedure FreeSearchingBitmap;
Procedure CreateSearchingBitmap(Width,Height : Integer);
Procedure RGBToHSLRay(R,G,B : integer;var H,S,L : double);
Procedure CreateSearchingBitmap(Width,Height : Integer);
Function FindColorsHSL(var Points : TPointArray;Color, xs, ys, xe, ye : Integer;HTol,STol,LTol : Double;const DC : LongWord) : Integer;
Function SortColors( Colors : TIntegerArray): TIntegerArray;
Procedure SortColorsSaveCounts(var Colors,Counts: TintegerArray);
Function SortTPAMiddles ( w,h : integer; TPA : TPointArray) : TPointArray;
Function SortTPAToATPA (w,h : integer; TPA : TPointArray) : TPointArrayArray;
Function BoxTPAToATPA(w,h : integer; Points : TPointArray) : TpointArrayArray;
Function GetTPABounds(TPA: TPointArray): TBox;
Function FloodFillTPA(TPA : TPointArray) : TPointArrayArray;
Function FloodFillTPADistance(Dist : Integer; TPA : TPointArray) : TPointArrayArray;
Function FindCommonPoint(ArrayTPA : TPointArrayArray) : TPointArray;
Function FindColorsXYZ(var Points : TPointArray;Color, xs, ys, xe, ye : Integer;XTol,YTol,ZTol : Double;const DC : LongWord) : Integer;
Procedure RGBToXYZRay(R,G,B : integer;var x,y,z : double);
Procedure XYZToRGBRay(X,Y,Z : Double;var R,G,B: integer);
function LargestTPAInATPA(ATPA: TPointArrayArray): Integer;
Function RemoveTPASameRange(Dist : Integer; TPA : TPointArray) : TPointArray;
Function FindTPAEdgePoints ( MaxW,MaxH : integer; TPA : TPointArray): TPointArray;
Procedure RGBToCMYKRay(R,G,B : integer;var C,M,Y,K : Double);
Function FindColorsCMYK(var Points : TPointArray;Color, xs, ys, xe, ye : Integer;CTol,MTol,YTol,KTol : Double;const DC : LongWord) : Integer;
Function SortTPABoxes( Boxes : TBoxArray; TPA: TPointArray) : TPointArrayArray;
Function SortTPADistance(x,y : integer; TPA : TPointArray) : TPointArray;
Function FindColorsRGB(var Points : TPointArray;const Color,RTol,GTol,BTol: integer; xs, ys : integer; const xe, ye : Integer;const DC : LongWord) : Integer;
function CenterTPA(TPA: TPointArray): TPoint;
function CenterBounds(Arr: TpointArray):Tpoint;
function MiddlePT(P1, P2: TPoint): TPoint;
Function MergeATPA(ATPA : TPointArrayArray): TPointArray;
Function AbsoluteInt ( SomeNumber : integer) : integer;
Function ColorToRGBASM( Color : integer;var R,G,B : integer):integer;
Function FindColorsHSLInt(var Points : TPointArray;Color, xs, ys, xe, ye : Integer;HTol,STol,LTol : Double;const DC : LongWord) : Integer;
Procedure CleanATPA(MinLength,MaxLength : Integer; var ATPA : TPointArrayArray);
function SortATPADistFirstPoint(x,y : integer ; ATPA : TPointArrayArray) : TPointArrayArray;
Procedure CenterTPAEx(var x,y : integer; tpa : TPointArray);
Function SortTPAToATPADist(Dist : Integer; TPA :TPointArray) : TPointArrayArray;
Function FindTPAinTPA(SearchTPA, TotalTPA : TPointArray; var Matches : TPointArray) : Boolean;
Function GayBounds(Points: TPointArray): TBox;
Function FindGapsTPA( TPA : TPointArray; MinPixels : Integer) :TpointArrayArray;
Procedure EditToBounds( var TPA : TPointArray);
Function FindMaskTolRay(xs,ys : integer; const xe,ye,Tol,ContourTol : integer;Const BackgroundAllColors : Boolean; Const Mask : TMaskRay; Const ClientDC : HDC; var mx,my : integer) : Boolean;
Function CreateMaskFromBMP( BmpDC : HDC) :TMaskRay;
Procedure RadixSort(Integers : TIntegerArray; Digits : Integer; Negative : Boolean);
procedure QuickSort(var arr: TIntegerArray; s, e: integer);
Procedure RandomArray(var Ints : TIntegerArray; MinRandom,PlusRandom : Integer; Len : Integer);[/LEFT]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Nameless Smither by Raymond
Time running: 5 Hours, 8 Minutes and 41 Seconds
Total loads: 253 rate 49 loads/hr
Total bars: 6822 rate 1325 bars/hr
Active players : 10
Potential levels gained : 38
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0) - T - Bank - Time: 24 - Rand: - 21 Loads - Smithing lvl : 40
1) - T - Bank - Time: 23 - Rand: - 22 Loads - Smithing lvl : 36
2) - T - Bank - Time: 22 - Rand: - 21 Loads - Smithing lvl : 36
3) - T - Bank - Time: 25 - Rand: - 23 Loads - Smithing lvl : 34
4) - T - Bank - Time: 31 - Rand: - 29 Loads - Smithing lvl : 38
5) - T - Bank - Time: 30 - Rand: - 29 Loads - Smithing lvl : 35
6) - F - Bank - Time: 9 - Rand: Oh Dear You Are in Lumby - 9 Loads - Smithing lvl : 33
7) - T - Bank - Time: 28 - Rand: - 26 Loads - Smithing lvl : 34
8) - T - Bank - Time: 29 - Rand: - 28 Loads - Smithing lvl : 36
9) - T - Bank - Time: 22 - Rand: - 21 Loads - Smithing lvl : 34
10) - T - Bank - Time: 25 - Rand: - 23 Loads - Smithing lvl : 33
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~