Simba Code:
]
[ [SRL] ]
[ [SMART] ]
[------------------------------------------------------------------------------]
[ Description: | ]
[-------------------. ]
[ - This script will either cut logs into bows, string unstrung bows, turn ]
[ shafts into headless arrows, or turn headless arrows into arrows ]
[ - It is imperitive that you read the first post in the thread for details ]
[ on how to set up the script: ]
[ [url]http://villavu.com/forum/showthread.php?p=869270[/url] ]
[------------------------------------------------------------------------------]
[ Features/Log: | ]
[-------------------. ]
[ ## Version 0.50 BETA (21/12/11): ]
[ - Released to villavu.com ]
[ - Supports cutting and stringing ]
[ ## Version 0.51 BETA (22/12/11): ]
[ - Fixed timer countdown while waiting to fletch ]
[ - Continues even if it cant find the bank/minigame symbols ]
[ - Added check to see in logs/bows have run out! ]
[ - Other minor amendments ]
[ *** Version 0.51.5 BETA *** ]
[ - Deposits after LevelUp (Temporary Implementation) ]
[ ## Version 0.52 BETA (22/12/11): ]
[ - Added SC Knife compatability ]
[ - Changed my for loops to reapeat-until loops. This makes the script ]
[ more reliable. I used for loops because I was lazy :P ]
[ - Removed CheckLoc; you now have to input which bank you're at ]
[ ## Version 0.53 BETA (23/12/11): ]
[ - Flushed out many bugs in the system! ]
[ - Added anti-ban frequency options ]
[ - Eliminated the most annoying 'Could not find Craft' error ]
[ - Fixed withdraw eror where it would missclick the bank and logout ]
[------------------------------------------------------------------------------]
[ Instructions: | ]
[-------------------. ]
[ 1. Setup varibles as required, see thread for detailed instructions. ]
[ 2. Make sure you have a KNIFE IN YOUR TOOLBELT! The script does not check ]
[ for it, it assumes that it is there! ]
[ 3. Make sure the logs/unstrung bows/bow strings are in the correct and ]
[ corresponding bank slot and tab! ]
[ 4. You must be standing right next to the bank chest at either Castle Wars ]
[ or Soul Wars! ]
[ 5. Press PLAY ]
[------------------------------------------------------------------------------}
var //<<<<<<<<//
x, y: Integer; //
WhenBreak, AntiBanAmount: Integer; //
extraDebug, ActAFK: Boolean; // DO
SRLStats_Username, SRLStats_Password: String; // NOT
// TOUCH
const // ANY
{ *** For Modes} // OF
MODE_CUT = 1; // THIS
MODE_STRING = 2; //
MODE_SHAFTS = 3; //
MODE_SHAFT_TO_HEADLESS = 4; //
MODE_HEADLESS_TO_ARROW = 5; //<<<<<<<<//
{------------------------------------------------------------------------------]
[ VARIBLE SETUP: ]
[ See the thread for details. ]
[------------------------------------------------------------------------------}
procedure LoadGlobals;
begin
WhenBreak := 45; // Minutes until break
ActAFK := True; // Do you randomly want to go AFK?
extraDebug := False; // Displays extra information about the bot
AntiBanAmount := 4; // How much anti-ban? [1=Always, 10=Sometimes]
SRLStats_Username := ''; // Stats Username
SRLStats_Password := ''; // Stats Password
end;
{------------------------------------------------------------------------------]
[ DECLARE PLAYERS: ]
[ Change accordingly. ]
[------------------------------------------------------------------------------}
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name :=''; // Username
Pass :=''; // Password
Nick :=''; // 3-4 lower case letters of your character's name
Pin :=''; // Bank PIN
Integers[0] := 1; // Bank Slot of Logs/Unstrung Bows. Bow Strings go in the next slot!
Integers[1] := 7; // Bank Tab which all of these are located
Integers[2] := MODE_CUT; // Cuttng Bows, Stringing Bows, or Fletching Arrows? (See thread)
Strings[3] := 'Maple'; // What log/bow type? ['Normal', 'Oak', 'Willow' etc..]
Strings[4] := 'long'; // Longbow or Shortbow? ['long', 'short']
Strings[5] := 'cw'; // What bank? ['sw', 'cw']
Booleans[6] := false; // Using SC Hammer? [Yes = true]
Member := true;
Active := true;
end;
end;
{------------------------------------------------------------------------------}
{ STOP STOP STOP STOP STOP-STOP STOP STOP }
{ STOP STOP STOP STOP STOP | }
{ ===== STOP STOP STOP STOP STOP STOP STOP ===== }
{ STOP STOP STOP STOP STOP }
{ STOP STOP STOP STOP-STOP STOP }
{------------------------------------------------------------------------------}
const
ScriptVersion = '0.53 BETA';
ScriptName = '[F]antastic [F]letcher';
LaggFactor = 3; // [1 = no lagg, 10 = HOLY S**T]
{ *** For Players *** }
P_BANK_SLOT = 0;
P_BANK_TAB = 1;
P_MODE = 2;
P_TYPE = 3;
P_BOW = 4;
P_BANK_LOC = 5;
P_SCKNIFE = 6;
{ *** For Location}
LOC_CASTLEW = 1;
LOC_SOULW = 2;
var
cutORstring, cutORstring2: String;
TotalTimeInactive, RoundTime, lTimer: Integer; // Time
Total_LevelUps, Total_Cut, Total_Strung: Integer; // Counts
Total_XP, XP_Gain: Extended;
wCol, wRow, wCol2, wRow2, wAmount, wCount: Integer;
WhichBank: Integer;
type
ItemProperties = record
Name: String;
Colour: Integer;
TPALength: Integer; // Outline
Midpoint: TPoint;
end;
type
TObjectProperties = record
TPA: TPointArray;
ATPA: array of TPointArray;
end;
var
Log, uBow, bString: ItemProperties;
BankChest: TObjectProperties;
procedure Debug(w: string);
begin
if extraDebug then
begin
Writeln(w);
end else
Status(w);
end;
procedure Paint(TPA: TPointArray);
begin
{$IFDEF SMART}
if extraDebug then
SMART_DrawDotsEx(true, TPA, 255);
{$ENDIF}
end;
function OverTime(theTime: Integer): Boolean;
begin
if TimeFromMark(theTime) > LaggFactor*10*1000 then
Result := True;
end;
procedure DoAntiBan;
var
r: Integer;
begin;
if not (LoggedIn) then Exit;
Debug('Performing Anti-Ban procedure...');
r:= Random(100);
case r of
10: HoverSkill('fletching', false);
15: HoverSkill('fletching', false);
20: RandomMovement;
25: RandomMovement;
30: RandomAngle(1);
40: PickupMouse;
50: RandomAngle(1);
60: RandomRClick;
70: ExamineInv;
end;
case r of
10, 15, 20, 25, 30, 40, 50, 60, 70:
begin
Wait(RandomRange(250, 1000));
GameTab(Tab_Inv);
end;
end;
end;
function FindItemTPA(var Item: ItemProperties; Bounds: TBox; Update: Boolean): Boolean;
var
ItemTPA: TPointArray; // TPA stored in this
M: TPoint; // For the middle point of Item
B: TBox; // Item bounds
i: Integer;
begin
B := Bounds;
MarkTime(lTimer);
for i:=1 to 1000 do
begin
FindColorsTolerance(ItemTPA, srl_outline_black, B.x1, B.y1, B.x2, B.y2, 0);
if (Length(ItemTPA) < 1) and ((Players[CurrentPlayer].Integers[P_MODE] = MODE_CUT)) then
begin
Debug('ATTENTION: Length(ItemTPA) was less than 1; something must have gone wrong!! ' +IntToStr(i));
end else
Break;
Wait(RandomRange(100, 200));
if OverTime(lTimer) then
Break;
end;
if (Length(ItemTPA) < 1) and ((Players[CurrentPlayer].Integers[P_MODE] = MODE_CUT)) then
begin
Debug('ATTENTION: Length(ItemTPA) was less than 1; something must have gone wrong!! Last');
Result := False;
Exit;
end;
B := GetTPABounds(ItemTPA);
M := MiddleTPA(ItemTPA);
Paint(ItemTPA);
if Update then
begin
Item.TPALength := Length(ItemTPA);
Debug('Length of: ' +Item.Name+' = '+IntToStr(Item.TPALength));
Item.Colour := GetColor(M.x, M.y);
Item.Midpoint := M;
Debug(Item.Name+'''s properties were set...');
Result := true;
Exit;
end;
Status('Length of inventory item = '+IntToStr(Length(ItemTPA)));
if (Length(ItemTPA) = Item.TPALength) then // Need to fix this.. colour at midpoint is dodgey with bos and bowstrings
Result:= True;
if Item.Colour > -1 then
Result := GetColor(M.x, M.y) = Item.Colour
else
Result := True;
end;
function CountItemsInv(Item :ItemProperties): Integer;
var
i, count: Integer;
begin
count:= 0;
for i:=1 to 28 do
begin
if FindItemTPA(Item, InvBox(i), False) then
begin
Inc(count);
//Status(IntToStr(count)+Item.Name+'s to go...');
end;
end;
Debug(IntToStr(count)+' '+Item.Name+'s to go...');
Result:= count;
end;
{function FindLoc(l: Integer): Boolean;
begin
if not LoggedIn then
Exit;
SymbolAccuracy := 0.7;
repeat
if (FindSymbol(x, y, 'bank')) and (FindSymbol(x, y, 'minigame'))then
begin
Result := True;
Break;
end else
begin
SymbolAccuracy := SymbolAccuracy - 0.1;
Debug('You are not in the correct location...');
Debug('SymbolAccuracy := ' +FloatToStr(SymbolAccuracy));
end;
until(SymbolAccuracy = 0.1);
SymbolAccuracy := 0.6;
if FindSymbol(x, y, 'quest') then
begin
Debug('You are at Soulwars bank chest...');
l := LOC_SOULW;
end else
begin
Debug('You are at Castlewars bank chest...');
l := LOC_CASTLEW;
end;
Result:= True;
end; }
function FindBankChest(var x, y: Integer): Boolean;
var
CTS, i, h: Integer;
begin
Debug('Method1: Blind...');
case WhichBank of
LOC_SOULW: MakeCompass('W');
LOC_CASTLEW: MakeCompass('N');
end;
MouseBox(290, 160, 314, 187, 3);
for i:=0 to 10 do
begin
if ( WaitUpTextMulti(['ank', 'chest'], 200) ) then
begin
Debug('Found bank using blind check!');
Result:= True;
GetMousePos(x, y);
Exit;
end;
end;
Debug('Method2: TPA...');
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.21, 0.24);
FindColorsSpiralTolerance(MSCX, MSCY, BankChest.TPA, 7963282, MSX1, MSY1, MSX2, MSY2, 32);
ColorToleranceSpeed(CTS);
BankChest.ATPA := TPAToATPAEx(BankChest.TPA, 2, 2);
SortATPAFrom(BankChest.ATPA, Point(MSCX, MSCY));
if ( Length(BankChest.ATPA)=0 ) then
begin
Debug('Bank chest not found.');
Result:= false;
end else
Debug('Found ' +IntToStr(Length(BankChest.ATPA))+ ' possible Bank chests?');
h:= High(BankChest.ATPA);
For i := 0 to h do
begin
Paint(BankChest.ATPA[i]);
MiddleTPAEx(BankChest.ATPA[i], x, y);
MMouse(x, y, 2, 2);
if ( WaitUpTextMulti(['ank', 'chest'], 200) ) then
begin
Result:= True;
GetMousePos(x, y);
Break;
end else
Result:= false;
if BankScreen or PinScreen then
begin
Debug('Bank is open...');
Result := True;
Exit;
end;
end;
end;
function OpenBankChest: Boolean;
var
i, ii: Integer;
begin
if BankScreen then
begin
Debug('Bank is already open...');
Result := True;
Exit;
end;
for i:=0 to 10 do
begin
if BankScreen or PinScreen then
Break;
Debug('Searching for bank...');
if FindBankChest(x, y) then
begin
//ClearRSCanvas(SMART_Canvas.canvas);
Debug('Found bank...');
MMouse(x, y, 3, 3);
if IsUpText('ank') then
begin
GetMousePos(x, y);
Case random(3) of
0, 1, 2 : Mouse(x, y, 0, 0, true);
3 : begin
Mouse(x, y, 0, 0, False);
if not ChooseOption('ank') then
Break;
end;
end;
Debug('Clicked bank...');
Wait(RandomRange(200,400));
MarkTime(lTimer);
repeat
if BankScreen or PinScreen then
Break;
if OverTime(lTimer) then
begin
if i >=10 then
begin
Debug('Clicked bank but may have missed (' +IntToStr(i)+ ' times)...');
Result := False;
Exit;
end else
Break;
end;
until(false)
end else
begin
if BankScreen or PinScreen then
Break;
Debug('Missed bank, re-searching');
end;
end else
begin
Debug('Can''t find bank ' +IntToStr(i)+ ' times...');
end;
end;
Wait(200+Random(150*LaggFactor));
if PinScreen then
InPin(Players[CurrentPlayer].Pin);
Debug('Opened bank...')
Result := True;
end;
function DepositProducts: Boolean;
begin
if not LoggedIn then Exit;
if OpenBankChest then
if InvCount>0 then
if not Players[CurrentPlayer].Booleans[P_SCKNIFE] then
begin
DepositAll;
end else
Deposit(2, 28, true);
Result := True;
end;
function WithdrawReactants: Boolean;
var
b: TPoint;
i, q, p: Integer;
f: TBox;
begin
if not LoggedIn then Exit;
b := BankIndexToMSPoint(Players[CurrentPlayer].Integers[P_BANK_SLOT]);
if OpenBankChest then
begin
if InvCount>0 then
DepositProducts;
Wait(200+Random(150*LaggFactor));
BankTab(Players[CurrentPlayer].Integers[P_BANK_TAB])
if GetAmountBox(BankIndexToMSBox(Players[CurrentPlayer].Integers[P_BANK_SLOT])) <= (wCount) then
begin
Writeln('Out of stuff to fletch!');
Players[CurrentPlayer].Loc:= 'Used up all items';
Result:= True;
Exit;
end;
Withdraw(wCol, wRow, wAmount);
f := InvBox(2);
MarkTime(lTimer)
repeat
Wait(RandomRange(100, 200));
if OverTime(lTimer) then
Break;
until(FindColor(q, p, srl_outline_black, f.x1, f.y1, f.x2, f.y2) or InvFull)
Wait(500+Random(100*laggfactor));
Case Players[CurrentPlayer].Integers[P_MODE] of
MODE_CUT : begin
if FindItemTPA(Log, f, True) then
Writeln('Updated item!!!');
end;
MODE_STRING : begin
if FindItemTPA(uBow, f, True) then
Writeln('Updated item!!!');
end;
end;
if Players[CurrentPlayer].Integers[P_MODE] = MODE_STRING then
begin
Withdraw(wCol2, wRow2, wAmount);
MarkTime(lTimer)
repeat
Wait(RandomRange(100, 200));
if OverTime(lTimer) then
Break;
until(FindColor(q, p, srl_outline_black, f.x1, f.y1, f.x2, f.y2) or InvFull)
Wait(500+Random(100*laggfactor));
if FindItemTPA(bString, InvBox(28), True) then
Writeln('Updated item!!!');
end;
Debug('Successfully withdrawn items...');
CloseBank;
Debug('Closing Bank...');
Result:= True;
end;
end;
function FletchReaction: Boolean;
var
B: TBox;
r, t, i: Integer;
T1, T2: TPoint;
begin
if not LoggedIn then Exit;
Debug('Fletching...');
GameTab(Tab_Inv);
MarkTime(t);
repeat
Wait(100+random(100))
until(InvFull or (TimeFromMark(t) > 5000))
if Players[CurrentPlayer].Booleans[P_BANK_LOC] then
begin
r := Random(12)+2;
end else
r := Random(13)+1;
Debug('Random Inventory slot choosen: ' +IntToStr(r));
case Players[CurrentPlayer].Integers[P_MODE] of // Important failsafe for Leveling up
MODE_CUT: begin
if CountItemsInv(Log) <> 28 then
begin
r := 28;
Debug('FletchReaction was called again; B := InvBox(28)');
end;
end;
MODE_STRING: begin
if not InvFull then //if not CountItemsInv(bString) = 14 then //must tidy/fix this up
begin
r := 28;
Debug('FletchReaction was called again; B := InvBox(28)');
end;
end;
end;
B := InvBox(r)
for i:=1 to 5 do
begin
MouseBox(B.x1, B.y1, B.x2, B.y2, 3);
MarkTime(lTimer);
repeat
if IsUpTextMultiCustom([cutORstring, 'log']) then
begin
Debug('Found: ''' +cutORstring+ ''', clicking...'); //cutORstring = ['Craft', 'Use']
GetMousePos(x, y);
Mouse(x, y, 0, 0, true);
i := 5;
Break;
end;
if OverTime(lTimer) then
begin
Debug('Could not find ''' +cutORstring+ ''' '+IntToStr(i)+' times');
Break;
end;
until(false)
end;
if Players[CurrentPlayer].Integers[P_MODE] = MODE_STRING then
begin
if Players[CurrentPlayer].Booleans[P_BANK_LOC] then
begin
r := Random(12)+16;
end else
r := Random(13)+15;
Debug('Random Inventory slot choosen: ' +IntToStr(r));
B := InvBox(r)
MouseBox(B.x1, B.y1, B.x2, B.y2, 3);
MarkTime(lTimer);
repeat
if IsUpTextMultiCustom( [cutORstring, lowercase(Players[CurrentPlayer].Strings[P_TYPE]+'bow')] ) then
begin
Debug('Found: ''' +cutORstring+ ''', clicking...'); //cutORstring = ['Use']
GetMousePos(x, y);
Mouse(x, y, 0, 0, true);
Break;
end;
if OverTime(lTimer) then
begin
Debug('Could not find ''' +cutORstring+ '''');
Exit;
end;
until(false)
end;
if Players[CurrentPlayer].Integers[P_MODE] = MODE_CUT then
begin
Debug('Searching for ''Knife'' option...');
MarkTime(lTimer);
repeat // Modified from Narcle's script:
if FindTextTpaEx(2070783, 0, MCX1, MCY1, MCX2, MCY2, T1.x, T1.y, 'nife', statchars, Nothing) then
begin
Wait(RandomRange(150, 350));
MouseBox(T1.x-20, T1.y-30, T1.x+20, T1.y+8, 1);
Debug('Clicked ''Knife''...');
Break;
end;
if FindTextTpaEx(2070783, 0, MCX1, MCY1, MCX2, MCY2, T2.x, T2.y, Players[CurrentPlayer].Strings[P_BOW]+'bow', statchars, Nothing) then
begin
Debug('''Knife'' option surpassed...');
Break;
end;
if OverTime(lTimer) then
begin
Debug('Could not find ''Knife''');
Exit;
end;
until(false)
Debug('Searching for '''+Capitalize(Players[CurrentPlayer].Strings[P_TYPE])+' '+Players[CurrentPlayer].Strings[P_BOW]+'bow(u)'' option...');
MarkTime(lTimer);
repeat
if FindTextTpaEx(2070783, 0, MCX1, MCY1, MCX2, MCY2, T2.x, T2.y, Players[CurrentPlayer].Strings[P_BOW]+'bow', statchars, Nothing) then
begin
Wait(RandomRange(150, 350));
MouseBox(T2.x-20, T2.y-30, T2.x+20, T2.y+8, 1);
Debug('Clicked '''+Capitalize(Players[CurrentPlayer].Strings[P_TYPE])+' '+Players[CurrentPlayer].Strings[P_BOW]+'bow(u)''...');
Break;
end;
if OverTime(lTimer) then
begin
Debug('Could not find '''+Capitalize(Players[CurrentPlayer].Strings[P_TYPE])+' '+Players[CurrentPlayer].Strings[P_BOW]+'bow(u)');
Exit;
end;
until(false)
end else
begin
Debug('Searching for '''+Capitalize(Players[CurrentPlayer].Strings[P_TYPE])+' '+Players[CurrentPlayer].Strings[P_BOW]+'bow'' option...');
MarkTime(lTimer);
repeat
if FindTextTpaEx(2070783, 0, MCX1, MCY1, MCX2, MCY2, T1.x, T1.y, 'bow', statchars, Nothing) then
begin
Wait(RandomRange(150, 350));
MouseBox(T1.x-20, T1.y-30, T1.x+20, T1.y+8, 1);
Debug('Clicked '''+Capitalize(Players[CurrentPlayer].Strings[P_TYPE])+' '+Players[CurrentPlayer].Strings[P_BOW]+'bow''...');
Break;
end;
if OverTime(lTimer) then
begin
Debug('Could not find '''+Capitalize(Players[CurrentPlayer].Strings[P_TYPE])+' '+Players[CurrentPlayer].Strings[P_BOW]+'bow');
Exit;
end;
until(false)
end;
Result := True;
end;
function WhileReaction: Boolean;
var
itemsLeft, oldCount, t: Integer;
begin
oldCount := -1;
MarkTime(t);
repeat
case Players[CurrentPlayer].Integers[P_MODE] of
MODE_CUT : itemsLeft := CountItemsInv(Log);
MODE_STRING : itemsLeft := CountItemsInv(bString);
end;
if oldCount = -1 then
oldCount := itemsLeft;
if oldCount <> itemsLeft then
begin
oldCount := itemsLeft;
MarkTime(t);
end;
if LevelUp then
begin
Debug('You Levelled Up!');
Inc(Total_LevelUps);
ClickToContinue;
FletchReaction;
//DepositProducts;
//Result := True;
//Exit;
end;
if ClickToContinue then
begin
Debug('Click to Continue Chosen!');
FletchReaction;
//DepositProducts;
//Result := True;
//Exit;
end;
if RandomRange(1, AntiBanAmount) = 1 then DoAntiBan;
if not LoggedIn then Exit;
//Debug('TimeFromMark(tt) := ' +IntToStr(TimeFromMark(tt)));
if (TimeFromMark(t) > (20*1*1000)) then
begin
Debug('Fletching has timed out...');
if oldCount = itemsLeft then
begin
FletchReaction;
MarkTime(t);
end else
Exit;
end;
FindNormalRandoms;
until((itemsLeft <= 0) or (InvCount <= 14))
Debug('Finished fletching load...');
Result:= True;
case Players[CurrentPlayer].Integers[P_MODE] of
MODE_CUT: begin
Total_Cut := Total_Cut + 28;
Total_XP := Total_XP + XP_Gain*28;
stats_IncVariable(Capitalize(Players[CurrentPlayer].Strings[P_TYPE])+ ' Logs Fletched', 28);
stats_IncVariable('Fletching EXP (Gained)', Round(XP_Gain*28));
end;
MODE_STRING:begin
Total_Strung := Total_Strung + 14;
Total_XP := Total_XP + XP_Gain*28;
stats_IncVariable(Capitalize(Players[CurrentPlayer].Strings[P_TYPE])+ ' Bows Strung', 14);
stats_IncVariable('Fletching EXP (Gained)', Round(XP_Gain*14));
end;
end;
end;
function CalculateXP: Extended;
var
xp: Extended;
begin
Case Capitalize(Players[CurrentPlayer].Strings[P_BOW]) of
'Short': begin
Case Capitalize(Players[CurrentPlayer].Strings[P_TYPE]) of
'Normal': xp := 5;
'Oak' : xp := 16.5;
'Willow': xp := 33.3;
'Maple' : xp := 50;
'Yew' : xp := 67.5;
'Magic' : xp := 83.3;
end;
end;
'Long' : begin
Case Capitalize(Players[CurrentPlayer].Strings[P_TYPE]) of
'Normal': xp := 10;
'Oak' : xp := 25;
'Willow': xp := 41.5;
'Maple' : xp := 58.3;
'Yew' : xp := 75;
'Magic' : xp := 91.5;
end;
end;
end;
if Players[CurrentPlayer].Integers[P_MODE] = MODE_STRING then
begin
Case Capitalize(Players[CurrentPlayer].Strings[P_BOW]) of
'Short': begin
Case Capitalize(Players[CurrentPlayer].Strings[P_TYPE]) of
'Willow': xp := 33.2;
'Magic' : xp := 83.2;
end;
end;
'Long' : begin
Case Capitalize(Players[CurrentPlayer].Strings[P_TYPE]) of
'Maple' : xp := 58.2;
end;
end;
end;
end;
Result := xp;
end;
procedure SetupScript;
begin
Disguise('Fantastic Fletcher has been started!')
ClearDebug;
ClearReport;
{$IFDEF SMART}
Smart_Server := 9;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
{$ENDIF}
SetupSRL;
DeclarePlayers;
LoadGlobals;
if SRLStats_Username = '' then
begin
SRLStats_Username := 'Anonymous';
SRLStats_Password := 'anon1337';
end;
SetupSRLStats(370, SRLStats_Username, SRLStats_Password);
Log.Name := 'Log';
uBow.Name := 'Unstrung Bow';
bString.Name := 'Bow String';
WhenBreak:= ((1000*60)*Whenbreak);
AddOnTerminate('AddToTerminate');
end;
procedure SetupPlayer;
var
P, PP: TPoint;
begin
case Players[CurrentPlayer].Integers[P_MODE] of
MODE_CUT: begin
cutORstring := 'Craft';
cutORstring2 := 'raft';
wAmount := 0;
case Players[CurrentPlayer].Booleans[P_SCKNIFE] of
false: wCount := 28;
true: wCount :=27;
end;
end;
MODE_STRING: begin
cutORstring := 'Use';
wAmount := 14;
wCount := 14;
end;
end;
P := BankIndexToBankPoint(Players[CurrentPlayer].Integers[P_BANK_SLOT]);
PP := BankIndexToBankPoint(Players[CurrentPlayer].Integers[P_BANK_SLOT] + 1);
wCol := P.x;
wRow := P.y;
wCol2 := PP.x;
wRow2 := PP.y
XP_Gain := CalculateXP;
LoginPlayer;
wait(100+random(50));
SetAngle(true);
Case lowercase(Players[CurrentPlayer].Strings[P_BANK_LOC]) of
'sw' : WhichBank := LOC_SOULW;
'cw' : WhichBank := LOC_CASTLEw;
//'burthrope'?
end;
Case lowercase(Players[CurrentPlayer].Strings[P_BANK_LOC]) of
'sw' : Debug('You are at Soulwars bank chest...');
'cw' : Debug('You are at CastleWars bank chest...');
end;
MarkTime(RoundTime);
end;
procedure ProgressReport;
var
i: Integer;
begin
Players[CurrentPlayer].Worked:= PlayerWorked(CurrentPlayer);
Writeln('/-------------------------------------------------------------\');
Writeln('|-------------------------------------------------------------|');
Writeln(PadR('| -daazndagger-''s', 62) + '|');
Writeln(PadR('| ' +ScriptName, 62) + '|');
Writeln(PadR('| Version ' + ScriptVersion, 62) + '|');
Writeln('|-------------------------------------------------------------|');
Writeln(PadR('| Time Running : ' +MsToTime(GetTimeRunning, Time_Abbrev), 62) + '|');
Writeln(PadR('| Logs Cut : ' +IntToStr(Total_Cut), 62) + '|');
Writeln(PadR('| Bows Strung : ' +IntToStr(Total_Strung), 62) + '|');
Writeln(PadR('| Exp Gained : ' +IntToStr(Round(Total_XP)), 62) + '|');
Writeln(PadR('| Level Up''s : ' +IntToStr(Total_LevelUps), 62) + '|');
Writeln(PadR('| ', 62) + '|');
Writeln(PadR('| False Reasons : ', 62) + '|');
for i:=0 to HowManyPlayers-1 do
Writeln(PadR('| Player ' +IntToStr(i)+': ' +Players[i].Loc, 62) + '|');
Writeln(PadR('| ', 62) + '|');
Writeln(PadR('| ', 62) + '|');
Writeln('|-------------------------------------------------------------|');
Writeln('\-------------------------------------------------------------/');
Writeln('');
Stats_Commit;
end;
procedure AddToTerminate;
begin
ProgressReport;
Disguise('[F]antastic [F]letcher has been successfully executed.');
end;
procedure TakeBreak;
var
Breaktime, Timeleft, i, e: Integer;
begin
if LoggedIn then
Logout;
if Players[CurrentPlayer].Worked > (2*60*60*1000) then
begin
Breaktime:= RandomRange(20*60*1000, 35*60*1000);
end else
Breaktime:= RandomRange(Players[CurrentPlayer].Worked / 8, Players[CurrentPlayer].Worked / 4);
Writeln('Taking a break for ' +mstotime(breaktime, Time_Abbrev) );
Writeln('');
i:= GetSystemTime;
repeat
wait(1000);
e:= GetSystemTime;
timeleft:= breaktime - (e - i);
Disguise('We have ' + mstotime(timeleft, Time_Abbrev) + ' to go');
until( (e-i) >= breaktime)
Disguise('Finished break.');
end;
procedure LogoutProcess;
begin
Debug('Loging out...');
if BankScreen then
CloseBank;
Logout;
ProgressReport;
if not( lowercase(Players[CurrentPlayer].Loc) = '') then
Players[CurrentPlayer].Active:= false;
if not AllPlayersInactive then
begin
TakeBreak;
end else
Exit;
NextPlayer(Players[CurrentPlayer].Active);
end;
function CUT_OR_STRING: Boolean; //funct boolean
begin
if not WithdrawReactants then
begin
Players[CurrentPlayer].Loc:= 'Could not withdraw';
Exit;
end;
if not( lowercase(Players[CurrentPlayer].Loc) = '') then
Exit;
if not FletchReaction then
begin
Players[CurrentPlayer].Loc:= 'Could not fletch';
Exit;
end;
FindNormalRandoms;
if not WhileReaction then
begin
Players[CurrentPlayer].Loc:= 'Could not finish fletching';
Exit;
end;
if ActAFK then
begin
case random(25) of
10: begin
Debug('Taking AFK break...');
Wait(RandomRange(10000, 45000));
end;
end;
end;
ProgressReport;
if Players[CurrentPlayer].Loc= 'Finished fletching' then
Exit;
Result:= True;
end;
function ARROWS: Boolean;
begin
end;
{if not DepositProducts then
begin
Players[CurrentPlayer].Loc:= 'Could not deposit';
Break;
end; }
begin
SetupScript;
repeat
SetupPlayer;
repeat
if not( lowercase(Players[CurrentPlayer].Loc) = '') then
Break;
CUT_OR_STRING;
until( TimeFromMark(RoundTime) >= (WhenBreak + RandomRange(-(1000*60*3), (1000*60*3)) ) )
LogoutProcess;
until(AllPlayersInactive) or ( TotalTimeInactive>(1000*60*10) )
Debug('All Players Inactive, or timed out. Script is finished!');
if LoggedIn then
Logout;
end.
procedure LogoutProcess;
begin
Debug('Loging out...');
Logout;
ProgressReport;
if not( lowercase(Players[CurrentPlayer].Loc) = '') then
Players[CurrentPlayer].Active:= false;
if not AllPlayersInactive then
begin
TakeBreak;
end else
Exit;
NextPlayer(Players[CurrentPlayer].Active);
end;
begin
SetupScript;
repeat
SetupPlayer;
repeat
if not( lowercase(Players[CurrentPlayer].Loc) = '') then
Break;
if not CUT_OR_STRING then
Break;
until( TimeFromMark(RoundTime) >= (WhenBreak + RandomRange(-(1000*60*3), (1000*60*3)) ) )
LogoutProcess;
until(AllPlayersInactive) or ( TotalTimeInactive>(1000*60*10) )
Debug('All Players Inactive, or timed out. Script is finished!');
if LoggedIn then
Logout;
end.