Fitta
2014-09-23 06:39:46
How Long have You Played Runescape?
1 Year(s)
Are you affilated in anyway with Jagex LTD?
No
Were you Referred to SRL?
What is your general programming knowledge?
Java, PHP
Are you a member of any other communities?
All major botting sites
Tell us about yourself…
Please show us one (or multiple) of your scripts.
Fletches any logs into longbows!
If you want some pascalcode with the OSRS SRL include, look here :)
Druidkiller
1 Year(s)
Are you affilated in anyway with Jagex LTD?
No
Were you Referred to SRL?
What is your general programming knowledge?
Java, PHP
Are you a member of any other communities?
All major botting sites
Tell us about yourself…
From: Fitta
17 year old guy studying from home. Got a lot of spare time as my legs are not fully working!
Started playing rs, got tired of it, found this place and made some simple scripts. Now I'm addicted heh.
Also plays CS:GO and Leauge Of Legends.
I'm terrible with introductions.. I like to lurk for myself and point out the obvious :)
Any questions feel free to ask away.
Please show us one (or multiple) of your scripts.
Fletches any logs into longbows!
program Le_sexyFletcher;
{$i AeroLib/AeroLib.Simba}
const
Version = '0.5';
PICK_BANKCOLOR = 5731455;
PICK_TOL = 15;
XP_PER = 59;
LIMIT = 10000;
INPUT_YES = 6;
INPUT_NO = 7;
INPUT_CANCEL = 2;
OUTLINE_LOGS = 85;
OUTLINE_KNIFE = 60;
OUTLINE_LONGBOW = 68;
var
GLOBAL_HOVERBANK: Boolean;
GLOBAL_DONE, GLOBAL_LVLS: Integer;
Procedure SetupScript;
var
Info_s: String;
action: integer;
begin
If FileExists(ScriptPath + 'playersetup.ini')then
begin
Me.Name := ReadINI('playersetup', 'username', ScriptPath + 'playersetup.ini');
Me.Pass := ReadINI('playersetup', 'password', ScriptPath + 'playersetup.ini');
Me.Pin := ReadINI('playersetup', 'bankpin', ScriptPath + 'playersetup.ini');
action := MessageBox('Do you wish to use player ' + Me.Name, 'Player setup', 3);
end else
action := INPUT_NO;
Case action of
INPUT_YES: warn('Using player ' + Me.Name, WT_CORE);
INPUT_NO:
begin
InputQuery('Player setup', 'Username', Me.Name);
InputQuery('Player setup', 'Password', Me.Pass);
InputQuery('Player setup', 'Bankpin', Me.Pin);
WriteINI('playersetup', 'username', Me.Name, ScriptPath + 'playersetup.ini');
WriteINI('playersetup', 'password', Me.Pass, ScriptPath + 'playersetup.ini');
WriteINI('playersetup', 'bankpin', Me.Pin, ScriptPath + 'playersetup.ini');
end;
INPUT_CANCEL:
begin
warn('You choose to cancel, terminating script.', WT_SCRIPT);
TerminateScript;
end;
end;
If (Me.Name = '')then
begin
warn('No player info detected, terminating script..', WT_SCRIPT);
TerminateScript;
end;
Me.Active := True;
end;
Procedure DebugIt(S: String);
begin
warn(S + ' [LoggedIn]: ' + BoolToStr(isLoggedIn), WT_SCRIPT);
end;
procedure Fail(FailedAT: String);
begin
DebugIt('Failed: ' + FailedAT);
closeInterface;
logoutPlayer;
end;
function Hover_OptionMulti(Texts: TStringArray): Boolean;
var
B : TBox;
T : Timer;
i,X,Y,ms,
R,x2,y2 : Integer;
Options : array of TOptions;
begin
Options := getOptions();
if (Length(Options) < 1) then
Exit(False);
ms := MouseSpeed;
MouseSpeed := RandomRange(13,17);
for i:=0 to high(Options) do
begin
if ArrInStr(Texts, Options[i].Str) then
begin
B := Options[i].Bounds;
getMousePos(x2, y2);
R:= Min(((B.X2 - B.X1) shr 1), 5);
if not pointInBox(Point(x2,y2), B) then
mouseBox(B.x1+R, B.Y1, B.x2-R, B.Y1+5, R, MOUSE_MOVE)
else
fastClick(MOUSE_MOVE);
MouseSpeed := ms;
Exit(True);
end;
end;
exitMenu;
MouseSpeed := ms;
end;
function Hover_waitOptionMulti(S: TStringArray; Time: Integer): Boolean;
var
T : Timer;
begin
Result := False;
T.start();
while (T.timeElapsed() < Time) do
begin
if Hover_OptionMulti(S) then
Exit(True);
Wait(20 + Random(10));
end;
end;
function MouseOnScreen: boolean;
var
x, y: integer;
begin
GetMousePos(x, y);
Result := PointInBox(Point(x, y), IntToBox(0, 0, 760, 500));
end;
procedure Handle_MouseOffScreen;
begin
If MouseOnScreen then
MMouseOffClient('rand');
end;
procedure Handle_MightOffScreen;
begin
If Random(5) = 0 then
Handle_MouseOffScreen;
end;
Procedure CMHere(mousetype: integer);
var
x, y: Integer;
begin
GetMousePos(x, y);
Mouse(Point(x, y), 0, 0, mousetype);
end;
function didLevel: boolean;
begin
Result := CountColor(0, 181, 405, 366, 424) = 368;
end;
function interface_Fletch: boolean;
begin
Result := CountColor(128, 151, 361, 364, 382) = 408;
end;
function interface_EnterAmount: boolean;
begin
Result := (CountColor(0, 209, 391, 308, 409) = 277);
end;
function countInvSpot_Outline(inv: integer): integer;
var
CurBox: TBox;
begin
GameTab(TAB_INV);
CurBox := invBox(inv);
Result := (CountColor(65536, CurBox.X1, CurBox.Y1, CurBox.X2, CurBox.Y2));
end;
function countInv_Index(count_Outline: Integer): integer;
var
I: Integer;
CurBox: TBox;
begin
If Not isLoggedIn then
Exit;
For I:=1 to 28 do
If countInvSpot_Outline(I) = count_Outline then
Inc(Result);
end;
function find_KnifeSpot: Integer;
var
I: Integer;
begin
gameTab(TAB_INV);
For I:=1 to 28 do
If countInvSpot_Outline(I) = OUTLINE_KNIFE then
Break;
If I = 29 then
Result := -1
else
Result := I;
DebugIt('Found knife spot ' + ToStr(I));
end;
function Handle_PairItems: boolean;
var
Timer: double;
begin
If Not isLoggedIn then
Exit;
If interface_Fletch then
begin
Result := True;
Exit;
end;
If Not interactSlot(find_KnifeSpot, MOUSE_LEFT)then
begin
Fail('Handle_Fletch - KnifeSpot');
Exit;
end;
Wait(20+Random(300));
Case CountInv_Index(OUTLINE_LOGS) of
1..26:
interactSlot(28, mouse_left);
27:
Case Random(10)of
0..5: interactSlot(2, MOUSE_LEFT);
6..8: interactSlot(5, MOUSE_LEFT);
9: interactSlot(6, MOUSE_LEFT);
end;
end;
DebugIt('Found items, waiting for interface');
TObjTime.Mark(Timer);
While (TObjTime.Ellapsed(Timer) < 2000)and(interface_Fletch = False) do
Wait(50+Random(200));
DebugIt('Out of interface loop');
Result := interface_Fletch;
DebugIt('Interface fletch > ' + ToStr(Result));
end;
function handle_FletchInterface: boolean;
begin
If Not interface_Fletch then
Exit;
Wait(150+Random(200));
MouseBox(209, 383, 299, 441, 20, mouse_Right);
Result := waitOption('Make X', 500+Random(400));
If Not Result then
DebugIt('Make X? FletchInterface')
else
begin
Handle_MightOffScreen;
If Not WaitFunc(@interface_EnterAmount, 100, 1500)then
begin
fail('no Enter Amount?');
Result := False;
Exit;
end;
Handle_MightOffScreen;
typeSend(intToStrEx(RandomRange(27, 100)), True);
Handle_MightOffScreen;
end;
end;
function hover_PestControlBank: boolean;
var
TPA: TPointArray;
ATPA: T2DPointArray;
I: Integer;
P: TPoint;
begin
If Not isLoggedIn then
Exit;
Result := (IsUpText('Bank Bank Booth')or(menuOpen));
If Result then
Exit;
FindColorsSpiralTolerance(MSCX, MSCY, TPA, PICK_BANKCOLOR, MSCX-50, MSCY, MSCX+50, MSCY+50, PICK_TOL);
ATPA := TPAtoATPAEx(TPA, 25, 8);
SortATPASize(ATPA, True);
SortATPAFromMidPoint(ATPA, point(MSCx,MSCy+50));
If Length(ATPA) = 0 then
Exit;
For I:=0 to High(ATPA)do
begin
P := MiddleTPA(ATPA[I]);
mouse(Point(P.X, P.Y-8), 5, 5, MOUSE_MOVE);
If waitUptext('Bank Bank booth', 100+Random(200))then
begin
DebugIt('Bank found');
Case Random(5) of
0: CMHere(mouse_move);
1..4:
begin
CMHere(mouse_right);
Hover_waitOptionMulti(['Bank Bank booth'], 300+Random(500));
end;
end;
Result := True;
Exit;
end;
end;
end;
Procedure Progress;
begin
Writeln('[Script] ' + Version + ' Time: ' + ToStr(MSToTime(GetTimeRunning, TIME_SHORT)) + ' / Done: ' + ToStr(GLOBAL_DONE) + ' / XP: ' + ToStr(GLOBAL_DONE*XP_PER) + ' / Lvls: ' + ToStr(GLOBAL_LVLS));
end;
Procedure wait_Fletching;
var
at_Logs: Integer;
Hover: Boolean;
begin
If Not isLoggedIn then
Exit;
Handle_MightOffScreen;
Progress;
If GLOBAL_HOVERBANK then
begin
at_Logs := RandomRange(1, 15);
DebugIt('Will hover bank at ' + ToStr(at_Logs));
end;
repeat
Wait(150+Random(200));
If not Hover then
Handle_MouseOffScreen;
If ((GLOBAL_HOVERBANK) and (CountInv_Index(OUTLINE_LOGS) = at_Logs) and (Hover = False)) then
begin
DebugIt('Time to hover bank..');
Hover := True;
If Not hover_PestControlBank then
begin
DebugIt('Failed to hover bank');
GLOBAL_HOVERBANK := False;
end;
end;
until(Not isLoggedIn)or(CountInv_Index(OUTLINE_LOGS) = 0)or(didLevel);
If didLevel then
begin
DebugIt('Lvl''d');
Inc(GLOBAL_LVLS);
If Random(5) = 0 then
begin
ClickToContinue;
ClickToContinue;
end;
GLOBAL_HOVERBANK := False;
Exit;
end;
If GLOBAL_HOVERBANK then
begin
DebugIt('Done fletching, already hovering');
If (menuOpen) then
begin
CMHere(Mouse_LEFT);
DebugIt('Waiting for bank..');
waitFunc(@isBankOpen, 100+Random(100), RandomRange(2000, 3000));
end else
DebugIt('Hovering failed..');
end;
GLOBAL_HOVERBANK := False;
end;
function find_PestControlBank: boolean;
var
TPA: TPointArray;
ATPA: T2DPointArray;
I: Integer;
P: TPoint;
begin
If Not isLoggedIn then
Exit;
Result := isBankOpen;
If Result then
Exit;
FindColorsSpiralTolerance(MSCX, MSCY, TPA, PICK_BANKCOLOR, MSCX-50, MSCY, MSCX+50, MSCY+50, PICK_TOL);
ATPA := TPAtoATPAEx(TPA, 25, 8);
SortATPASize(ATPA, True);
SortATPAFromMidPoint(ATPA, point(MSCx,MSCy+50));
If Length(ATPA) = 0 then
Exit;
For I:=0 to High(ATPA)do
begin
P := MiddleTPA(ATPA[I]);
mouse(Point(P.X, P.Y-8), 5, 5, MOUSE_MOVE);
If waitUptext('Bank Bank', 100+Random(200))then
begin
DebugIt('Bank found');
CMHere(mouse_left);
Result := waitFunc(@isBankOpen, 100+Random(100), 3000);
Exit;
end;
end;
end;
Procedure Handle_Bank;
var
C: Integer;
begin
repeat
Inc(C);
until(C > 4)or(find_PestControlBank);
If C > 4 then
begin
Fail('Failed opening bank');
Exit;
end else
DebugIt('Opened bank in ' + ToStr(C) + ' try(ies)');
DebugIt('Depositing items..');
IncEx(GLOBAL_DONE, countInv_Index(OUTLINE_LONGBOW));
depositAllFrom(2);
DebugIt('Withdrawing items..');
if not withdrawPointEx(Point(426, 100), 0, ['aple'])then
begin
fail('withdrawpointEx');
Exit;
end;
DebugIt('Closing interface..');
closeInterface;
Wait(250+Random(500));
end;
Procedure SetupPlayer;
begin
setupBreak(200, 50, 200, 200);
compassMovement(0, 0, False);
SetAngle(ANGLE_HIGH);
end;
begin
initAL();
SetupScript;
If Not isLoggedIn then
begin
DebugIt('Player ' + Me.Name + ' loginPlayer');
loginPlayer(True);
end;
SetupPlayer;
Repeat
If Random(12) = 0 then
GLOBAL_HOVERBANK := True;
If CountInv_Index(OUTLINE_LOGS) > 0 then
begin
DebugIt('Logs > 0');
Handle_PairItems;
If Handle_FletchInterface then
wait_Fletching;
end;
If CountInv_Index(OUTLINE_LOGS) = 0 then
begin
DebugIt('Logs = 0');
Handle_Bank;
end;
{If breakHandler then
SetupPlayer;}
until(Me.Active = False)or(GLOBAL_DONE > LIMIT)or(not isLoggedIn);
If isLoggedIn then
begin
Progress;
DebugIt('We are done for today :)');
end;
end.If you want some pascalcode with the OSRS SRL include, look here :)
Druidkiller
program DRUIDKILLER;
{$DEFINE SMART8}
{$I SRL-OSR/SRL.Simba}
{$I SRL-OSR/SRL/Reflection/Reflection.simba}
{$I SRL-OSR\SRL\misc\SmartGraphics.simba}
{
TODO
WALKSTOP at gate
Adding:
}
var
item_IDs, weChecked: TIntegerArray;
CurIndex: Integer;
ClickedAttacker: Boolean;
Loots: Array of TIntegerArray;
procedure Setup;
var
I: Integer;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Loc := 'kill';
Players[0].Active := True;
Players[0].Member := True;
SetLength(Loots, HowManyPlayers);
For I:=0 to High(Loots)do
SetLength(Loots[I], 20000);
item_IDs := [199, 201, 203, 205, 207, 209, 2485, 215, 213, 211, 217];
end;
Procedure CMHere(left: Boolean);
var
x, y: Integer;
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, left);
end;
function r_TileOnMS(tile: TPoint): Boolean;
begin
Result := (PointInBox(r_TileToMS(tile), IntToBox(MSX1, MSY1, MSX2, MSY2)));
end;
function MouseOnScreen: boolean;
var
x, y: integer;
begin
GetMousePos(x, y);
Result := PointInBox(Point(x, y), IntToBox(0, 0, 760, 500));
end;
function IDToString(id: integer): string;
begin
case id of
250, 200: Result := 'Guam Leaf';
252, 202: Result := 'Marrentil';
254, 204: Result := 'Tarromin';
256, 206: Result := 'Harralander';
258, 208: Result := 'Ranarr weed';
260, 210: Result := 'Irit leaf';
262, 212: Result := 'Avantoe';
264, 214: Result := 'Kwuarm';
268, 218: Result := 'Dwarf Weed';
2482, 2486: Result := 'Lantadyme';
266, 216: Result := 'Cadantine';
9143: Result := 'Mithril bolts';
562: Result := 'Nature runes';
564: Result := 'Law runes';
else Result := 'Unknown ID: ' + ToStr(ID);
end;
end;
function IntInArrEx(var index: integer; iarr: TIntegerArray; int: Integer): boolean;
var
I: Integer;
begin
For I:=0 to High(iarr)do
if iarr[I] = int then
begin
Result := True;
Index := I;
Exit;
end;
end;
function IntInArr(iarr: TIntegerArray; int: Integer): boolean;
var
t: Integer;
begin
Result := IntInArrEx(t, iarr, int);
end;
Procedure CountLoot;
var
I, Ind: Integer;
Inv: TInventoryItemArray;
begin
If Not LoggedIn then
Exit;
Inv := R_GetInventoryItems;
For I:=0 to 27 do
If Inv[I].ID > 0 then
IncEx(Loots[CurrentPlayer][Inv[I].ID], Inv[I].Quantity);
end;
procedure Fail(FailedAT: String);
begin
Writeln('A function failed: ' + FailedAT);
LogOut;
end;
Function AreWeStandingOn(Tile: TPoint): boolean;
var
MyPos: TPoint;
begin
MyPos := R_GetTileGlobal;
Result := (MyPos.X = Tile.X)and(MyPos.Y = Tile.Y);
end;
Procedure WaitWhileWalking(Tile: TPoint);
begin
If AreWeStandingOn(Tile)or(not LoggedIn) then
Exit;
Repeat
Wait(100+Random(100));
Until(Not R_IsWalking)or(AreWeStandingOn(Tile));
end;
Procedure DrawCurIndex(TP: TPoint);
begin
//SMART_ClearCanvas;
// SMART_DrawText(TP.X-15, TP.y-15, 'smallchars07', 'CurIndex', clRed);
end;
Procedure MightRun;
begin
If (R_IsRunOn)or(Not LoggedIn) then
Exit;
If R_GetRunEnergy > RandomRange(20, 30) then
MouseBox(571, 128, 590, 145, mouse_Left);
end;
Procedure CheckHerbs;
var
I, L: Integer;
BadArr: TIntegerArray;
Inv: TInventoryItemArray;
begin
If (Not LoggedIn) then
Exit;
Inv := R_GetInventoryItems;
BadArr := [200, 202, 204, 206, 208, 210, 2486, 216, 214, 212, 218];
For I:=0 to 27 do
If Not IntInArr(weChecked, I+1) then
If IntInArr(BadArr, Inv[I].ID)then
MouseItem(I+1, mouse_Left);
Wait(300+Random(500));
Inv := R_GetInventoryItems;
BadArr := [252, 254];
For I:=0 to 27 do
If IntInArr(BadArr, Inv[I].ID)then
DropItem(I+1);
Wait(600+Random(500));
SetLength(weChecked, 0);
Inv := R_GetInventoryItems;
BadArr := [200, 202, 204, 206, 208, 210, 2486, 216, 214, 212, 218];
For I:=0 to 27 do
If IntInArr(BadArr, Inv[I].ID)then
begin
L := Length(weChecked);
SetLength(weChecked, L+1);
weChecked[L] := I+1;
end;
end;
Procedure Antiban(numb: Integer);
begin
If (Not LoggedIn) then
Exit;
Case numb of
0: HoverSkill(SKILL_ATTACK, False);
1: HoverSkill(SKILL_HITPOINTS, False);
2..50:
begin
Writeln('Antiban We are turning the compass around');
MakeCompass(Random(361));
end;
51..70:
begin
MMouse(Random(800), Random(600), 0, 0);
Writeln('Antiban Random Mouse movements');
end;
71:
begin
Writeln('Antiban Random Right clicks');
RandomRClick;
end;
72:
begin
Writeln('Antiban You just picked up your mouse, and put it down again.');
PickUpMouse;
end;
73..100:
begin
Writeln('Antiban Some more random movement');
RandomMovement;
end;
101:
begin
Writeln('Antiban WE ARE BORED');
BoredHuman;
end;
102:
begin
Writeln('Antiban Examine inv');
ExamineInv;
end;
103: RandomFKeys(True);
104: RandomFKeys(False);
105: RandomTab(True);
106: RandomTab(False);
107:
begin
Writeln('Antiban Whos online');
HoverOnlineFriend;
end;
108..140:
begin
Writeln('Antiban Mouse off client');
MMouseOffClient('rand');
end;
141: SmallRandomMouse;
end;
end;
function getFirstIndex(Path: TPointArray): integer;
var
I, H: Integer;
begin
H := High(Path);
For I:=0 to H do
If r_TileOnMM(Path[I])then
Result := I;
end;
function waitTileMM(Tile: TPoint): boolean;
var
Timer, t: Integer;
begin
MarkTime(Timer);
t := 300+Random(300);
repeat
Result := r_TileOnMM(Tile);
Antiban(4000);
MightRun;
until(TimeFromMark(Timer) > t)or(Result)or(Not R_IsWalking);
end;
function WalkPath(Path: TPointArray): boolean;
var
tPath: TPointArray;
I, H, Timer, StartIndex: Integer;
begin
If (Not LoggedIn) then
Exit;
tPath := Path;
H := High(tPath);
StartIndex := getFirstIndex(Path);
For I:=StartIndex to H do
If R_WalkToTileMM(tPath[I])then
begin
Writeln('Walking to: ' + ToStr(tPath[I]) + ' - Index[' + ToStr(I) + ']');
If I = H then
begin
Writeln('Last tile in array, waiting to stop.');
WaitWhileWalking(Point(-1, -1));
Result := True;
end else
begin
Writeln('Waiting for next tile to be visable..');
MarkTime(Timer);
while (not waitTileMM(tPath[I+1])and(TimeFromMark(Timer) < 10000))do
wait(100+Random(100));
If not waitTileMM(tPath[I+1])then
begin
Writeln('We failed walking');
Result := False;
Exit;
end;
end;
end;
end;
function InFight: boolean;
begin
Result := R_InFight;
end;
function IndexOfAttacker: Integer;
var
NPCs: TNPCArray;
I, MyIndex: Integer;
P: TPoint;
begin
If (Not LoggedIn) then
Exit;
NPCs := R_GetNpcs('Chaos druid');
MyIndex := R_GetPlayerIndex;
For I:=0 to High(NPCs)do
If NPCs[I].Interacting = MyIndex then
begin
Result := NPCs[I].Index;
P := r_TileToMS(NPCs[I].Tile);
DrawCurIndex(P);
Break;
end;
end;
function newAttacker: boolean;
var
t_Index: Integer;
begin
If (Not LoggedIn) then
Exit;
Result := Not (CurIndex = IndexOfAttacker);
If result then
begin
ClickedAttacker := False;
t_Index := IndexOfAttacker;
If not t_Index = 0 then
CurIndex := t_Index;
end;
end;
Procedure WaitPickUp(Tile: TPoint);
var
timer, invC: Integer;
begin
If (Not LoggedIn) then
Exit;
InvC := R_InvCount;
MarkTime(timer);
WaitWhileWalking(Tile);
repeat
wait(100+Random(100));
Until(TimeFromMark(timer) > 1000*2)or(InvC < r_InvCount)or(AreWeStandingOn(Tile));
end;
function FindExtras: boolean;
var
Items: TGroundItemArray;
IDs: TIntegerArray;
ExName: TStringArray;
MP: TPoint;
I, L, H: Integer;
begin
If (Not LoggedIn)then
Exit;
Items := R_GetGroundItemsDistance(30);
H := High(Items);
If H = -1 then
Exit;
IDs := [561, 563, 9142];
ExName := ['Take Nature rune', 'Take Law rune', 'Take Mithril bolt'];
For I:=0 to High(Items)do
If IntInArrEx(L, IDs, Items[I].ID) then
begin
If (r_InvFull)then
Exit;
If Not r_TileOnMS(Items[I].Tile)then
Continue;
// First check if uptext is correct
If R_IsUpText(ExName[L])then
begin
CMHere(True);
WaitPickUp(Items[I].Tile);
Result := True;
Continue;
end;
MP := r_TileToMS(Items[I].Tile);
MMouse(MP.X, MP.Y, 5, 5);
If R_WaitUpText(ExName[L], 200+Random(200))then
begin
CMHere(True);
WaitPickUp(Items[I].Tile);
Result := True;
Continue;
end else
begin
Writeln('Hard time finding item');
If r_IsUpText('Walk here')then
Exit;
CMHere(False);
Result := r_WaitChooseOption(ExName[L], 200+Random(200));
WaitPickUp(Items[I].Tile);
end;
end;
end;
function FindHerbs: boolean;
var
Items: TGroundItemArray;
MP: TPoint;
I, L, H: Integer;
begin
If (Not LoggedIn)then
Exit;
Items := R_GetGroundItemsDistance(30);
H := High(Items);
If H = -1 then
Exit;
For I:=0 to High(Items)do
If IntInArrEx(L, item_Ids, Items[I].ID) then
begin
If (r_InvFull)then
Exit;
If Not r_TileOnMS(Items[I].Tile)then
Continue;
MP := r_TileToMS(Items[I].Tile);
MMouse(MP.X, MP.Y, 5, 5);
If Not R_WaitUpText('Walk Here', 200+Random(200))then
begin
CMHere(False);
Result := r_WaitChooseOption('Take Herb', 200+Random(200));
WaitPickUp(Items[I].Tile);
Wait(350+Random(350));
end;
end;
end;
function AttackIndex(Index: Integer): boolean;
var
tNPC: TNPC;
TP: TPoint;
begin
tNPC := R_GetTNPC(Index);
If (Not r_TileOnMS(tNPC.Tile))then
Exit;
TP := r_TileToMS(tNPC.Tile);
MMouse(TP.X, TP.Y, 15, 15);
Case Random(3)of
0:
begin
CMHere(False);
Result := R_WaitChooseOption('Attack Chaos druid', 200+Random(200));
end;
1, 2:
begin
Result := r_WaitUpText('Attack Chaos druid', 200+Random(200));
If Result then
CMHere(True);
end;
end;
If Result then
begin
CurIndex := Index;
ClickedAttacker := True;
end;
end;
Procedure WWFight;
begin
If (Not LoggedIn) then
Exit;
WaitWhileWalking(Point(-1, -1));
If (FindHerbs)or(FindExtras) then
ClickedAttacker := False;
If not ClickedAttacker then
AttackIndex(IndexOfAttacker);
repeat
Wait(200+Random(300));
Antiban(Random(10000));
until(Not InFight)or(r_InvFull)or(newAttacker);
end;
Procedure Attack;
var
I: Integer;
NPCs: TNPCArray;
begin
If (Not LoggedIn) then
Exit;
NPCs := R_GetNpcs('Chaos druid');
For I:=0 to High(NPCs)do
If (NPCs[I].Interacting = -1)then
begin
If NPCs[I].Index = CurIndex then
Continue;
AttackIndex(NPCs[I].Index);
Break;
end;
end;
function OpenEdgeBank: boolean;
var
BT: TPoint;
Timer: Integer;
begin
If (Not LoggedIn) then
Exit;
Result := BankScreen;
If Result then
Exit;
Case Random(2)of
0: BT := Point(3095, 3489);
1: BT := Point(3095, 3491);
end;
MarkTime(Timer);
Repeat
If Not r_TileOnMS(BT)then
begin
WalkPath([Point(3093, 3491)]);
WaitWhileWalking(Point(-1, -1));
end;
Result := R_InteractTileWait(BT, 'Bank Bank booth', 600+Random(500));
until(Result)or(TimeFromMark(Timer) > 10000);
If Result then
begin
WaitWhileWalking(Point(BT.X-1, BT.Y));
While Not BankScreen do
Wait(150+Random(200));
end;
Result := BankScreen;
end;
function ClimbDown: boolean;
var
BT: TPoint;
Timer: Integer;
begin
If (Not LoggedIn) then
Exit;
Result := r_TileOnMS(Point(3097, 9867));
If Result then
Exit;
R_MouseTile(Point(3097, 3468), 10, 10, mouse_move);
MarkTime(Timer);
Repeat
If Not r_TileOnMS(Point(3097, 3468))then
begin
WalkPath([Point(3096, 3468)]);
WaitWhileWalking(Point(3096, 3468));
end;
If R_WaitUpTextMulti(['Open Trapdoor', 'Climb-down'], 300+Random(300))then
begin
Writeln('Correct uptext');
If r_IsUpText('Open Trapdoor')then
begin
CMHere(True);
WaitWhileWalking(Point(-1, -1));
Wait(800+Random(500));
end;
If R_WaitUpText('Climb-down', 400+Random(300))then
begin
CMHere(TRue);
WaitWhileWalking(Point(3096, 9867));
Result := True;
end;
end;
If (TimeFromMark(Timer) > 1000)and(not result) then
MakeCompass(Random(361));
If Not Result then
R_MouseTile(Point(3097, 3468), 10, 10, mouse_move);
until(r_TileOnMS(Point(3097, 9867))or(TimeFromMark(Timer) > 10000));
Result := r_TileOnMS(Point(3097, 9867));
end;
function ClimbUp: boolean;
var
Timer: Integer;
begin
If (Not LoggedIn) then
Exit;
Result := r_TileOnMS(Point(3097, 3468));
If Result then
Exit;
MarkTime(Timer);
Repeat
If Not r_TileOnMS(Point(3097, 9867))then
begin
WalkPath([Point(3097, 9867)]);
WaitWhileWalking(Point(-1, -1));
end;
Result := R_InteractTileWait(Point(3097, 9867), 'Climb-up', 600+Random(500));
If Result then
begin
WaitWhileWalking(Point(-1, -1));
Wait(600+Random(800));
end;
until(r_TileOnMS(Point(3097, 3468))or(TimeFromMark(Timer) > 10000)or(Result));
end;
Function HandleGate(banking: boolean): boolean;
var
T, GT: TPoint;
Timer: Integer;
begin
If (Not LoggedIn) then
Exit;
T := R_GetTileGlobal;
If Random(2) = 0 then
GT := Point(3103, 9909)
else
GT := Point(3103, 9910);
repeat
If Not r_TileOnMS(GT)then
begin
WalkPath([GT]);
WaitWhileWalking(Point(-1, -1));
end;
Case banking of
False:
If Not (T.X > 3103)then
begin
WaitWhileWalking(Point(-1, -1));
Result := R_OpenDoor(GT, 'e');
end else
Result := True;
True:
If Not (T.X < 3104)then
begin
WaitWhileWalking(Point(-1, -1));
Result := R_OpenDoor(GT, 'e');
end else
Result := True;
end;
If Not Result then
MakeCompass(Random(361));
Until(Result)or(TimeFromMark(Timer) > 10000);
If Result then
begin
WaitWhileWalking(Point(-1, -1));
Wait(300+Random(700));
end;
end;
Function HandleWildyDoor(GoingOut:boolean): boolean;
var
GT: TPoint;
Timer, Offset: Integer;
begin
If (Not LoggedIn) then
Exit;
If GoingOut then
Offset := -1
else
Offset := 0;
If Random(2) = 0 then
GT := Point(3131, 9918)
else
GT := Point(3132, 9918);
repeat
If Not r_TileOnMS(GT)then
begin
WalkPath([GT]);
WaitWhileWalking(Point(-1, -1));
end;
Result := R_OpenDoor(GT, 's');
If Not Result then
MakeCompass(Random(361));
Until(Result)or(TimeFromMark(Timer) > 30000);
If Result then
begin
WaitWhileWalking(Point(GT.X, Offset));
Wait(300+Random(700));
end;
end;
Procedure DropBadItems;
var
I: Integer;
BadArr: TIntegerArray;
Inv: TInventoryItemArray;
begin
If (Not LoggedIn) then
Exit;
Inv := R_GetInventoryItems;
BadArr := [527];
For I:=0 to 27 do
If IntInArr(BadArr, Inv[I].ID)then
DropItem(I+1);
end;
Procedure SetupPlayer;
begin
Antiban(Random(10000));
If R_GetCameraZ > -1250 then
begin
Writeln('Camera is too low');
SetAngle(SRL_ANGLE_HIGH);
end;
Antiban(Random(10000));
Case Random(3)of
0: RandomFKeys(False);
1: MakeCompass(Random(361));
2: GameTab(tab_Friends);
end;
MightRun;
Antiban(Random(10000));
end;
Procedure DebugChaos;
var
NPCs: TNPCArray;
I: Integer;
begin
NPCs := R_GetNpcs('Chaos druid');
For I:=0 to High(NPCs)do
Writeln('InCombat; ' + ToStr(NPCs[I].InCombat) + ' - INTERACTING: ' + ToStr(NPCs[I].Interacting) + ' - HP: ' + ToStr(NPCs[I].HitPoints));
end;
Procedure ProgressReport;
var
I, II: Integer;
begin
WriteLn('[#] Progress Report, Fitta''s Druid Mass Murderer(DMM)');
Writeln(' Time Running: ' + TimeRunning);
Writeln(' Players: ' + ToStr(HowManyPlayers));
Writeln('');
For I:=0 to HowManyPlayers-1 do
begin
Writeln('[P' + ToStr(I) + ']');
For II:=0 to High(Loots[I])do
If Loots[I][II] > 0 then
Writeln(' Item: ' + IDToString(II) + ' Amount: ' + ToStr(Loots[I][II]));
WriteLn('[#]');
end;
end;
Procedure BankToDruids;
begin
WalkPath([Point(3094, 3484), Point(3094, 3477), Point(3094, 3470)]);
If Not ClimbDown then
Fail('ClimbDown');
WalkPath([Point(3097, 9879), Point(3095, 9888), Point(3096, 9901), Point(3102, 9909), Point(3109, 9909)]);
If not HandleGate(False)then
Fail('HandleGate(False)');
WalkPath([Point(3112, 9910), Point(3122, 9908), Point(3131, 9917)]);
If Not HandleWildyDoor(False) then
Fail('HandleWildyDoor');
WalkPath([Point(3128, 9928), Point(3120, 9925), Point(3114, 9929)]);
If LoggedIn then
Players[CurrentPlayer].Loc := 'kill';
end;
Procedure DruidToBank;
begin
WalkPath([Point(3111, 9932), Point(3118, 9927), Point(3130, 9927), Point(3131, 9918)]);
If Not HandleWildyDoor(True) then
Fail('HandleWildyDoor');
WalkPath([Point(3124, 9909), Point(3113, 9909), Point(3101, 9908)]);
If Not HandleGate(True)then
Fail('HandleGate(True)');
WalkPath([Point(3096, 9900), Point(3095, 9889), Point(3098, 9875), Point(3096, 9867)]);
If Not ClimbUp then
Fail('ClimbUp');
WalkPath([Point(3094, 3475), Point(3093, 3482), Point(3093, 3491)]);
If LoggedIn then
Players[CurrentPlayer].Loc := 'bank';
end;
Procedure HandleBanking;
begin
weChecked := [];
CountLoot;
If Not OpenEdgeBank then
Fail('OpenEdgeBank');
Wait(900+Random(900));
MouseBox(429, 299, 459, 328, mouse_Left);
Wait(400+Random(600));
If Random(5) = 0 then
CloseBank;
If LoggedIn then
Players[CurrentPlayer].Loc := 'todruids';
end;
Procedure FightLoop;
begin
If IndexOfAttacker = 0 then
Attack
else
if newAttacker then
AttackIndex(IndexOfAttacker);
WWFight;
If Random(400) = 0 then
CheckHerbs;
If R_InvFull then
CheckHerbs;
DropBadItems;
If R_InvFull then
Players[CurrentPlayer].Loc := 'tobank';
end;
begin
setupSRL();
SetupReflection;
Setup;
If Not LoggedIn Then
LoginPlayer;
Repeat
MightRun;
If Not LoggedIn then
begin
Writeln('NextPlayer..');
NextPlayer(False);
SetupPlayer;
end;
Case Lowercase(Players[CurrentPlayer].Loc) of
'bank': HandleBanking;
'kill': Fightloop;
'tobank': DruidToBank;
'todruids': BankToDruids;
end;
ProgressReport;
Until(AllPlayersInactive);
Writeln('All players are InActive');
end.