SRL Archive - Archive

serajin - SRL Member Application


serajin

2013-03-29 21:20:37

How Long have You Played Runescape?
5 Year(s)


Are you affilated in anyway with Jagex LTD?
No

Were you Referred to SRL?



What is your general programming knowledge?
C, C++, C#, Visual Basic


Are you a member of any other communities?
I am not.


Tell us about yourself…
From: serajin
I'm 23 years old. I went to school and majored in Computer Animation. I took an interest in programming and took some courses at the local college. I did coding on a private RunUO Server for Ultima Online a few years ago, as well as a few pet projects and programs for myself. I enjoy playing games with my friends, currently League of Legends and Runescape, and spending time with my Fiance.



Please show us one (or multiple) of your scripts.
Currently my only 100% finished and
flawless script is my SenjuGoldSmith, which Smelts
and crafts gold ore into Gold Bracelets in Edgeville.
The longest I have run the script for is 45 hours
before my computer ran out of memory. I have
other scripts that are incomplete, as they ended
up being small pieces of other scripts, or general
tests. Including item finders, combat locators,
and a pottery crafter. Below is my Goldsmither.

I believe I gave everyone credit where credit was due. There are a few
functions that I did not write, but did modify several from other authors.
I included their names next to the function as best as I could.


program SenjuGoldSmelter;

{$Define Smart8}
{$I SRL/SRL.Simba}
{$I SRL/SRL/Misc/Debug.Simba}
{$I SRL/SRL/Misc/SmartGraphics.Simba}

Const
Debug = False;
Timeouts = True;

{Break Settings} // From Ashman
TakeBreaks = True; // ***Do you want to take breaks?***
BreakIn = 300; // ***How long before we take a break? (minutes)***
BreakFor = 15; // ***How long will we break for? (minutes)***
Bir = 15; // ***Random minutes to add/subtract from how long until we break***
Bfr = 7; // ***Random minutes to add/subjtract from break duraction***

Var
StartTime: Int64;
StartingEXP: Integer;
EdgeBankDTM, EdgeFurnaceDTM, GoldOreDTM, GoldBarDTM, GoldBarDTM2, GoldBarMenuDTM, GoldBraceletMenuDTM: Integer; // DTMs
BreakInLocal,BreakForRandom,BreakForLocal, BreakInRandom,RealBTime,CurrentBTime,BreakRounds,TotalBreaks,Timeout,Timeout2: Integer; //Break Variables
Timer, Timer2: Integer;
afound: Extended;
x, y: Integer;
OreAvailable: Integer;
TPA: TPointArray;
GoldBarsCrafted, GoldBraceletsCrafted: Integer;

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name := '';
Pass := '';
Pin := '';
Nick := '';
//WorldInfo := [50] //Set this if you want a specific world.
Active := True;
end;
end;

{*******************************************************************************

All of these mouse movements and typing are credited to benland100 and flight.
thanks to Ashaman88 for his awesome scripts, i used his as a template

*******************************************************************************}

//By Bandland100, modified by Ashaman88 to shift mouse speeds after every step//

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);
wait(W);
lastdist:= dist;
end;

if (Round(xe) <> Round(xs)) or (Round(ye) <> Round(ys)) then
MoveMouse(Round(xe), Round(ye));

MouseSpeed := MSP;
end;

procedure HumanMMouse(eX, eY, ranX, ranY: Integer);
var
randSpeed: extended;
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;
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);
MouseSpeed := j;
end;

procedure HumanMouseBox(X1, Y1, X2, Y2: Integer);
var
FX, FY: Integer;
begin
GaussBox(FX,FY,X1,Y1,X2,Y2);
HumanMMouse(FX,FY,0,0)
end;

procedure LeftClickSpot(X1, Y1, X2, Y2: Integer); //From DannyRS
var
Y1NOBanner, Y2NOBanner: Integer;
begin
Y1NOBanner:= Y1 - 50;
Y2NOBanner:= Y2 - 50;
HumanMMouse(RandomRange(X1, X2), RandomRange(Y1NOBanner, Y2NOBanner), 0, 0);
ClickMouse2(True);
end;

procedure PickOptionNumber(ToDo,XSize: Integer); //From DannyRS
var
X, Y, YAddValue, CPX, CPY: Integer;
Begin
GetMousePos(X, Y);
YAddValue:= Y + 21;
CPX:= X;
CPY:= YAddValue + (ToDo * 16);
Wait(RandomRange(100, 250));
LeftClickSpot(CPX - XSize, CPY + 51, CPX + XSize, CPY + 49 + 15);
End;

function GetMMPoints(x, y, color, width, height, tolerance: Integer; huem,
satm: Extended): TpointArray;
var
TPA: TpointArray; ATPA: T2DpointArray; l, i, p, CTS: Integer;
begin
CTS:= GetColorToleranceSpeed;
ColorToleranceSpeed(2);

SetColorspeed2Modifiers(huem, satm);

FindColorsSpiralTolerance(x, y, TPA, color, MMx1, MMy1, MMx2, MMy2, tolerance);

ColorToleranceSpeed(CTS);
ATPA:= TPAtoATPAEx(TPA, width, height);
for i:= 0 to High(ATPA) do
if Length(ATPA) > 5 then
begin
l:= getarraylength(Result);
SetArrayLength(Result, l + 1);
Result[l]:= MiddleTpa(ATPA[i]);
end;

if Length(result) = 0 then Exit;
for i:= 0 to High(Result) do
if rs_OnMiniMap(result[i].x, result[i].y) then Inc(p);
if p = 0 then SetArrayLength(Result, 0);

If Debug Then
WriteLn('Found: ' + IntToStr(l) + ' Result(s)');
end;

function GetMSPoints(x, y, color, width, height, tolerance: Integer; huem,
satm: Extended): TpointArray;
var
TPA: TpointArray; ATPA: T2DpointArray; l, i, p, CTS: Integer;
begin
CTS:= GetColorToleranceSpeed;
ColorToleranceSpeed(2);

SetColorspeed2Modifiers(huem, satm);

FindColorsSpiralTolerance(x, y, TPA, color, MSx1, MSy1, MSx2, MSy2, tolerance);

ColorToleranceSpeed(CTS);
ATPA:= TPAtoATPAEx(TPA, width, height);
for i:= 0 to High(ATPA) do
if Length(ATPA) > 5 then
begin
l:= getarraylength(Result);
SetArrayLength(Result, l + 1);
Result[l]:= MiddleTpa(ATPA[i]);
end;

if Length(result) = 0 then Exit;
for i:= 0 to High(Result) do
if not rs_OnMiniMap(result[i].x, result[i].y) then Inc(p);
if p = 0 then SetArrayLength(Result, 0);

If Debug Then
WriteLn('Found: ' + IntToStr(l) + ' Result(s)');
end;

procedure FilterTPADistTPA(var TPA1: TPointArray; const MinDist,
MaxDist: Extended; TPA2: TPointArray);
var
c, i, j, h, hh: integer;
d: extended;
mind, maxd: extended;
begin
h:= high(TPA1);
hh:= high(TPA2);
c:= 0;
mind:= sqr(MinDist);
maxd:= sqr(MaxDist);
for i:= 0 to h do
for j:= 0 to hh do
begin
d:= sqr(TPA1[i].x - TPA2[j].x) + sqr(TPA1[i].y - TPA2[j].y);
if (d >= mind) and (d <= maxd) then
begin
TPA1[c]:= TPA1[i];
inc(c);
break;
end;
end;
setlength(TPA1, c);
end;

procedure OffMM(RedTu, LeWait, rWait: Integer); // By Le Jingle, From Ashman Script
var
W, H, RX, RY, T, RT, X, Y: Integer;
begin
GetMousePos(X, Y);
if (X > 0) and (Y > 0) then
begin
GetClientDimensions(W, H);
H:= H + 50;
RX:= RandomRange(0, W);
RY:= RandomRange(0, H);
case (RedTu) of
0..1: HumanMMouse(W / 2, RandomRange(-110, -60), RX, 0);
2: HumanMMouse(RandomRange(-50, -10), H / 2, 0, RY);
3: HumanMMouse(W / 2, h + RandomRange(10, 50), RX, 0);
4: HumanMMouse(W + RandomRange(10,50), H / 2, 0, RY);
end;
RT:= (Random(rWait));
MarkTime(T);
repeat
Wait(Random(200));
until TimeFromMark(T) > (LeWait + RT);
end;
end;

function WaitLoggedIn(Time: Integer): Boolean;
var
T: Integer;
begin
Result:= (GetColor(472, 490) = 16777215);
if Result then
Exit;
MarkTime(T);

repeat
Wait(Random(100));
SRL_ResetNavBar;
if TimeFromMark(T) > Time then
begin
Result:=False;
Exit;
end;
until (GetColor(472, 490) = 16777215);

Result:= True;
end;

function IsWorking: Boolean;
begin
if ((CountColorTolerance(855309, 97, 77, 421, 165, 25)) > 6000) then
Result:= True;
end;

function Antiban: Boolean; // AntiBan From Ashman - Modified
var
r: Integer;
begin
r := Random(5000);
case r of
1..5:
begin
if Debug then
WriteLn('Random Movement');
RandomMovement;
end;
6..30:
begin
if Debug then
WriteLn('Checking Crafting Level');
HoverSkill('Crafting', False);
GameTab(Tab_Inv);
end;
35..60:
begin
if Debug then
WriteLn('Checking Smithing level');
HoverSkill('Smithing', False);
GameTab(Tab_Inv);
end;
100..200:
begin
if Debug then
WriteLn('Picking Up Mouse');
PickUpMouse;
end;
500..600:
begin
if Debug then
WriteLn('Sleep And Move Mouse');
SleepAndMoveMouse(RandomRange(400,500));
Result:=True;
end;
700..800:
begin
if Debug then
WriteLn('Going Off the Screen');
Wait(RandomRange(1250, 1500));
OffMM(Random(4),RandomRange(2500,4000),2000);
Result:=True;
end;
end;
end;

function FindForgeMM: Boolean;
var
TPA, TPA2: TPointArray;
ATPA: array of TPointArray;
a, x, y: integer;
begin

TPA:= GetMMPoints(x, y, 1599977, 0, 0, 0, 0.00, 0.00); //Furnace Symbol 2
TPA2:= GetMMPoints(x, y, 3030615, 0, 0, 0, 0.00, 0.00); //Furnace Symbol 3

FilterTPADistTPA(TPA, 0, 5, TPA2);
SplitTPAWrap(TPA, 50, ATPA);

if Debug then
for a:= 0 to high(ATPA) do
SMART_DrawCircle(True, MiddleTPA(ATPA[a]), 10, False, clred);

if GetArrayLength(ATPA) > 0 then
begin
HumanMMouse(MiddleTPA(ATPA[0]).x, MiddleTPA(ATPA[0]).y, 5, 5);
ClickMouse2(true);
wait(RandomRange(500, 700));
while (IsMoving) do (Wait(1));
Result:= true;
Exit;
end;

Result:= false;
end;

function FindBankMM: Boolean;
var
TPA: TPointArray;
ATPA: array of TPointArray;
a, x, y: integer;
begin
TPA:= GetMMPoints(x, y, 7198185, 0, 0, 14, 0.05, 0.49); //Furnace Symbol 2

SplitTPAWrap(TPA, 50, ATPA);

if Debug then
for a:= 0 to high(ATPA) do
SMART_DrawCircle(True, MiddleTPA(ATPA[a]), 10, False, clred);

if GetArrayLength(ATPA) > 0 then
begin
HumanMMouse(MiddleTPA(ATPA[0]).x, MiddleTPA(ATPA[0]).y, 5, 5);
ClickMouse2(true);
FFlag(0);
while (IsMoving) do (Wait(1));
Result:= true;
Exit;
end;

Result:= false;
end;

function CheckStuff: Boolean; // Modified from Ashman
begin
Result:= False;

if not WaitLoggedIn(1000) then
begin
SmartSetEnabled(False);
SmartSetEnabled(True);
if not WaitLoggedIn(1000) then
begin
LoginPlayer;
Wait(RandomRange(4000, 6000));
ClickNorth(SRL_ANGLE_HIGH);
FindNormalRandoms;
Result:= True;
end;
end;

if TimeFromMark(Timer) > 120000 then
begin
Writeln('Nothing has happened for too long, resetting focus.');
SmartSetEnabled(False);
SmartSetEnabled(True);
MarkTime(Timer);
ClickNorth(SRL_ANGLE_HIGH);
FindNormalRandoms;
end;

if Timeouts then
if TimeFromMark(Timer2)>300000 then
begin
Writeln('Nothing has happened for too long, shutting down.');
Logout;
TerminateScript;
end;

if FindSpinTicket or ExitSquealOfFortune then
if not WaitLoggedIn(1000) then
TerminateScript else
begin
ClickNorth(SRL_ANGLE_HIGH);
if Debug then
Writeln('Found squeal stuff');
Result:=True;
end;
end;

procedure CheckCraftBar;
Var
TPA: TPointArray;
x, y: Integer;
Begin
CheckStuff;

if FindDTM(GoldBarMenuDTM, x, y, 240, 55, 285, 85) then
begin
if Debug then
WriteLn('Already On The Item');
Exit;
end else
begin
TPA:= GetMSPoints(MSCX, MSCY, 6533359, 0, 0, 0, 0.00, 0.00); //MenuText Color
if not FindTextTPAEx(6533359, 0, 15, 40, 215, 60, x, y, 'Gold', UpChars, Nothing) then
begin
if Debug then
WriteLn('Not on the menu, going to the menu');
HumanMouseBox(15, 40, 215, 60);
ClickMouse2(true);
Wait(RandomRange(100, 200));
if Debug then
WriteLn(FindTextTPAEx(6533359, 0, 15, 65, 215, 175, x, y, 'Smelt', UpChars, Nothing));
HumanMMouse(x, y, 20, 2);
ClickMouse2(true);
Wait(RandomRange(1000, 1200));
end;

if FindDTM(GoldBarMenuDTM, x, y, 240, 55, 285, 85) then
begin
if Debug then
WriteLn('Already on the item, waiting for smelt');
Exit;
end else
if FindDTM(GoldBarMenuDTM, x, y, 23, 80, 222, 300) then
begin
if Debug then
WriteLn('Found the bar in the menu');
HumanMMouse(x, y, 5, 5);
ClickMouse2(true);
Exit;
end else
if not FindDTM(GoldBarMenuDTM, x, y, 23, 80, 222, 300) then
begin
if Debug then
WriteLn('Maybe mouse was covering it, trying again');
HumanMMouse(350, 180, 100, 100);
Wait(RandomRange(500, 1000));
FindDTM(GoldBarMenuDTM, x, y, 23, 80, 222, 300);
HumanMMouse(x, y, 5, 5);
ClickMouse2(true);
Exit;
end;
Wait(RandomRange(500, 1000));
end;
end;

procedure CheckCraftBracelet;
var
TPA: TPointArray;
x, y: Integer;
begin
CheckStuff;

if FindDTM(GoldBraceletMenuDTM, x, y, 240, 55, 285, 85) then
begin
if Debug then
WriteLn('Already On The Item');
Exit;
end else
begin
if Debug then
WriteLn('Not on the item, going to the menu');
TPA:= GetMSPoints(MSCX, MSCY, 6533359, 0, 0, 0, 0.00, 0.00); //MenuText Color
if not FindTextTPAEx(6533359, 0, 15, 40, 215, 60, x, y, 'Gold', UpChars, Nothing) then
begin
HumanMouseBox(15, 40, 215, 60);
ClickMouse2(true);
Wait(RandomRange(100, 200));
if Debug then
WriteLn(FindTextTPAEx(6533359, 0, 15, 65, 215, 175, x, y, 'Gold', UpChars, Nothing));
HumanMMouse(x, y, 20, 2);
ClickMouse2(true);
Wait(RandomRange(1000, 1200));
end;
HumanMouseBox(228, 85, 231, 145);
ClickMouse2(True);

