Page 1 of 3 123 LastLast
Results 1 to 25 of 52

Thread: [AeroLib / Reflection] J Ghoul Killer

  1. #1
    Join Date
    Jun 2013
    Location
    Scranton
    Posts
    496
    Mentioned
    5 Post(s)
    Quoted
    220 Post(s)

    Default [AeroLib] Ghoul Killer

    Ghoul Killer


    Hi guys, I had some free time and decided to completely re do this seeing as I was a beginner when i wrote it (code was horrendous ngl). Only combat works at the moment, and I have been hung up on perfecting it (the logic is there for the other features). If I could get some feedback on how it works that would be great. What I really want to do in the long run is track which ghoul you are interacting with, so you are able to see it's health bar and such. However I raged and deleted the progress I had made because it kept getting caught up on other ghouls that walked by. As far as the current combat detection system goes, it works somewhat like hoodz fighter, although I did incorporate TEntities into the script, which I have yet to see anyone do, so feedback on that aspect would be great. The script can be used in SMART or on an official client, and infact, I wrote it completely on the official client.

    What it does

    - Kills the Ghouls at the north spot, west of Canifis
    - Eats food in or out of combat (salmon)
    - Decent Antiban

    Requirements

    - AeroLib Include && plugins: https://villavu.com/forum/showthread.php?t=108953
    - Latest version of SMART and Simba.

    Instructions

    - Start script north ghoul spot

    Credits

    - The Aerolib team

    To do

    - A lot

    Bugs

    - ??

    Code:
    v0.2
    - Smart Banking (if it has items in inv it will deposit, if not then it won't deposit)
    - 100% accurate progress report make sure to put in training skill at top of script
    - Some randomness to walkpath
    Code:
    v0.3
    - Converted majority of script to reflection
    - Pot support added
    - Random dismissing added
    - Won't try to attack the ghoul that was previously killed anymore
    - A very nice randomized walkpath function added (thanks to cosmas jdz)
    Code:
    v2.0
    - Converted to 100% color
    - Everything rewritten
    Simba Code:
    program ColorGhouler;
    {$DEFINE WALKER}
    {$i AeroLib/AeroLib.Simba}

    const
    {---------------------------------------------------------}
    {                      USER INPUT                         }
    {---------------------------------------------------------}
    {}  USER  = '';                                          {}
    {}  PASS  = '';                                          {}
    {}  PIN   = '';                                          {}
    {}                                                       {}
    {}  MOUSE_SPEED: TIntegerArray :=                        {}
    {}          [19, 23];                                    {}
    {}  EAT_BETWEEN: TIntegerArray :=                        {}
    {}          [19, 76];                                    {}
    {}  RUN_BETWEEN: TIntegerArray :=                        {}
    {}          [15, 60];                                    {}
    {---------------------------------------------------------}

      DEBUG   = false;
      VERSION = '2.0';

      BANK    : Tbox := IntToBox(5840, 2507, 5867, 2553);
      GHOULS  : Tbox := IntToBox(5440, 2370, 5515, 2435);

    type
      _NPC = record
        _TColors: array of TColEx;
        _UpTexts: TStringArray;
        _Options: TStringArray;
        _Points: TPointArray;
      end;

    var
      RSW: TRSWalker;
      Fails: Integer;
      Ghoul:  _NPC;
      TFood: TItem;

    procedure DebugMsg(What: String; terminate: boolean = false);
    begin
      writeln(MsToTime(getTimeRunning, 3) + ' | ' + What);
      if (terminate) then TerminateScript();
    end;

    procedure Ghoul.Init();
    begin
      self._TColors := [createCol(3883067, 11, 0.00, 0.17), createCol(8233378, 28, 0.03, 0.21)];
      self._UpTexts := ['houl', 'hou', 'oul'];
      self._Options := ['ttack Gho', 'ack Ghoul', 'k Ghoul'];
      self._Points  := [];
    end;

    procedure HealthRegen();
    begin
      Me.Integers[0] := iGaussRange(EAT_BETWEEN[0], EAT_BETWEEN[1]);
      DebugMsg('Eating next at ' + IntToStr(Me.Integers[0]) + ' hp');
    end;

    procedure RunRegen();
    begin
      Me.Integers[1] := iGaussRange(RUN_BETWEEN[0], RUN_BETWEEN[1]);
      DebugMsg('Running next at ' + IntToStr(Me.Integers[1]) + ' Energy');
    end;

    procedure FreeMemory;
    begin
      DebugMsg('Freeing memory...');
      freeDTM(TFood.DTM);
      RSW.Free();
    end;

    procedure Load();
    begin
      DebugMsg('Loading stuff...');
      InitAL();
      MouseSpeed := RandomRange(MOUSE_SPEED[0], MOUSE_SPEED[1]);
      RSW.Init('WorldMap');
      RSW.walkStyle := wsSPS;
      RSW.anyAngle := True;
      RSW.skipClose := 15;
      Me.Active := True;
      Me.Member := True;
      Me.Name := USER;
      Me.Pass := PASS;
      Me.Pin := PIN;
      Ghoul.Init();
      with (TFood) do
      begin
        Name := 'Salmon';
        DTM  := DTMFromString('mbQAAAHicY2VgYMhmYmBIAuJkIC4G4nwg5mZkYOADYiEgZgdiNiC+7i7JcKAyh+FSZxXDcx8ZhgWmAgxyQP38aJgRCwYDAHgGCaM=');
      end;
      Setlength(Me.Integers, 2);
      HealthRegen();
      RunRegen();
      addonterminate('FreeMemory');
      DebugMsg('Starting Color Ghouler - v' + VERSION);
      DebugMsg('Start the script logged in to define your player model');
    end;

    function TPointArray.Random(): TPoint;
    begin
      if (Length(Self)) < 1 then exit;
      result := self[RandomRange(0, Length(self) - 1)];
    end;

    procedure CustomMouse(point: TPoint; RX, RY: Integer);
    begin
      RX := iGaussRange(0, RX);
      RY := iGaussRange(0, RY);
      case random(0, 15) of
        0..5: BrakeMMouse(point, RX, RY, false);
        6..7: MissMouse(point, RX, RY);
        8..15: HumanMMouse(point, RX, RY);
      end;
    end;

    procedure Antiban();
    begin
      if (not (isMouseInClient())) then exit;
      DebugMsg('Performing antiban');

      if ((not (isUsingRun())) and (getRunEnergy() >= Me.Integers[1])) then
      begin
        toggleRunning(true);
        RunRegen();
      end;

      case random(0, 100) of
        0..3: hoverSkill('hitpoints', false);
        4..20: MMouseOffClient('Random'); //blaze it
        21..45: SleepAndMoveMouse(200 + random(2000));
        46..75: HumanRandomMouse();
        76..100: setCompass(round(getCompassAngle()) + GaussRange(5 + random(100), 150 + random(200)));
      end;

      if (random(50) = 1) then
        Antiban();
      if (random(250) = 1) then
        Sleep(GaussRandom(60000));
    end;

    { Methodology borrowed from hoodz fighter,
        modified to incorporate Entities +
           better hitsplats detection }


    function Me.SeeHitsplats(timeOut: Integer): Boolean;
    var
      TColArr: array of TColEx;
      TPA: TpointArray;
      t1, t2: timer;
      i, loadTime: integer;
    begin
      Result := false;
      TColArr := [createCol(13108739, 23, 0.02, 0.17), createCol(65941, 9, 0.00, 0.15)];
      loadTime := 0;
      t1.start();
      while ((t1.timeElapsed() - loadTime) < timeOut) do
      begin
        t2.start();
        self.Model.update();
        loadTime := t2.timeElapsed();

        TPA := TPAFromEllipse(self.Model.BasePnt.X, self.Model.BasePnt.Y, 14, 18);
        FillEllipse(TPA);
        if (DEBUG) then DebugTPA(TPA, '');

        for i := 0 to High(TColArr) do
        begin
          if (TColArr[i].count(TPA.getBounds()) > 100) then
            exit(true);
        end;
      end;
    end;

    function Ghoul.FindFree(): TPointArray;
    var
      ATPA, TPAs: T2DPointArray;
      i, j: Integer;
      b: TBox;
    begin
      result := [];
      SetLength(TPAs, Length(Self._TColors));

      for j := 0 to High(Self._TColors) do
      begin
        self._TColors[j].FindAllIn(Area_MS, TPAs[j]);
        if length(TPAs[j]) < 1 then exit;
      end;

      AppendTPA(TPAs[0], TPAs[1]);
      ATPA := FloodFillTPA(TPAs[0]);

      FilterTPAsBetween(ATPA, 0, 100);
      SortATPAFromMidPoint(ATPA, Point(MSCX, MSCY));
      if (length(ATPA) < 1) then exit;

      for i := 0 to high(ATPA) do
      begin
        b := toBox(ATPA[i].getBounds().X1 - 30, ATPA[i].getBounds().Y1 - 30, ATPA[i].getBounds().X2 + 30, ATPA[i].getBounds().Y2 + 5);
        if (not (foundHPBarIn(B))) then
        begin
          if (DEBUG) then debugTPA(ATPA[i], '');
          exit(ATPA[i]);
        end;
      end;
    end;

    function Ghoul.Interact(): Boolean;
    var
      pnt: TPoint;
    begin
      result := false;
      if (not (isLoggedIn())) then exit;
      self._Points := Ghoul.findFree();

      if self._Points = [] then exit;
      if (DEBUG) then DebugTPA(self._Points, '');

      case random(0, 20) of
        0..15: pnt := self._Points.midPnt();
        16..18: pnt := MedianTPA(self._Points);
        19..20: pnt := self._Points.Random();
      end;
      if (Pnt.X < 1) then exit;
      CustomMouse(Pnt, 3, 3);

      if (waitUpTextMulti(self._UpTexts, 50 + random(100))) then
      begin
        if (random(0, 50) > 1) then
          fastClick(MOUSE_LEFT)
        else
        begin
          fastClick(MOUSE_RIGHT);
          if (not (waitOptionMulti(self._Options, 50 + random(100)))) then exit;
        end;
      end else
      begin
        if (random(0, 5)) = 1 then
          CustomMouse(Pnt, 100, 100);
        if (Ghoul.Interact()) then
          exit(true);
      end;

      if (not (didRedClick())) then exit;
      result := (Me.SeeHitsplats(4250 + random(750)));

      if (result) then
        DebugMsg('Successfully interacted with ghoul')
      else
        DebugMsg('Failed to interact with ghoul');
    end

    Procedure Eat();
    var
      slots: TIntegerArray;
      x, y, rand: Integer;
    begin
      if (not (gameTab(TAB_INV))) then exit;
      sleep(GaussRandom(2000));

      slots := TFood.getSlots();
      if (length(slots) < 1) then exit;
      if (random(0, 8) > 1) then
        rand := low(slots)
      else
        rand := random(low(slots), length(slots) - 1);
      GaussBox(x, y, invBox(slots[rand]).X1, invBox(slots[rand]).Y1, invBox(slots[rand]).X2, invBox(slots[rand]).Y2)

      if (not (PointInBox(getMousePnt(), invBox(slots[rand])))) then
        CustomMouse(Point(x, y), 0, 0);

      if (random(0, 50) > 1) then
        fastClick(MOUSE_LEFT)
      else
      begin
        fastClick(MOUSE_RIGHT);
        if (not (waitOptionMulti(['Eat', 'at'], 50 + random(100)))) then exit;
      end;

      HealthRegen();
    end;

    procedure WaitFight();
    var
      t: timer;
    begin
      t.Start();
      while ((Me.SeeHitsplats(1650 + GaussRandom(250))) or (isPlayerWalking())) do
      begin
        if (t.timeElapsed > (28000 + random(3000))) then
          break;
        if (getCurrenthealth() <= Me.Integers[0]) then
          Eat();
        if (random(60) = 1) then
          Antiban();
      end;
    end;

    function Fighting(): Boolean;
    begin
      result := false;
      if (not (Me.SeeHitsplats(1))) then
      begin
        if (Ghoul.Interact()) then
        begin
          result := true;
          WaitFight();
        end else
          sleep(50);
      end;
    end;

    function Banking(): Boolean;
    begin

    end;

    function GetArea(): Integer;
    var
      i: Integer;
      arr: TBoxArray;
    begin
      result := - 1;
      arr := [GHOULS, BANK];
      for i := 0 to high(arr) do
        if (PointInBox(RSW.GetMyPos(), arr[i])) then
          exit(i);
    end;

    function GetState(): Variant;
    begin
      if (not (isLoggedIn())) then
        exit(0);
      case (TFood.InInventory()) of
        true: exit(1);
        false: exit(2);
      end;
    end;

    procedure Execute();
    var
      State: Variant;
      Area: Integer;
    begin
      if (random(125) = 1) then
        Antiban();
      Area := GetArea();
      case (GetState()) of
        0: State := LoginPlayer(False);
        1:
        if (Area = 0) then
          State := Fighting();
        {else
          State := walk to ghouls;}

        2:
        if (Area = 1) then
          State := Banking();
        {else
          State := walk to bank;}

      end;
      if (not (State)) then
        inc(fails)
      else
        fails := 0;
      if (fails > 15) then
        DebugMsg('Too many fails - TERMINATING', true);
    end;

    begin
      Load();
      while (not (IsLoggedIn())) do
        sleep(2500);
      definePlayerModel(35, 70);
      if (not (Me.ModelSet)) then
        terminateScript;
      while (Me.Active) do
        Execute();
    end.
    Last edited by jstemper; 02-24-2017 at 02:05 PM. Reason: Updates

  2. #2
    Join Date
    Sep 2012
    Location
    Netherlands
    Posts
    2,752
    Mentioned
    193 Post(s)
    Quoted
    1468 Post(s)

    Default

    congratulations on release!

    ps for bug report: you could do cb xp gained / xp from 1 ghoul (200 i believe)

  3. #3
    Join Date
    Oct 2011
    Location
    England
    Posts
    401
    Mentioned
    10 Post(s)
    Quoted
    176 Post(s)

    Default

    Nice one JS!
    Yer a wizard, 'oopi

  4. #4
    Join Date
    Jun 2013
    Location
    Scranton
    Posts
    496
    Mentioned
    5 Post(s)
    Quoted
    220 Post(s)

    Default

    Quote Originally Posted by hoodz View Post
    congratulations on release!

    ps for bug report: you could do cb xp gained / xp from 1 ghoul (200 i believe)
    cb xp gained / 200 will just give me the amount of ghouls that i killed, problem is that sometimes it will click on a ghoul, then right after it dies sometimes it clicks the same one thus script thinks it counts for 2 kills. I think i can make it more accurate by adjusting some wait times or something
    edit: also thanks, reading through yours, i need bot, and davi scripts are basically how i learned how to script.. still have a lot to learn though
    edit 2: thanks anth

  5. #5
    Join Date
    Aug 2014
    Location
    Australia
    Posts
    932
    Mentioned
    53 Post(s)
    Quoted
    495 Post(s)

    Default

    Congrats on release mate!



    New to scripting? Procedures & Functions for Beginners
    Do you use your computer at night? Just get f.lux

  6. #6
    Join Date
    Sep 2012
    Location
    Netherlands
    Posts
    2,752
    Mentioned
    193 Post(s)
    Quoted
    1468 Post(s)

    Default

    Quote Originally Posted by jstemper View Post
    cb xp gained / 200 will just give me the amount of ghouls that i killed, problem is that sometimes it will click on a ghoul, then right after it dies sometimes it clicks the same one thus script thinks it counts for 2 kills. I think i can make it more accurate by adjusting some wait times or something
    edit: also thanks, reading through yours, i need bot, and davi scripts are basically how i learned how to script.. still have a lot to learn though
    edit 2: thanks anth
    no i mean you should track xp gained with reflection.

  7. #7
    Join Date
    Jun 2013
    Location
    Scranton
    Posts
    496
    Mentioned
    5 Post(s)
    Quoted
    220 Post(s)

    Default

    Quote Originally Posted by hoodz View Post
    no i mean you should track xp gained with reflection.
    i'm not sure what you mean by 'with reflection.' I am tracking xp gained it just isnt 100% accurate atm

  8. #8
    Join Date
    Sep 2012
    Location
    Netherlands
    Posts
    2,752
    Mentioned
    193 Post(s)
    Quoted
    1468 Post(s)

    Default

    Quote Originally Posted by jstemper View Post
    i'm not sure what you mean by 'with reflection.' I am tracking xp gained it just isnt 100% accurate atm
    look at my nightmare zone script for tracking xp

  9. #9
    Join Date
    Jun 2013
    Location
    Scranton
    Posts
    496
    Mentioned
    5 Post(s)
    Quoted
    220 Post(s)

    Default

    Quote Originally Posted by hoodz View Post
    look at my nightmare zone script for tracking xp
    thanks, also might edit and utilize that potion handler

  10. #10
    Join Date
    Feb 2015
    Posts
    35
    Mentioned
    0 Post(s)
    Quoted
    13 Post(s)

    Default

    If other players are wearing ghoul/ off white clothing would this script have some kind of an issue with that?

  11. #11
    Join Date
    Jun 2013
    Location
    Scranton
    Posts
    496
    Mentioned
    5 Post(s)
    Quoted
    220 Post(s)

    Default

    Tbh yeah it might but I doubt anyone will, ghouls isn't a popular place anyways but if you have a problem with that tell me and I couldn't always use reflection instead of color

  12. #12
    Join Date
    Feb 2013
    Location
    Rimmington
    Posts
    319
    Mentioned
    33 Post(s)
    Quoted
    183 Post(s)

    Default

    Very nice stuff! Keep up the good work

    Edit: rep++





  13. #13
    Join Date
    Jun 2015
    Posts
    7
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    It work's fine but my one issue is that it sometimes clicks the ghoul I have just killed while it is dying, rather than a new ghoul. Is there any way around this?

  14. #14
    Join Date
    Jun 2013
    Location
    Scranton
    Posts
    496
    Mentioned
    5 Post(s)
    Quoted
    220 Post(s)

    Default

    Quote Originally Posted by frankbojen View Post
    It work's fine but my one issue is that it sometimes clicks the ghoul I have just killed while it is dying, rather than a new ghoul. Is there any way around this?
    yes it's very easy, I have an updated version but I'm on vacation atm. All you have to do is call a randomwait right before the attack ghoul function

  15. #15
    Join Date
    Jul 2015
    Posts
    11
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    Error: Access violation
    Compiling failed.
    I'm getting this, didn't edit the script... any ideas?

  16. #16
    Join Date
    Jun 2013
    Location
    Scranton
    Posts
    496
    Mentioned
    5 Post(s)
    Quoted
    220 Post(s)

    Default

    Quote Originally Posted by Aegydoesit View Post
    I'm getting this, didn't edit the script... any ideas?
    hmm that is weird, so you couldn't start the script at all?

  17. #17
    Join Date
    Mar 2013
    Location
    USA
    Posts
    11
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Quote Originally Posted by Aegydoesit View Post
    I'm getting this, didn't edit the script... any ideas?
    Quote Originally Posted by jstemper View Post
    hmm that is weird, so you couldn't start the script at all?
    Getting this as well, ran Simba as Administrator thinking it may have been the issue, no luck. Quite disappointed too, this looks like a useful script. Any ideas on what it may be friends?

    EDIT: https://villavu.com/forum/showthread...93#post1348393

    Fix for error at link, after following the fix the script works perfectly fine. Thanks!
    Last edited by xlxneonxlx; 08-22-2015 at 12:59 AM.

  18. #18
    Join Date
    Jun 2013
    Location
    Scranton
    Posts
    496
    Mentioned
    5 Post(s)
    Quoted
    220 Post(s)

    Default

    Quote Originally Posted by xlxneonxlx View Post
    Getting this as well, ran Simba as Administrator thinking it may have been the issue, no luck. Quite disappointed too, this looks like a useful script. Any ideas on what it may be friends?

    EDIT: https://villavu.com/forum/showthread...93#post1348393

    Fix for error at link, after following the fix the script works perfectly fine. Thanks!
    Yeah as flight said it was caused by trying to load the prosocks plugin twice, glad you fixed it. Tomorrow I will push an update making progress report 99% correct, faster npc detecting, and possible combat potion support

  19. #19
    Join Date
    Jul 2015
    Posts
    11
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    Thank you, the prosocks was causing the error.
    EDIT: will post proggy after a few hours, thank you so much.


    Was able to run for over 10+ hours,



    zzz.png
    Last edited by Aegydoesit; 08-23-2015 at 11:22 PM.

  20. #20
    Join Date
    Jun 2013
    Location
    Scranton
    Posts
    496
    Mentioned
    5 Post(s)
    Quoted
    220 Post(s)

    Default

    Quote Originally Posted by Aegydoesit View Post
    Thank you, the prosocks was causing the error.



    EDIT: will post proggy after a few hours, thank you so much.
    alright cool, atm the proggy is off but I have an updated version with 100% accurate progress report.. gonna wait till next weekend to release it because by that time i will have potion support added. College has taken over my free time :|

  21. #21
    Join Date
    Jun 2015
    Posts
    21
    Mentioned
    0 Post(s)
    Quoted
    11 Post(s)

    Default

    The script is Great! But there are a few bugs that annoy me quite a lot and assuming others as well.

    1st bug i noticed that the script also picks up bones from time to time and therefor takes space in your inventory and eventually become full of them ( could you try adding something to the script that before it takes food it banks all the items in the inventory? )

    2nd one is that it wont log back onto the account after disconnecting from the game ( hope you can do something about that if you plan to update your script )

    Overall a great script and runs well fixing those 2 things would make it PERFECT !

  22. #22
    Join Date
    Jun 2013
    Location
    Scranton
    Posts
    496
    Mentioned
    5 Post(s)
    Quoted
    220 Post(s)

    Default

    Quote Originally Posted by sjemple View Post
    The script is Great! But there are a few bugs that annoy me quite a lot and assuming others as well.

    1st bug i noticed that the script also picks up bones from time to time and therefor takes space in your inventory and eventually become full of them ( could you try adding something to the script that before it takes food it banks all the items in the inventory? )

    2nd one is that it wont log back onto the account after disconnecting from the game ( hope you can do something about that if you plan to update your script )

    Overall a great script and runs well fixing those 2 things would make it PERFECT !
    Fixed, thanks for bug report

  23. #23
    Join Date
    Jun 2015
    Posts
    21
    Mentioned
    0 Post(s)
    Quoted
    11 Post(s)

    Default

    Thanks for the update ! Going to try it out right now and will post my results ( also the potion option I noticed is something to look forward to. )

  24. #24
    Join Date
    Jun 2013
    Location
    Scranton
    Posts
    496
    Mentioned
    5 Post(s)
    Quoted
    220 Post(s)

    Default

    Quote Originally Posted by sjemple View Post
    Thanks for the update ! Going to try it out right now and will post my results ( also the potion option I noticed is something to look forward to. )
    Just realized i added hp to 200 not thinking that the 200 already included hp xp... will fix when i get home

  25. #25
    Join Date
    Jun 2015
    Posts
    21
    Mentioned
    0 Post(s)
    Quoted
    11 Post(s)

    Default

    runescape detected me using a 3rd party program while running this script...I had a nice long run about 5-7 hours of botting a day for 10 days and previously about total of 300 hours of botting with various other scripts before using ghouler. Just so you people know how long it took them to detect a simba script. Maybe they just caught me by not doing randoms. ( got banned for 2 days )

Page 1 of 3 123 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •