smurg
2010-12-31 04:31:08
How Long have You Played Runescape?
6 Year(s)
Are you affilated in anyway with Jagex LTD?
No
Were you Referred to SRL?
What is your general programming knowledge?
Java, C++, VB, PHP, MySQL, etc, small amounts, nothing too major.
Are you a member of any other communities?
New to RSCheata.com, RSBotting.com, Powerbot.org, RSBots.net also
Tell us about yourself…
Please show us one (or multiple) of your scripts.
6 Year(s)
Are you affilated in anyway with Jagex LTD?
No
Were you Referred to SRL?
What is your general programming knowledge?
Java, C++, VB, PHP, MySQL, etc, small amounts, nothing too major.
Are you a member of any other communities?
New to RSCheata.com, RSBotting.com, Powerbot.org, RSBots.net also
Tell us about yourself…
From: smurg
I am a Senior in college. I previously scripted for SCAR back in the day during ScarScape. I had written a nature rune crafter and went by the name Zestyroper.
Sythe was the boards back then. I always had an interest in scripting, and even when I just came back to dabble in the game, it was alot more interesting when I was scripting instead of playing :).
After being in this community now for a month or two, I have bought several nexus bots and they are fantastic. It opened my eyes to the capabilities of Reflection. I disliked that I would have to pay for the Pro version of ibot nexus in order to script whenever instead of just weekends. So I want to script for Simba hardcore.
I want to be able to produce top notch quality scripts for this community and help it grow.
Please show us one (or multiple) of your scripts.
//////////////////////////////////////////////////
/////// ///////
// //
// Smurg's AIO Fletcher V2.00 //
// -------------------------------- //
// | Fill in lines 59-105 | //
// -------------------------------- //
// //
/////// ///////
////////////////////////////////////////////////////////////////////////////////
/////// ///////
// //
// Release Notes: //
// Version 1.00: //
// + Wrote original script and personally tested //
// Version 1.10: //
// + Added in breaks and fixed antiban //
// Version 1.20: //
// + Added final report and fixed formatting, break handler, //
// and various errors //
// Version 1.30: //
// + Added stringing support //
// + Pulled ID #'s out and replaced using constants //
// + Replaced waits with failsafe loops ending on conditions //
// + Restructured the Mainloop from inventory counts to by each //
// 'activity' and individual checks //
// Version 2.00: //
// + Added arrow support. (Darts and Bolts soon!) //
// + Added some more antiban. //
// //
// Future Additions: //
// + Darts/Bolts Support //
// //
// Known Bugs: Sometimes SRL Anti-Ban functions makes it walk (should //
// relocate to a bank if on screen though. //
// //
/////// ///////
////////////////////////////////////////////////////////////////////////////////
// //
// Instructions: //
// //
// + Start with knife in first inventory spot if cutting wood. ///////
// + Only cutting/stringing logs and arrows are supported so far, no bolts/darts. //
// + For arrows/darts/bolts: Start with any items you need in inventory, it will //
// make the headless for you and then attach the tips. //
// ///////
////////////////////////////////////////////////////////////////////////////////
program AIOFletcher; //
{$i SRL/SRL/misc/smart.scar} //
{$i SRL/SRL.scar} //
{$i SRL/SRL/Misc/Stats.scar} //
{$i Reflection/Reflection.Simba} //
const //
//////////////////////////////////////////////////
///////////////////////////////////////////////////////////
//////////////////// Global Settings /////////////////////
///////////////////////////////////////////////////////////
World = 67; // World # to play on //
DebugMode = True; // Output debugging statements? //
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
////////// Break Handler for Single Player Only ///////////
////////////////////////////////////////////////////////////////////////////////
BreakEvery = 220; // Break every ... (+/- 'BreakEveryRand' minutes) //
BreakEveryRand = 40; // +/- amount for BreakEvery //
//----------------------------------------------------------------------------//
BreakFor = 10; // Break for ... (+/- 'BreakForRand' minutes) //
BreakForRand = 5; // +/- amount for BreakFor //
////////////////////////////////////////////////////////////////////////////////
procedure DeclarePlayers;
var
x: Integer;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name := '';
Pass := '';
Nick := '';
Pin := '';
Active := True;
//----------------------------------------------------------------------------------------------------
Integers[0] := 99999; // Items (Logs, Arrows, Darts, etc.) to fletch before switching players
// If using one player, leave Integers[0] blank or equal to Integers[1]
//----------------------------------------------------------------------------------------------------
Integers[1] := 99999; // Items (Logs, Arrows, Darts, etc.) to fletch before stopping player.
//----------------------------------------------------------------------------------------------------
Strings[0] := 'Cut'; // Activity ('Cut'/'String'/'Arrows'/'Darts'/'Bolts')
//----------------------------------------------------------------------------------------------------
Strings[1] := 'Willow'; // Cutting/Stringing: ('Normal'/'Oak'/'Willow'/'Maple'/'Yew'/'Magic')
// Arrows: ('ABronze'/'AIron'/'ASteel'/'AMithril'/'ABroad'/'AAdamant'/'ARune'/'ADragon')
// Darts: ('DBronze'/'DIron'/'DSteel'/'DMithril'/'DAdamant'/'DRune'/'DDragon')
// Bolts: ('BBronze'/'BIron'/'BSilver'/'BSteel'/'BMithril'/'BAdamant'/'BRune'/'BBroad')
// Headless: Just for making headless arrows, no tips added.
//----------------------------------------------------------------------------------------------------
Strings[2] := 'Long'; // Cutting/Stringing: ('Long'/'Short'/'Stock'/'Shaft') (Stringing only supports longbows.)
// Arrows, Darts, Bolts: Leave as ''
//----------------------------------------------------------------------------------------------------
Strings[3] := 'lb'; // Bank location.
// veb - Varrock East Bank
// vwb - Varrock West Bank
// fwb - Falador West Bank
// feb - Falador East Bank
// lb - Lumbridge Bank
// db - Draynor Bank
// akb - Al-Kharid Bank
// seb - Seers Bank
// ctb - Catherby Bank
// eb - Edgeville Bank
// fgb - Fishing Guild Bank
// mc - Moonclan Bank
// yb - Yanille Bank
// da - Duel Arena Bank
// asb - Ardougne South Bank
// pc - Pest Control Bank
end; {
with Players[1] do
begin
Name := '';
Pass := '';
Nick := '';
Pin := '';
Active := True;
//----------------------------------------------------------------------------------------------------
Integers[0] := 99999; // Items (Logs, Arrows, Darts, etc.) to fletch before switching players
// If using one player, leave Integers[0] blank or equal to Integers[1]
//----------------------------------------------------------------------------------------------------
Integers[1] := 99999; // Items (Logs, Arrows, Darts, etc.) to fletch before stopping player.
//----------------------------------------------------------------------------------------------------
Strings[0] := 'Cut'; // Activity ('Cut'/'String'/'Arrows'/'Darts'/'Bolts')
//----------------------------------------------------------------------------------------------------
Strings[1] := 'Willow'; // Cutting/Stringing: ('Normal'/'Oak'/'Willow'/'Maple'/'Yew'/'Magic')
// Arrows: ('ABronze'/'AIron'/'ASteel'/'AMithril'/'ABroad'/'AAdamant'/'ARune'/'ADragon')
// Darts: ('DBronze'/'DIron'/'DSteel'/'DMithril'/'DAdamant'/'DRune'/'DDragon')
// Bolts: ('BBronze'/'BIron'/'BSilver'/'BSteel'/'BMithril'/'BAdamant'/'BRune'/'BBroad')
//----------------------------------------------------------------------------------------------------
Strings[2] := 'Long'; // Cutting/Stringing: ('Long'/'Short'/'Stock'/'Shaft') (Stringing only supports longbows.)
// Arrows, Darts, Bolts: Leave as ''
//----------------------------------------------------------------------------------------------------
Strings[3] := 'lb'; // Bank location.
// veb - Varrock East Bank
// vwb - Varrock West Bank
// fwb - Falador West Bank
// feb - Falador East Bank
// lb - Lumbridge Bank
// db - Draynor Bank
// akb - Al-Kharid Bank
// seb - Seers Bank
// ctb - Catherby Bank
// eb - Edgeville Bank
// fgb - Fishing Guild Bank
// mc - Moonclan Bank
// yb - Yanille Bank
// da - Duel Arena Bank
// asb - Ardougne South Bank
// pc - Pest Control Bank
end;}
for x := 0 to (HowManyPlayers - 1) do
begin
Players[x].Integers[90] := 0; // Local loads done per player.
Players[x].Integers[91] := 0; // Global loads done per player.
Players[x].Integers[92] := 0; // Time ran per player.
Players[x].Integers[93] := 0; // Sleep time per player.
// 80: FeathersSlot // 94: Headless Arrow XP
// 81: ShaftSlot // 95: Unstrung Bow ID #
// 82: HeadlessSlot // 96: Finished Bow ID #
// 83: TipsSlot // 97: XP per log
// 98: Wood/Tip ID #
end;
if(HowManyPlayers = 1)then Players[CurrentPlayer].Integers[0] := Players[CurrentPlayer].Integers[1];
end;
var
StartTime, EndTime, Wrong: Integer;
BreakStartTime, SBreakEvery, SBreakFor: Integer;
const
//////////////////
// ID's //
/////////////////////////
Knife = 946; //
BowString = 1777; //
Feathers = 314; //
Shafts = 52; //
Headless = 53; //////////////////////////////////////////////
ABronze = 39; AIron = 40; ASteel = 41; AMithril = 42; //
ABroad = 13278; AAdamant = 43; ARune = 44; ADragon = 11237; //
DBronze = 819; DIron = 820; DSteel = 821; DMithril = 822; //
DAdamant = 823; DRune = 824; DDragon = 11232; //
BBronze = 9375; BIron = 9377; BSilver = 9382; BSteel = 9378; //
BMithril = 9379; BBroad = 13279; BAdamant = 9380; BRune = 9381; //
/////////////////////////////////////////////////////////////////////
// Colors //
/////////////////////////
WhBorder = 16777215; //
OrText = 2070783; //
/////////////////////////
////////////////////////////////////////////////////////////////////////////////
procedure RWait(WaitTime: Integer); //
begin //
Wait(WaitTime + Random(WaitTime / 5)); //
end; //
////////////////////////////////////////////////////////////////////////////////
procedure MC(x, y, rx, ry: Integer; Left: Boolean); //
begin //
Mouse(x + RandomRange(-rx,rx), y + RandomRange(-ry,ry), 0, 0, Left); //
end; //
////////////////////////////////////////////////////////////////////////////////
procedure Debug(Msg: String); //
begin //
if(DebugMode)then //
Writeln(Msg); //
end; //
////////////////////////////////////////////////////////////////////////////////
procedure Bye(Msg: String); //
begin //
Players[CurrentPlayer].Active := False; //
Players[CurrentPlayer].Strings[99] := Msg; //
Logout; //
end; //
////////////////////////////////////////////////////////////////////////////////
function WhiteBorder(x, y: Integer): Boolean;
var
i, n, m: Integer;
begin
Debug('Selecting White Border');
Result := False; i := 0;
repeat
if(FindColorSpiralTolerance(n, m, WhBorder, x - 8, y - 8, x + 8, y + 8, 1))then
Result := True
else begin
MC(x, y, 6, 6, True);
Wait(200 + Random(100));
end;
Inc(i);
until((i > 2) or (Result = True))
end;
function OrangeText: Boolean;
var
i, x, y: Integer;
begin
Debug('Selecting Orange Text');
Result := False;
repeat
Wait(50);
if(FindColorSpiralTolerance(x, y, OrText, MCX1, MCY1, MCX2, MCY2, 2))then
Result := True;
Inc(i);
until((i > 100) or (Result = True))
end;
procedure TakeBreak;
var
i, StartBreak: Integer;
begin
Logout;
StartBreak := GetSystemTime;
Debug('Taking a break for ' + IntToStr(SBreakFor div 1000 div 60) + ' minutes.');
repeat
Wait(1000);
Inc(i);
if((i > 120) and ((SBreakFor - (GetSystemTime - StartBreak)) > 5000))then
begin
i := 0;
Debug('Waking up in ' + IntToStr((SBreakFor - (GetSystemTime - StartBreak)) div 1000 div 60) + ' minutes.');
end;
until(SBreakFor < (GetSystemTime - StartBreak))
Debug('Waking up');
LogInPlayer;
IncEx(Players[CurrentPlayer].Integers[93], SBreakFor);
BreakStartTime := GetSystemTime;
SBreakEvery := (BreakEvery + RandomRange(-BreakEveryRand, BreakEveryRand)) * 60 * 1000;
SBreakFor := (BreakFor + RandomRange(-BreakForRand, BreakForRand)) * 60 * 1000;
Wait(6000 + Random(6000));
end;
procedure AntiBan;
begin
case Random(500) of
0..4: Gametab(RandomRange(tab_Combat, tab_Notes));
5..14: RandomRClick;
15..47: SleepAndMoveMouse(1000+ Random(1200));
48..50: BoredHuman;
51..60: HoverSkill('fletching', False);
61..100: IdleTime(2000, 1000, 0.2);
end;
end;
procedure SoftAntiBan;
begin
case Random(500) of
0..10: RandomRClick;
11..50: SleepAndMoveMouse(RandomRange(200, 1200));
51..85: IdleTime(1000, 500, 0.2);
end;
end;
procedure AFKAntiBan;
begin
Wait(30000 + Random(50000));
end;
function GetDTM(Item: string): Integer;
begin
case Lowercase(Item) of
'normal', 'regular': Result := DTMFromString('mrAAAAHic42BgYLDgYmCwB2JLI' +
'NYFYhcoNgJiLSDuBKqZAMQTgbgPiLuAeDIQz4DSiZ7aYBznrsVQnWQGFGFCw' +
'SxAEhmjA0YCGAYAyCEKRg==');
'oak': Result := DTMFromString('mrAAAAHic42BgYEgE4kwgTgDiUCDOAuJ8II4' +
'B4hCoXAEUg8SzgbgIiCuAuASIW5KtGNpSrRkaEi0ZZlSCTGBCwSxAEhmjA0Y' +
'CGAYAWtcLeQ==');
'willow': Result := DTMFromString('mrAAAAHic42BgYOgF4slA3A3ETUA8A4hnAnE' +
'PEDcAcToQFwBxIZTOAuJiIC4H4hIgdrAUYXC2FgHTgT5mQBEmFMwCJJExOmA' +
'kgGEAAFEyCpI=');
'maple': Result := DTMFromString('mlwAAAHicY2dgYNjLxcBwGoi3A/E6ID4IxFu' +
'BeD0QtwPlJwDxdCDuAeI+IO6HikVa8gBJJjgG8UuDlMGYlQEVsCJhRjwYCgB' +
'hrwx4');
'yew': Result := DTMFromString('mrAAAAHic42BgYHgGxG+A+CkQ3wLiL0D8Foi' +
'fA/FtIE4D4nwgLoTSeUBcAsRlQFwKxK5GXAxeZlwMHiZcDJkhekARJhTMAiS' +
'RMTpgJIBhAAD9zg1b');
'magic': Result := DTMFromString('mwQAAAHic42RgYBBkZGCQAWIBIGaHsqWBWAL' +
'KZwXiDKC6QiAuhdLZUHYZFIP4taXBDLlpngwtNREMupPbgSJMGJgVSMIwBwN' +
'2wEgEhgMAyW0J0g==');
'bow string': Result := DTMFromString('mlwAAAHicY2dgYHgGxbeB+DMQvwXie1D6E' +
'RC/AeL7QPwCSe4lEGclB4JxZIA1kMeEglmBJAyjA0Y8GAoADrAP4Q==');
'umaple': Result := DTMFromString('mbQAAAHicY2VgYEgD4kQgzgfiHCDOBuIHQ' +
'HwXiN8B8TMgfg3EdUV5DFGBfgyVOZlAHhMYswJJGIYBRiwYDAAAvApM');
'uyew': Result := DTMFromString('mggAAAHicY2NgYOgH4glAPA2KpwPxLCC+C' +
'8QPgPghED8B4ldA/A6Il0+QBJJMYDy5XhRM1+YIMbAyIAArEs2IA0MAAHC' +
'xDGo=');
'umagic': Result := DTMFromString('mlwAAAHicY2dgYNgFxHuAeB8QHwTiw0B8B' +
'IiPA/FtIL4HxI+g+DkQvwHid0CslJsCJJnAWD4pmkE2JhTMlg71Y2BlQAB' +
'WKIaxGfFgKAAAb20PBQ==');
else
begin
Bye('Wrong DTM selected.');
Exit;
end;
end;
end;
procedure BankDTM(Item: String; Num: Integer);
var
i, x, y, DTM_OBJ, Start, StartInv: Integer;
begin
if(not(LoggedIn))then Exit;
DTM_OBJ := GetDTM(Item);
repeat
RWait(75);
if(i = 85)then
MMouse(300, 50, 100, 45);
if((i > 90) and (i < 94))then
begin
FreeDTM(DTM_OBJ);
DTM_OBJ := GetDTM(Item);
CloseBank;
R_OpenBankBooth(Players[CurrentPlayer].Strings[3]);
Wait(350 + Random(500));
end;
if(i > 100)then
begin
CloseBank;
Logout;
FreeDTM(DTM_OBJ);
Bye('Couldnt find ' + Item + ' Logs.');
Exit;
end;
Inc(i);
until(FindDTM(DTM_OBJ, x, y, MSX1, 80, MSX2, MSY2))
FreeDTM(DTM_OBJ);
i := 0;
Wait(50 + Random(150));
MC(x, y, 5, 5, False);
Wait(250 + Random(300));
StartInv := InvCount;
if(Num = 28)then
begin
ChooseOption('ithdraw-All but');
RWait(300);
Exit;
end else
begin
if(OptionsExist(['draw-' + IntToStr(num)], False))then
begin
ChooseOption('draw-' + IntToStr(num));
Wait(150 + Random(450));
end else
begin
ChooseOption('draw-X');
DTM_OBJ := DTMFromString('mwQAAAHic42QAAkYGhhtA6g4QawLZekAsAsRvgPxbQKwA' +
'ZE8C4ilA3APEU4G4HyoGwhOAeCIjA9UAIxEYDgCBqglB');
Start := GetSystemTime;
repeat
RWait(100);
if((GetSystemTime - Start) > 7500)then
begin
FreeDTM(DTM_OBJ);
Exit;
end;
until((FindDTM(DTM_OBJ, x, y, 200, 380, 320, 420)))
FreeDTM(DTM_OBJ);
Wait(150 + Random(450));
TypeSend(IntToStr(Num));
end;
end;
repeat
RWait(50);
if(i > 150)then
Break;
Inc(i);
until(InvCount > StartInv)
i := 0;
Wait(100 + Random(250));
end;
{procedure Stats;
begin
Debug('Sending Updated Stats');
if(not(SRLStats_UserID = ''))then
begin
Stats_SendReport;
Stats_ManageAccounts;
end;
end;}
{procedure SetupStats;
begin
Stats_UserID := SRLStats_UserID;
Stats_Password := SRLStats_Password;
Stats_ScriptID := '91';
Debug('Setup Stats With Website');
end;}
procedure CutLogs;
var
i, r, Inv, LogCount, Num, Start: Integer;
begin
if(not(LoggedIn))then Exit;
if(R_BankScreen = False)then
begin
Inv := R_CountItemID(Players[CurrentPlayer].Integers[98]);
if(Inv < 27)then
begin
Inc(Wrong);
Exit;
end;
if(not(WhiteBorder(580, 230)))then
Inc(Wrong)
else begin
Debug('Clicking Knife onto Wood');
Wait(300 + Random(300));
case Random(6) of
0..3: MC(625, 225, 7, 7, True);
4: MC(580, 265, 7, 7, True);
5: MC(625, 265, 7, 7, True);
end;
Wait(300 + Random(300));
if(not(OrangeText))then
Inc(Wrong)
else begin
Debug('Clicking Orange Text');
Wait(200 + Random(300));
case LowerCase(Players[CurrentPlayer].Strings[1]) of
'normal', 'regular': begin
case LowerCase(Players[CurrentPlayer].Strings[2]) of
'shaft': MC(110, 425, 25, 15, True);
'short': MC(210, 425, 25, 15, True);
'long': MC(310, 425, 25, 15, True);
'stock': MC(410, 425, 25, 15, True);
end;
end;
'oak', 'willow', 'maple', 'yew': begin
case LowerCase(Players[CurrentPlayer].Strings[2]) of
'short': MC(160, 425, 25, 15, True);
'long': MC(260, 425, 25, 15, True);
'stock': MC(360, 425, 25, 15, True);
end;
end;
'magic': begin
case LowerCase(Players[CurrentPlayer].Strings[2]) of
'short': MC(210, 425, 25, 15, True);
'long': MC(310, 425, 25, 15, True);
end;
end;
end;
repeat
Wait(100);
Inc(i);
if(i > 75)then
Inc(Wrong);
until((R_CountItemID(Players[CurrentPlayer].Integers[98]) < Inv) or (i > 75))
i := 0;
if(R_CountItemID(Players[CurrentPlayer].Integers[98]) < Inv)then
begin
Wrong := 0;
Start := GetSystemTime;
repeat
if(r = 0)then
LogCount := R_CountItemID(Players[CurrentPlayer].Integers[98]);
RWait(100);
if(LevelUp)then Exit;
if(i > 1000)then
Inc(Wrong);
if(R_CountItemID(Players[CurrentPlayer].Integers[98]) > 8)then
AntiBan
else
SoftAntiBan;
if(R_FindRandoms)then
begin
RWait(2500 + Random(5300));
Exit;
end;
Inc(i); Inc(r);
if(R_CountItemID(Players[CurrentPlayer].Integers[98]) < LogCount)then
begin
//Debug('Less Logs Detected. Resetting R.');
r := 0;
end else
begin
//Debug('R: ' + IntToStr(r));
if(r > 20)then
begin
Inc(Wrong);
Exit;
end;
end;
until((R_CountItemID(Players[CurrentPlayer].Integers[98]) = 0) or ((GetSystemTime - Start) > 120000))
Num := (27 - R_CountItemID(Players[CurrentPlayer].Integers[98]));
IncEx(Players[CurrentPlayer].Integers[90], Num);
IncEx(Players[CurrentPlayer].Integers[91], Num);
//IncEx(Stats_CustomVars[1], Num);
//IncEx(Stats_CustomVars[2], Num * Players[CurrentPlayer].Integers[97]);
//Stats;
Debug(IntToStr(i));
end;
end;
end;
end else
CloseBank;
end;
procedure StringThem;
var
i, r, x, y, Inv, Num, StringCount, Start: Integer;
begin
if(not(LoggedIn))then Exit;
if((R_BankScreen = False) and (R_CountItemID(BowString) = 14) and (R_CountItemID(Players[CurrentPlayer].Integers[95]) = 14))then
begin
Inv := InvCount;
case Random(100) of
0..55: begin
x := 585; y := 340;
end;
56..80: begin
x := 625; y := 340;
end;
81..92: begin
x := 665; y := 300;
end;
93..99: begin
x := 705; y := 300;
end;
end;
if(not(WhiteBorder(x, y)))then
Inc(Wrong)
else begin
Debug('Clicking String onto Unstrung');
Wait(300 + Random(300));
if(x < 600)then
MC(585, 375, 7, 7, True)
else if(x < 640)then
MC(625, 375, 7, 7, True)
else if(x < 680)then
MC(665, 335, 7, 7, True)
else if(x < 720)then
MC(705, 335, 7, 7, True);
Wait(300 + Random(300));
if(not(OrangeText))then
Inc(Wrong)
else begin
Debug('Clicking Orange Text');
Wait(200 + Random(300));
MC(260, 425, 25, 15, True);
repeat
Wait(100);
Inc(i);
if(i > 75)then
begin
Inc(Wrong);
Exit;
end;
until(InvCount < Inv)
i := 0; Wrong := 0;
Start := GetSystemTime;
repeat
if(r = 0)then
StringCount := R_CountItemID(BowString);
RWait(100);
if(LevelUp)then Exit;
if(i > 1000)then
Inc(Wrong);
if(R_CountItemID(Players[CurrentPlayer].Integers[96]) < 8)then
AntiBan
else
SoftAntiBan;
if(R_FindRandoms)then
begin
RWait(2500 + Random(5300));
Exit;
end;
Inc(i); Inc(r);
if(R_CountItemID(BowString) < StringCount)then
begin
Debug('Less Strings Detected. Resetting R.');
r := 0;
end else
begin
Debug('R: ' + IntToStr(r));
if(r > 20)then
begin
Inc(Wrong);
Exit;
end;
end;
until((R_CountItemID(BowString) = 0) or ((GetSystemTime - Start) > 45000))
Num := (14 - R_CountItemID(BowString));
IncEx(Players[CurrentPlayer].Integers[90], Num);
IncEx(Players[CurrentPlayer].Integers[91], Num);
//IncEx(Stats_CustomVars[1], Num);
//IncEx(Stats_CustomVars[2], Num * Players[CurrentPlayer].Integers[97]);
//Stats;
end;
end;
end else
Inc(Wrong);
end;
procedure HeadlessLoop;
var
i, r, Num, Start, StartAmount, StartAmount2: Integer;
Inv: array[1..28] of TInvItem;
begin
if(Players[CurrentPlayer].Booleans[0] = False)then
begin
for i := 1 to 28 do
begin
Inv[i] := GetInvItemAt(i);
case Inv[i].ID of
Feathers: Players[CurrentPlayer].Integers[80] := Inv[i].Slot;
Shafts: Players[CurrentPlayer].Integers[81] := Inv[i].Slot;
Headless: Players[CurrentPlayer].Integers[82] := Inv[i].Slot;
Players[CurrentPlayer].Integers[98]: Players[CurrentPlayer].Integers[83] := Inv[i].Slot;
end;
end;
Players[CurrentPlayer].Booleans[0] := True;
end;
if(Random(2) = 0)then
begin
R_ClickItemID(Feathers, True, '');
RWait(150 + Random(350));
R_ClickItemID(Shafts, True, '');
end else
begin
R_ClickItemID(Shafts, True, '');
RWait(150 + Random(350));
R_ClickItemID(Feathers, True, '');
end;
Start := GetSystemTime;
repeat
RWait(100);
if((GetSystemTime - Start) > 5000)then
begin
Inc(Wrong);
Exit;
end;
until(OrangeText)
Wait(150 + Random(350));
MC(260, 425, 25, 10, True);
StartAmount := GetItemStackSizeAt(Players[CurrentPlayer].Integers[80]);
Start := GetSystemTime;
repeat
RWait(100);
if((GetSystemTime - Start) > 5000)then
begin
Inc(Wrong);
Exit;
end;
until(GetItemStackSizeAt(Players[CurrentPlayer].Integers[80]) < StartAmount)
Wrong := 0;
repeat
if(r = 0)then
StartAmount2 := GetItemStackSizeAt(Players[CurrentPlayer].Integers[80]);
RWait(25);
if(LevelUp)then
begin
Wait(500 + Random(2000));
Exit;
end;
if(R_FindRandoms)then
begin
RWait(2500 + Random(5300));
Exit;
end;
SoftAntiBan;
Inc(r);
if(GetItemStackSizeAt(Players[CurrentPlayer].Integers[80]) < StartAmount2)then
begin
Debug('Less Feathers Detected. Resetting R.');
r := 0;
end else
Debug('R: ' + IntToStr(r));
until((r >= 15) or ((GetSystemTime - Start) > 25000))
Wait(100 + Random(250));
Num := (StartAmount - GetItemStackSizeAt(Players[CurrentPlayer].Integers[80]));
IncEx(Players[CurrentPlayer].Integers[94], Num);
//IncEx(Stats_CustomVars[2], Num * Players[CurrentPlayer].Integers[97]);
//Stats;
if(Random(19) = 0)then BoredHuman;
end;
procedure ArrowLoop;
var
i, r, Num, Start, StartAmount, StartAmount2: Integer;
Inv: array[1..28] of TInvItem;
begin
if(Players[CurrentPlayer].Booleans[1])then
begin
Players[CurrentPlayer].Booleans[0] := False;
Players[CurrentPlayer].Booleans[1] := False;
end;
if(Players[CurrentPlayer].Booleans[0] = False)then
begin
for i := 1 to 28 do
begin
Inv[i] := GetInvItemAt(i);
case Inv[i].ID of
Feathers: Players[CurrentPlayer].Integers[80] := Inv[i].Slot;
Shafts: Players[CurrentPlayer].Integers[81] := Inv[i].Slot;
Headless: Players[CurrentPlayer].Integers[82] := Inv[i].Slot;
Players[CurrentPlayer].Integers[98]: Players[CurrentPlayer].Integers[83] := Inv[i].Slot;
end;
end;
Players[CurrentPlayer].Booleans[0] := True;
end;
if(Random(2) = 0)then
begin
R_ClickItemID(Headless, True, '');
RWait(150 + Random(350));
R_ClickItemID(Players[CurrentPlayer].Integers[98], True, '');
end else
begin
R_ClickItemID(Players[CurrentPlayer].Integers[98], True, '');
RWait(150 + Random(350));
R_ClickItemID(Headless, True, '');
end;
Start := GetSystemTime;
repeat
RWait(100);
if((GetSystemTime - Start) > 5000)then
begin
Inc(Wrong);
Exit;
end;
until(OrangeText)
Wait(150 + Random(350));
MC(260, 425, 25, 10, True);
StartAmount := GetItemStackSizeAt(Players[CurrentPlayer].Integers[83]);
Start := GetSystemTime;
repeat
RWait(100);
if((GetSystemTime - Start) > 5000)then
begin
Inc(Wrong);
Exit;
end;
until(GetItemStackSizeAt(Players[CurrentPlayer].Integers[83]) < StartAmount)
Wrong := 0;
repeat
if(r = 0)then
StartAmount2 := GetItemStackSizeAt(Players[CurrentPlayer].Integers[83]);
RWait(25);
if(LevelUp)then
begin
Wait(500 + Random(2000));
Exit;
end;
if(R_FindRandoms)then
begin
RWait(2500 + Random(5300));
Exit;
end;
SoftAntiBan;
Inc(r);
if(GetItemStackSizeAt(Players[CurrentPlayer].Integers[83]) < StartAmount2)then
begin
Debug('Less Tips Detected. Resetting R.');
r := 0;
end else
Debug('R: ' + IntToStr(r));
until((r >= 15) or ((GetSystemTime - Start) > 25000))
Wait(100 + Random(250));
Num := (StartAmount - GetItemStackSizeAt(Players[CurrentPlayer].Integers[83]));
IncEx(Players[CurrentPlayer].Integers[90], Num);
IncEx(Players[CurrentPlayer].Integers[91], Num);
//IncEx(Stats_CustomVars[1], Num);
//IncEx(Stats_CustomVars[2], Num * Players[CurrentPlayer].Integers[97]);
//Stats;
if(Random(25) = 0)then BoredHuman;
end;
procedure DartLoop;
begin
end;
procedure BoltLoop;
begin
end;
procedure MainLoop;
var
Start: Integer;
begin
if(not(LoggedIn))then Exit;
RWait(150 + Random(150));
case (LowerCase(Players[CurrentPlayer].Strings[0])) of
'cut': begin
R_FindRandoms;
if(not(R_CountItemID(Knife) = 1))then
begin
Bye('No Knife in Inventory');
Exit;
end;
if(not(R_CountItemId(Players[CurrentPlayer].Integers[98]) = 27))then
begin
R_OpenBankBooth(Players[CurrentPlayer].Strings[3]);
//OpenBank(Players[CurrentPlayer].Strings[3], True, True);
Start := GetSystemTime;
repeat
RWait(100);
until((R_BankScreen) or ((GetSystemTime - Start) > 5000))
Wait(200 + random(300));
R_DepositAllButID(Knife);
Wait(200 + Random(300));
BankDTM(Players[CurrentPlayer].Strings[1], 28);
end;
Wait(350 + Random(500));
CloseBank;
if((R_CountItemID(Players[CurrentPlayer].Integers[98]) > 0) and (R_CountItemID(Players[CurrentPlayer].Integers[98]) < 27) and (not(InvCount = 28)))then
begin
Bye('Insufficient Logs Detected');
Exit;
end;
Start := GetSystemTime;
repeat
RWait(100);
until((not(R_BankScreen)) or ((GetSystemTime - Start) > 5000))
if(R_BankScreen)then CloseBank;
Wait(500 + Random(1000));
CutLogs;
R_FindRandoms;
end;
'string': begin
R_FindRandoms;
if(((R_CountItemID(BowString) > 0) and (R_CountItemID(BowString) < 14) and (not(InvCount = 28))) or
((R_CountItemID(Players[CurrentPlayer].Integers[95]) > 0) and (R_CountItemID(Players[CurrentPlayer].Integers[95]) < 14) and (not(InvCount = 28))))then
begin
Bye('Insufficient Strings/Unstrung Detected');
Exit;
end;
if(not((R_CountItemID(BowString) = 14) and (R_CountItemID(Players[CurrentPlayer].Integers[95]) = 14)))then
begin
R_OpenBankBooth(Players[CurrentPlayer].Strings[3]);
//OpenBank(Players[CurrentPlayer].Strings[3], True, True);
Start := GetSystemTime;
repeat
RWait(100);
until((R_BankScreen) or ((GetSystemTime - Start) > 5000))
Wait(200 + random(300));
R_DepositAll(True);
Wait(200 + Random(300));
BankDTM('Bow String', 14);
BankDTM('u' + Players[CurrentPlayer].Strings[1], 14);
end;
Wait(350 + Random(500));
CloseBank;
Start := GetSystemTime;
repeat
RWait(100);
until((not(R_BankScreen)) or ((GetSystemTime - Start) > 5000))
if(R_BankScreen)then CloseBank;
Wait(500 + Random(1000));
StringThem;
R_FindRandoms;
end;
'arrows', 'arrow':
begin
R_FindRandoms;
if(InvCount > 4)then
begin
Debug('To many item in inventory. Get it together.');
Exit;
end else
if((R_CountItemID(Feathers) > 0) and (R_CountItemID(Shafts) > 0))then
begin
HeadlessLoop;
Players[CurrentPlayer].Booleans[1] := True;
end
else if((R_CountItemID(Headless) > 0) and (R_CountItemID(Players[CurrentPlayer].Integers[98]) > 0))then
ArrowLoop
else
begin
Debug('Out of materials');
Exit;
end;
end;
'darts', 'dart':
begin
R_FindRandoms;
DartLoop;
end;
'bolts', 'bolt':
begin
R_FindRandoms;
BoltLoop;
end;
else
begin
Bye('Wrong selection type entered.');
Exit;
end;
end;
R_FindRandoms;
end;
procedure Report;
var
a, i, SleepPer: Integer;
PlayerRunTime: Extended;
begin
if(DebugMode = False)then
ClearDebug;
EndTime := GetSystemTime;
IncEx(Players[CurrentPlayer].Integers[92], EndTime - StartTime);
Writeln('---------------------------------------------');
Writeln('------- Smurgs AIO Fletcher V2.00 -----------');
Writeln('---------------------------------------------');
Writeln('You are running: ' + IntToStr(HowManyPlayers) + ' character(s).');
Writeln('---------------------------------------------');
for a := 0 to (HowManyPlayers - 1) do
begin
PlayerRunTime := Players[a].Integers[92] div 1000.0 div 60.0 div 60.0;
Writeln('Character: ' + Players[a].Nick);
case LowerCase(Players[a].Strings[0]) of
'cut': Writeln('Logs Cut: ' + IntToStr(Players[a].Integers[91]) + ' (' + IntToStr(Round((Players[a].Integers[91]) div PlayerRunTime)) + ' logs/hr)(Cutting ' + Players[a].Strings[1] + ' ' + Players[a].Strings[2] + 's)');
'string': Writeln('Bows Strung: ' + IntToStr(Players[a].Integers[91]) + ' (' + IntToStr(Round((Players[a].Integers[91]) div PlayerRunTime)) + ' bows/hr)(Stringing ' + Players[a].Strings[1] + ' Bows)');
'arrows', 'arrow': Writeln('Arrows Fletched: ' + IntToStr(Players[a].Integers[91]) + ' (' + IntToStr(Round((Players[a].Integers[91] * 15) div PlayerRunTime)) + ' arrows/hr)(Making ' + Players[a].Strings[1] + ' Arrows)');
'darts', 'dart': Writeln('Darts Fletched: ' + IntToStr(Players[a].Integers[91]) + ' (' + IntToStr(Round((Players[a].Integers[91] * 10) div PlayerRunTime)) + ' darts/hr)(Making ' + Players[a].Strings[1] + ' Darts)');
'bolts', 'bolt': Writeln('Bolts Fletched: ' + IntToStr(Players[a].Integers[91]) + ' (' + IntToStr(Round((Players[a].Integers[91] * 10) div PlayerRunTime)) + ' bolts/hr)(Making ' + Players[a].Strings[1] + ' Bolts)');
end;
case LowerCase(Players[a].Strings[0]) of
'cut', 'string': Writeln('Experience Gained: ' + IntToStr(Players[a].Integers[91] * Players[a].Integers[97]) + ' (' + IntToStr(Round((Players[a].Integers[91] * Players[a].Integers[97]) div PlayerRunTime)) + ' xp/hr)');
'arrows', 'arrow': Writeln('Experience Gained: ' + IntToStr(((Players[a].Integers[91] * Players[a].Integers[97]) / 15) + Players[CurrentPlayer].Integers[94]) + ' (' + IntToStr(Round((((Players[a].Integers[91] * Players[a].Integers[97]) / 15) + Players[CurrentPlayer].Integers[94]) div PlayerRunTime)) + ' xp/hr)');
'darts', 'dart': Writeln('Experience Gained: ' + IntToStr((Players[a].Integers[91] * Players[a].Integers[97]) / 10) + ' (' + IntToStr(Round(((Players[a].Integers[91] * Players[a].Integers[97]) / 10) div PlayerRunTime)) + ' xp/hr)');
'bolts', 'bolt': Writeln('Experience Gained: ' + IntToStr((Players[a].Integers[91] * Players[a].Integers[97]) / 10) + ' (' + IntToStr(Round(((Players[a].Integers[91] * Players[a].Integers[97]) / 10) div PlayerRunTime)) + ' xp/hr)');
end;
Writeln('This character has been running for: ' + MsToTime(Players[a].Integers[92], 0));
if(HowManyPlayers = 1)then
Writeln('This character has slept for: ' + MsToTime(Players[a].Integers[93], 0))
else
begin
SleepPer := 0;
for i := 0 to (HowManyPlayers - 1)do
begin
if(not(a = i))then
IncEx(SleepPer, Players[i].Integers[92]);
end;
Writeln('This character has slept for: ' + MsToTime(SleepPer, 0));
end;
if(Players[a].Active)then
Writeln('Active Status: Active')
else
begin
Writeln('Active Status: Not Active (Reason: ' + Players[a].Strings[99] + ')');
end;
Writeln('---------------------------------------------');
end;
Writeln('Total Script RunTime: ' + TimeRunning);
Writeln('---------------------------------------------');
end;
procedure FinalReport;
var
a, i, SleepPer: Integer;
PlayerRunTime: Extended;
begin
Writeln('---------------------------------------------');
Writeln('------- Smurgs AIO Fletcher V2.00 -----------');
Writeln('---------------------------------------------');
Writeln('You are running: ' + IntToStr(HowManyPlayers) + ' character(s).');
Writeln('---------------------------------------------');
for a := 0 to (HowManyPlayers - 1) do
begin
PlayerRunTime := Players[a].Integers[92] div 1000.0 div 60.0 div 60.0;
Writeln('Character: ' + Players[a].Nick);
case LowerCase(Players[a].Strings[0]) of
'cut': Writeln('Logs Cut: ' + IntToStr(Players[a].Integers[91]) + ' (' + IntToStr(Round((Players[a].Integers[91]) div PlayerRunTime)) + ' logs/hr)(Cutting ' + Players[a].Strings[1] + ' ' + Players[a].Strings[2] + 's)');
'string': Writeln('Bows Strung: ' + IntToStr(Players[a].Integers[91]) + ' (' + IntToStr(Round((Players[a].Integers[91]) div PlayerRunTime)) + ' bows/hr)(Stringing ' + Players[a].Strings[1] + ' Bows)');
'arrows', 'arrow': Writeln('Arrows Fletched: ' + IntToStr(Players[a].Integers[91]) + ' (' + IntToStr(Round((Players[a].Integers[91] * 15) div PlayerRunTime)) + ' arrows/hr)(Making ' + Players[a].Strings[1] + ' Arrows)');
'darts', 'dart': Writeln('Darts Fletched: ' + IntToStr(Players[a].Integers[91]) + ' (' + IntToStr(Round((Players[a].Integers[91] * 10) div PlayerRunTime)) + ' darts/hr)(Making ' + Players[a].Strings[1] + ' Darts)');
end;
case LowerCase(Players[a].Strings[0]) of
'cut', 'string': Writeln('Experience Gained: ' + IntToStr(Players[a].Integers[91] * Players[a].Integers[97]) + ' (' + IntToStr(Round((Players[a].Integers[91] * Players[a].Integers[97]) div PlayerRunTime)) + ' xp/hr)');
'arrows', 'arrow': Writeln('Experience Gained: ' + IntToStr(((Players[a].Integers[91] * Players[a].Integers[97]) / 15) + Players[CurrentPlayer].Integers[94]) + ' (' + IntToStr(Round((((Players[a].Integers[91] * Players[a].Integers[97]) / 15) + Players[CurrentPlayer].Integers[94]) div PlayerRunTime)) + ' xp/hr)');
'darts', 'dart': Writeln('Experience Gained: ' + IntToStr((Players[a].Integers[91] * Players[a].Integers[97]) / 10) + ' (' + IntToStr(Round(((Players[a].Integers[91] * Players[a].Integers[97]) / 10) div PlayerRunTime)) + ' xp/hr)');
end;
Writeln('This character has been running for: ' + MsToTime(Players[a].Integers[92], 0));
if(HowManyPlayers = 1)then
Writeln('This character has slept for: ' + MsToTime(Players[a].Integers[93], 0))
else
begin
SleepPer := 0;
for i := 0 to (HowManyPlayers - 1)do
begin
if(not(a = i))then
IncEx(SleepPer, Players[i].Integers[92]);
end;
Writeln('This character has slept for: ' + MsToTime(SleepPer, 0));
end;
if(Players[a].Active)then
Writeln('Active Status: Active')
else
begin
Writeln('Active Status: Not Active (Reason: ' + Players[a].Strings[99] + ')');
end;
Writeln('---------------------------------------------');
end;
Writeln('Total Script RunTime: ' + TimeRunning);
Writeln('---------------------------------------------');
end;
procedure SetVars;
var
i: Integer;
begin
SBreakEvery := (BreakEvery + RandomRange(-BreakEveryRand, BreakEveryRand)) * 60 * 1000;
SBreakFor := (BreakFor + RandomRange(-BreakForRand, BreakForRand)) * 60 * 1000;
BreakStartTime := GetSystemTime;
for i := 0 to (HowManyPlayers - 1)do
begin
case LowerCase(Players[i].Strings[1]) of
'regular', 'normal':
begin
if(LowerCase(Players[i].Strings[0]) = 'string')then
begin
Bye('The script doesnt support stringing normal bows.');
TerminateScript;
end;
Players[i].Integers[98] := 1511;
case LowerCase(Players[i].Strings[2]) of
'short': Players[i].Integers[97] := 5;
'long': Players[i].Integers[97] := 10;
'stock': Players[i].Integers[97] := 6;
'shaft': Players[i].Integers[97] := 5;
else
begin
Bye('Wrong value entered for fletch type');
TerminateScript;
end;
end;
end;
'oak':
begin
if(LowerCase(Players[i].Strings[0]) = 'string')then
begin
Bye('The script doesnt support stringing oak bows.');
TerminateScript;
end;
Players[i].Integers[98] := 1521;
case LowerCase(Players[i].Strings[2]) of
'short': Players[i].Integers[97] := 17;
'long': Players[i].Integers[97] := 25;
'stock': Players[i].Integers[97] := 16;
else
begin
Bye('Wrong value entered for fletch type');
TerminateScript;
end;
end;
end;
'willow':
begin
if(LowerCase(Players[i].Strings[0]) = 'string')then
begin
Bye('The script doesnt support stringing willow bows.');
TerminateScript;
end;
Players[i].Integers[98] := 1519;
case LowerCase(Players[i].Strings[2]) of
'short': Players[i].Integers[97] := 33;
'long': Players[i].Integers[97] := 42;
'stock': Players[i].Integers[97] := 22;
else
begin
Bye('Wrong value entered for fletch type');
TerminateScript;
end;
end;
end;
'maple':
begin
if(LowerCase(Players[i].Strings[0]) = 'string')then
begin
if(not(LowerCase(Players[i].Strings[2]) = 'long'))then
begin
Bye('The script doesnt support stringing anything but longbows.');
TerminateScript;
end;
end;
Players[i].Integers[95] := 62;
Players[i].Integers[96] := 851;
Players[i].Integers[98] := 1517;
case LowerCase(Players[i].Strings[2]) of
'short': Players[i].Integers[97] := 50;
'long': Players[i].Integers[97] := 58;
'stock': Players[i].Integers[97] := 32;
else
begin
Bye('Wrong value entered for fletch type');
TerminateScript;
end;
end;
end;
'yew':
begin
if(LowerCase(Players[i].Strings[0]) = 'string')then
begin
if(not(LowerCase(Players[i].Strings[2]) = 'long'))then
begin
Bye('The script doesnt support stringing anything but longbows.');
TerminateScript;
end;
end;
Players[i].Integers[95] := 66;
Players[i].Integers[96] := 855;
Players[i].Integers[98] := 1515;
case LowerCase(Players[i].Strings[2]) of
'short': Players[i].Integers[97] := 68;
'long': Players[i].Integers[97] := 75;
'stock': Players[i].Integers[97] := 50;
else
begin
Bye('Wrong value entered for fletch type');
TerminateScript;
end;
end;
end;
'magic':
begin
if(LowerCase(Players[i].Strings[0]) = 'string')then
begin
if(not(LowerCase(Players[i].Strings[2]) = 'long'))then
begin
Bye('The script doesnt support stringing anything but longbows.');
TerminateScript;
end;
end;
Players[i].Integers[95] := 70;
Players[i].Integers[96] := 859;
Players[i].Integers[98] := 1513;
case LowerCase(Players[i].Strings[2]) of
'short': Players[i].Integers[97] := 83;
'long': Players[i].Integers[97] := 92;
else
begin
Bye('Wrong value entered for fletch type');
TerminateScript;
end;
end;
end;
'abronze': begin Players[i].Integers[98] := ABronze; Players[i].Integers[97] := 40; end;
'airon': begin Players[i].Integers[98] := AIron; Players[i].Integers[97] := 58; end;
'asteel': begin Players[i].Integers[98] := ASteel; Players[i].Integers[97] := 95; end;
'amithril': begin Players[i].Integers[98] := AMithril; Players[i].Integers[97] := 133; end;
'abroad': begin Players[i].Integers[98] := ABroad; Players[i].Integers[97] := 225; end;
'aadamant': begin Players[i].Integers[98] := AAdamant; Players[i].Integers[97] := 170; end;
'arune': begin Players[i].Integers[98] := ARune; Players[i].Integers[97] := 207; end;
'adragon': begin Players[i].Integers[98] := ADragon; Players[i].Integers[97] := 245; end;
'dbronze': begin Players[i].Integers[98] := DBronze; Players[i].Integers[97] := 18; end;
'diron': begin Players[i].Integers[98] := DIron; Players[i].Integers[97] := 38; end;
'dsteel': begin Players[i].Integers[98] := DSteel; Players[i].Integers[97] := 75; end;
'dmithril': begin Players[i].Integers[98] := DMithril; Players[i].Integers[97] := 112; end;
'dadamant': begin Players[i].Integers[98] := DAdamant; Players[i].Integers[97] := 150; end;
'drune': begin Players[i].Integers[98] := DRune; Players[i].Integers[97] := 188; end;
'ddragon': begin Players[i].Integers[98] := DDragon; Players[i].Integers[97] := 250; end;
'bbronze': begin Players[i].Integers[98] := BBronze; Players[i].Integers[97] := 5; end;
'biron': begin Players[i].Integers[98] := BIron; Players[i].Integers[97] := 15; end;
'bsilver': begin Players[i].Integers[98] := BSilver; Players[i].Integers[97] := 25; end;
'bsteel': begin Players[i].Integers[98] := BSteel; Players[i].Integers[97] := 35; end;
'bmithril': begin Players[i].Integers[98] := BMithril; Players[i].Integers[97] := 50; end;
'badamant': begin Players[i].Integers[98] := BAdamant; Players[i].Integers[97] := 70; end;
'brune': begin Players[i].Integers[98] := BRune; Players[i].Integers[97] := 100; end;
'bbroad': begin Players[i].Integers[98] := BBroad; Players[i].Integers[97] := 30; end;
'headless': begin end;
else
begin
Bye('Wrong value entered for wood type');
TerminateScript;
end;
end;
end;
end;
procedure StartSMART;
begin
Smart_Server := World;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
Debug('SMART Setup');
ClearDebug;
SetupSRL;
SetUpReflectionEx(True);
DeclarePlayers;
if(not LoggedIn)then
begin
LogInPlayer;
Wait(6000 + Random(6000));
end;
Debug('Setup SRL, Declared Players, Logged In');
SetAngle(True);
MakeCompass('N');
Debug('Setup Camera');
AddOnTerminate('FinalReport');
end;
begin
StartSMART;
SetVars;
//if(not(SRLStats_UserID = ''))then SetupStats;
repeat
Players[CurrentPlayer].Integers[90] := 0;
repeat
StartTime := GetSystemTime;
MainLoop;
if(Wrong > 3)then
begin
Bye('Wrong counter exceeded');
Wrong := 0;
Break;
end;
if((Players[CurrentPlayer].Active) and ((GetSystemTime - StartTime) > 5000))then
Report;
if(((SBreakEvery < (GetSystemTime - BreakStartTime))) and (HowManyPlayers = 1))then
TakeBreak;
until(((Players[CurrentPlayer].Integers[90]) >= Players[CurrentPlayer].Integers[0]) or not(LoggedIn))
if(HowManyPlayers > 1)then
begin
if((Players[CurrentPlayer].Integers[91]) >= (Players[CurrentPlayer].Integers[1]))then
NextPlayer(False)
else
NextPlayer(Players[CurrentPlayer].Active);
Wait(6000 + Random(6000));
end else
begin
Players[CurrentPlayer].Active := False;
Logout;
TerminateScript;
end;
until(AllPlayersInactive)
end.
//////////////////////////////////////////////////
/////// ///////
// //
// Smurg's GnomeAgility V3.01 //
// -------------------------------- //
// | Fill in lines 37-72 | //
// -------------------------------- //
// //
/////// ///////
//////////////////////////////////////////////////
/////// ///////
// //
// Release Notes: //
// -1.00: Just released //
// -2.00: Re-written using reflection //
// -3.00: Added multi-player support, //
// improved report, rewrote branch 1 //
// procedure and brought out wait //
// times. //
// -3.01: Fixed some debug messages //
// and the Bye procedure. //
// //
// Future Additions: //
// -Breaks for 1 player. //
// //
// Known Bugs: None. //
// //
/////// ///////
//////////////////////////////////////////////////
program GnomeAgility;
{.include SRL/SRL/misc/smart.scar}
{.include SRL/SRL.scar}
{.include SRL/SRL/Misc/Stats.scar}
{.include Reflection/Reflection.Simba}
const
WORLD = 67; // World # to play on
DEBUG_MODE = True; // Output different debugging statements?
////////////////////////////////////////////////
// Wait times after object to search for next //
///////////////////////////////////////////////////////////////////////
W_LOG = 0; // //
W_NET1 = 800; // Edit if your computer is slower/faster. //
W_BRANCH1 = 700; // //
W_ROPE = 150; /////////////////////////////////////////////////
W_BRANCH2 = 500; //
W_NET2 = 300; //
W_PIPE = 100; //
////////////////////////
// For [url]http://scriptmanager.freehostia.com/[/url]
//--------------------------------------------
SRLStats_UserID = ''; // Temporary Stats ID (not username | Profile --> User ID)
SRLStats_Password = ''; // Password login to stats account.
//--------------------------------------------
procedure DeclarePlayers;
begin
HowManyPlayers := 1; // How many players are you using?
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name := ''; // Runescape Login
Pass := ''; // Runescape Password
Nick := ''; // 3-4 chars from Runescape name
Pin := ''; // Bank PIN
Active := True; // Start with this char?
Integers[0] := 999; // Laps to do.
end;
{with Players[1] do // Uncomment if using multiple players.
begin
Name := ';
Pass := '';
Nick := '';
Pin := '';
Active := True;
Integers[0] := 2; // Laps to do.
end;
with Players[2] do
begin
Name := '';
Pass := '';
Nick := '';
Pin := '';
Active := False;
Integers[0] := 1; // Laps to do.
end;}
end;
// Global Vars
var
Start, P_Net2: TPoint;
Log, Net1, Branch1, Rope, Branch2, Net2, Pipe: TRSObject;
StartTime, EndTime: Integer;
// Global Consts
//const
////////////////////////////////////////////////////////////////////////////////
procedure RWait(WaitTime: Integer); //
begin //
Wait(WaitTime + Random(WaitTime / 5)); //
end; //
////////////////////////////////////////////////////////////////////////////////
procedure MC(x, y, rx, ry: Integer; Left: Boolean); //
begin //
Mouse(x + RandomRange(-rx,rx), y + RandomRange(-ry,ry), 0, 0, Left); //
end; //
////////////////////////////////////////////////////////////////////////////////
procedure Debug(Msg: String); //
begin //
if(DEBUG_MODE)then //
Writeln(Msg); //
end; //
////////////////////////////////////////////////////////////////////////////////
procedure Bye(Msg: String); //
begin //
Logout; //
writeln(Msg); //
Players[CurrentPlayer].Active := False; //
end; //
////////////////////////////////////////////////////////////////////////////////
procedure FixCamera;
begin
MakeCompass('S');
SetAngle(True);
end;
procedure AntiBan;
begin
Debug('Running AntiBan Procedures');
case Random(100) of
0..20: RandomRClick;
end;
FixCamera;
end;
procedure Stats;
begin
Debug('Sending Updated Stats');
if(not(SRLStats_UserID = ''))then
begin
Stats_SendReport;
Stats_ManageAccounts;
end;
end;
procedure StartSMART;
begin
Smart_Server := WORLD;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
Debug('SMART Setup');
ClearDebug;
SetupSRL;
SetUpReflectionEx(true);
DeclarePlayers;
if(not LoggedIn)then LogInPlayer;
Debug('Setup SRL, Declared Players, Logged In');
SetAngle(True);
MakeCompass('S');
Debug('Setup Camera');
end;
procedure SetupStats;
begin
Stats_UserID := SRLStats_UserID;
Stats_Password := SRLStats_Password;
Stats_ScriptID := '81';
Debug('Setup Stats With Website');
end;
procedure SetVars;
var x: Integer;
begin
Start := Point(2475, 3435);
P_Net2 := Point(2488, 3424);
Log := NewObject(1, 0, Point(2474, 3435));
Net1 := NewObject(2285, 0, Point(2474, 3425));
Branch1 := NewObject(35970, 0, Point(2473, 3422));
Rope := NewObject(1, 0, Point(2478, 3420));
Branch2 := NewObject(2314, 0, Point(2486, 3419));
Net2 := NewObject(2286, 0, Point(2487, 3426));
Pipe := NewObject(43543, 0, Point(2487, 3431));
Debug('Set Vars');
for x := 0 to (HowManyPlayers - 1) do
begin
Players[x].Integers[90] := 0; // Laps done.
Players[x].Integers[91] := 0;
Players[x].Integers[92] := 0;
end;
end;
procedure CrossObject(Where: TTile; text: String; Finish: TPoint; AdjustX, AdjustY: Extended; WaitAfter, Height, Ran: Integer);
var
PT, LastPos: TPoint;
i, tries: Integer;
begin
repeat
R_FindRandoms;
if(tries = 0)then
begin
PT := TileToMSEx(TileToPoint(Where), AdjustX, AdjustY, Height);
MC(PT.x, PT.y, Ran, Ran, true);
Flag;
rwait(WaitAfter);
end else
begin
PT := TileToMSEx(TileToPoint(Where), AdjustX, AdjustY , Height);
MC(PT.x, PT.y, Ran, Ran, false);
rwait(300);
R_ChooseOption(text);
Flag;
rwait(WaitAfter);
end;
RWait(500);
LastPos := GetMyPos;
repeat
RWait(100);
if((i > 10) and (GetMyPos = LastPos))then
Break;
if(tries > 5)then
begin
Bye('Trouble at tile: (' + IntToStr(TileToPoint(Where).X) + ', ' + IntToStr(TileToPoint(Where).Y) + '). Uptext: ' + text);
Exit;
end;
Inc(i);
until(GetMyPos = Finish)
i := 0;
Inc(tries);
until(GetMyPos = Finish)
R_FindRandoms;
RWait(WaitAfter);
end;
procedure StupidLittleRope(Color: Integer; Text: String; WaitAfter: Integer; Position: TPoint; X1, Y1, X2, Y2, Tol: Integer);
var
LastPos, n, m: TPoint;
i, a, p, x, y, ax, ay, tries: Integer;
begin
repeat
if(GetMyPos = Point(2477, 3420))then
begin
RWait(100);
repeat
MMouse(230, 170 + a, 0, 0);
RWait(50);
Inc(a);
until(R_IsUpText('lk-on')) or (a > 40)
if(a > 40)then
begin
Bye('Couldnt find balancing rope.')
Exit;
end
else
begin
GetMousePos(x, y);
MC(x, y, 0, 0, False);
RWait(100);
R_ChooseOption('lk-on');
RWait(1700);
LastPos := GetMyPos;
repeat
AntiBan;
if((i > 5) and (GetMyPos = LastPos))then
Break;
if(tries > 3)then
begin
Bye('Missed Object. Color: ' + IntToStr(Color));
Exit;
end;
Inc(i);
until(GetMyPos = Position)
i := 0;
Inc(tries);
if(GetMyPos = Position)then
begin
RWait(WaitAfter);
Exit;
end;
end;
end;
if(tries = 0)then
begin
n := TileToMSEx(PointToTile(Point(2478, 3420)), 1, 0, 1);
m := TileToMSEx(PointToTile(Point(2478, 3420)), 0, 1, 1);
repeat
MMouse(n.x + 8, n.y + 8 + p, 0, 0);
Inc(p);
rwait(50);
until(((n.y + p) > m.y) or (R_IsUpText('alk-o')))
p := 0;
GetMousePos(ax, ay);
RWait(100);
MC(ax, ay + 2, 0, 0, true);
RWait(150);
end else
begin
n := TileToMSEx(PointToTile(Point(2478, 3420)), 1, 0, 1);
m := TileToMSEx(PointToTile(Point(2478, 3420)), 0, 1, 1);
repeat
MMouse(n.x, n.y + p, 0, 0);
Inc(p);
rwait(50);
until(((n.y + p) > m.y) or (R_IsUpText('alk-o')))
p := 0;
GetMousePos(ax, ay);
RWait(100);
MC(ax, ay, 0, 0, false);
RWait(150);
R_ChooseOption('alk-o');
RWait(150);
end;
Flag;
RWait(500);
LastPos := GetMyPos;
repeat
RWait(100);
if((i > 10) and (GetMyPos = LastPos))then
Break;
if(tries > 3)then
begin
Bye('Missed Object. Color: ' + IntToStr(Color));
Exit;
end;
Inc(i);
if(tries > 80)then
begin
Bye('Lost at rope');
Exit;
end;
until(GetMyPos = Position)
i := 0;
Inc(tries);
until(GetMyPos = Position)
R_FindRandoms;
RWait(WaitAfter);
end;
procedure Report;
var
a: Integer;
PlayerRunTime: Extended;
begin
if(DEBUG_MODE = false)then
ClearDebug;
EndTime := GetSystemTime;
IncEx(Players[CurrentPlayer].Integers[92], EndTime - StartTime);
writeln('---------------------------------------------');
writeln('------- Smurgs GnomeAgility V3.01 -----------');
writeln('---------------------------------------------');
writeln('You are running: ' + IntToStr(HowManyPlayers) + ' character(s).');
writeln('---------------------------------------------');
for a := 0 to (HowManyPlayers - 1) do
begin
PlayerRunTime := Players[a].Integers[92] div 1000.0 div 60.0 div 60.0;
writeln('Character: ' + Players[a].Nick);
writeln('Laps completed: ' + IntToStr(Players[a].Integers[91]) + ' (' + IntToStr(Round(Players[a].Integers[91] div PlayerRunTime)) + ' laps/hr)');
writeln('Experience gained: ' + IntToStr(Players[a].Integers[91] * 86) + ' (' + IntToStr(Round(Players[a].Integers[91] * 86 div PlayerRunTime)) + ' xp/hr)');
writeln('This character has been running for: ' + MsToTime(Players[a].Integers[92], 0));
writeln('---------------------------------------------');
end;
writeln('Total script runtime: ' + TimeRunning);
writeln('---------------------------------------------');
end;
procedure StupidThinBranch;
var
a, b: TPoint;
i, p, ax, ay, tries: Integer;
begin
repeat
R_FindRandoms;
if(tries = 0)then
begin
//PT := TileToMSEx(TileToPoint(Branch1.Tile), 0.45, 0.5, 1);
a := TileToMSEx(Branch1.Tile, 1, 0, 1);
b := TileToMSEx(Branch1.Tile, 0, 1, 1);
repeat
MMouse(a.x + 10 + p, a.y - ((a.y - b.y)/3), 0, 0);
Inc(p);
rwait(50);
until(((a.x + p) > b.x) or (R_IsUpText('limb')))
GetMousePos(ax, ay);
RWait(100);
MC(ax, ay, 0, 0, true);
RWait(150);
end else
begin
a := TileToMSEx(Branch1.Tile, 1, 0, 1);
b := TileToMSEx(Branch1.Tile, 0, 1, 1);
repeat
MMouse(a.x + p, a.y - ((a.y - b.y)/3), 0, 0);
Inc(p);
rwait(50);
until(((a.x + p) > b.x) or (R_IsUpText('limb')))
if((a.x + p) > b.x)then
begin
Bye('Couldnt get up branch');
Exit;
end;
p := 0;
GetMousePos(ax, ay);
MC(ax, ay, 0, 0, false);
rwait(300);
if(R_ChooseOption('limb'))then
begin
Flag;
rwait(W_BRANCH1);
end;
end;
RWait(500);
repeat
RWait(100);
if(i > 6)then
Break;
if(tries > 3)then
begin
Bye('Couldnt get up branch.');
Exit;
end;
Inc(i);
until(GetMyPos = Point(2473, 3420))
i := 0;
Inc(tries);
until(GetMyPos = Point(2473, 3420))
R_FindRandoms;
RWait(W_BRANCH1);
end;
procedure RunBack;
begin
WalkToTile(Start, 0, 500);
Inc(Players[CurrentPlayer].Integers[90]);
Inc(Players[CurrentPlayer].Integers[91]);
Inc(Stats_CustomVars[1]);
IncEx(Stats_CustomVars[2], 86);
Stats;
Report;
Flag;
RWait(600);
SetRun(True);
end;
begin
StartSMART;
SetVars;
if(not(SRLStats_UserID = ''))then SetupStats;
repeat
Players[CurrentPlayer].Integers[90] := 0;
repeat
MakeCompass('S');
StartTime := GetSystemTime;
Debug('Crossing Log');
CrossObject(Log.Tile, 'cros', Point(2474, 3429), 0.5, 0.5, W_LOG, 1, 0);
Debug('Climbing Net');
CrossObject(Net1.Tile, 'limb', Point(2473, 3423), 0.15, 0.4, W_NET1, 1, 5);
Debug('Climbing Branch');
StupidThinBranch;
Debug('Crossing Rope');
StupidLittleRope(5074827, 'alk', W_ROPE, Point(2483, 3420), 50, 140, 90, 240, 25);
Debug('Climbing-down Branch');
CrossObject(Branch2.Tile, 'limb', Point(2487, 3420), 0.65, 0.35, W_BRANCH2, 1, 3);
Debug('Walking to Net');
WalkToTile(P_Net2, 0, 0);
Debug('Climbing Net');
CrossObject(Net2.Tile, 'limb', Point(2487, 3428), 0.5, 0.15, W_NET2, 1, 2);
Debug('Entering Pipe');
CrossObject(Pipe.Tile, 'queez', Point(2487, 3437), 0.5, 0.5, W_PIPE, 1, 2);
Debug('Running back to start');
RunBack;
until((Players[CurrentPlayer].Integers[90] >= Players[CurrentPlayer].Integers[0]) or not(LoggedIn))
if(HowManyPlayers > 1)then
NextPlayer(Players[CurrentPlayer].Active)
else
begin
writeln('Script Finished. Bye Bye.');
TerminateScript;
end;
until(AllPlayersInactive)
end.