if FindDTM(GoldBraceletMenuDTM, x, y, 240, 55, 285, 85) then
begin
if Debug then
WriteLn('Already on the item, waiting for craft');
Exit;
end else
if FindDTM(GoldBraceletMenuDTM, x, y, 23, 80, 222, 300) then
begin
if Debug then
WriteLn('Found the bar in the menu');
HumanMMouse(x, y, 5, 5);
ClickMouse2(true);
Exit;
end else
if not FindDTM(GoldBraceletMenuDTM, x, y, 23, 80, 222, 300) then
begin
if Debug then
WriteLn('Maybe mouse was covering it, trying again');
HumanMMouse(350, 180, 100, 100);
Wait(RandomRange(500, 1000));
if FindDTM(GoldBraceletMenuDTM, x, y, 23, 80, 222, 300) then
begin
HumanMMouse(x, y, 5, 5);
ClickMouse2(true);
Exit;
end else
begin
if Debug then
WriteLn('Couldnt find the item');
Exit;
end;
end;
Wait(RandomRange(500, 1000));
end;
end;

procedure CraftButton;
var
TPA: TPointArray;
TimeTimer: Integer;
begin
MarkTime(TimeTimer);
TPA:= GetMSPoints(MSCX, MSCY, 7755272, 20, 20, 13, 0.03, 0.49);
FilterPointsDist(TPA, 0, 100, 365, 315);

if Debug then
SMART_DrawDotsEx(True, TPA, clWhite);

if Length(TPA) > 0 then
begin
HumanMMouse(MiddleTPA(TPA).x, MiddleTPA(TPA).y, 5, 2);
Wait(RandomRange(200, 300));
ClickMouse2(true);
end;

repeat
Wait(RandomRange(1000, 1500));
AntiBan;
if TimeFromMark(TimeTimer) > 100000 then
Break;
until (IsWorking = False);
End;

procedure DTMLoad;
begin
EdgeBankDTM := DTMFromString('mrAAAAHic42BgYGAFYjUgVgBiNigfBliAWAaIdYFYHiqmCcVKULFAH3sG72IzBqVIITBOjvZleP+XE47/A9XIIWENND4jEDPhwTAAAHpLDRw=');
EdgeFurnaceDTM := DTMFromString('mlwAAAHicY2dgYDABYh0g5gZieSA2BWIlBgiQhtJcQGwExK5A7ATEQkD84cF9hsAALzA2ThBmaOudxuBTYMygHMbP8B8oL4eENZDYjEiYCQ1DAQDhRgvs');
GoldBarDTM := DTMFromString('mwQAAAHic42RgYGBnZmDgBGJBIBYDYj4gZgXiP0wMDD+BmAHIdgLS/kDsDsR2QGwFxc5A7AXEvkC8tFkcqJgJL2ZlIAwYicBwAAB12gY1');
GoldBarDTM2 := DTMFromString('mlwAAAHicY2dgYHBiYmCwB2J3IHYFYmcgDgRiEyB+AJR/BsSPgfgWEH8A4odA/AKIFzWIMcR48jJcWi4L5DGhYBEgCcOsaJgRD4YCAN+0DAY=');
GoldBarMenuDTM := DTMFromString('mlwAAAHicY2dgYOACYhYGCACxJYFYDIh5oeLCQMwJlWcFYh4gFgXiJU3iQJIRTMPYMMwPJHFhRjwYCgCaogTN');
GoldOreDTM := DTMFromString('mAAEAAHic42FgYPgKxIyMDAz/gfRPIP4MxG+B+BUQPwHil0D8B4g/APEnIJ4HxHOAeBEQLwXi1UC8AsqeD8WLgXg5EM8G4i39kkCSCSeOcDNkWNMpAaYnlYgycDHgB5JomJFEjAwAkOoX9w==');
GoldBraceletMenuDTM := DTMFromString('mlwAAAHicY2dgYOgF4j4gngrE06HsFiDuBOKJQDwfimdC5SZC2fcOyANJRjjurhBmmNEsynBpqxyDEVAEF2bEg6EAAMG1Dxo=');
end;

procedure DTMFree;
begin
FreeDTM(EdgeBankDTM);
FreeDTM(EdgeFurnaceDTM);
FreeDTM(GoldBarDTM);
FreeDTM(GoldBarDTM2);
FreeDTM(GoldOreDTM);
FreeDTM(GoldBarMenuDTM);
FreeDTM(GoldBraceletMenuDTM);
end;

procedure Setup;
begin
ClearDebug;
Smart_ClearCanvas;

if Debug then
WriteLn('Begin Setup');

{$IFDEF SIMBAMAJOR980}
SMART_SERVER := 10;
SMART_MEMBERS := TRUE;
SMART_SIGNED := TRUE;
SMART_SUPERDETAIL := FALSE;
SRL_SIXHOURFIX := TRUE;
{$ELSE}
SRL_SIXHOURFIX := TRUE;
SMART_FIXSPEED := TRUE;
{$ENDIF}

SetupSRL;

BreakInLocal := (BreakIn * 60000);
BreakForLocal := (BreakFor * 60000);
BreakInRandom := RandomRange(-BIR * 60000, BIR * 60000);
BreakForRandom := RandomRange(-BFR * 60000, BFR * 60000);

OreAvailable := 0;

GoldBarsCrafted := 0;
GoldBraceletsCrafted := 0;

DeclarePlayers;
DTMLoad;
LoginPlayer;
Wait(RandomRange(100,500));

if Debug then
Writeln('Logged into a world');

CloseAllScreens;

ClickNorth(SRL_ANGLE_HIGH);
ToggleMoneyPouch(False);
ToggleXPBar(False);
StartingEXP := GetXPBarTotal;
FindNormalRandoms;

StartTime := GetSystemTime;

if Debug then
WriteLn('End Setup');

MarkTime(Timer);
MarkTime(Timer2);

end;

function RunEdgeBank: Boolean;
var
x, y, i: integer;
TPA: TPointArray;
ATPA: array of TPointArray;
begin
if Debug then
WriteLn('Running to Bank');
Result:= False;

TPA:= GetMSPoints(MSCX, MSCY, 3219493, 3, 3, 15, 0.26, 0.91); //Banker

SplitTPAWrap(TPA, 10, ATPA);

if Debug then
for i:= 0 to high(ATPA) do
SMART_DrawCircle(True, MiddleTPA(ATPA[i]), 5, False, clPurple);

if GetArrayLength(ATPA) > 0 then
for i:= 0 to High(ATPA) do
if Length(ATPA[i]) > 7 then
begin
Result:= True;
Exit;
end;

if BankScreen then
begin
Result:= True;
Exit;
end;

for i:= 0 to 2 do
begin
if FindDTMRotated(EdgeBankDTM, x, y, MMX1, MMY1, MMX2, MMY2, -Pi, Pi, Pi/30, afound) then
begin
HumanMMouse(x, y, 2, 2);
ClickMouse2(True);
FFlag(10);
Result:= True;
while (IsMoving) do (Wait(1));
Exit;
end else
begin
if FindBankMM then
begin
Result:= True;
Exit;
end;
end;
end;

if Debug then
WriteLn('Failed to find bank, walking left, and searching again.');
HumanMMouse(590, 100, 5, 5);
ClickMouse2(true);

for i:= 0 to 2 do
begin
if FindDTMRotated(EdgeBankDTM, x, y, MMX1, MMY1, MMX2, MMY2, -Pi, Pi, Pi/30, afound)then
begin
HumanMMouse(x, y, 2, 2);
ClickMouse2(True);
FFlag(10);
Result:= True;
while (IsMoving) do (Wait(1));
Exit;
end else
begin
if FindBankMM then
begin
Result:= True;
Exit;
end else
begin

end;
end;
end;

if not FindBankMM then
begin
if Debug then
Writeln('Did not get to bank, logging in and out to reset map');
ExitToLobby;
Wait(RandomRange(2500,3500));

if Debug then
Writeln('Loging back in');

LoginPlayer;
Wait(RandomRange(2000,3000));
ClickNorth(SRL_ANGLE_HIGH);
FindNormalRandoms;
RunEdgeBank;
end;
end;

function OpenBanker: Boolean;
var
TPA: TPointArray;
ATPA: array of TPointArray;
i, a:Integer;
begin
Result:= False;

if Debug then
WriteLn('Attempting to Find Banker');

if BankScreen then
begin
Result:= True;
Exit;
end;

TPA:= GetMSPoints(MSCX, MSCY, 3219493, 3, 3, 15, 0.26, 0.91); //Banker

if Debug then
SMART_DrawDotsEx(True, TPA, ClYellow);

SplitTPAWrap(TPA,10,ATPA);

if Debug then
for a:= 0 to high(ATPA) do
SMART_DrawCircle(True, MiddleTPA(ATPA[a]), 5, False, clPurple);

if GetArrayLength(ATPA) > 0 then
for a:= 0 to High(ATPA) do
if Length(ATPA[a]) > 6 then
begin
HumanMMouse(MiddleTPA(ATPA[a]).x, MiddleTPA(ATPA[a]).y, 10, 5);
Wait(RandomRange(150, 250));
if IsUpText('to Ba') then
begin
ClickMouse2(false);
ChooseOption('ank Ba');
while (IsMoving) do (Wait(1));
if (PinScreen) then
InPin(Players[0].Pin);
Break;
end;
end;

Wait(RandomRange(500, 1000));

if BankScreen or PinScreen then
begin
FixBank;
Result:= True;
if Debug then
WriteLn('Opened Banker Using Standard Method');
MarkTime(Timer);
MarkTime(Timer2);
Exit;
end;
Wait(RandomRange(500, 1000));

if Debug then
WriteLn('Failed to open bank using standard method');

for i:=0 to 5 do
begin
if BankScreen then
begin
Result:= True;
MarkTime(Timer);
MarkTime(Timer2);
Exit;
end;

If Debug Then
WriteLn('Attempting to Find Banker Using Secondary Method');

if not OpenBankNPC() then
Result:= False;
end;

MarkTime(Timer);
MarkTime(Timer2);

end;

procedure Banking;
var
x, y: Integer;
BankSlot: TPoint;
begin
CheckStuff;

if (PinScreen) then
InPin(Players[0].Pin);

if BankScreen then
begin

if OreAvailable = 0 then
begin
FindDTM(GoldOreDTM, X, Y, MSX1, MSY1, MSX2, MSY2);
BankSlot:= Point(X, Y);
BankSlot:= MSTPointToBankPoint(BankSlot);
OreAvailable:= GetBankItemAmount(BankSlot.X, BankSlot.Y);
end;

if not InvEmpty then
begin
BankTab(1);
FixBank;
DepositAll;
Wait(RandomRange(200, 250));
FindDTM(GoldOreDTM, X, Y, MSX1, MSY1, MSX2, MSY2);
BankSlot:= Point(X, Y);
BankSlot:= MSTPointToBankPoint(BankSlot);
OreAvailable:= GetBankItemAmount(BankSlot.X, BankSlot.Y);
end;

FindDTM(GoldOreDTM, X, Y, MSX1, MSY1, MSX2, MSY2);
HumanMMouse(X, Y, 10, 10);
ClickMouse2(False);
Wait(RandomRange(150, 250));
PickOptionNumber(6, 78);
Wait(RandomRange(500, 1000));
end;

if InvEmpty then
Banking;

