Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program AIOFighter;
- {$DEFINE SMART}
- {$i AeroLib/AeroLib.Simba}
- {$i Reflection/Reflection.Simba}
- const
- ScriptVersion = '0.2';
- Player_Username = '4';
- Player_Password = '3';
- var
- LocP: TReflectLocalPlayer;
- OgreCount, TotalSlayed: Integer;
- swordfish, randomHP, lobster, x, y, tuna, trout, salmon, shark, food, currentFood: integer;
- FoodDTMs: TIntegerArray;
- randomEnergy: Integer;
- procedure HandleLogin;
- begin
- if (not isLoggedIn()) then
- LocP.Login;
- if (isLoggedIn()) then
- begin
- exit;
- end;
- end;
- procedure setVars;
- begin
- LocP.Username := Player_Username;
- LocP.Password := Player_Password;
- LocP.Active := True;
- end;
- function MouseOnScreen: boolean;
- begin
- Result := PointInBox(getMousePnt, IntToBox(0, 0, 760, 500));
- end;
- procedure mouseOffScreen;
- begin
- if MouseOnScreen then
- MMouseOffClient('rand');
- end;
- procedure mightOffScreen;
- begin
- if Random(10) = 0 then
- mouseOffScreen;
- end;
- procedure randomCompass;
- var
- Keys: TIntegerArray;
- I: Integer;
- begin
- if (not locP.isLoggedIn) then
- Exit;
- Keys := [VK_RIGHT, VK_LEFT];
- I := Random(2);
- Wait(100 + random(50));
- KeyDown(Keys[I]);
- Wait(500 + random(1000));
- KeyUp(Keys[I]);
- Wait(200 + random(350));
- end;
- function GotFood: boolean;
- var
- x, y, z: integer;
- begin
- GameTab(tab_inv);
- wait(randomrange(200, 600));
- for z := 0 to high(FoodDTMs) do
- if findDTM(FoodDTMs[z], x, y, 524, 176, 737, 470) then
- begin
- Result := true;
- exit;
- end;
- end;
- procedure customMouse(point: TPoint);
- begin
- case random(0, 6) of
- 0..2: BrakeMMouse(point, random(3), random(3), true);
- 3: BrakeMMouse(point, random(3), random(3), false);
- 4..5: MissMouse(point, random(3), random(3));
- 6: HumanMMouse(point, random(3), random(3));
- end;
- end;
- procedure afterClick;
- begin
- case Random(20) of
- 4..6: randomCompass;
- 9..15: SleepAndMoveMouse(200 + Random(2000));
- 16..19: mouseOffScreen;
- end;
- end;
- procedure randomAngleMM();
- var
- leftSide, rightSide: TBox;
- boxArray: array of TBox;
- endPoint: TPoint;
- I: Integer;
- begin
- leftSide := intToBox(9, 9, 360, 480);
- rightSide := intToBox(361, 9, 720, 480);
- boxArray := [leftSide, rightSide];
- I := random(0, 1);
- mouseBox(boxArray[I], MOUSE_MOVE);
- sleep(random(40, 600));
- getMousePos(x, y);
- if (pointInBox(Point(x, y), leftSide)) then
- endPoint := Point(x + 80 + random(1, 340), y + random(9, 19))
- else
- endPoint := Point(x - 80 - random(1, 340), y + random(9, 19));
- HoldMouse(x, y, MOUSE_MIDDLE);
- customMouse(endPoint);
- sleep(random(1, 30));
- ReleaseMouse(x, y, MOUSE_MIDDLE);
- end;
- procedure setPlayer;
- begin
- LocP.Login;
- Wait(1000 + Random(1500));
- Reflect.Compass.MakePitch(10);
- end;
- procedure AntiBan;
- begin
- case random(30000) of
- 0..50: BoredHuman;
- 51..55: HoverSkill('Strength', False);
- 56..60: HoverSkill('Hitpoints', False);
- 61..70: pickUpMouse();
- 71..500: MMouseOffClient('random');
- 501..750: compassMovement(10, 160, False);
- 751..1000: randomAngleMM();
- end;
- end;
- procedure Debug(DebugSTR: string);
- begin
- WriteLn(DebugSTR);
- end;
- procedure waitRandom;
- begin
- case random(1000) of
- 0..700: waitEx(RandomRange(400, 1000));
- 701..900: waitEx(RandomRange(1600, 2600));
- 901..1000: waitEx(RandomRange(1800, 3800));
- end;
- end;
- procedure randomMouseInput(pnt: Tpoint; ranx, rany: integer);
- begin
- case random(3) of
- 0: humanMMouse(pnt, ranx, rany);
- 1: missMouse(pnt, ranx, rany);
- 2: mouse(pnt, ranx, rany, mouse_move);
- end;
- end;
- function R_TileOnMS(Tile: TPoint; var OutputPoint: TPoint; x: integer = 0; y: integer = 0; z: integer = 0): boolean;
- var
- tempB: TBox;
- begin
- OutputPoint := TReflectionTiles.TileToMS(Tile, x, y, z);
- tempB := intToBox(MSX1, MSY1, MSX2, MSY2);
- result := PointInBox(OutputPoint, tempB);
- end;
- function R_InteractTile(tile: Tpoint; action: string; x: integer = 0; y: integer = 0; z: integer = 0): boolean;
- var
- RSTile: TPoint;
- begin
- if not R_TileOnMS(Tile, RSTile, x, y, z) then
- begin
- locP.WalkToTileMM(Tile);
- Wait(100 + Random(200));
- FFlag(0);
- Exit;
- end;
- if R_TileOnMS(Tile, RSTile, x, y, z) then
- begin
- randomMouseInput(rsTile, 3, 3);
- if (Reflect.Text.IsUpText(action)) then
- begin
- FastClick(mouse_left);
- result := didClick(true, 1000);
- afterClick;
- Wait(1000 + Random(200));
- end
- else
- begin
- if TReflectionText.OptionExists(action) then
- begin
- FastClick(mouse_right);
- result := Reflect.Text.ChooseOption(action);
- afterClick;
- Wait(1000 + Random(200));
- end;
- if not result then
- exit;
- end;
- end;
- end;
- procedure dismissAllRandoms;
- var
- i, j, me_indice: integer;
- _npcs: TReflectNPCArray;
- randoms: tstringarray;
- begin
- randoms := ['molly', 'niles', 'miles', 'giles', 'sandwich lady', 'drunken dwarf', 'genie', 'highwayman', 'dr jekyll', 'cap' 'n hand', 'security guard', 'rick turpentine', 'mysterious old man', 'frog', 'null', 'mime', 'sergeant damien', 'freaky forester', 'postie pete', 'tilt', 'flippa', 'leo', 'pillory guard', 'evil bob'];
- _npcs.GetAll;
- me_indice := TReflectLocalPlayer.GetPlayerIndex;
- for i := 0 to high(_npcs) do
- begin
- if (_npcs[i].getInteractingIndex = me_indice) then
- begin
- for j := 0 to high(randoms) do
- begin
- if (pos(randoms[j], lowercase(_npcs[i].getName)) > 0) then
- begin
- if R_InteractTile(_npcs[i].getTile, 'Dismiss', 0, 0, 50) then
- begin
- sleep(2500 + random(1000));
- writeln('Dismissed random: ' + _npcs[i].getname + ' Time Running: ' + TimeRunning);
- end;
- end;
- end;
- end;
- end;
- end;
- function Attack: boolean;
- var
- NPCs: TReflectNPCArray;
- I: Integer;
- begin
- Wait(200 + Random(200));
- NPCs.Get('Chicken');
- for I := 0 to High(NPCs) do
- if (NPCs[I].GetInteractingIndex = - 1) and (NPCs[I].GetMaxHealth = 0) then
- begin
- Result := R_InteractTile(NPCs[I].GetTile, 'Attack', mouse_Right);
- Exit;
- end;
- end;
- procedure checkRun;
- begin
- if ((not locp.IsRunOn()) and (locp.GetRunEnergy() > randomEnergy)) then
- begin
- toggleRunning(true);
- end;
- end;
- procedure WaitFight;
- begin
- while (LocP.GetInteractingIndex > 0) or LocP.ismoving do
- begin
- Wait(20 + Random(20));
- handlelogin;
- dismissAllRandoms;
- end;
- end;
- begin
- InitAL();
- Reflect.Setup;
- LocP.Create;
- setVars;
- setPlayer;
- mouseSpeed := Random(20, 40);
- repeat
- dismissAllRandoms;
- handlelogin;
- Attack();
- waitFight;
- until (false);
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement