Page 2 of 2 FirstFirst 12
Results 26 to 40 of 40

Thread: CosmasJDZ red spider eggs

  1. #26
    Join Date
    Feb 2014
    Posts
    47
    Mentioned
    1 Post(s)
    Quoted
    26 Post(s)

    Default

    it has a pretty hard time looting the spider eggs and when it fails to loot the spider eggs it just leaves them unlooted

  2. #27
    Join Date
    Feb 2014
    Posts
    47
    Mentioned
    1 Post(s)
    Quoted
    26 Post(s)

    Default

    The runescape update changed the summoning interface so when it tries to cast the spell it is in the wrong coordinates

  3. #28
    Join Date
    Jun 2015
    Posts
    41
    Mentioned
    1 Post(s)
    Quoted
    16 Post(s)

    Default

    @Anish do a ctrl+f for
    Simba Code:
    (17, 110, 33, 126)
    and change all of them to
    Simba Code:
    (24, 154, 39, 168)
    . Worked for me.

    Edit: Actually, might needa find your own coords. I reloaded my client and the coords of the special move box changed again.
    Last edited by currynoodle; 07-06-2015 at 09:47 PM.

  4. #29
    Join Date
    Sep 2014
    Posts
    39
    Mentioned
    0 Post(s)
    Quoted
    21 Post(s)

    Default

    Is anyone able to find out the new coordinates? Fagex made the click option smaller. It's less than a mm off....

  5. #30
    Join Date
    Jun 2014
    Location
    Lithuania
    Posts
    475
    Mentioned
    27 Post(s)
    Quoted
    200 Post(s)

    Default

    Seems like needs a revision. Probably will look through script today

  6. #31
    Join Date
    Oct 2015
    Location
    Hungary
    Posts
    1
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Hi!This script is broken or am i the only one having problems?

  7. #32
    Join Date
    Jan 2012
    Posts
    9
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    YEE, scripts is broken, anyone got worked version?

  8. #33
    Join Date
    Dec 2011
    Location
    East Coast, USA
    Posts
    4,231
    Mentioned
    112 Post(s)
    Quoted
    1869 Post(s)

    Default

    Quote Originally Posted by bzq132 View Post
    YEE, scripts is broken, anyone got worked version?
    The fact that your graphics settings were incorrect probably isn't helping.

    https://villavu.com/forum/showthread.php?t=115675

    Have you fixed that yet?
    GitLab projects | Simba 1.4 | Find me on IRC or Discord | ScapeRune scripts | Come play bot ScapeRune!

    <BenLand100> we're just in the transitional phase where society reclassifies guns as Badâ„¢ before everyone gets laser pistols

  9. #34
    Join Date
    Feb 2016
    Posts
    18
    Mentioned
    1 Post(s)
    Quoted
    4 Post(s)

    Default

    Changed some coordinates but bot still gets stuck spamming special move button .

  10. #35
    Join Date
    Feb 2012
    Posts
    180
    Mentioned
    2 Post(s)
    Quoted
    84 Post(s)

    Default

    This seems to work for me, but its slow with looting, so I'd really appreciate it if someone could change the looting procedure to make it work with the loot interface to "loot all".

    Simba Code:
    program CosmasJdzRedEggs;
    {$DEFINE SMART}
    {$i srl-6/srl.simba}
    {$i srl-6/lib/misc/srlplayerform.simba}
    {$I SPS/lib/SPS-RS3.Simba}

    // Farms red spider eggs at bank of goodwill //
    { Since cant attach stuff here so setup goes there:

    Download map and place in runescape_other: [url]http://i.imgur.com/UhRQzL1.png?1[/url]

    Graphics mode opengl preffered.

    Bank: [url]http://i.imgur.com/8IPXAhh.png?1[/url]

    Setup: [url]http://i.imgur.com/QGGjwok.png?1[/url]
    Save inventory in setup as Preset1

    Progress reports: [url]http://i.imgur.com/Vhd55uZ.png?1[/url]

     }


    const
      PosDtm := DTMFromString ('mbQAAAHicY2VgYBBigAANIJaC8mWAWA6IpaFyBkDs4a7LsOz/f4bPnznA+PLV8wz/geKSaJgRiFmBmBkJgwEAof0MFg==');
      Background := BitmapFromString (550, 130, 'meJztwjENAAAMAyD/biqqfy1M' +
      'xT4I6aKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq' +
      'qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq' +
      'qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq' +
      'qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq' +
      'qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq' +
      'qqqqqqqqqqqqqqqqqr+P8MkrPg=');
      PossibleWorldsArray = [4, 5, 6, 9, 10, 12, 14, 15, 16, 21, 22, 23, 24, 25, 26, 27, 28, 31, 32, 35, 36, 37, 39, 40, 44, 45, 46, 49, 50, 51, 53, 54, 56, 58, 59, 60, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 76, 77, 78, 79, 82, 83, 84, 85, 87, 88, 89, 91, 92, 98, 99, 100, 103, 104, 105, 106, 116, 117, 119, 123, 124, 134, 138];
      Centerx := 290;
      Centery := 199;
      LootingBox := inttobox (194, 105, 412, 272);

    var
    { Patternloot variables }
      shiftx := 0;
      shifty := 0;
      StaticPoints := [[ - 32, 32], [0, 32], [32, 32], [ - 32, 0], [32, 0], [ - 32, - 32], [0, - 32], [32, - 32]];
      StaticRotatedPoints, DynamicPoints: array [0..7] of array [0..1] of extended;
      StandartEggsLocationsArray: array [0..7] of boolean;
      LootingPattern: array [0..7] of integer;

    { Other variables }
      Miscli := 0;
      CheckedToPile := 0;
      Whopped := false;
      LootAntibanned := false;
      Fail := 0;
      Flag := 0;
      TripsDone := 0;
      RedNoob := 0;
      EggsBanked, EggsOnFloor, MiniBreakTimer, BreakingTime, RestartTime: integer;
      CurrentTripTime, TotalScriptTime, PlayersTimer, SixhourFixTime: ttimemarker;
      BreakEvery := 2150000;
      BreakFor := 432000;


    procedure InitPlayerForm();
    begin
      with playerForm do
      begin
        name := 'CosmasJDZ Eggs form';
        editBoxLabels := ['Run time before switch(mins)', 'Fails allowed'];
        editBoxDefaults := ['360', '10'];
        comboBoxLabels := ['World', 'Alternative looting?'];
        comboBoxDefaults := ['63', 'False'];
        setLength(comboBoxItems, length(comboBoxLabels));
        comboBoxItems[0] := ['4', '5', '6', '9', '10', '12', '14', ' 15', '16', '21', '22', '23', '24', '25', '26', '27', '28', '31', '32', '35', '36', '37', '39', '40', '44', '45', '46', '49', '50', '51', '53', '54', '56', '58', '59', '60', '62', '63', '64', '65', '66', '67', '68', '69', '70', '71', '72', '73', '74', '76', '77', '78', '79', ' 82', '83', '84', '85', '87', '88', ' 89', '91', '92', '98', '99', '100', '103', '104', '105', '106', '116', '117', '119', '123', '124', '134', '138'];
        comboBoxItems[1] := ['False', 'True'];
      end;
    end;

    procedure DeclarePlayers();
    var
      i: Integer;
    begin
      players.setup(playerForm.players);
      currentPlayer := 0;
      for i := 0 to high(players) do
        with players[i] do
        begin
          integers[0] := strToInt(playerForm.players[i].settings[0]);
          integers[1] := strToInt(playerForm.players[i].settings[1]);
          integers[2] := strtoint(playerform.players[i].settings[2]);
          booleans[0] := strtobool(playerform.players[i].settings[3]);
        end;
    end;

    procedure Statusas(debugMessage: string);
    var
      h, m, s, ht, mt, st: Integer;
    begin
      Smartimage.clearArea(inttobox(1, 450, 551, 580));
      convertTime((TotalScriptTime.gettime()), h, m, s);
      convertTime((CurrentTripTime.gettime()), ht, mt, st);
      smartImage.drawBitmap(Background, point(1, 450));
      smartImage.drawText(' Cosmas JDZ Red eggs v.3.0 ' + ' Fails: ' + tostr(fail) + ' Flags ' + tostr(flag), point(10, 460), SmallChars, false, 1054574);
      smartImage.drawText(' This trip time: ' + (tostr(mt) + 'm ' + toStr(s) + 's') + ' Trips done: ' + tostring(TripsDone) + ' Worldhops: ' + tostr(RedNoob), point(10, 475), SmallChars, false, 1054574);
      smartImage.drawText(' Time running: ' + toStr(h) + 'h ' + toStr(m) + 'm ' + toStr(s) + 's' + ' Eggs collected: ' + tostring(trunc(EggsBanked)) + ' Eggs/Hour: ' + tostring(trunc(((EggsBanked + 0.00000001) / (TotalScriptTime.getTime() + 0.00000001)) * 3600000)), point(10, 490), SmallChars, false, 1054574);
      smartimage.drawText(' Now: ' + debugMessage, point(10, 505), SmallChars, false, 1054574);
    end;

    procedure breakTimes();
    begin
      MiniBreakTimer := getSystemTime() + 2 * (breakevery + random( - 280800, 280800));
      BreakingTime := breakfor + random(60000, 600000) + random( - 21600, 21600);
      Statusas('Generating break times');
    end;

    procedure TakeBreak();
    begin
      if getSystemTime() >= MiniBreakTimer then
      begin
        Statusas('Taking a break');
        RestartTime := (getSystemTime() + BreakingTime);
        wait(random(2000, 4000));
        players[currentplayer].exitToLobby();
        if getsystemtime() >= RestartTime then
          wait(random(478000, 900000));
        repeat
          wait(15000 + random( - 7500, 7500));
          Statusas('Miliseconds left: ' + tostr(RestartTime - getsystemtime()));
        until getSystemTime() >= RestartTime;
        players[currentplayer].exittolobby();
        players[currentplayer].switchtoworld(PossibleWorldsArray[random(0, 78)]);
        wait(gaussrangeint(5500, 7500));
        exitTreasure();
        breaktimes();
        mainscreen.setAngle(ms_angle_high);
      end;
    end;

    procedure Logintow();
    begin
      players[currentplayer].logintolobby();
      players[currentplayer].switchtoworld(players[currentplayer].integers[2]);
      wait(gaussrangeint(4200, 6750));
      minimap.clickcompass();
      mainscreen.setzoom(true);
      mainscreen.setangle(ms_angle_high);
      exitTreasure();
    end;

    procedure MiniAntiban();
    begin
      if not isloggedin() then
        exit;
      case random(18457) of
        0..341: Minimap.setAngle(trunc(minimap.getangledegrees()) + random( - 145, 145));
        342..451: Minimap.setAngle(trunc(minimap.getangledegrees()) + gaussrangeint(115, 135));
        452..515: Minimap.setAngle(trunc(minimap.getangledegrees()) + gaussrangeint( - 115, - 135));
        516..525: hoverskill(random(1, 28));
        526..614: hoverskill(skill_summoning);
        614..619: boredhuman();
        1016..1018:
          begin
            if tabbackpack.count() >= 4 then
              mouse(MiddleBox(tabbackpack.getslotbox(random(4, tabbackpack.count()))), mouse_right);
            chooseoption.select(['examine']);
          end;
      end;
    end;

    procedure CloseBank();
    var
      afterbanktimer: ttimemarker;
    begin
      BankScreen.clickButton(BANK_BUTTON_PRESET_1);
      afterbanktimer.start();
      repeat
        wait(gaussrangeint(178, 283));
      until ((bankscreen.isOpen() = false) or (Afterbanktimer.gettime() >= 5000));
      if bankscreen.isOpen() then
      begin
        bankscreen.close();
        wait(gaussrangeint(1745, 3654));
      end;
      Mainscreen.setAngle(ms_angle_high);
      inc(TripsDone);
    end;

    procedure InBank();
    begin
      if not isloggedin() then
        exit;
      if (((101 >= getitemamount(bankscreen.getbankslotbox(1))) or (2 >= getitemamount(bankscreen.getbankslotbox(2)))) or (2 >= getitemamount(bankscreen.getbankslotbox(4)))) then
      begin
        Statusas('Not enough scrolls found int the bank');
        players[currentplayer].isactive := false;
        closeBank();
        exit;
      end;
      wait(gaussrangeint(512, 874));
      case random(118) of
        0..9:
          begin
            wait(gaussrangeint(250, 475));
            mousebox(BankScreen.getPackSlotBox(gaussrangeint(4, 25)), mouse_right);
            wait(gaussrangeint(250, 475));
            if chooseoption.isOpen() then
              chooseoption.select(['All', 'Deposti-All']);
            wait(gaussrangeint(315, 785));
          end;
        10..12:
          begin
            wait(gaussrangeint(411, 785));
            mousebox(BankScreen.getBankSlotBox(3), mouse_right);
            wait(gaussrangeint(250, 475));
            if chooseoption.isOpen() then
              chooseoption.select(['Examine']);
            wait(gaussrangeint(411, 785));
          end;
      end;
      closeBank();
    end;

    procedure BankFailsafe();
    var
      x, y, i: integer;
      TPA: TPointArray;
      ATPA: T2DPointArray;
      btm: ttimemarker;
    begin
      if not Isloggedin() then
        exit;
      Statusas('Bank failsafe');
      if not bankscreen.isOpen() then
      begin
        mousecircle(599, 35, 10, mouse_left);
        mousebox(mainscreen.getbounds(), mouse_move);
        minimap.setAngle(135 + random( - 15, 17));
        wait(random(1250, 2354));
        FindColorsSpiralTolerance(x, y, TPA, 10673123, mainScreen.getBounds(), 2, colorSetting(2, 0.26, 2.06));
        ATPA := TPA.toATPA(20, 20);
        ATPA.filterBetween(0, 3);
        ATPA.sortFromMidPoint(mainscreen.playerPoint);
        smartImage.debugATPA(ATPA);
        Statusas('Banking trying to catch bank from roof top');
        for i := 0 to 3 do
        begin
          if length(atpa) > 0 then
            mouse(middleTPA(ATPA[0]).x, middleTPA(ATPA[0]).y + (30 * i) + random( - 5, 5), MOUSE_MOVE);
          if isMouseOverText(['Donate', 'odwill', 'ell'], 500) then
          begin
            btm.start();
            fastclick(MOUSE_right);
            wait(547 + random(200));
            ChooseOption.select(['Bank', 'Open Bank']);
            repeat
              wait(random(1050, 1415));
            until ((bankscreen.isopen() = true) or (btm.gettime() > 8000));
            if bankscreen.isOpen() then
              break;
          end;
        end;
      end;
      if not bankscreen.isopen() then
      begin
        statusas('Havent banked');
        inc(fail);
        if fail > players[currentplayer].integers[1] then
          terminatescript;
      end
      else
        InBank();
    end;

    function Bank(): boolean;
    var
      x, xb, xp, y, yp, yb, i: integer;
      TPA, TPAB, TPAP: TPointArray;
      ATPA, ATPAB, ATPAP: T2DPointArray;
    begin
      if not Isloggedin() then
        exit;
      result := false;
      Statusas('Searching for bank by shinny gold >:-)');
      FindColorsSpiralTolerance(x, y, TPA, 10673123, mainScreen.getBounds(), 2, colorSetting(2, 0.26, 2.06));
      ATPA := clustertpa(TPA, 4);
      ATPA.filterBetween(0, 20);
      smartimage.debugtpa(tpa);
      smartImage.debugATPA(ATPA);
      for i := 0 to high(ATPA) do
      begin
        Mouse(middleTPA(ATPA[i]), Mouse_move);
        if isMouseOverText(['Donate', 'odwill', 'ell'], 500) then
        begin
          Fastclick(Mouse_right);
          Chooseoption.isOpen(1000);
          wait(gaussrangeint(166, 289));
          ChooseOption.select(['Bank', 'Open Bank']);
          if bankscreen.isOpen(5000) then
          begin
            Inbank();
            result := true;
            exit;
          end;
        end;
      end;
      Statusas('Trying to bank searching bank booth blue and pink colors');
      if FindColorsSpiralTolerance(xb, yb, TPAB, 10326079, mainScreen.getBounds(), 6, colorSetting(2, 0.07, 0.22)) then
      begin
        ATPAB := clustertpa(TPAB, 4);
        ATPAB.filterBetween(0, 20);
        smartimage.debugtpa(tpaB);
        smartImage.debugATPA(ATPAB);
        FindColorsSpiralTolerance(xp, yp, TPAP, 10133924, mainScreen.getBounds(), 7, colorSetting(2, 0.24, 0.33));
        ATPAP := clustertpa(TPAP, 2);
        ATPAP.filterBetween(0, 30);
        smartimage.debugtpa(tpaP);
        smartImage.debugATPA(ATPAP);
        writeln(length(ATPAP));
        writeln(length(ATPAB));
        if (((length(ATPAP)) > 0) and ((length(ATPAB)) > 0)) then
        begin
          for i := 0 to high(ATPAP) do
          begin
            if (distance(MiddleTPA(ATPAB[0]), MiddleTPA(ATPAP[i])) < 50) then
            begin
              smartimage.drawCross(medianTPA(ATPAP[i]), 20, 1158749);
              Mouse(medianTPA(ATPAP[i]), Mouse_move);
              if isMouseOverText(['Donate', 'odwill', 'ell'], 500) then
              begin
                Fastclick(Mouse_right);
                Chooseoption.isOpen(1000);
                wait(gaussrangeint(126, 589));
                ChooseOption.select(['Bank', 'Open Bank']);
                if bankscreen.isOpen(5000) then
                begin
                  Inbank();
                  result := true;
                  exit;
                end;
              end;
            end;
          end;
        end
        else
        begin
          if length(ATPAB) > 0 then
          begin
            Mouse(middleTPA(ATPAB[0]), Mouse_move);
            if isMouseOverText(['Donate', 'odwill', 'ell'], 500) then
            begin
              Fastclick(Mouse_right);
              Chooseoption.isOpen(1000);
              wait(gaussrangeint(66, 289));
              ChooseOption.select(['Bank', 'Open Bank']);
              if bankscreen.isOpen(5000) then
              begin
                Inbank();
                result := true;
                exit;
              end;
            end;
          end;
        end;
      end;
    end;

    procedure RotateToBank();
    var
      x, y, xv, yv, ml: integer;
      TPA: tpointarray;
      ATPA: T2dpointarray;
    begin
      if not isloggedin() then
        exit;
      FindColorsSpiralTolerance(x, y, TPA, 14213766, minimap.getbounds(), 13, colorSetting(2, 0.18, 2.98));
      if length(TPA) < 1 then
        exit;
      atpa := clustertpa(tpa, 4);
      atpa.filterBetween(0, 6);
      smartImage.debugTPA(TPA, true);
      SmartImage.debugATPA(atpa);
      if Length(atpa) < 1 then
        exit;
      ml := gaussrangeint(40, 90);
      xv := TPA[0].x - minimap.getCenterPoint().x;
      yv := minimap.getCenterPoint().y - TPA[0].y;
      minimap.setangle(trunc(degrees(ArcTan2(yv, xv)) + minimap.getangledegrees() - 90 + ml));
    end;

    function StartPosition(): boolean;
    var
      fx, fy, xb, yb, x, y: integer;
      TPAB: tpointarray;
      res: tpoint;
    begin
      if not isloggedin() then
        exit;
      result := false;
      if minimap.finddtm(PosDtm, fx, fy) then
      begin
        smartimage.drawcross(point(fx, fy), 2, 255);
        smartimage.drawcross(minimap.pointtomainscreen(point(fx, fy)), 10, 255);
        writeln(distance(minimap.getcenterpoint(), point(fx, fy)));
        if (distance(minimap.getcenterpoint(), point(fx, fy))) >= 12 then
        begin
          if (pointinbox(minimap.pointtomainscreen(point(fx, fy)), inttobox(200, 1, 575, 385)) or ((pointinbox(minimap.pointtomainscreen(point(fx, fy)), inttobox(3, 196, 211, 387))))) then
          begin
            mouse(minimap.pointtomainscreen(point(fx, fy)), mouse_left);
            wait(gaussrangeint(1200, 1750));
            result := true;
          end
          else
          begin
            minimap.setAngle(gaussrangeint(30, 60));
          end;
        end
        else
          result := true;
      end
      else
      begin
        if (PointInBox(sps.getplayerpos(), inttobox(126, 114, 138, 134))) = false then
        begin
          Mainscreen.setAngle(ms_angle_high);
          Sps_PosToMM(point(130, 126), sps.getplayerpos(), res);
          if 0 >= (res.x) then
            exit;
          if PointInBox(minimap.pointstomainscreen([res])[0], inttobox(185, 1, 575, 388)) then
          begin
            mouse(minimap.pointstomainscreen([res])[0], mouse_left);
            result := true;
          end
          else
          begin
            Sps.walkPath([sps.getplayerpos(), point(130 + random( - 4, 4), 126 + random( - 4, 4))]);
          end;
          wait(random(785, 1486));
          Minimap.waitPlayerMoving(random(1457, 2758));
          result := true;
        end
        else
        begin
          Mainscreen.setAngle(ms_angle_high);
        end;
      end;
      case random(143) of
        0..7:
          if findcolortolerance(x, y, 13929833, inttobox(107, 583, 157, 590), 15) then
            typeSend('', true);
      end;
    end;

    procedure BankMain();
    begin
      if not isloggedin() then
        exit;
      EggsBanked := EggsBanked + tabbackpack.count() - 3;
      if not Bank() then
      begin
        RotateToBank();
        wait(gaussrangeint(547, 1250));
        if not bank() then
        begin
          if not StartPosition() then
            StartPosition();
          wait(gaussrangeint(1780, 3456));
          if not Bank() then
          begin
            sps.blindWalk(point(122, 119));
            wait(gaussrangeint(1500, 2785));
            RotateToBank();
            wait(gaussrangeint(547, 1250));
            if not Bank() then
              Bankfailsafe();
          end;
        end;
      end;
    end;

    function SpecBar(): integer;
    var
      x, y, i: integer;
    begin
      if not Isloggedin() then
        exit;
      result := - 1;
      for i := 0 to 27 do
      begin
        //writeln('SPecbar');
        if FindColorTolerance(x, y, 8098829, inttobox(25 - (5 * i), 171, 173 - (5 * i), 177), 13, colorSetting(2, 0.10, 0.85)) then
        begin
          result := 28 - i;
         // writeln(result);
          exit;
        end;
      end;
    end;

    function _filter(Spalva: integer; Box: Tbox; Tol: integer; ColSettings: TColorSettings): tbox;
    var
      x, y: integer;
      TPA: TPointArray;
      ATPA: T2DPointArray;
    begin
      FindColorsSpiralTolerance(x, y, TPA, Spalva, Box, Tol, ColSettings);
      ATPA := TPA.toATPA(20, 20);
      result := GetATPABounds(atpa);
    end;

    procedure lootingAntiban();
    begin
      if not isloggedin() then
        exit;
      case random(3500) of
        0..145: smallrandommouse();
        146..174: mouseoffclient(4);
        175..183:
          begin
            wait(gaussrangeint(1450, 2145));
            pickupmouse();
          end;
        184..242: Minimap.setAngle(trunc(minimap.getangledegrees()) + (random( - 45, 45)));
        243..247: sleepAndMoveMouse(random(1, 4500) + gaussrangeint(1235, 2475));
        283..285: hoverRandomSkill();
        286: boredhuman();
        287..415: randomCompass(30, 145, false);
        416..453: mousemovingobject();
      end;
      LootAntibanned := true;
    end;

    function PartiallyInBox(mmpb, box: tbox): boolean;
    begin
      result := false;
      if not isloggedin() then
        exit;
      if (((((mmpb.x1 < box.x2) and (mmpb.x1 > box.x1)) and ((mmpb.y2 > box.y1) and (mmpb.y2 < box.y2))) or (((mmpb.x1 < box.x2) and (mmpb.x1 > box.x1)) and ((mmpb.y1 > box.y1) and (mmpb.y1 < box.y2)))) or ((((mmpb.x2 < box.x2) and (mmpb.x2 > box.x1)) and ((mmpb.y1 > box.y1) and (mmpb.y1 < box.y2))) or (((mmpb.x2 < box.x2) and (mmpb.x2 > box.x1)) and ((mmpb.y2 > box.y1) and (mmpb.y2 < box.y2))))) then
      begin
        result := true;
        exit;
      end;
    end;

    function FindEggs(box: tbox = LootingBox): tbox;
    var
      x, y, eggsbefore, i: integer;
      TPA, TPAmm: TPointArray;
      ATPA: T2DPointArray;
      lootingtimer: ttimemarker;
      mmpb: tbox;
    begin
      if not isloggedin() then
        exit;
      result := (inttobox(0, 0, 0, 0));
      EggsOnFloor := 0;
      tpamm := minimap.pointsToMainscreen(minimap.getdots(MM_DOT_ITEM, minimap.getbounds()), true);
      if chooseoption.isopen() then
      begin
        if chooseoption.optionsexist(['eggs', 'ggs']) then
          chooseoption.select(['eggs', 'ggs'])
        else
          chooseoption.close;
        wait(gaussrangeint(166, 283));
        eggsbefore := tabbackpack.count();
        lootingtimer.start();
        repeat
          wait(gaussrangeint(173, 238));
          if not lootantibanned then
            LootingAntiban();
        until ((eggsbefore < tabbackpack.count()) or (lootingtimer.gettime() >= 2000));
        Wait(gaussrangeint(495, 603));
      end;
      for i := 0 to high(tpamm) do
      begin
        mmpb := [tpamm[i].x - 32, tpamm[i].y - 32, tpamm[i].x + 32, tpamm[i].y + 32];
        FindColorsSpiralTolerance(x, y, TPA, 9342998, mmpb, 10, colorSetting(2, 4.99, 1.08));
        tpa := clearTPAFromTPA(tpa, TPAFromBox(_filter(2930118, inttobox(212, 119, 360, 260), 20, colorSetting(2, 0.23, 1.83))));
        tpa := clearTPAFromTPA(tpa, TPAFromBox(_filter(10260030, inttobox(212, 119, 360, 260), 5, colorSetting(2, 0.08, 0.15))));
        if length(tpa) < 1 then
          continue;
        atpa := clustertpa(tpa, 4);
        atpa.filterBetween(0, 8);
        ATPA.sortFromMidPoint(mainscreen.playerPoint);
        SmartImage.debugATPA(atpa);
        if Length(atpa) < 1 then
          continue;
        if partiallyinbox(mmpb, box) then
        begin
          result := GetTPABounds(atpa[0]);
          EggsOnFloor := length(atpa);
          exit;
        end;
      end;
    end;

    function FindEggsOld(box: tbox = LootingBox): tbox;
    var
      x, y, i: integer;
      TPA: TPointArray;
      ATPA: T2DPointArray;
    begin
      result := (inttobox(0, 0, 0, 0));
      if not isloggedin() then
        exit;
      EggsOnFloor := 0;
      FindColorsSpiralTolerance(x, y, TPA, 9342998, box, 10, colorSetting(2, 4.99, 1.08));
      tpa := clearTPAFromTPA(tpa, TPAFromBox(_filter(2930118, inttobox(212, 119, 360, 260), 20, colorSetting(2, 0.23, 1.83))));
      tpa := clearTPAFromTPA(tpa, TPAFromBox(_filter(10260030, inttobox(212, 119, 360, 260), 5, colorSetting(2, 0.08, 0.15))));
      if length(TPA) < 1 then
        exit;
      atpa := clustertpa(tpa, 4);
      atpa.filterBetween(0, 7);
      atpa.sortFromMidPoint(mainscreen.playerPoint);
      SmartImage.debugATPA(atpa);
      if Length(atpa) < 1 then
        Exit;
      if GetTPABounds(atpa[0]).x1 < 1 then
        Exit;
      result := GetTPABounds(atpa[0]);
      EggsOnFloor := length(atpa);
    end;

    procedure Minibreak();
    begin
      if not isloggedin() then
        exit;
      case random(914) of
        0..11: mouseOffClient(OFF_CLIENT_TOP);
        12..35: mouseOffClient(OFF_CLIENT_RIGHT);
        36..57: mouseOffClient(OFF_CLIENT_RANDOM);
        58..74:
          begin
            wait(random(1, 7000) + gaussrangeint(3500, 8500 + random(122, 4150)));
            pickupmouse();
            case random(7) of
              0..1: smallrandommouse();
              2..4: mouseMovingObject();
            end;
          end;
        75..83: mouseMovingObject();
        84..91: smallrandommouse(200);
        92..142:
          begin
            case random(21) of
              0..8: mouseOffClient(OFF_CLIENT_RIGHT);
              9: mouseOffClient(OFF_CLIENT_TOP);
              10..20: mouseOffClient(OFF_CLIENT_RANDOM);
            end;
            case random(35) of
              0..11: wait(gaussrangeint(4423, 7425));
              12..33: wait(gaussrangeint(11111 - random(3452, 10574), 17450 + random(4521, 7521)));
              34: wait(random(35000, 55000) + gaussrangeint(1235, 4520 + random(250, 47000)));
            end;
          end;
      end;
    end;

    procedure PickUpEgg(box: tbox = LootingBox);
    var
      x, y, eggsBefore, eggsAfter: integer;
      boxas: tbox;
      lootingtimer: ttimemarker;
      missclickPoint: tpoint;
    begin
      Lootantibanned := false;
      Whopped := false;
      if (Isloggedin() = false) then
        exit;
      if (tabbackpack.isFull()) then
        exit;
      if Ismouseovertext(['Red', 'Take Red']) then
      begin
        flag := 0;
        getmousepos(x, y);
        case random(47) of
          0..11:
            begin
              case random(874) of
                0..414: missmouse(point(x, y), true);
                415..873: fastclick(mouse_left);
              end;
              wait(gaussrangeint(153, 274));
            end;
          25..46:
            begin
              case random(874) of
                0..174:
                  begin
                    missmouse(point(x, y), true);
                    multiclick(point(x, y), 75, 3);
                  end;
                175..873: multiclick(point(x, y), 75, 3);
              end;
            end;
        end;
      end;
      if ((chooseoption.isopen()) and (chooseoption.optionsexist(['eggs', 'ggs']))) then
      begin
        chooseoption.select(['eggs', 'ggs']);
        flag := 0;
      end;
      if ((tabbackpack.isFull()) or (findEggs(box).x1 <= 0)) then
        exit;
      boxas := findEggs(box);
      case random(3874) of
        0..1274:
          begin
            Mousecircle(boxas.getMiddle.x, boxas.getMiddle.y, 9, mouse_move);
            if ((ismouseovertext(['Donate', 'onate', 'Bank'])) or (Ismouseovertext(['Spirit', 'Interact', 'pirit', 'pirit spider']))) then
            begin
              minimap.setAngle(Trunc(minimap.getangledegrees()) + Random(30, 90));
              exit;
            end;
            if Ismouseovertext(['Red', 'Take Red']) then
            begin
              flag := 0;
              case random(415) of
                0..118: missmouse(boxas.getmiddle(), true);
                119..414: Fastclick(mouse_left);
              end;
              case random(112) of
                0..43:
                  begin
                    wait(gaussrangeint(220, 315));
                    mousebox(boxas, mouse_right);
                    ChooseOption.optionsExist(['eggs', 'ggs']);
                    Chooseoption.select(['eggs', 'ggs']);
                  end;
              end;
              eggsbefore := tabbackpack.count();
              lootingtimer.start();
              repeat
                wait(gaussrangeint(173, 238));
                if not lootantibanned then
                  LootingAntiban();
              until ((eggsbefore < tabbackpack.count()) or (lootingtimer.gettime() >= 2000));
              Wait(gaussrangeint(595, 703));
            end
            else
              Mousecircle(boxas.getMiddle.x, boxas.getMiddle.y, 9, mouse_left);
          end;
        1275..3874:
          begin
            Mousecircle(boxas.getMiddle.x, boxas.getMiddle.y, 9, mouse_right);
            ChooseOption.isOpen(gaussrangeint(475, 987));
            if ((ismouseovertext(['Donate', 'onate', 'Bank'])) or (Ismouseovertext(['Spirit', 'Interact', 'pirit', 'pirit spider']))) then
            begin
              minimap.setAngle(Trunc(minimap.getangledegrees()) + Random(30, 90));
              exit;
            end;
            if chooseoption.optionsexist(['Trade', 'with', 'rade']) then
            begin
              Statusas('Switching world because someone is messing up');
              inc(RedNoob);
              players[currentplayer].exittolobby();
              players[currentplayer].switchtoworld(PossibleWorldsArray[random(0, 78)]);
              wait(gaussrangeint(5500, 8780));
              Whopped := true;
              mainscreen.setzoom(true);
              mainscreen.setangle(ms_angle_high);
              exitTreasure();
              exit;
            end;
            if ChooseOption.optionsExist(['eggs', 'ggs']) then
            begin
              if (length(chooseoption.getOptions()) >= 5) then
              begin
                Chooseoption.select(['eggs', 'ggs']);
                flag := 0;
                case random(47) of
                  10..12: smallrandommouse(24);
                  28..29: smallrandommouse(153);
                  17..23:
                    begin
                      wait(gaussrangeint(495, 615));
                      mousecircle(290, 199, 11, mouse_move);
                    end;
                  24..47:
                    begin
                      gaussrangeint(175, 275);
                      mousebox(boxas, mouse_right);
                      if ChooseOption.optionsExist(['eggs', 'ggs']) then
                      begin
                        eggsbefore := tabbackpack.count();
                        lootingtimer.start();
                        repeat
                          wait(gaussrangeint(173, 238));
                          if not lootantibanned then
                            LootingAntiban();
                        until ((eggsbefore < tabbackpack.count()) or (lootingtimer.gettime() >= 2000));
                        wait(gaussrangeint(78, 186));
                        Chooseoption.select(['eggs', 'ggs']);
                        flag := 0;
                        Wait(gaussrangeint(595, 715));
                        exit;
                      end;
                    end;
                end;
              end
              else
                Chooseoption.select(['eggs', 'ggs']);
              Flag := 0;
              eggsbefore := tabbackpack.count();
              lootingtimer.start();
              repeat
                wait(gaussrangeint(173, 238));
                if not lootantibanned then
                  LootingAntiban();
              until ((eggsbefore < tabbackpack.count()) or (lootingtimer.gettime() >= 2000));
              Wait(gaussrangeint(795, 715));
            end
            else
            begin
              ChooseOption.close();
              inc(Flag);
              if Flag >= 6 then
              begin
                if not StartPosition() then
                  StartPosition();
                minimap.setangle(random(0, 45));
                inc(Fail);
              end;
            end;
          end;
      end;
      smartimage.clearArea(inttobox(1, 1, 799, 450));
    end;

    procedure SpamRoutine();
    var
      x, y: integer;
      i: integer;
      settingsButton: TBox;
    begin
      if not Isloggedin() then
        exit;
      if not findcolortolerance(x, y, 10066448, inttobox(45, 45, 135, 80), 11, colorSetting(2, 4.44, 0.44)) then
        exit;
        //writeln('Spamroutina');
      if 2 >= SpecBar() then
        Exit;
      case random(4500) of
        0..1274:
          begin
            Wait(gaussrangeint(150, 450));
            settingsButton := intToBox(22, 128, 33, 143);
            mouseBox(settingsButton, MOUSE_LEFT);
            Wait(gaussrangeint(150, 450));
          end;
        1275..3499:
          begin
            settingsButton := intToBox(22, 128, 33, 143);
            mouseBox(settingsButton, MOUSE_LEFT);
            for i := 0 to gaussrangeint(0, 5) do
            begin
              Fastclick(mouse_left);
              case random(27) of
                0..7: Wait(Gaussrangeint(500, 700));
                8..11: Wait(Random(150, 174));
              end;
            end;
          end;
        3500..4499:
          begin
            Wait(gaussrangeint(1500, 2450));
            settingsButton := intToBox(22, 128, 33, 143);
            mouseBox(settingsButton, MOUSE_LEFT);
            Wait(gaussrangeint(850, 1450));
          end;
      end;
    end;

    procedure Summ();
    var
      x, y: integer;
    begin
      if not Isloggedin() then
        exit;
      if not FindColorTolerance(x, y, 660871, inttobox(16, 51, 173, 116), 40) then
      begin
        Statusas('No Spider');
        if (ActionBar.getSummoningPercent() < 35) then
        begin
          if findcolortolerance(x, y, 14538272, tabbackpack.getslotbox(2), 35) then
          begin
            mousebox(tabbackpack.getslotbox(2), mouse_left);
            wait(gaussrangeint(845, 1452));
          end
          else
          begin
            BankMain();
            exit;
          end;
        end;
        if FindColorTolerance(x, y, 11058626, tabbackpack.getslotbox(3), 35) then
        begin
          Statusas('Summoning spider');
          Wait(random(356, 742));
          Mousebox(tabbackpack.getslotbox(3), mouse_left);
          wait(random(587, 2145));
        end
        else
          bankMain();
      end;
    end;

    procedure Spec();
    var
      x, y, p, a: integer;
    begin
      if not isloggedin() then
        exit;
      Summ();
      if ((3 >= SpecBar()) and (FindColorTolerance(x, y, 12828188, inttobox(421, 445, 432, 450), 10))) then
      begin
        mouseBox(TabBackpack.getSlotBox(2), mouse_left);
        wait(gaussrangeint(845, 1452));
      end;
      smartimage.drawBox(inttobox(22, 128, 33, 143),false,255);
      repeat
        p := SpecBar();
        //writeln('Pradzia');
        SpamRoutine();
        a := SpecBar();
       // writeln('Pabaiga');
        if 2 >= SpecBar() then
          Exit;
      until (a <> p);
    end;

    procedure AngleTransform();
    var
      i, iz, ix: integer;
      angle, c, s: extended;
    begin
      angle := Minimap.getAngleDegrees();
      s := sin(radians(angle));
      c := cos(radians(angle));
      for i := 0 to 7 do
      begin
        StaticRotatedPoints[i][0] := c * StaticPoints[i][0] + s * StaticPoints[i][1];
        StaticRotatedPoints[i][1] := ( - 1) * s * StaticPoints[i][0] + c * StaticPoints[i][1];
      end;
      for iz := 0 to 7 do
      begin
        DynamicPoints[iz][0] := StaticRotatedPoints[iz][0] + Centerx;
        DynamicPoints[iz][1] := Centery - StaticRotatedPoints[iz][1];
      end;
      for ix := 0 to 7 do
      begin
        smartimage.drawtext(tostring(ix), point(trunc(DynamicPoints[ix][0]), trunc(DynamicPoints[ix][1])), 11839306);
        Smartimage.drawCross(point(trunc(DynamicPoints[ix][0]), trunc(DynamicPoints[ix][1])), 3, 16777215);
      end;
    end;

    procedure AlternativePickingPile(kar: integer);
    var
      eggsBefore: integer;
      lootingTimer: ttimemarker;
      x, y, miss: integer;
    begin
      if not isloggedin() then
        exit;
      miss := 0;
      mousebox(inttobox(Centerx - 6, Centery - 6, Centerx + 6, Centery + 6), mouse_move);
      wait(gaussrangeint(120, 315));
      getmousepos(x, y);
      if Ismouseovertext(['Red', 'Take Red']) then
      begin
        case random(152) of
          0..74: mousebox(inttobox(Centerx - 12, Centery - 12, Centerx + 12, Centery + 12), mouse_left);
        end;
        multiclick(point(x, y), 100, gaussrangeint(1, 3));
        dec(kar);
      end
      else
      begin
        if ismouseovertext(['spider', 'Spirit']) then
        begin
          mouse(point(x, y), mouse_right);
          chooseoption.isopen(gaussrangeint(350, 678));
          if chooseoption.optionsexist(['eggs', 'ggs']) then
          begin
            wait(gaussrangeint(168, 365));
            chooseoption.select(['eggs', 'ggs']);
            dec(kar);
          end
          else
          begin
            chooseoption.close();
            inc(miss);
          end;
        end;
      end;
      while ((kar > 0) and (miss < 2)) do
      begin
        if not isloggedin() then
          exit;
        case random(419) of
          0..274:
            begin
              mousebox(inttobox(Centerx - 5, Centery - 5, Centerx + 4, Centery + 3), mouse_right);
              if chooseoption.isopen(gaussrangeint(235, 456)) then
              begin
                wait(gaussrangeint(167, 314));
                if chooseoption.optionsexist(['eggs', 'ggs']) then
                begin
                  chooseoption.select(['eggs', 'ggs']);
                  dec(kar);
                  wait(gaussrangeint(144, 235));
                end
                else
                begin
                  chooseoption.close();
                  inc(miss);
                end;
              end;
            end;
          275..365:
            begin
              mousebox(inttobox(Centerx - 4, Centery - 5, Centerx + 4, Centery + 4), mouse_move);
              if ismouseovertext(['eggs', 'ggs']) then
              begin
                getmousepos(x, y);
                wait(gaussrangeint(166, 258));
                case random(123) of
                  0..21: missMouse(point(x, y), true);
                  22..122: fastclick(mouse_left);
                end;
                dec(kar);
              end
              else
              begin
                inc(miss);
              end;
            end;
          366..418:
            begin
              mousebox(inttobox(Centerx - 4, Centery - 5, Centerx + 3, Centery + 6), mouse_move);
              if ismouseovertext(['eggs', 'ggs']) then
              begin
                getmousepos(x, y);
                wait(gaussrangeint(187, 285));
                case random(143) of
                  0..87: multiClick(point(x, y), 100, 3);
                  88..127: multiClick(point(x, y), 100, 2);
                  128..142:
                    begin
                      missmouse(point(x, y), true);
                      multiClick(point(x, y), 100, 2);
                    end;
                end;
                dec(kar);
              end
              else
              begin
                inc(miss);
              end;
            end;
        end;
      end;
    end;

    function AlternativePicking(out Transpoint: integer): boolean;
    var
      i, x, y, mx, my, z, r, eggsbefore: integer;
      pai, eggsCount: integer;
      optionsai: TOptionArray;
      lootingtimer: ttimemarker;
      centr: tpoint;
      boxas: tbox;
    begin
      transpoint := - 1;
      result := false;
      for i := checkedToPile to high(DynamicPoints) do
      begin
        if not isloggedin() then
          exit;
        pai := LootingPattern[i];
        if ((findEggsOld(inttobox(trunc(DynamicPoints[pai][0] - 12), trunc(DynamicPoints[pai][1] - 12), trunc(DynamicPoints[pai][0] + 12), trunc(DynamicPoints[pai][1] + 12))).x1 = 0) and (StandartEggsLocationsArray[pai] = false)) then
          continue;
        smartimage.drawbox(inttobox(trunc(DynamicPoints[pai][0] - 12), trunc(DynamicPoints[pai][1] - 12), trunc(DynamicPoints[pai][0] + 12), trunc(DynamicPoints[pai][1] + 12)), 16777215);
        if (EggsOnFloor > 0) or (StandartEggsLocationsArray[pai] = true) then
        begin
          if ((StandartEggsLocationsArray[pai] = true) and (EggsOnFloor > 0)) then
          begin
            for r := 0 to 2 do
            begin
              if not isloggedin() then
                exit;
              case random(415) of
                0..91:
                  begin
                    Boxas := findEggsOld(inttobox(trunc(DynamicPoints[pai][0] - 10), trunc(DynamicPoints[pai][1] - 10), trunc(DynamicPoints[pai][0] + 10), trunc(DynamicPoints[pai][1] + 10)));
                    if (boxas.x1 > 100) then
                      mousebox(boxas, mouse_left);
                    wait(gaussrangeint(166, 283));
                    if (boxas.x1 > 100) then
                      Mousebox(boxas, mouse_right);
                  end;
                92..414:
                  begin
                    centr := findEggsOld(inttobox(trunc(DynamicPoints[pai][0] - 10), trunc(DynamicPoints[pai][1] - 10), trunc(DynamicPoints[pai][0] + 10), trunc(DynamicPoints[pai][1] + 10))).getmiddle();
                    if (r >= 1) then
                    begin
                      if (centr.x >= 200) then
                        Mousecircle(centr.x, centr.y, 5, mouse_right);
                    end
                    else
                    begin
                      if (centr.x < 200) then
                        continue;
                      case random(215) of
                        0..5: Mousecircle(centr.x, centr.y, 14, mouse_right);
                        5..11: Mousecircle(centr.x, centr.y, 11, mouse_right);
                        12..214: Mousecircle(centr.x, centr.y, 10, mouse_right);
                      end;
                    end;
                  end;
              end;
              if ChooseOption.isOpen(gaussrangeint(200, 387)) then
              begin
                Optionsai := ChooseOption.getOptions();
                if chooseoption.optionsexist(['eggs', 'ggs']) then
                begin
                  eggsCount := 0;
                  for z := 0 to high(optionsai) do
                  begin
                    if optionsai[z].str = 'Take Red spiders' ' eggs' then
                      inc(eggsCount);
                  end;
                  chooseoption.select(['eggs', 'ggs']);
                  StandartEggsLocationsArray[pai] := false;
                  miscli := 0;
                  eggsbefore := tabbackpack.count();
                  lootingtimer.start();
                  repeat
                    wait(gaussrangeint(173, 238));
                    if not lootantibanned then
                      LootingAntiban();
                  until ((eggsbefore < tabbackpack.count()) or (lootingtimer.gettime() >= 2500));
                  if (eggsCount > 1) then
                  begin
                    case random(315) of
                      0..214: mousebox(inttobox(Centerx - 12, Centery - 11, Centerx + 12, Centery + 13), mouse_move);
                    end;
                  end;
                  Wait(gaussrangeint(595, 815));
                  result := true;
                  transpoint := pai;
                  if ((eggsbefore < tabbackpack.count()) and (eggsCount > 1)) then
                  begin
                    alternativePickingPile((eggsCount - 1));
                  end;
                  checkedToPile := i;
                  exit;
                end
                else
                begin
                  inc(miscli);
                  if (miscli >= 2) then
                  begin
                    miscli := 0;
                    inc(checkedToPile);
                  end;
                  chooseoption.close();
                end;
              end;
            end;
          end
          else
            mousebox(inttobox(trunc(DynamicPoints[pai][0] - 3), trunc(DynamicPoints[pai][1] - 3), trunc(DynamicPoints[pai][0] + 3), trunc(DynamicPoints[pai][1] + 3)), mouse_right);
          if ChooseOption.isOpen(gaussrangeint(575, 887)) then
          begin
            Optionsai := ChooseOption.getOptions();
            if chooseoption.optionsexist(['eggs', 'ggs']) then
            begin
              eggsCount := 0;
              for z := 0 to high(optionsai) do
              begin
                if optionsai[z].str = 'Take Red spiders' ' eggs' then
                  inc(eggsCount);
              end;
              chooseoption.select(['eggs', 'ggs']);
              StandartEggsLocationsArray[pai] := false;
              miscli := 0;
              eggsbefore := tabbackpack.count();
              lootingtimer.start();
              repeat
                wait(gaussrangeint(173, 238));
                if not lootantibanned then
                  LootingAntiban();
              until ((eggsbefore < tabbackpack.count()) or (lootingtimer.gettime() >= 2500));
              if (eggsCount > 1) then
              begin
                case random(315) of
                  0..214: mousebox(inttobox(Centerx - 12, Centery - 11, Centerx + 12, Centery + 13), mouse_move);
                end;
              end;
              Wait(gaussrangeint(595, 815));
              result := true;
              transpoint := pai;
              if ((eggsbefore < tabbackpack.count()) and (eggsCount > 1)) then
              begin
                alternativePickingPile((eggsCount - 1));
              end;
              checkedToPile := i;
              exit;
            end
            else
            begin
              inc(miscli);
              if miscli >= 1 then
              begin
                miscli := 0;
                inc(checkedToPile);
              end;
              chooseoption.close();
            end;
          end;
        end;
      end;
    end;

    procedure TransitionShift();
    var
      Transpoint: integer;
      i: integer;
    begin
      if not isloggedin() then
        exit;
      angleTransform();
      if alternativePicking(Transpoint) then
      begin
        shiftx := ( - StaticPoints[Transpoint][0]);
        shifty := ( - StaticPoints[Transpoint][1]);
        for i := 0 to 7 do
        begin
          StaticPoints[i][0] := StaticPoints[i][0] + shiftx;
          StaticPoints[i][1] := StaticPoints[i][1] + shifty;
        end;
      end;
      for i := 0 to 7 do
      begin
        smartimage.drawcross(point(StaticPoints[i][0], StaticPoints[i][1]), 5, 16777215);
      end;
      smartimage.clear();
    end;

    procedure ResetCoordinates();
    begin
      checkedToPile := 0;
      miscli := 0;
      StandartEggsLocationsArray := [false, false, false, false, false, false, false, false];
      shiftx := 0;
      shifty := 0;
      StaticPoints := [[ - 32, 32], [0, 32], [32, 32], [ - 32, 0], [32, 0], [ - 32, - 32], [0, - 32], [32, - 32]];
    end;

    procedure CheckSpots();
    var
      i: integer;
    begin
      if not isloggedin() then
        exit;
      angleTransform();
      for i := 0 to high(DynamicPoints) do
      begin
        if findEggsOld(inttobox(trunc(DynamicPoints[i][0] - 12), trunc(DynamicPoints[i][1] - 12), trunc(DynamicPoints[i][0] + 12), trunc(DynamicPoints[i][1] + 12))).x1 = 0 then
        begin
          StandartEggsLocationsArray[i] := false;
          smartimage.drawbox(inttobox(trunc(DynamicPoints[i][0] - 12), trunc(DynamicPoints[i][1] - 12), trunc(DynamicPoints[i][0] + 12), trunc(DynamicPoints[i][1] + 12)), 255);
        end
        else
        begin
          StandartEggsLocationsArray[i] := true;
          smartimage.drawbox(inttobox(trunc(DynamicPoints[i][0] - 12), trunc(DynamicPoints[i][1] - 12), trunc(DynamicPoints[i][0] + 12), trunc(DynamicPoints[i][1] + 12)), 14538272);
        end;
      end;
    end;

    procedure PatternLoot();
    var
      i: integer;
    begin
      if not isloggedin() then
        exit;
      statusas('ALternative patterned picking');
      ResetCoordinates();
      CheckSpots();
      case random(91) of
        0..11: LootingPattern := [0, 1, 2, 4, 7, 6, 5, 3];
        12..27: LootingPattern := [1, 2, 4, 7, 6, 5, 3, 0];
        28..37: LootingPattern := [4, 7, 6, 5, 3, 0, 1, 2];
        38..43: LootingPattern := [4, 2, 1, 0, 3, 5, 6, 7];
        44..58: LootingPattern := [6, 5, 3, 0, 1, 2, 4, 7];
        59..71: LootingPattern := [3, 0, 1, 2, 4, 7, 6, 5];
        72..79: LootingPattern := [5, 3, 0, 1, 2, 4, 7, 6];
        80..83: LootingPattern := [7, 6, 5, 3, 0, 1, 2, 4];
        84..91: LootingPattern := [2, 4, 7, 6, 5, 3, 0, 1];
      end;
      statusas(tostring(LootingPattern));
      for i := 0 to 7 do
      begin
        if not isloggedin() then
          exit;
        transitionShift();
        MiniAntiban();
        if ((length(minimap.getdots(mm_dot_item, inttobox(660, 80, 715, 125))) < 1) or (tabbackpack.isfull())) then
          exit;
      end;
    end;

    procedure NormalLoot();
    var
      invCountBefore: integer;
      lootsTimer: ttimemarker;
      x, y: integer;
    begin
      if not isloggedin() then
        exit;
      if length(minimap.getdots(mm_dot_item, inttobox(660, 80, 715, 125))) < 1 then
      begin
        Minibreak();
        exit;
      end;
      if players[currentplayer].booleans[0] then
        PatternLoot();
      statusas('Normal loot');
      lootsTimer.start();
      invCountBefore := TabBackpack.count();
      repeat
        if (length(minimap.getdots(mm_dot_item, minimap.getbounds())) >= 1) then
          pickUpEgg()
        else
          break;
        if ((Whopped) or (not isloggedin())) then
          exit;
        MiniAntiban();
        if lootsTimer.getTime() > 75000 then
        begin
          if TabBackpack.count() <= invCountBefore then
          begin
            Statusas('75 seconds havent looted single egg');
            inc(fail);
            if fail > players[currentplayer].integers[1] then
              terminatescript;
          end
          else
            Break;
        end;
      until ((TabBackpack.isfull()) or (EggsOnFloor = 0));
    end;

    procedure SpawnAndLoot();
    var
      SpecClickingTimer: ttimemarker;
      clickingTime: integer;
    begin
      if not Isloggedin() then
        exit;
      NormalLoot();
      if not StartPosition() then
        StartPosition();
      if TabBackpack.isfull() then
        exit;
      if TabBackpack.count() >= 23 then
        clickingTime := gaussrangeint(5500, 11000)
      else
        clickingTime := gaussrangeint(15000, 23000);
      SpecClickingTimer.start();
      Statusas('Spamclicking spec');
      repeat
        Spec();
      until SpecClickingTimer.gettime() > clickingTime;
      Statusas('looting eggs');
      NormalLoot();
      if tabbackpack.isFull() then
        exit;
    end;

    procedure Distloot();
    begin
      if not isloggedin() then
        exit;
      if findEggs(inttobox(200, 6, 573, 384)).x1 > 0 then
      begin
        pickUpEgg(inttobox(200, 6, 573, 384));
        wait(gaussrangeint(1500, 2510));
        exit;
      end;
      if findEggs(inttobox(2, 195, 199, 384)).x1 > 0 then
      begin
        pickUpEgg(inttobox(2, 195, 199, 384));
        wait(gaussrangeint(1500, 2510));
        exit;
      end;
    end;

    procedure SwitchPlayer();
    begin
      players[currentplayer].logout();
      players.next(false);
      wait(gaussrangeint(4200, 6750));
      minimap.clickcompass();
      mainscreen.setzoom(true);
      mainscreen.setangle(ms_angle_high);
      exitTreasure();
    end;

    procedure Mainloop();
    var
      x, y: integer;
    begin
      CurrentTripTime.start();
      mousespeed := (gaussrangeint(30, 40));
      repeat
        if not isloggedin() then
          exit;
        if not findcolortolerance(x, y, 4179190, inttobox(182, 27, 193, 31), 50) then
        begin
          mouseScroll(inttobox(10, 25, 163, 140).getrandompoint(), 10 + random(5), false);
          inc(fail);
          if fail > players[currentplayer].integers[1] then
            terminatescript;
        end;
        Summ();
        SpawnAndLoot();
      until tabbackpack.count() >= 25;
      BankMain();
      DistLoot();
      if CurrentTripTime.getTime() > 480000 then
      begin
        Statusas('Failed to do trip in 8 mins');
        inc(fail);
        if fail > players[currentplayer].integers[1] then
          terminatescript;
      end;
      takeBreak();
    end;

    begin
      SmartEnableDrawing := true;
      smartShowConsole := false;
      SetupSRL();
      initPlayerForm();
      runPlayerForm();
      DeclarePlayers();
      SPS.setup('ge', Runescape_other);
      breaktimes();
      if not isloggedin() then
        logintow();
      TotalScriptTime.start();
      SixhourFixTime.start();
      while players.getactive() > 0 do
      begin
        PlayersTimer.start();
        repeat
          Mainloop();
          if (SixhourFixTime.getTime() >= (gaussrangeint(19600000, 22000000))) then
          begin
            sixhourfix();
            SixhourFixTime.Start();
            wait(gaussrangeint(6000, 9500));
            mainscreen.setzoom(true);
            Mainscreen.setAngle(ms_angle_high);
          end;
        until (((PlayersTimer.gettime() >= (players[currentplayer].integers[0]) * 60000) or (not isloggedin())) or (players[currentplayer].isactive = false));
        switchPlayer();
      end;
    end.

  11. #36
    Join Date
    Jun 2014
    Posts
    369
    Mentioned
    14 Post(s)
    Quoted
    217 Post(s)

    Default

    Quote Originally Posted by Pastah View Post
    This seems to work for me, but its slow with looting, so I'd really appreciate it if someone could change the looting procedure to make it work with the loot interface to "loot all".

    Simba Code:
    program CosmasJdzRedEggs;
    {$DEFINE SMART}
    {$i srl-6/srl.simba}
    {$i srl-6/lib/misc/srlplayerform.simba}
    {$I SPS/lib/SPS-RS3.Simba}

    // Farms red spider eggs at bank of goodwill //
    { Since cant attach stuff here so setup goes there:

    Download map and place in runescape_other: [url]http://i.imgur.com/UhRQzL1.png?1[/url]

    Graphics mode opengl preffered.

    Bank: [url]http://i.imgur.com/8IPXAhh.png?1[/url]

    Setup: [url]http://i.imgur.com/QGGjwok.png?1[/url]
    Save inventory in setup as Preset1

    Progress reports: [url]http://i.imgur.com/Vhd55uZ.png?1[/url]

     }


    const
      PosDtm := DTMFromString ('mbQAAAHicY2VgYBBigAANIJaC8mWAWA6IpaFyBkDs4a7LsOz/f4bPnznA+PLV8wz/geKSaJgRiFmBmBkJgwEAof0MFg==');
      Background := BitmapFromString (550, 130, 'meJztwjENAAAMAyD/biqqfy1M' +
      'xT4I6aKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq' +
      'qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq' +
      'qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq' +
      'qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq' +
      'qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq' +
      'qqqqqqqqqqqqqqqqqr+P8MkrPg=');
      PossibleWorldsArray = [4, 5, 6, 9, 10, 12, 14, 15, 16, 21, 22, 23, 24, 25, 26, 27, 28, 31, 32, 35, 36, 37, 39, 40, 44, 45, 46, 49, 50, 51, 53, 54, 56, 58, 59, 60, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 76, 77, 78, 79, 82, 83, 84, 85, 87, 88, 89, 91, 92, 98, 99, 100, 103, 104, 105, 106, 116, 117, 119, 123, 124, 134, 138];
      Centerx := 290;
      Centery := 199;
      LootingBox := inttobox (194, 105, 412, 272);

    var
    { Patternloot variables }
      shiftx := 0;
      shifty := 0;
      StaticPoints := [[ - 32, 32], [0, 32], [32, 32], [ - 32, 0], [32, 0], [ - 32, - 32], [0, - 32], [32, - 32]];
      StaticRotatedPoints, DynamicPoints: array [0..7] of array [0..1] of extended;
      StandartEggsLocationsArray: array [0..7] of boolean;
      LootingPattern: array [0..7] of integer;

    { Other variables }
      Miscli := 0;
      CheckedToPile := 0;
      Whopped := false;
      LootAntibanned := false;
      Fail := 0;
      Flag := 0;
      TripsDone := 0;
      RedNoob := 0;
      EggsBanked, EggsOnFloor, MiniBreakTimer, BreakingTime, RestartTime: integer;
      CurrentTripTime, TotalScriptTime, PlayersTimer, SixhourFixTime: ttimemarker;
      BreakEvery := 2150000;
      BreakFor := 432000;


    procedure InitPlayerForm();
    begin
      with playerForm do
      begin
        name := 'CosmasJDZ Eggs form';
        editBoxLabels := ['Run time before switch(mins)', 'Fails allowed'];
        editBoxDefaults := ['360', '10'];
        comboBoxLabels := ['World', 'Alternative looting?'];
        comboBoxDefaults := ['63', 'False'];
        setLength(comboBoxItems, length(comboBoxLabels));
        comboBoxItems[0] := ['4', '5', '6', '9', '10', '12', '14', ' 15', '16', '21', '22', '23', '24', '25', '26', '27', '28', '31', '32', '35', '36', '37', '39', '40', '44', '45', '46', '49', '50', '51', '53', '54', '56', '58', '59', '60', '62', '63', '64', '65', '66', '67', '68', '69', '70', '71', '72', '73', '74', '76', '77', '78', '79', ' 82', '83', '84', '85', '87', '88', ' 89', '91', '92', '98', '99', '100', '103', '104', '105', '106', '116', '117', '119', '123', '124', '134', '138'];
        comboBoxItems[1] := ['False', 'True'];
      end;
    end;

    procedure DeclarePlayers();
    var
      i: Integer;
    begin
      players.setup(playerForm.players);
      currentPlayer := 0;
      for i := 0 to high(players) do
        with players[i] do
        begin
          integers[0] := strToInt(playerForm.players[i].settings[0]);
          integers[1] := strToInt(playerForm.players[i].settings[1]);
          integers[2] := strtoint(playerform.players[i].settings[2]);
          booleans[0] := strtobool(playerform.players[i].settings[3]);
        end;
    end;

    procedure Statusas(debugMessage: string);
    var
      h, m, s, ht, mt, st: Integer;
    begin
      Smartimage.clearArea(inttobox(1, 450, 551, 580));
      convertTime((TotalScriptTime.gettime()), h, m, s);
      convertTime((CurrentTripTime.gettime()), ht, mt, st);
      smartImage.drawBitmap(Background, point(1, 450));
      smartImage.drawText(' Cosmas JDZ Red eggs v.3.0 ' + ' Fails: ' + tostr(fail) + ' Flags ' + tostr(flag), point(10, 460), SmallChars, false, 1054574);
      smartImage.drawText(' This trip time: ' + (tostr(mt) + 'm ' + toStr(s) + 's') + ' Trips done: ' + tostring(TripsDone) + ' Worldhops: ' + tostr(RedNoob), point(10, 475), SmallChars, false, 1054574);
      smartImage.drawText(' Time running: ' + toStr(h) + 'h ' + toStr(m) + 'm ' + toStr(s) + 's' + ' Eggs collected: ' + tostring(trunc(EggsBanked)) + ' Eggs/Hour: ' + tostring(trunc(((EggsBanked + 0.00000001) / (TotalScriptTime.getTime() + 0.00000001)) * 3600000)), point(10, 490), SmallChars, false, 1054574);
      smartimage.drawText(' Now: ' + debugMessage, point(10, 505), SmallChars, false, 1054574);
    end;

    procedure breakTimes();
    begin
      MiniBreakTimer := getSystemTime() + 2 * (breakevery + random( - 280800, 280800));
      BreakingTime := breakfor + random(60000, 600000) + random( - 21600, 21600);
      Statusas('Generating break times');
    end;

    procedure TakeBreak();
    begin
      if getSystemTime() >= MiniBreakTimer then
      begin
        Statusas('Taking a break');
        RestartTime := (getSystemTime() + BreakingTime);
        wait(random(2000, 4000));
        players[currentplayer].exitToLobby();
        if getsystemtime() >= RestartTime then
          wait(random(478000, 900000));
        repeat
          wait(15000 + random( - 7500, 7500));
          Statusas('Miliseconds left: ' + tostr(RestartTime - getsystemtime()));
        until getSystemTime() >= RestartTime;
        players[currentplayer].exittolobby();
        players[currentplayer].switchtoworld(PossibleWorldsArray[random(0, 78)]);
        wait(gaussrangeint(5500, 7500));
        exitTreasure();
        breaktimes();
        mainscreen.setAngle(ms_angle_high);
      end;
    end;

    procedure Logintow();
    begin
      players[currentplayer].logintolobby();
      players[currentplayer].switchtoworld(players[currentplayer].integers[2]);
      wait(gaussrangeint(4200, 6750));
      minimap.clickcompass();
      mainscreen.setzoom(true);
      mainscreen.setangle(ms_angle_high);
      exitTreasure();
    end;

    procedure MiniAntiban();
    begin
      if not isloggedin() then
        exit;
      case random(18457) of
        0..341: Minimap.setAngle(trunc(minimap.getangledegrees()) + random( - 145, 145));
        342..451: Minimap.setAngle(trunc(minimap.getangledegrees()) + gaussrangeint(115, 135));
        452..515: Minimap.setAngle(trunc(minimap.getangledegrees()) + gaussrangeint( - 115, - 135));
        516..525: hoverskill(random(1, 28));
        526..614: hoverskill(skill_summoning);
        614..619: boredhuman();
        1016..1018:
          begin
            if tabbackpack.count() >= 4 then
              mouse(MiddleBox(tabbackpack.getslotbox(random(4, tabbackpack.count()))), mouse_right);
            chooseoption.select(['examine']);
          end;
      end;
    end;

    procedure CloseBank();
    var
      afterbanktimer: ttimemarker;
    begin
      BankScreen.clickButton(BANK_BUTTON_PRESET_1);
      afterbanktimer.start();
      repeat
        wait(gaussrangeint(178, 283));
      until ((bankscreen.isOpen() = false) or (Afterbanktimer.gettime() >= 5000));
      if bankscreen.isOpen() then
      begin
        bankscreen.close();
        wait(gaussrangeint(1745, 3654));
      end;
      Mainscreen.setAngle(ms_angle_high);
      inc(TripsDone);
    end;

    procedure InBank();
    begin
      if not isloggedin() then
        exit;
      if (((101 >= getitemamount(bankscreen.getbankslotbox(1))) or (2 >= getitemamount(bankscreen.getbankslotbox(2)))) or (2 >= getitemamount(bankscreen.getbankslotbox(4)))) then
      begin
        Statusas('Not enough scrolls found int the bank');
        players[currentplayer].isactive := false;
        closeBank();
        exit;
      end;
      wait(gaussrangeint(512, 874));
      case random(118) of
        0..9:
          begin
            wait(gaussrangeint(250, 475));
            mousebox(BankScreen.getPackSlotBox(gaussrangeint(4, 25)), mouse_right);
            wait(gaussrangeint(250, 475));
            if chooseoption.isOpen() then
              chooseoption.select(['All', 'Deposti-All']);
            wait(gaussrangeint(315, 785));
          end;
        10..12:
          begin
            wait(gaussrangeint(411, 785));
            mousebox(BankScreen.getBankSlotBox(3), mouse_right);
            wait(gaussrangeint(250, 475));
            if chooseoption.isOpen() then
              chooseoption.select(['Examine']);
            wait(gaussrangeint(411, 785));
          end;
      end;
      closeBank();
    end;

    procedure BankFailsafe();
    var
      x, y, i: integer;
      TPA: TPointArray;
      ATPA: T2DPointArray;
      btm: ttimemarker;
    begin
      if not Isloggedin() then
        exit;
      Statusas('Bank failsafe');
      if not bankscreen.isOpen() then
      begin
        mousecircle(599, 35, 10, mouse_left);
        mousebox(mainscreen.getbounds(), mouse_move);
        minimap.setAngle(135 + random( - 15, 17));
        wait(random(1250, 2354));
        FindColorsSpiralTolerance(x, y, TPA, 10673123, mainScreen.getBounds(), 2, colorSetting(2, 0.26, 2.06));
        ATPA := TPA.toATPA(20, 20);
        ATPA.filterBetween(0, 3);
        ATPA.sortFromMidPoint(mainscreen.playerPoint);
        smartImage.debugATPA(ATPA);
        Statusas('Banking trying to catch bank from roof top');
        for i := 0 to 3 do
        begin
          if length(atpa) > 0 then
            mouse(middleTPA(ATPA[0]).x, middleTPA(ATPA[0]).y + (30 * i) + random( - 5, 5), MOUSE_MOVE);
          if isMouseOverText(['Donate', 'odwill', 'ell'], 500) then
          begin
            btm.start();
            fastclick(MOUSE_right);
            wait(547 + random(200));
            ChooseOption.select(['Bank', 'Open Bank']);
            repeat
              wait(random(1050, 1415));
            until ((bankscreen.isopen() = true) or (btm.gettime() > 8000));
            if bankscreen.isOpen() then
              break;
          end;
        end;
      end;
      if not bankscreen.isopen() then
      begin
        statusas('Havent banked');
        inc(fail);
        if fail > players[currentplayer].integers[1] then
          terminatescript;
      end
      else
        InBank();
    end;

    function Bank(): boolean;
    var
      x, xb, xp, y, yp, yb, i: integer;
      TPA, TPAB, TPAP: TPointArray;
      ATPA, ATPAB, ATPAP: T2DPointArray;
    begin
      if not Isloggedin() then
        exit;
      result := false;
      Statusas('Searching for bank by shinny gold >:-)');
      FindColorsSpiralTolerance(x, y, TPA, 10673123, mainScreen.getBounds(), 2, colorSetting(2, 0.26, 2.06));
      ATPA := clustertpa(TPA, 4);
      ATPA.filterBetween(0, 20);
      smartimage.debugtpa(tpa);
      smartImage.debugATPA(ATPA);
      for i := 0 to high(ATPA) do
      begin
        Mouse(middleTPA(ATPA[i]), Mouse_move);
        if isMouseOverText(['Donate', 'odwill', 'ell'], 500) then
        begin
          Fastclick(Mouse_right);
          Chooseoption.isOpen(1000);
          wait(gaussrangeint(166, 289));
          ChooseOption.select(['Bank', 'Open Bank']);
          if bankscreen.isOpen(5000) then
          begin
            Inbank();
            result := true;
            exit;
          end;
        end;
      end;
      Statusas('Trying to bank searching bank booth blue and pink colors');
      if FindColorsSpiralTolerance(xb, yb, TPAB, 10326079, mainScreen.getBounds(), 6, colorSetting(2, 0.07, 0.22)) then
      begin
        ATPAB := clustertpa(TPAB, 4);
        ATPAB.filterBetween(0, 20);
        smartimage.debugtpa(tpaB);
        smartImage.debugATPA(ATPAB);
        FindColorsSpiralTolerance(xp, yp, TPAP, 10133924, mainScreen.getBounds(), 7, colorSetting(2, 0.24, 0.33));
        ATPAP := clustertpa(TPAP, 2);
        ATPAP.filterBetween(0, 30);
        smartimage.debugtpa(tpaP);
        smartImage.debugATPA(ATPAP);
        writeln(length(ATPAP));
        writeln(length(ATPAB));
        if (((length(ATPAP)) > 0) and ((length(ATPAB)) > 0)) then
        begin
          for i := 0 to high(ATPAP) do
          begin
            if (distance(MiddleTPA(ATPAB[0]), MiddleTPA(ATPAP[i])) < 50) then
            begin
              smartimage.drawCross(medianTPA(ATPAP[i]), 20, 1158749);
              Mouse(medianTPA(ATPAP[i]), Mouse_move);
              if isMouseOverText(['Donate', 'odwill', 'ell'], 500) then
              begin
                Fastclick(Mouse_right);
                Chooseoption.isOpen(1000);
                wait(gaussrangeint(126, 589));
                ChooseOption.select(['Bank', 'Open Bank']);
                if bankscreen.isOpen(5000) then
                begin
                  Inbank();
                  result := true;
                  exit;
                end;
              end;
            end;
          end;
        end
        else
        begin
          if length(ATPAB) > 0 then
          begin
            Mouse(middleTPA(ATPAB[0]), Mouse_move);
            if isMouseOverText(['Donate', 'odwill', 'ell'], 500) then
            begin
              Fastclick(Mouse_right);
              Chooseoption.isOpen(1000);
              wait(gaussrangeint(66, 289));
              ChooseOption.select(['Bank', 'Open Bank']);
              if bankscreen.isOpen(5000) then
              begin
                Inbank();
                result := true;
                exit;
              end;
            end;
          end;
        end;
      end;
    end;

    procedure RotateToBank();
    var
      x, y, xv, yv, ml: integer;
      TPA: tpointarray;
      ATPA: T2dpointarray;
    begin
      if not isloggedin() then
        exit;
      FindColorsSpiralTolerance(x, y, TPA, 14213766, minimap.getbounds(), 13, colorSetting(2, 0.18, 2.98));
      if length(TPA) < 1 then
        exit;
      atpa := clustertpa(tpa, 4);
      atpa.filterBetween(0, 6);
      smartImage.debugTPA(TPA, true);
      SmartImage.debugATPA(atpa);
      if Length(atpa) < 1 then
        exit;
      ml := gaussrangeint(40, 90);
      xv := TPA[0].x - minimap.getCenterPoint().x;
      yv := minimap.getCenterPoint().y - TPA[0].y;
      minimap.setangle(trunc(degrees(ArcTan2(yv, xv)) + minimap.getangledegrees() - 90 + ml));
    end;

    function StartPosition(): boolean;
    var
      fx, fy, xb, yb, x, y: integer;
      TPAB: tpointarray;
      res: tpoint;
    begin
      if not isloggedin() then
        exit;
      result := false;
      if minimap.finddtm(PosDtm, fx, fy) then
      begin
        smartimage.drawcross(point(fx, fy), 2, 255);
        smartimage.drawcross(minimap.pointtomainscreen(point(fx, fy)), 10, 255);
        writeln(distance(minimap.getcenterpoint(), point(fx, fy)));
        if (distance(minimap.getcenterpoint(), point(fx, fy))) >= 12 then
        begin
          if (pointinbox(minimap.pointtomainscreen(point(fx, fy)), inttobox(200, 1, 575, 385)) or ((pointinbox(minimap.pointtomainscreen(point(fx, fy)), inttobox(3, 196, 211, 387))))) then
          begin
            mouse(minimap.pointtomainscreen(point(fx, fy)), mouse_left);
            wait(gaussrangeint(1200, 1750));
            result := true;
          end
          else
          begin
            minimap.setAngle(gaussrangeint(30, 60));
          end;
        end
        else
          result := true;
      end
      else
      begin
        if (PointInBox(sps.getplayerpos(), inttobox(126, 114, 138, 134))) = false then
        begin
          Mainscreen.setAngle(ms_angle_high);
          Sps_PosToMM(point(130, 126), sps.getplayerpos(), res);
          if 0 >= (res.x) then
            exit;
          if PointInBox(minimap.pointstomainscreen([res])[0], inttobox(185, 1, 575, 388)) then
          begin
            mouse(minimap.pointstomainscreen([res])[0], mouse_left);
            result := true;
          end
          else
          begin
            Sps.walkPath([sps.getplayerpos(), point(130 + random( - 4, 4), 126 + random( - 4, 4))]);
          end;
          wait(random(785, 1486));
          Minimap.waitPlayerMoving(random(1457, 2758));
          result := true;
        end
        else
        begin
          Mainscreen.setAngle(ms_angle_high);
        end;
      end;
      case random(143) of
        0..7:
          if findcolortolerance(x, y, 13929833, inttobox(107, 583, 157, 590), 15) then
            typeSend('', true);
      end;
    end;

    procedure BankMain();
    begin
      if not isloggedin() then
        exit;
      EggsBanked := EggsBanked + tabbackpack.count() - 3;
      if not Bank() then
      begin
        RotateToBank();
        wait(gaussrangeint(547, 1250));
        if not bank() then
        begin
          if not StartPosition() then
            StartPosition();
          wait(gaussrangeint(1780, 3456));
          if not Bank() then
          begin
            sps.blindWalk(point(122, 119));
            wait(gaussrangeint(1500, 2785));
            RotateToBank();
            wait(gaussrangeint(547, 1250));
            if not Bank() then
              Bankfailsafe();
          end;
        end;
      end;
    end;

    function SpecBar(): integer;
    var
      x, y, i: integer;
    begin
      if not Isloggedin() then
        exit;
      result := - 1;
      for i := 0 to 27 do
      begin
        //writeln('SPecbar');
        if FindColorTolerance(x, y, 8098829, inttobox(25 - (5 * i), 171, 173 - (5 * i), 177), 13, colorSetting(2, 0.10, 0.85)) then
        begin
          result := 28 - i;
         // writeln(result);
          exit;
        end;
      end;
    end;

    function _filter(Spalva: integer; Box: Tbox; Tol: integer; ColSettings: TColorSettings): tbox;
    var
      x, y: integer;
      TPA: TPointArray;
      ATPA: T2DPointArray;
    begin
      FindColorsSpiralTolerance(x, y, TPA, Spalva, Box, Tol, ColSettings);
      ATPA := TPA.toATPA(20, 20);
      result := GetATPABounds(atpa);
    end;

    procedure lootingAntiban();
    begin
      if not isloggedin() then
        exit;
      case random(3500) of
        0..145: smallrandommouse();
        146..174: mouseoffclient(4);
        175..183:
          begin
            wait(gaussrangeint(1450, 2145));
            pickupmouse();
          end;
        184..242: Minimap.setAngle(trunc(minimap.getangledegrees()) + (random( - 45, 45)));
        243..247: sleepAndMoveMouse(random(1, 4500) + gaussrangeint(1235, 2475));
        283..285: hoverRandomSkill();
        286: boredhuman();
        287..415: randomCompass(30, 145, false);
        416..453: mousemovingobject();
      end;
      LootAntibanned := true;
    end;

    function PartiallyInBox(mmpb, box: tbox): boolean;
    begin
      result := false;
      if not isloggedin() then
        exit;
      if (((((mmpb.x1 < box.x2) and (mmpb.x1 > box.x1)) and ((mmpb.y2 > box.y1) and (mmpb.y2 < box.y2))) or (((mmpb.x1 < box.x2) and (mmpb.x1 > box.x1)) and ((mmpb.y1 > box.y1) and (mmpb.y1 < box.y2)))) or ((((mmpb.x2 < box.x2) and (mmpb.x2 > box.x1)) and ((mmpb.y1 > box.y1) and (mmpb.y1 < box.y2))) or (((mmpb.x2 < box.x2) and (mmpb.x2 > box.x1)) and ((mmpb.y2 > box.y1) and (mmpb.y2 < box.y2))))) then
      begin
        result := true;
        exit;
      end;
    end;

    function FindEggs(box: tbox = LootingBox): tbox;
    var
      x, y, eggsbefore, i: integer;
      TPA, TPAmm: TPointArray;
      ATPA: T2DPointArray;
      lootingtimer: ttimemarker;
      mmpb: tbox;
    begin
      if not isloggedin() then
        exit;
      result := (inttobox(0, 0, 0, 0));
      EggsOnFloor := 0;
      tpamm := minimap.pointsToMainscreen(minimap.getdots(MM_DOT_ITEM, minimap.getbounds()), true);
      if chooseoption.isopen() then
      begin
        if chooseoption.optionsexist(['eggs', 'ggs']) then
          chooseoption.select(['eggs', 'ggs'])
        else
          chooseoption.close;
        wait(gaussrangeint(166, 283));
        eggsbefore := tabbackpack.count();
        lootingtimer.start();
        repeat
          wait(gaussrangeint(173, 238));
          if not lootantibanned then
            LootingAntiban();
        until ((eggsbefore < tabbackpack.count()) or (lootingtimer.gettime() >= 2000));
        Wait(gaussrangeint(495, 603));
      end;
      for i := 0 to high(tpamm) do
      begin
        mmpb := [tpamm[i].x - 32, tpamm[i].y - 32, tpamm[i].x + 32, tpamm[i].y + 32];
        FindColorsSpiralTolerance(x, y, TPA, 9342998, mmpb, 10, colorSetting(2, 4.99, 1.08));
        tpa := clearTPAFromTPA(tpa, TPAFromBox(_filter(2930118, inttobox(212, 119, 360, 260), 20, colorSetting(2, 0.23, 1.83))));
        tpa := clearTPAFromTPA(tpa, TPAFromBox(_filter(10260030, inttobox(212, 119, 360, 260), 5, colorSetting(2, 0.08, 0.15))));
        if length(tpa) < 1 then
          continue;
        atpa := clustertpa(tpa, 4);
        atpa.filterBetween(0, 8);
        ATPA.sortFromMidPoint(mainscreen.playerPoint);
        SmartImage.debugATPA(atpa);
        if Length(atpa) < 1 then
          continue;
        if partiallyinbox(mmpb, box) then
        begin
          result := GetTPABounds(atpa[0]);
          EggsOnFloor := length(atpa);
          exit;
        end;
      end;
    end;

    function FindEggsOld(box: tbox = LootingBox): tbox;
    var
      x, y, i: integer;
      TPA: TPointArray;
      ATPA: T2DPointArray;
    begin
      result := (inttobox(0, 0, 0, 0));
      if not isloggedin() then
        exit;
      EggsOnFloor := 0;
      FindColorsSpiralTolerance(x, y, TPA, 9342998, box, 10, colorSetting(2, 4.99, 1.08));
      tpa := clearTPAFromTPA(tpa, TPAFromBox(_filter(2930118, inttobox(212, 119, 360, 260), 20, colorSetting(2, 0.23, 1.83))));
      tpa := clearTPAFromTPA(tpa, TPAFromBox(_filter(10260030, inttobox(212, 119, 360, 260), 5, colorSetting(2, 0.08, 0.15))));
      if length(TPA) < 1 then
        exit;
      atpa := clustertpa(tpa, 4);
      atpa.filterBetween(0, 7);
      atpa.sortFromMidPoint(mainscreen.playerPoint);
      SmartImage.debugATPA(atpa);
      if Length(atpa) < 1 then
        Exit;
      if GetTPABounds(atpa[0]).x1 < 1 then
        Exit;
      result := GetTPABounds(atpa[0]);
      EggsOnFloor := length(atpa);
    end;

    procedure Minibreak();
    begin
      if not isloggedin() then
        exit;
      case random(914) of
        0..11: mouseOffClient(OFF_CLIENT_TOP);
        12..35: mouseOffClient(OFF_CLIENT_RIGHT);
        36..57: mouseOffClient(OFF_CLIENT_RANDOM);
        58..74:
          begin
            wait(random(1, 7000) + gaussrangeint(3500, 8500 + random(122, 4150)));
            pickupmouse();
            case random(7) of
              0..1: smallrandommouse();
              2..4: mouseMovingObject();
            end;
          end;
        75..83: mouseMovingObject();
        84..91: smallrandommouse(200);
        92..142:
          begin
            case random(21) of
              0..8: mouseOffClient(OFF_CLIENT_RIGHT);
              9: mouseOffClient(OFF_CLIENT_TOP);
              10..20: mouseOffClient(OFF_CLIENT_RANDOM);
            end;
            case random(35) of
              0..11: wait(gaussrangeint(4423, 7425));
              12..33: wait(gaussrangeint(11111 - random(3452, 10574), 17450 + random(4521, 7521)));
              34: wait(random(35000, 55000) + gaussrangeint(1235, 4520 + random(250, 47000)));
            end;
          end;
      end;
    end;

    procedure PickUpEgg(box: tbox = LootingBox);
    var
      x, y, eggsBefore, eggsAfter: integer;
      boxas: tbox;
      lootingtimer: ttimemarker;
      missclickPoint: tpoint;
    begin
      Lootantibanned := false;
      Whopped := false;
      if (Isloggedin() = false) then
        exit;
      if (tabbackpack.isFull()) then
        exit;
      if Ismouseovertext(['Red', 'Take Red']) then
      begin
        flag := 0;
        getmousepos(x, y);
        case random(47) of
          0..11:
            begin
              case random(874) of
                0..414: missmouse(point(x, y), true);
                415..873: fastclick(mouse_left);
              end;
              wait(gaussrangeint(153, 274));
            end;
          25..46:
            begin
              case random(874) of
                0..174:
                  begin
                    missmouse(point(x, y), true);
                    multiclick(point(x, y), 75, 3);
                  end;
                175..873: multiclick(point(x, y), 75, 3);
              end;
            end;
        end;
      end;
      if ((chooseoption.isopen()) and (chooseoption.optionsexist(['eggs', 'ggs']))) then
      begin
        chooseoption.select(['eggs', 'ggs']);
        flag := 0;
      end;
      if ((tabbackpack.isFull()) or (findEggs(box).x1 <= 0)) then
        exit;
      boxas := findEggs(box);
      case random(3874) of
        0..1274:
          begin
            Mousecircle(boxas.getMiddle.x, boxas.getMiddle.y, 9, mouse_move);
            if ((ismouseovertext(['Donate', 'onate', 'Bank'])) or (Ismouseovertext(['Spirit', 'Interact', 'pirit', 'pirit spider']))) then
            begin
              minimap.setAngle(Trunc(minimap.getangledegrees()) + Random(30, 90));
              exit;
            end;
            if Ismouseovertext(['Red', 'Take Red']) then
            begin
              flag := 0;
              case random(415) of
                0..118: missmouse(boxas.getmiddle(), true);
                119..414: Fastclick(mouse_left);
              end;
              case random(112) of
                0..43:
                  begin
                    wait(gaussrangeint(220, 315));
                    mousebox(boxas, mouse_right);
                    ChooseOption.optionsExist(['eggs', 'ggs']);
                    Chooseoption.select(['eggs', 'ggs']);
                  end;
              end;
              eggsbefore := tabbackpack.count();
              lootingtimer.start();
              repeat
                wait(gaussrangeint(173, 238));
                if not lootantibanned then
                  LootingAntiban();
              until ((eggsbefore < tabbackpack.count()) or (lootingtimer.gettime() >= 2000));
              Wait(gaussrangeint(595, 703));
            end
            else
              Mousecircle(boxas.getMiddle.x, boxas.getMiddle.y, 9, mouse_left);
          end;
        1275..3874:
          begin
            Mousecircle(boxas.getMiddle.x, boxas.getMiddle.y, 9, mouse_right);
            ChooseOption.isOpen(gaussrangeint(475, 987));
            if ((ismouseovertext(['Donate', 'onate', 'Bank'])) or (Ismouseovertext(['Spirit', 'Interact', 'pirit', 'pirit spider']))) then
            begin
              minimap.setAngle(Trunc(minimap.getangledegrees()) + Random(30, 90));
              exit;
            end;
            if chooseoption.optionsexist(['Trade', 'with', 'rade']) then
            begin
              Statusas('Switching world because someone is messing up');
              inc(RedNoob);
              players[currentplayer].exittolobby();
              players[currentplayer].switchtoworld(PossibleWorldsArray[random(0, 78)]);
              wait(gaussrangeint(5500, 8780));
              Whopped := true;
              mainscreen.setzoom(true);
              mainscreen.setangle(ms_angle_high);
              exitTreasure();
              exit;
            end;
            if ChooseOption.optionsExist(['eggs', 'ggs']) then
            begin
              if (length(chooseoption.getOptions()) >= 5) then
              begin
                Chooseoption.select(['eggs', 'ggs']);
                flag := 0;
                case random(47) of
                  10..12: smallrandommouse(24);
                  28..29: smallrandommouse(153);
                  17..23:
                    begin
                      wait(gaussrangeint(495, 615));
                      mousecircle(290, 199, 11, mouse_move);
                    end;
                  24..47:
                    begin
                      gaussrangeint(175, 275);
                      mousebox(boxas, mouse_right);
                      if ChooseOption.optionsExist(['eggs', 'ggs']) then
                      begin
                        eggsbefore := tabbackpack.count();
                        lootingtimer.start();
                        repeat
                          wait(gaussrangeint(173, 238));
                          if not lootantibanned then
                            LootingAntiban();
                        until ((eggsbefore < tabbackpack.count()) or (lootingtimer.gettime() >= 2000));
                        wait(gaussrangeint(78, 186));
                        Chooseoption.select(['eggs', 'ggs']);
                        flag := 0;
                        Wait(gaussrangeint(595, 715));
                        exit;
                      end;
                    end;
                end;
              end
              else
                Chooseoption.select(['eggs', 'ggs']);
              Flag := 0;
              eggsbefore := tabbackpack.count();
              lootingtimer.start();
              repeat
                wait(gaussrangeint(173, 238));
                if not lootantibanned then
                  LootingAntiban();
              until ((eggsbefore < tabbackpack.count()) or (lootingtimer.gettime() >= 2000));
              Wait(gaussrangeint(795, 715));
            end
            else
            begin
              ChooseOption.close();
              inc(Flag);
              if Flag >= 6 then
              begin
                if not StartPosition() then
                  StartPosition();
                minimap.setangle(random(0, 45));
                inc(Fail);
              end;
            end;
          end;
      end;
      smartimage.clearArea(inttobox(1, 1, 799, 450));
    end;

    procedure SpamRoutine();
    var
      x, y: integer;
      i: integer;
      settingsButton: TBox;
    begin
      if not Isloggedin() then
        exit;
      if not findcolortolerance(x, y, 10066448, inttobox(45, 45, 135, 80), 11, colorSetting(2, 4.44, 0.44)) then
        exit;
        //writeln('Spamroutina');
      if 2 >= SpecBar() then
        Exit;
      case random(4500) of
        0..1274:
          begin
            Wait(gaussrangeint(150, 450));
            settingsButton := intToBox(22, 128, 33, 143);
            mouseBox(settingsButton, MOUSE_LEFT);
            Wait(gaussrangeint(150, 450));
          end;
        1275..3499:
          begin
            settingsButton := intToBox(22, 128, 33, 143);
            mouseBox(settingsButton, MOUSE_LEFT);
            for i := 0 to gaussrangeint(0, 5) do
            begin
              Fastclick(mouse_left);
              case random(27) of
                0..7: Wait(Gaussrangeint(500, 700));
                8..11: Wait(Random(150, 174));
              end;
            end;
          end;
        3500..4499:
          begin
            Wait(gaussrangeint(1500, 2450));
            settingsButton := intToBox(22, 128, 33, 143);
            mouseBox(settingsButton, MOUSE_LEFT);
            Wait(gaussrangeint(850, 1450));
          end;
      end;
    end;

    procedure Summ();
    var
      x, y: integer;
    begin
      if not Isloggedin() then
        exit;
      if not FindColorTolerance(x, y, 660871, inttobox(16, 51, 173, 116), 40) then
      begin
        Statusas('No Spider');
        if (ActionBar.getSummoningPercent() < 35) then
        begin
          if findcolortolerance(x, y, 14538272, tabbackpack.getslotbox(2), 35) then
          begin
            mousebox(tabbackpack.getslotbox(2), mouse_left);
            wait(gaussrangeint(845, 1452));
          end
          else
          begin
            BankMain();
            exit;
          end;
        end;
        if FindColorTolerance(x, y, 11058626, tabbackpack.getslotbox(3), 35) then
        begin
          Statusas('Summoning spider');
          Wait(random(356, 742));
          Mousebox(tabbackpack.getslotbox(3), mouse_left);
          wait(random(587, 2145));
        end
        else
          bankMain();
      end;
    end;

    procedure Spec();
    var
      x, y, p, a: integer;
    begin
      if not isloggedin() then
        exit;
      Summ();
      if ((3 >= SpecBar()) and (FindColorTolerance(x, y, 12828188, inttobox(421, 445, 432, 450), 10))) then
      begin
        mouseBox(TabBackpack.getSlotBox(2), mouse_left);
        wait(gaussrangeint(845, 1452));
      end;
      smartimage.drawBox(inttobox(22, 128, 33, 143),false,255);
      repeat
        p := SpecBar();
        //writeln('Pradzia');
        SpamRoutine();
        a := SpecBar();
       // writeln('Pabaiga');
        if 2 >= SpecBar() then
          Exit;
      until (a <> p);
    end;

    procedure AngleTransform();
    var
      i, iz, ix: integer;
      angle, c, s: extended;
    begin
      angle := Minimap.getAngleDegrees();
      s := sin(radians(angle));
      c := cos(radians(angle));
      for i := 0 to 7 do
      begin
        StaticRotatedPoints[i][0] := c * StaticPoints[i][0] + s * StaticPoints[i][1];
        StaticRotatedPoints[i][1] := ( - 1) * s * StaticPoints[i][0] + c * StaticPoints[i][1];
      end;
      for iz := 0 to 7 do
      begin
        DynamicPoints[iz][0] := StaticRotatedPoints[iz][0] + Centerx;
        DynamicPoints[iz][1] := Centery - StaticRotatedPoints[iz][1];
      end;
      for ix := 0 to 7 do
      begin
        smartimage.drawtext(tostring(ix), point(trunc(DynamicPoints[ix][0]), trunc(DynamicPoints[ix][1])), 11839306);
        Smartimage.drawCross(point(trunc(DynamicPoints[ix][0]), trunc(DynamicPoints[ix][1])), 3, 16777215);
      end;
    end;

    procedure AlternativePickingPile(kar: integer);
    var
      eggsBefore: integer;
      lootingTimer: ttimemarker;
      x, y, miss: integer;
    begin
      if not isloggedin() then
        exit;
      miss := 0;
      mousebox(inttobox(Centerx - 6, Centery - 6, Centerx + 6, Centery + 6), mouse_move);
      wait(gaussrangeint(120, 315));
      getmousepos(x, y);
      if Ismouseovertext(['Red', 'Take Red']) then
      begin
        case random(152) of
          0..74: mousebox(inttobox(Centerx - 12, Centery - 12, Centerx + 12, Centery + 12), mouse_left);
        end;
        multiclick(point(x, y), 100, gaussrangeint(1, 3));
        dec(kar);
      end
      else
      begin
        if ismouseovertext(['spider', 'Spirit']) then
        begin
          mouse(point(x, y), mouse_right);
          chooseoption.isopen(gaussrangeint(350, 678));
          if chooseoption.optionsexist(['eggs', 'ggs']) then
          begin
            wait(gaussrangeint(168, 365));
            chooseoption.select(['eggs', 'ggs']);
            dec(kar);
          end
          else
          begin
            chooseoption.close();
            inc(miss);
          end;
        end;
      end;
      while ((kar > 0) and (miss < 2)) do
      begin
        if not isloggedin() then
          exit;
        case random(419) of
          0..274:
            begin
              mousebox(inttobox(Centerx - 5, Centery - 5, Centerx + 4, Centery + 3), mouse_right);
              if chooseoption.isopen(gaussrangeint(235, 456)) then
              begin
                wait(gaussrangeint(167, 314));
                if chooseoption.optionsexist(['eggs', 'ggs']) then
                begin
                  chooseoption.select(['eggs', 'ggs']);
                  dec(kar);
                  wait(gaussrangeint(144, 235));
                end
                else
                begin
                  chooseoption.close();
                  inc(miss);
                end;
              end;
            end;
          275..365:
            begin
              mousebox(inttobox(Centerx - 4, Centery - 5, Centerx + 4, Centery + 4), mouse_move);
              if ismouseovertext(['eggs', 'ggs']) then
              begin
                getmousepos(x, y);
                wait(gaussrangeint(166, 258));
                case random(123) of
                  0..21: missMouse(point(x, y), true);
                  22..122: fastclick(mouse_left);
                end;
                dec(kar);
              end
              else
              begin
                inc(miss);
              end;
            end;
          366..418:
            begin
              mousebox(inttobox(Centerx - 4, Centery - 5, Centerx + 3, Centery + 6), mouse_move);
              if ismouseovertext(['eggs', 'ggs']) then
              begin
                getmousepos(x, y);
                wait(gaussrangeint(187, 285));
                case random(143) of
                  0..87: multiClick(point(x, y), 100, 3);
                  88..127: multiClick(point(x, y), 100, 2);
                  128..142:
                    begin
                      missmouse(point(x, y), true);
                      multiClick(point(x, y), 100, 2);
                    end;
                end;
                dec(kar);
              end
              else
              begin
                inc(miss);
              end;
            end;
        end;
      end;
    end;

    function AlternativePicking(out Transpoint: integer): boolean;
    var
      i, x, y, mx, my, z, r, eggsbefore: integer;
      pai, eggsCount: integer;
      optionsai: TOptionArray;
      lootingtimer: ttimemarker;
      centr: tpoint;
      boxas: tbox;
    begin
      transpoint := - 1;
      result := false;
      for i := checkedToPile to high(DynamicPoints) do
      begin
        if not isloggedin() then
          exit;
        pai := LootingPattern[i];
        if ((findEggsOld(inttobox(trunc(DynamicPoints[pai][0] - 12), trunc(DynamicPoints[pai][1] - 12), trunc(DynamicPoints[pai][0] + 12), trunc(DynamicPoints[pai][1] + 12))).x1 = 0) and (StandartEggsLocationsArray[pai] = false)) then
          continue;
        smartimage.drawbox(inttobox(trunc(DynamicPoints[pai][0] - 12), trunc(DynamicPoints[pai][1] - 12), trunc(DynamicPoints[pai][0] + 12), trunc(DynamicPoints[pai][1] + 12)), 16777215);
        if (EggsOnFloor > 0) or (StandartEggsLocationsArray[pai] = true) then
        begin
          if ((StandartEggsLocationsArray[pai] = true) and (EggsOnFloor > 0)) then
          begin
            for r := 0 to 2 do
            begin
              if not isloggedin() then
                exit;
              case random(415) of
                0..91:
                  begin
                    Boxas := findEggsOld(inttobox(trunc(DynamicPoints[pai][0] - 10), trunc(DynamicPoints[pai][1] - 10), trunc(DynamicPoints[pai][0] + 10), trunc(DynamicPoints[pai][1] + 10)));
                    if (boxas.x1 > 100) then
                      mousebox(boxas, mouse_left);
                    wait(gaussrangeint(166, 283));
                    if (boxas.x1 > 100) then
                      Mousebox(boxas, mouse_right);
                  end;
                92..414:
                  begin
                    centr := findEggsOld(inttobox(trunc(DynamicPoints[pai][0] - 10), trunc(DynamicPoints[pai][1] - 10), trunc(DynamicPoints[pai][0] + 10), trunc(DynamicPoints[pai][1] + 10))).getmiddle();
                    if (r >= 1) then
                    begin
                      if (centr.x >= 200) then
                        Mousecircle(centr.x, centr.y, 5, mouse_right);
                    end
                    else
                    begin
                      if (centr.x < 200) then
                        continue;
                      case random(215) of
                        0..5: Mousecircle(centr.x, centr.y, 14, mouse_right);
                        5..11: Mousecircle(centr.x, centr.y, 11, mouse_right);
                        12..214: Mousecircle(centr.x, centr.y, 10, mouse_right);
                      end;
                    end;
                  end;
              end;
              if ChooseOption.isOpen(gaussrangeint(200, 387)) then
              begin
                Optionsai := ChooseOption.getOptions();
                if chooseoption.optionsexist(['eggs', 'ggs']) then
                begin
                  eggsCount := 0;
                  for z := 0 to high(optionsai) do
                  begin
                    if optionsai[z].str = 'Take Red spiders' ' eggs' then
                      inc(eggsCount);
                  end;
                  chooseoption.select(['eggs', 'ggs']);
                  StandartEggsLocationsArray[pai] := false;
                  miscli := 0;
                  eggsbefore := tabbackpack.count();
                  lootingtimer.start();
                  repeat
                    wait(gaussrangeint(173, 238));
                    if not lootantibanned then
                      LootingAntiban();
                  until ((eggsbefore < tabbackpack.count()) or (lootingtimer.gettime() >= 2500));
                  if (eggsCount > 1) then
                  begin
                    case random(315) of
                      0..214: mousebox(inttobox(Centerx - 12, Centery - 11, Centerx + 12, Centery + 13), mouse_move);
                    end;
                  end;
                  Wait(gaussrangeint(595, 815));
                  result := true;
                  transpoint := pai;
                  if ((eggsbefore < tabbackpack.count()) and (eggsCount > 1)) then
                  begin
                    alternativePickingPile((eggsCount - 1));
                  end;
                  checkedToPile := i;
                  exit;
                end
                else
                begin
                  inc(miscli);
                  if (miscli >= 2) then
                  begin
                    miscli := 0;
                    inc(checkedToPile);
                  end;
                  chooseoption.close();
                end;
              end;
            end;
          end
          else
            mousebox(inttobox(trunc(DynamicPoints[pai][0] - 3), trunc(DynamicPoints[pai][1] - 3), trunc(DynamicPoints[pai][0] + 3), trunc(DynamicPoints[pai][1] + 3)), mouse_right);
          if ChooseOption.isOpen(gaussrangeint(575, 887)) then
          begin
            Optionsai := ChooseOption.getOptions();
            if chooseoption.optionsexist(['eggs', 'ggs']) then
            begin
              eggsCount := 0;
              for z := 0 to high(optionsai) do
              begin
                if optionsai[z].str = 'Take Red spiders' ' eggs' then
                  inc(eggsCount);
              end;
              chooseoption.select(['eggs', 'ggs']);
              StandartEggsLocationsArray[pai] := false;
              miscli := 0;
              eggsbefore := tabbackpack.count();
              lootingtimer.start();
              repeat
                wait(gaussrangeint(173, 238));
                if not lootantibanned then
                  LootingAntiban();
              until ((eggsbefore < tabbackpack.count()) or (lootingtimer.gettime() >= 2500));
              if (eggsCount > 1) then
              begin
                case random(315) of
                  0..214: mousebox(inttobox(Centerx - 12, Centery - 11, Centerx + 12, Centery + 13), mouse_move);
                end;
              end;
              Wait(gaussrangeint(595, 815));
              result := true;
              transpoint := pai;
              if ((eggsbefore < tabbackpack.count()) and (eggsCount > 1)) then
              begin
                alternativePickingPile((eggsCount - 1));
              end;
              checkedToPile := i;
              exit;
            end
            else
            begin
              inc(miscli);
              if miscli >= 1 then
              begin
                miscli := 0;
                inc(checkedToPile);
              end;
              chooseoption.close();
            end;
          end;
        end;
      end;
    end;

    procedure TransitionShift();
    var
      Transpoint: integer;
      i: integer;
    begin
      if not isloggedin() then
        exit;
      angleTransform();
      if alternativePicking(Transpoint) then
      begin
        shiftx := ( - StaticPoints[Transpoint][0]);
        shifty := ( - StaticPoints[Transpoint][1]);
        for i := 0 to 7 do
        begin
          StaticPoints[i][0] := StaticPoints[i][0] + shiftx;
          StaticPoints[i][1] := StaticPoints[i][1] + shifty;
        end;
      end;
      for i := 0 to 7 do
      begin
        smartimage.drawcross(point(StaticPoints[i][0], StaticPoints[i][1]), 5, 16777215);
      end;
      smartimage.clear();
    end;

    procedure ResetCoordinates();
    begin
      checkedToPile := 0;
      miscli := 0;
      StandartEggsLocationsArray := [false, false, false, false, false, false, false, false];
      shiftx := 0;
      shifty := 0;
      StaticPoints := [[ - 32, 32], [0, 32], [32, 32], [ - 32, 0], [32, 0], [ - 32, - 32], [0, - 32], [32, - 32]];
    end;

    procedure CheckSpots();
    var
      i: integer;
    begin
      if not isloggedin() then
        exit;
      angleTransform();
      for i := 0 to high(DynamicPoints) do
      begin
        if findEggsOld(inttobox(trunc(DynamicPoints[i][0] - 12), trunc(DynamicPoints[i][1] - 12), trunc(DynamicPoints[i][0] + 12), trunc(DynamicPoints[i][1] + 12))).x1 = 0 then
        begin
          StandartEggsLocationsArray[i] := false;
          smartimage.drawbox(inttobox(trunc(DynamicPoints[i][0] - 12), trunc(DynamicPoints[i][1] - 12), trunc(DynamicPoints[i][0] + 12), trunc(DynamicPoints[i][1] + 12)), 255);
        end
        else
        begin
          StandartEggsLocationsArray[i] := true;
          smartimage.drawbox(inttobox(trunc(DynamicPoints[i][0] - 12), trunc(DynamicPoints[i][1] - 12), trunc(DynamicPoints[i][0] + 12), trunc(DynamicPoints[i][1] + 12)), 14538272);
        end;
      end;
    end;

    procedure PatternLoot();
    var
      i: integer;
    begin
      if not isloggedin() then
        exit;
      statusas('ALternative patterned picking');
      ResetCoordinates();
      CheckSpots();
      case random(91) of
        0..11: LootingPattern := [0, 1, 2, 4, 7, 6, 5, 3];
        12..27: LootingPattern := [1, 2, 4, 7, 6, 5, 3, 0];
        28..37: LootingPattern := [4, 7, 6, 5, 3, 0, 1, 2];
        38..43: LootingPattern := [4, 2, 1, 0, 3, 5, 6, 7];
        44..58: LootingPattern := [6, 5, 3, 0, 1, 2, 4, 7];
        59..71: LootingPattern := [3, 0, 1, 2, 4, 7, 6, 5];
        72..79: LootingPattern := [5, 3, 0, 1, 2, 4, 7, 6];
        80..83: LootingPattern := [7, 6, 5, 3, 0, 1, 2, 4];
        84..91: LootingPattern := [2, 4, 7, 6, 5, 3, 0, 1];
      end;
      statusas(tostring(LootingPattern));
      for i := 0 to 7 do
      begin
        if not isloggedin() then
          exit;
        transitionShift();
        MiniAntiban();
        if ((length(minimap.getdots(mm_dot_item, inttobox(660, 80, 715, 125))) < 1) or (tabbackpack.isfull())) then
          exit;
      end;
    end;

    procedure NormalLoot();
    var
      invCountBefore: integer;
      lootsTimer: ttimemarker;
      x, y: integer;
    begin
      if not isloggedin() then
        exit;
      if length(minimap.getdots(mm_dot_item, inttobox(660, 80, 715, 125))) < 1 then
      begin
        Minibreak();
        exit;
      end;
      if players[currentplayer].booleans[0] then
        PatternLoot();
      statusas('Normal loot');
      lootsTimer.start();
      invCountBefore := TabBackpack.count();
      repeat
        if (length(minimap.getdots(mm_dot_item, minimap.getbounds())) >= 1) then
          pickUpEgg()
        else
          break;
        if ((Whopped) or (not isloggedin())) then
          exit;
        MiniAntiban();
        if lootsTimer.getTime() > 75000 then
        begin
          if TabBackpack.count() <= invCountBefore then
          begin
            Statusas('75 seconds havent looted single egg');
            inc(fail);
            if fail > players[currentplayer].integers[1] then
              terminatescript;
          end
          else
            Break;
        end;
      until ((TabBackpack.isfull()) or (EggsOnFloor = 0));
    end;

    procedure SpawnAndLoot();
    var
      SpecClickingTimer: ttimemarker;
      clickingTime: integer;
    begin
      if not Isloggedin() then
        exit;
      NormalLoot();
      if not StartPosition() then
        StartPosition();
      if TabBackpack.isfull() then
        exit;
      if TabBackpack.count() >= 23 then
        clickingTime := gaussrangeint(5500, 11000)
      else
        clickingTime := gaussrangeint(15000, 23000);
      SpecClickingTimer.start();
      Statusas('Spamclicking spec');
      repeat
        Spec();
      until SpecClickingTimer.gettime() > clickingTime;
      Statusas('looting eggs');
      NormalLoot();
      if tabbackpack.isFull() then
        exit;
    end;

    procedure Distloot();
    begin
      if not isloggedin() then
        exit;
      if findEggs(inttobox(200, 6, 573, 384)).x1 > 0 then
      begin
        pickUpEgg(inttobox(200, 6, 573, 384));
        wait(gaussrangeint(1500, 2510));
        exit;
      end;
      if findEggs(inttobox(2, 195, 199, 384)).x1 > 0 then
      begin
        pickUpEgg(inttobox(2, 195, 199, 384));
        wait(gaussrangeint(1500, 2510));
        exit;
      end;
    end;

    procedure SwitchPlayer();
    begin
      players[currentplayer].logout();
      players.next(false);
      wait(gaussrangeint(4200, 6750));
      minimap.clickcompass();
      mainscreen.setzoom(true);
      mainscreen.setangle(ms_angle_high);
      exitTreasure();
    end;

    procedure Mainloop();
    var
      x, y: integer;
    begin
      CurrentTripTime.start();
      mousespeed := (gaussrangeint(30, 40));
      repeat
        if not isloggedin() then
          exit;
        if not findcolortolerance(x, y, 4179190, inttobox(182, 27, 193, 31), 50) then
        begin
          mouseScroll(inttobox(10, 25, 163, 140).getrandompoint(), 10 + random(5), false);
          inc(fail);
          if fail > players[currentplayer].integers[1] then
            terminatescript;
        end;
        Summ();
        SpawnAndLoot();
      until tabbackpack.count() >= 25;
      BankMain();
      DistLoot();
      if CurrentTripTime.getTime() > 480000 then
      begin
        Statusas('Failed to do trip in 8 mins');
        inc(fail);
        if fail > players[currentplayer].integers[1] then
          terminatescript;
      end;
      takeBreak();
    end;

    begin
      SmartEnableDrawing := true;
      smartShowConsole := false;
      SetupSRL();
      initPlayerForm();
      runPlayerForm();
      DeclarePlayers();
      SPS.setup('ge', Runescape_other);
      breaktimes();
      if not isloggedin() then
        logintow();
      TotalScriptTime.start();
      SixhourFixTime.start();
      while players.getactive() > 0 do
      begin
        PlayersTimer.start();
        repeat
          Mainloop();
          if (SixhourFixTime.getTime() >= (gaussrangeint(19600000, 22000000))) then
          begin
            sixhourfix();
            SixhourFixTime.Start();
            wait(gaussrangeint(6000, 9500));
            mainscreen.setzoom(true);
            Mainscreen.setAngle(ms_angle_high);
          end;
        until (((PlayersTimer.gettime() >= (players[currentplayer].integers[0]) * 60000) or (not isloggedin())) or (players[currentplayer].isactive = false));
        switchPlayer();
      end;
    end.
    http://docs.villavu.com/srl-6/lootscreen.html
    https://villavu.com/forum/image.php?type=sigpic&userid=147422&dateline=14358  53409

  12. #37
    Join Date
    Dec 2015
    Posts
    1
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Could someone update this script? I tried changing it to using loot menu but failed :|

  13. #38
    Join Date
    Oct 2016
    Posts
    3
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    summons spider. goes back to bank and withdraws preset. Attempts to summon spider again. Cant cause theres already a spider. Drinks potion. Tries to summon. Cant. Drink potion. Etc. not really sure what im doing wrong.

  14. #39
    Join Date
    Aug 2014
    Location
    Michigan, USA
    Posts
    138
    Mentioned
    1 Post(s)
    Quoted
    68 Post(s)

    Default

    This seems like a great Script. I may have to test this out. (:

  15. #40
    Join Date
    Jan 2018
    Posts
    6
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Thank you very much, I had some trouble setting it up at first but it works like a dream now.

Page 2 of 2 FirstFirst 12

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
  •