if OreAvailable < 29 then
begin
WriteLn('We are out of ore');
DTMFree;
TerminateScript;
end;

MarkTime(Timer);
MarkTime(Timer2);
end;

function RunToFurnace: Boolean;
var
TPA: TPointArray;
ATPA: Array of TPointArray;
x, y, a: integer;
begin
Result:= False;

if not(InvCount = 28)then
begin
Result:= False;
Exit;
end;

TPA:= GetMSPoints(MSCX, MSCY, 2110653, 3, 3, 20, 0.08, 0.38);
SplitTPAWrap(TPA, 10, ATPA);

if GetArrayLength(ATPA) > 0 then
for a:= 0 to High(ATPA) do
if Length(ATPA[a]) > 15 then
begin
Result:= True;
Exit;
end;

if Debug then
WriteLn('Running to Furnace');

if FindDTMRotated(EdgeFurnaceDTM, x, y, MMX1, MMY1, MMX2, MMY2, -Pi, Pi, Pi/30, aFound) then
begin
HumanMMouse(x, y, 2, 2);
ClickMouse2(True);
wait(randomrange(500, 7000));
FFlag(10);
while (IsMoving) do (Wait(1));

TPA:= GetMSPoints(MSCX, MSCY, 2110653, 3, 3, 20, 0.08, 0.38);
SplitTPAWrap(TPA, 10, ATPA);

if GetArrayLength(ATPA) > 0 then
for a:= 0 To High(ATPA) do
if Length(ATPA[a]) > 15 then
begin
Result:= True;
Exit;
end;
end else
begin
if FindForgeMM then
Result:= True;
Exit;
end;
end;

procedure FindFurnace;
var
TPA: TPointArray;
ATPA: array of TPointArray;
a: Integer;
begin
CheckStuff;

TPA:= GetMSPoints(MSCX, MSCY, 2110653, 3, 3, 13, 0.08, 0.38);
SplitTPAWrap(TPA, 10, ATPA);

if Debug then
for a:= 0 to High(ATPA) do
if Length(ATPA[a]) > 15 then
SMART_DrawCircle(False, MiddleTPA(ATPA[a]), 5, False, clWhite);

if GetArrayLength(ATPA) > 0 then
for a:= 0 To High(ATPA) Do
if Length(ATPA[a]) > 15 then
begin
HumanMMouse(MiddleTPA(ATPA[a]).x, MiddleTPA(ATPA[a]).y, 20, 20);
Wait(RandomRange(250, 350));
if IsUpText('lt Fu') then
begin
ClickMouse2(true);
wait(randomRange(100, 250));
FFlag(0);
while (IsMoving) do (Wait(1));
if Debug then
WriteLn('Done Walking to Furnace');
Wait(RandomRange(400, 500));
Break;
end;
end;

MarkTime(Timer);
MarkTime(Timer2);
end;

procedure ProgressReport;
var
TimeUntilBreak: Integer;
begin
TimeUntilBreak := (((BreakInLocal) + (BreakInRandom) + BreakRounds)-GetTimeRunning);

WriteLn('---------Senju Goldsmith v. 1.0---------');
WriteLn('Time elapsed: ' + TimeRunning);
WriteLn('Gold Ore Remaining In Bank: ' + IntToStr(OreAvailable));
WriteLn('');
WriteLn('Gold Bars Made: ' + IntToStr(GoldBarsCrafted));
WriteLn('Gold Bars/Hour: ' + IntToStr(Round((GoldBarsCrafted)*(3600.0 / (GetTimeRunning / 1000.0)))));
WriteLn('Smithing Experience Earned: ' + IntToStr(Round(GoldBarsCrafted*56.2)));
WriteLn('Smithing Experience/Hour: ' + IntToStr(Round((GoldBarsCrafted*56.2)*(3600.0 / (GetTimeRunning / 1000.0)))));
WriteLn('');
WriteLn('Gold Bracelets Made: ' + IntToStr(GoldBraceletsCrafted));
WriteLn('Gold Bracelets/Hour: ' + IntToStr(Round((GoldBraceletsCrafted)*(3600.0 / (GetTimeRunning / 1000.0)))));
WriteLn('Crafting Experience Earned: ' + IntToStr(Round(GoldBraceletsCrafted*25)));
WriteLn('Crafting Experience/Hour: ' + IntToStr(Round((GoldBraceletsCrafted*25)*(3600.0 / (GetTimeRunning / 1000.0)))));
WriteLn('----------------------------------------');

if TakeBreaks then
Writeln('Time until next break: '+MsToTime(TimeUntilBreak, Time_Bare));

MarkTime(Timer);
MarkTime(Timer2);
end;

function BreakHandler(BreakIn, BreakFor, randBreakIn, randBreakFor: Integer): Boolean; //From Ashman, Modified.
var
H,M,S: Integer;
begin
if not LoggedIn then
Exit;

if not TakeBreaks then
Exit;


if (HowManyPlayers = 1) then
begin
if (GetTimeRunning < ((BreakInLocal) + (BreakInRandom) + BreakRounds)) then
Exit else
if (GetTimeRunning > ((BreakInLocal) + (BreakInRandom) + BreakRounds)) then
begin
RealBTime := ((BreakForLocal+BreakForRandom)/60000);
Writeln('Taking a break for about ' + IntToStr(RealBTime) + ' minutes.');
Logout;
MarkTime(CurrentBTime);
repeat
Wait(21000);
ConvertTime((BreakForLocal+BreakForRandom)-TimeFromMark(CurrentBTime),H,M,S);
Writeln('Breaktime left: '+IntToStr(H)+':'+IntToStr(M)+':'+IntToStr(S));
until(TimeFromMark(CurrentBTime)>(BreakForLocal+BreakForRandom));
Writeln('Logging in.');
LoginPlayer;
Wait(4000);
MarkTime(Timeout);
MarkTime(Timeout2);
Result := LoggedIn;
ClickNorth(SRL_ANGLE_HIGH);
IncEx(BreakRounds, (BreakInLocal) + (BreakForLocal));
Inc(TotalBreaks);
Writeln('The next break will occur in about ' + IntToStr(BreakIn) + ' minutes.');
BreakInLocal := (BreakIn * 60000); //W
BreakForLocal := (BreakFor * 60000); //X
BreakInRandom := RandomRange(-BIR * 60000, BIR * 60000); // Y
BreakForRandom := RandomRange(-BFR * 60000, BFR * 60000); // Z
end;
end;
end;

begin

Setup;
ActivateClient;

repeat

ProgressReport;

if FindDTM(GoldOreDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
if Debug then
WriteLN('Found Gold Ore in Inventory, Running to Furnace');

RunToFurnace;
FindFurnace;

FindDTMs(GoldOreDTM, TPA, MIX1, MIY1, MIX2, MIY2);
FilterTPADist(TPA, 30);
GoldBarsCrafted:= GoldBarsCrafted + Length(TPA);

CheckCraftBar;
CraftButton;
Wait(RandomRange(1000, 1500));
end;

if FindDTM(GoldBarDTM, x, y, MIX1, MIY1, MIX2, MIY2) or FindDTM(GoldBarDTM2, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
if Debug then
WriteLN('Found Gold Bar in Inventory, Running to Furnace');

RunToFurnace;
FindFurnace;

FindDTMs(GoldBarDTM, TPA, MIX1, MIY1, MIX2, MIY2);
FilterTPADist(TPA, 30);
GoldBraceletsCrafted:= GoldBraceletsCrafted + Length(TPA);

CheckCraftBracelet;
CraftButton;
end;

if RunEdgeBank then
if OpenBanker then
Banking;

BreakHandler(BreakIn,BreakFor,Bir,Bfr);

until(false);

DTMFree;
end.

Sin

2013-03-29 21:33:57

Hey there! Thanks for taking the time to apply!
Although your script might be great (really well done IMO), your activity is sorely lacking :/
The SRL Member rank is a community rank as much as a scripting rank, and while you may have the scripting part of that down, your community aspect isn't that good.
Don't let this discourage you, you're in no rush to get the rank, and we'll be here for a LONG time so familarise yourself with the community!

Best of luck,
Sin.

serajin

2013-03-29 21:45:52

Alright! :) I was a little more active on the forum a few months ago, but life got in the way. I recently came back and have been browsing around, but not posting much. I was in the IRC a bunch when I was figure all the SRL Programming stuff out.

cause

2013-03-29 23:40:37

Voted yes.

serajin

2013-03-29 23:43:59

Thank you cause!

Vinyl Scratch

2013-03-30 01:24:23

I really like the script. Nicely done, man.


I see you took a Computer Animation course, what did you use to animate? I animate occasionally, so just thought it was cool.

Holding vote, going to check in on some things.


E: I'm REALLY conflicted here, you're a good scripter, but there are some things that need to be fixed. You declare x, and y globally, but then go and declare them locally. You only need one, and you should stick to local. You use Int64, but integer works just fine. I'm not sure on this one, though. I've only seen it used once or twice in my time here at SRL, so I don't know what to say on that. I do like that you have alot of functions, and TPAs, that's great. Though, your activity is REALLY low, and we've gotten a bit more strict after an incident with a former SRL Member, and like to have people we trust in here. We have some stuff in our forums that need to stay there, they're kept from the public for a reason, among other things.

serajin

2013-03-30 02:21:55

Hello Vinyl Scratch,

Thank you for the comments and critique. The time is Int64 because that is what was taught to me in a class. I'm not sure the reasoning behind it, but an Int would probably work just fine as well. As for why X and Y are defined globally…I am 90% sure that is just something I overlooked while cleaning up the script from development.

As for my activity. I work a lot, and do not have much time for games or programming. I spent several weeks on developing just this simple script, as I could not find one that worked well for my purposes. I bot on RS simply so when I do have time, usually Saturday is my only day off, I am able to play and do things I would normally not be able to due to lack of time etc.

I understand strictness, and the need for community. I try to browse the forums, and learn and such. I am just a very quiet person, and I am not sure what to say to threads or comments. I don't want to be "that guy" who just goes around saying Thanks, or haha I agree! In the threads. The last thread I had a say in I believe was a script for Cosmic crafting. I was discussing something about it.

Vinyl Scratch

2013-03-30 15:00:33

From: serajin
Hello Vinyl Scratch,

Thank you for the comments and critique. The time is Int64 because that is what was taught to me in a class. I'm not sure the reasoning behind it, but an Int would probably work just fine as well. As for why X and Y are defined globally…I am 90% sure that is just something I overlooked while cleaning up the script from development.

As for my activity. I work a lot, and do not have much time for games or programming. I spent several weeks on developing just this simple script, as I could not find one that worked well for my purposes. I bot on RS simply so when I do have time, usually Saturday is my only day off, I am able to play and do things I would normally not be able to due to lack of time etc.

I understand strictness, and the need for community. I try to browse the forums, and learn and such. I am just a very quiet person, and I am not sure what to say to threads or comments. I don't want to be "that guy" who just goes around saying Thanks, or haha I agree! In the threads. The last thread I had a say in I believe was a script for Cosmic crafting. I was discussing something about it.


I do like your attitude. Very understanding, and not all.. pissy, I guess would be a good word for this. There's another app that a guy posted, and was really.. not good with taking critique.

I'll vote yes, but I want to see you as active as possible within the forums when you can. I understand that you're busy, I get that aspect totally, lol. I get rather busy with school, and the such.

Good luck on your application.

Edit: This is me being picky, I know. But work on making the bold words (var, program, ect..) lowercase. It's just good standards, and will help you get in.

serajin

2013-03-30 19:52:20

Thank you very much Vinyl Scratch! I went through the whole script and made the var/procedure/function bits all lowercase. But I no doubt missed a couple. I was conflicted on how to code it when I was writing it, and bounced back and forth between a Capital first letter and not.

I am trying to be more active as much I can on the forum, as I do understand that is an important aspect, as I do like the people here from what I have seen.

Vinyl Scratch

2013-03-30 21:17:21

I'm glad! You're really respectful to people, I've noticed. I like that.

Kevin

2013-03-31 01:26:40

From: Sin
Hey there! Thanks for taking the time to apply!
Although your script might be great (really well done IMO), your activity is sorely lacking :/
The SRL Member rank is a community rank as much as a scripting rank, and while you may have the scripting part of that down, your community aspect isn't that good.
Don't let this discourage you, you're in no rush to get the rank, and we'll be here for a LONG time so familarise yourself with the community!

Best of luck,
Sin.


As Sin noted, your community involvement is fairly minimal so far. Not to say any comment as to your scripting skill, but one of the big things to a SRL member is how you will improve the community after becoming a member as well. You will find a good guide here: http://villavu.com/forum/showthread.php?t=74195.
The first two things Daniel points out are:

I am nice and helpful around the forums?
I have got to know many people from the community?


I am sorry to limit myself so quickly, but those are important facets of being a member. A member is not just someone with a competent scripting ability, but also a designation showing your capability in helping people and positively improving the image of the Villavu community as a whole. I wish you luck in your pursuits, however I will be voting no.

-Kevin

serajin

2013-03-31 02:53:56

Hello nivek1989.

Thank you for the insight! I am trying to become more involved with the community, as I understand that it is a part of becoming a member here.

Benny

2013-03-31 07:30:52

Hey there,

I voted yes, I like your script and most importantly I like your attitude.
My only hesitation is that you may not stick around and hang out with the community. I would like to see you contribute more in that respect. It doesn't take long to have a quick browse and post a few comments here and there.

Good luck

serajin

2013-03-31 14:48:46

Hello Benny,

Thank you for your support. I have been around for almost a year now, mostly just browsing and reading. Learning etc. I tried my best not to just browse the scripts section and leach, and when I did, I read over the scripts and tried to learn.

I am trying to be more involved in the community and comment, but as I stated before I feel strange just making quick comments, or short posts as I feel they don't really add to anything. I will try my best though!

Vinyl Scratch

2013-03-31 17:03:14

From: serajin
Hello Benny,

Thank you for your support. I have been around for almost a year now, mostly just browsing and reading. Learning etc. I tried my best not to just browse the scripts section and leach, and when I did, I read over the scripts and tried to learn.

I am trying to be more involved in the community and comment, but as I stated before I feel strange just making quick comments, or short posts as I feel they don't really add to anything. I will try my best though!



I remember that feeling. What helps is to post feedback, and ways to make it better. Bug-testing and the such will get you lots of friends with us SRL members, if you have a good opinion. You don't have to post "Thanks, script is good." You could post "The script is good, but here are some things that you could add/fix: (insert things that need fixing.)"

Olly

2013-03-31 17:18:29

The first question I ask to myself before voting is have I seen them around before? And the answer is no for you, as Sin said SRL-Members is much about community rank as much as a scripting rank (if not more now). The script is decent though. :)

[XoL]

2013-03-31 17:29:52

Script looks great, but I am voting no based on activity sorry I value a community SRL members > than a great scripter that isn't active. (Not saying you are not active, it is just you have been here for a short period of time) If you don't get in try applying again in a month (you will def be active enough then, I would hope you keep up what you are doing now!)

serajin

2013-04-01 02:23:33

Hello Ollybest and [XoL], Thank you both for your input! I am definitely trying to become more active, and will be keeping up with viewing, and trying to make helpful posts.

rj

2013-04-01 18:26:17

Script: 10/10
Activity: 2/10

:/ show yourself around the forums!

serajin

2013-04-01 19:59:18

Hi RJJ95, I'm a trying! =)

Jakkle

2013-04-02 11:15:12

I personally think it's a bit harsh only going by activity. The script seems rather nice from a quick look at it and your attitude seems good to.
I'm going to vote yes on this one. I hope you do keep your word and be more active tho. Good luck with your app :)

rj

2013-04-02 14:41:16

From: Jakkle
I personally think it's a bit harsh only going by activity. The script seems rather nice from a quick look at it and your attitude seems good to.
I'm going to vote yes on this one. I hope you do keep your word and be more active tho. Good luck with your app :)


I think people are being harsh because the have seen people with low activity in the past get in and then just leave

serajin

2013-04-02 18:20:32

I understand that SRL is about community. And I think since the application process is based on not just the script but activity, I should have been a bit more active before I attempted to apply for members. No big deal :) I'm trying my best to stay more active and show you guys I'm going to be around for a while.

Hobbit

2013-04-20 17:41:45

Didn't quite make it this time. Take the suggestions given to you above and feel free to reapply in 3 weeks time. :)

Cheers
Hobbit