Results 1 to 4 of 4

Thread: [OSRS] NMZ DHAROK'ing AFK SCRIPT

  1. #1
    Join Date
    Apr 2015
    Posts
    3
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default [OSRS] NMZ DHAROK'ing AFK SCRIPT

    Simba Code:
    {$i AeroLib/AeroLib.Simba}

    var
      obj_prayericon : TItem;
      item_cake : TItem;
      item_overload : TItem;
      item_absorb : TItem;
      invbox1 : TBox;
      minimap : TBox;

    procedure createItems;
    begin
      obj_prayericon.Name := 'prayer';
      item_cake.Name := 'Dwarven rock cake';
      item_overload.Name := 'Overload';
      item_absorb.Name := 'Absorb';
      obj_prayericon.DTM := DTMFromString('mbQAAAHicY2VgYMhnYWAoAeJUIE6Hsi8wMjCcAOKTQHwZitds3sCgKWfL4G6SxWCuEcggL6HPIALUj44ZsWAwAAAq6QtA');
      item_cake.DTM := DTMFromString('mbQAAAHicY2VgYHBiYmAwB2J3ILYFYm8gfgEUfwPEH4D4DhA/AuLSbH8gyYiCFRkwASMWDAYAMLoHMw==');
      item_overload.DTM:= DTMFromString('mggAAAHicY2NgYLjGwsBwF4jPA/FFIL4DpauYGBiKgLgEiAuAuA6KBfn4gLoYMTAXA3aAqRKCIQAAaUMIOQ==');
      item_absorb.DTM := DTMFromString('mbQAAAHicY2VgYHBiYmDwAmJLILYBYjcgFmVkYOAHYj4g5gBidiBev2s/UDUjClYEkuiYEQsGAwA64wRz');
    end;

    procedure eatcake;
    var
      pnt : TPoint;
      x , y : Integer;
    begin
      if item_cake.findIn(invbox1,pnt) then
      begin
        Writeln('Guzzling the Cake');
        humanMMouse(pnt,2,2);
        wait(random(300, 500));
        ClickMouse(x,y,mouse_right);
        wait(random(100, 200));
        chooseOption('Guzzle');
      end;
    end;

    procedure flickprayer;
    var
      pnt : TPoint;
      x , y : Integer;
    begin
      writeln('Flicking Prayer');
      pnt := [555,95];
      humanMMouse(pnt,10,10);
      wait(random(200, 500));
      ClickMouse(x,y,mouse_left);
      wait(random(200, 500));
      ClickMouse(x,y,mouse_left);
    end;

    procedure drinkoverload;
    var
      pnt : TPoint;
      x , y : Integer;
    begin
      if item_overload.findIN(invbox1,pnt) then
      begin
        writeln('Drinking Overload');
        humanMMouse(pnt,2,2);
        wait(random(100, 300));
        ClickMouse(x,y,mouse_Left);
        flickprayer;
        if (getCurrentHealth() >= 11) then
        begin
          repeat
          wait(100);
          until (getCurrentHealth() = 1);
        end;
        wait(random(100,300));
      end;
    end;

    procedure drinkabsorb;
    var
      pnt : TPoint;
      x , y : Integer;
    begin
      if item_absorb.findIn(invbox1,pnt) then
      begin
        writeln('Drinking Absorbtion');
        humanMMouse(pnt,2,2);
        wait(random(100, 200));
        ClickMouse(x,y,mouse_left);
      end;
    end;

    procedure antiban;
    var
      rand : Integer;
    begin
      if (random(0, 4) = 0) then
      begin
        rand := random(0, 60);
        case rand of
          0..45:
          begin
            if (pointInBox(getMousePnt(), intToBox(1, 1, 765, 500))) then
              MMouseOffClient('random');
          end;
          46..51:
          begin
            compassMovement(random(60), random(230), false);
          end;
          52..60:
          begin
            pickUpMouse;
          end;
        end;
      end;
    end;

    procedure afk;
    var
    counter : Integer;
    begin
    repeat
      if (getCurrentHealth() >= 51) then
      begin
        drinkoverload();
        drinkabsorb();
        antiban();
      end
      else if (getCurrentHealth() >= 2) then
        begin
        repeat
            eatcake();
        until (getCurrentHealth() = 1)
        end
      else if (counter = 20) then
      begin
        flickprayer();
        counter := 0;
        antiban();
      end
      else
      begin
        wait(random(1500, 2900));
        Inc(counter);
        end
    until (getCurrentHealth() >= 53)
    end;

    procedure log;
    begin
      logoutplayer();
      terminatescript();
    end;

    begin
      initAL;
      minimap := ToBox(500, 91, 600, 31);
      invbox1 := ToBox(550, 208, 735, 465);
      mouseSpeed := Random (18, 30);
      createitems;
      flickprayer;
      afk;
      log;
    end;

    I based that script on another script that wasn't working that well.

    Got 99 attack and strength with this script, no bans (yet!)

    Needs a lot better antiban, any suggestion will be heard
    Last edited by h4n1virus; 05-16-2018 at 07:36 AM.

  2. #2
    Join Date
    Jan 2012
    Location
    Sydney, Australia
    Posts
    877
    Mentioned
    12 Post(s)
    Quoted
    368 Post(s)

    Default

    Quote Originally Posted by h4n1virus View Post
    Simba Code:
    {$i AeroLib/AeroLib.Simba}

    var
      obj_prayericon : TItem;
      item_cake : TItem;
      item_overload : TItem;
      item_absorb : TItem;
      invbox1 : TBox;
      minimap : TBox;

    procedure createItems;
    begin
      obj_prayericon.Name := 'prayer';
      item_cake.Name := 'Dwarven rock cake';
      item_overload.Name := 'Overload';
      item_absorb.Name := 'Absorb';
      obj_prayericon.DTM := DTMFromString('mbQAAAHicY2VgYMhnYWAoAeJUIE6Hsi8wMjCcAOKTQHwZitds3sCgKWfL4G6SxWCuEcggL6HPIALUj44ZsWAwAAAq6QtA');
      item_cake.DTM := DTMFromString('mbQAAAHicY2VgYHBiYmAwB2J3ILYFYm8gfgEUfwPEH4D4DhA/AuLSbH8gyYiCFRkwASMWDAYAMLoHMw==');
      item_overload.DTM:= DTMFromString('mggAAAHicY2NgYLjGwsBwF4jPA/FFIL4DpauYGBiKgLgEiAuAuA6KBfn4gLoYMTAXA3aAqRKCIQAAaUMIOQ==');
      item_absorb.DTM := DTMFromString('mbQAAAHicY2VgYHBiYmDwAmJLILYBYjcgFmVkYOAHYj4g5gBidiBev2s/UDUjClYEkuiYEQsGAwA64wRz');
    end;

    procedure eatcake;
    var
      pnt : TPoint;
      x , y : Integer;
    begin
      if item_cake.findIn(invbox1,pnt) then
      begin
        Writeln('Guzzling the Cake');
        humanMMouse(pnt,2,2);
        wait(random(300, 500));
        ClickMouse(x,y,mouse_right);
        wait(random(100, 200));
        chooseOption('Guzzle');
      end;
    end;

    procedure flickprayer;
    var
      pnt : TPoint;
      x , y : Integer;
    begin
      writeln('Flicking Prayer');
      pnt := [555,95];
      humanMMouse(pnt,10,10);
      wait(random(200, 500));
      ClickMouse(x,y,mouse_left);
      wait(random(200, 500));
      ClickMouse(x,y,mouse_left);
    end;

    procedure drinkoverload;
    var
      pnt : TPoint;
      x , y : Integer;
    begin
      if item_overload.findIN(invbox1,pnt) then
      begin
        writeln('Drinking Overload');
        humanMMouse(pnt,2,2);
        wait(random(100, 300));
        ClickMouse(x,y,mouse_Left);
        flickprayer;
        if (getCurrentHealth() >= 11) then
        begin
          repeat
          wait(100);
          until (getCurrentHealth() = 1);
        end;
        wait(random(100,300));
      end;
    end;

    procedure drinkabsorb;
    var
      pnt : TPoint;
      x , y : Integer;
    begin
      if item_absorb.findIn(invbox1,pnt) then
      begin
        writeln('Drinking Absorbtion');
        humanMMouse(pnt,2,2);
        wait(random(100, 200));
        ClickMouse(x,y,mouse_left);
      end;
    end;

    procedure antiban;
    var
      rand : Integer;
    begin
      if (random(0, 4) = 0) then
      begin
        rand := random(0, 60);
        case rand of
          0..45:
          begin
            if (pointInBox(getMousePnt(), intToBox(1, 1, 765, 500))) then
              MMouseOffClient('random');
          end;
          46..51:
          begin
            compassMovement(random(60), random(230), false);
          end;
          52..60:
          begin
            pickUpMouse;
          end;
        end;
      end;
    end;

    procedure afk;
    var
    counter : Integer;
    begin
    repeat
      if (getCurrentHealth() >= 51) then
      begin
        drinkoverload();
        drinkabsorb();
        antiban();
      end
      else if (getCurrentHealth() >= 2) then
        begin
        repeat
            eatcake();
        until (getCurrentHealth() = 1)
        end
      else if (counter = 20) then
      begin
        flickprayer();
        counter := 0;
        antiban();
      end
      else
      begin
        wait(random(1500, 2900));
        Inc(counter);
        end
    until (getCurrentHealth() >= 53)
    end;

    procedure log;
    begin
      logoutplayer();
      terminatescript();
    end;

    begin
      initAL;
      minimap := ToBox(500, 91, 600, 31);
      invbox1 := ToBox(550, 208, 735, 465);
      mouseSpeed := Random (18, 30);
      createitems;
      flickprayer;
      afk;
      log;
    end;

    I based that script on another script that wasn't working that well.

    Got 99 attack and strength with this script, no bans (yet!)

    Needs a lot better antiban, any suggestion will be heard
    Nice release.

    Few bits of feedback.

    You have created TBox's for Inventory and Minimap. Aerolib has these dimensions already declared in the include, so you can use Area_Inv in replacement of invbox1, and Area_mm in replacement of minimap

    You have also created a TItem called obj_prayer icon which hasn't been used. What was this going to be used for?

    It will look a little botlike with the eatcake procedure that you have written in there. I would suggest a few things.
    • Limit the procedure to include 1 instance of using the rock cake per cycle, and start the way delay at a lower point: Wait(randomrange(50,150). When a player right clicks over and over again, they begin to do it quite quickly. An alternative way to do this would be to create a random case and have a series of different delay periods depending on rng.
    • There is an infinite loop with the function. If the rock cake isn't in the inventory, the procedure will repeat forever. Is certainly worth putting a failsafe timer in the afk function to prevent infinite loops, as well as putting an end else statement at the end of your rockcake procedure to terminate the script if no rockcake is found.
    • The drinkabsorb procedure can be problematic for lower defence players as well. Since it is only drinking 1 sip every 5 minutes (I assume, as you have attached its condition to > 51 hp) then there is a high risk of dying form lack of absorption before running out of potions. Would recommend implementing a color check on the absorb counter on the left of the screen to detect when the numbers are no longer white. This is what I do in my script.
    • You need to Free your TItem DTMs when the script shuts down. Add something like: AddOnTerminate('StopScript'); after you declare createitems; in your main loop, then create a procedure called StopScript and add freeDTM(item_cake.DTM);. Do this for every item/DTM.


    That's the only feedback I have time for at the moment. If you take it on board, I would be happy to provide you with some more.

    All in all, nice work and thanks for the release

  3. #3
    Join Date
    Apr 2015
    Posts
    3
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    I have fixed most of these problems, (I think)
    Probably caused a fuckton of new bugs, but I really appreciate your help and implement them as soon as I find a bit more time.
    What do you think melee prayer flicking during the time it overloads?

    Simba Code:
    program NightmareZone;
    {$i AeroLib/AeroLib.Simba}

    var
      item_cake, item_overload, item_absorb : TItem;
      invbox1, minimap : TBox;

    procedure createItems;
    begin
      item_cake.Name := 'Dwarven rock cake';
      item_overload.Name := 'Overload';
      item_absorb.Name := 'Absorb';
      item_cake.DTM := DTMFromString('mbQAAAHicY2VgYHBiYmAwB2J3ILYFYm8gfgEUfwPEH4D4DhA/AuLSbH8gyYiCFRkwASMWDAYAMLoHMw==');
      item_overload.DTM:= DTMFromString('mggAAAHicY2NgYLjGwsBwF4jPA/FFIL4DpauYGBiKgLgEiAuAuA6KBfn4gLoYMTAXA3aAqRKCIQAAaUMIOQ==');
      item_absorb.DTM := DTMFromString('mbQAAAHicY2VgYHBiYmDwAmJLILYBYjcgFmVkYOAHYj4g5gBidiBev2s/UDUjClYEkuiYEQsGAwA64wRz');
    end;

    procedure eatcake;
    var
      pnt : TPoint;
      x, y : Integer;
    begin
      if item_cake.findIn(invbox1, pnt) then
      begin
        Writeln('Guzzling the Cake');
        humanMMouse(pnt, 2, 2);
        wait(random(100, 300));
        ClickMouse(x, y, mouse_right);
        wait(random(200, 400));
        chooseOption('Guzzle');
      end;
    end;

    procedure flickprayer;
    var
      pnt : TPoint;
      x, y : Integer;
    begin
      writeln('Flicking Prayer');
      pnt := [555, 95];
      humanMMouse(pnt, 10, 10);
      wait(random(100, 300));
      ClickMouse(x, y, mouse_left);
      wait(random(200, 500));
      ClickMouse(x, y, mouse_left);
    end;

    procedure drinkoverload;
    var
      pnt : TPoint;
      x, y : Integer;
    begin
      if item_overload.findIN(invbox1, pnt) then
      begin
        writeln('Drinking Overload');
        humanMMouse(pnt, 2, 2);
        wait(random(100, 150));
        ClickMouse(x, y, mouse_Left);
        wait(random(100, 150));
        if (getCurrentHealth() > 11) then
          {begin
          writeln('Flicking Protect From Melee');
          togglePrayer('Protect From Melee', true);
          wait(random(300, 550));
            repeat
          begin
            ClickMouse(x, y, Mouse_left);
            wait(random(300, 550));
          end;
            until (getCurrentHealth() = 1);
          end;
          wait(random(300,600));
          togglePrayer('Protect From Melee', false);}

          repeat
          begin
            wait(100);
          end;
          until (getCurrentHealth() = 1)
      end;
    end;

    procedure drinkabsorb;
    var
      pnt : TPoint;
      x, y : Integer;
    begin
      if item_absorb.findIn(invbox1, pnt) then
      begin
        writeln('Drinking Absorbtion');
        humanMMouse(pnt, 2, 2);
        wait(random(100, 200));
        ClickMouse(x, y,mouse_left);
        wait(random(200, 300));
      end;
    end;

    procedure antiban;
    var
      rand : Integer;
    begin
      if (random(0, 4) = 0) then
      begin
        rand := random(0, 70);
        case rand of
          0..45:
          begin
            if (pointInBox(getMousePnt(), intToBox(1, 1, 765, 500))) then
              MMouseOffClient('random');
          end;
          46..51:
          begin
            compassMovement(0, 360, false);
          end;
          52..70:
          begin
            pickUpMouse;
          end;
        end;
      end;
    end;

    procedure afk;
    var
      flick, absorb : Integer;
      pnt : TPoint;
    begin
      flickprayer;
    repeat
      if (getCurrentHealth() >= 60) then
      begin
        logoutplayer();
        terminatescript();
      end
      else if (getCurrentHealth() >= 51) AND (item_overload.findIN(invbox1, pnt)) then
      begin
        drinkoverload();
        {gameTab(TAB_INV);}
        antiban();
      end
      else if (getCurrentHealth() >= 2) AND (getCurrentHealth() <= 59) then
      begin
      repeat
          eatcake();
      until (getCurrentHealth() = 1)
      end
      else if (flick = 20) then
      begin
        flickprayer();
        flick := 0;
        antiban();
      end
      else if (absorb = (random(150, 180))) then
      begin
        drinkabsorb();
        absorb := 0;
        antiban();
      end
      else
      begin
        wait(random(1500, 3000));
        Inc(flick);
        Inc(absorb);
        end
    until (getCurrentHealth() >= 60)
    end;

    begin
      initAL;
      minimap := ToBox(500, 91, 600, 31);
      invbox1 := ToBox(550, 208, 735, 465);
      mouseSpeed := Random (18, 30);
      createitems;
      afk;
    end;

    I am unable to see your scripts though. Would be glad to see how did you implement the absorbtions. Right now the absorbtions are based on my own need.
    Last edited by h4n1virus; 05-17-2018 at 09:09 PM.

  4. #4
    Join Date
    Jan 2012
    Location
    Sydney, Australia
    Posts
    877
    Mentioned
    12 Post(s)
    Quoted
    368 Post(s)

    Default

    Yeah I use protect from melee while doing overload/rock cake to 1 hp. I also flick an absorb potion when i get low enough HP for when I prayer flick for the first time (as protect from melee gets removed).

    My method is in no way optimal; I probably should redo it a little, but I just got max combat so won't need to go to NMZ for a while lol.

    I'll pm you a copy of my script. Feel free to use some functions from it but be sure to credit any copied code.

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
  •