Page 1 of 2 12 LastLast
Results 1 to 25 of 40

Thread: CosmasJDZ red spider eggs

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

    Default CosmasJDZ red spider eggs

    CosmasJDZ red spider eggs collector


    What it does?

    Collects red spider eggs using spirit spider and spawn scrolls.


    Requirements

    *lvl 10 summoning
    *Some spirit spider pouches
    *Some summoning potions
    *Some spawn scrolls

    Abilities

    *Complex patternlooting system which loots like human by making lines/circles, remembers eggs under spider/itself, clicks blindly if needed
    *Multiple failsafes everywhere, 3 different banking methods
    *Switch worlds if someone with red stuff messes around toomuch
    *Doesnt loot anything unless its on minimap as red dot, always checks before looting, very minimal close to none mouse hovering red objects
    *Stops if low of scrolls, pouches or summ pots.
    *Stops if messes up toomuch, you can choose minot fails allowed at start
    *Simple on screen progress report
    *Takes breaks
    *Checks if is near bank if not(when someone tried to lure) then walks back
    *Supports 6hourfix
    *Supports multiplayer

    Known bugs

    *None but havent used a month or so

    Setup

    *First of all try to avoid orange/red clothes yourself
    *OpenGL mode support only
    *Follow photos they self explanatory:
    Bank: in the same order, spot 3 instead of beef can be eggs, whatever but other right where they are:

    Inventory, action bar and familiar interface setup:

    *Save inventory in setup as Preset1
    *Save minimap called ge at runescape_other folder: http://imgur.com/UhRQzL1
    *Start at the bank of goodwill
    *Start script, fill out the form and happy botting.
    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: http://i.imgur.com/UhRQzL1.png?1

    Graphics mode opengl preffered.

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

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

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

     }


    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, 7822103, inttobox(168 - (5 * i), 145, 169 - (5 * i), 160), 15, colorSetting(2, 0.02, 2.0)) 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;
    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));
            Mousebox(inttobox(17, 110, 33, 126), mouse_left);
            Wait(gaussrangeint(150, 450));
          end;
        1275..3499:
          begin
            Mousebox(inttobox(17, 110, 33, 126), 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));
            Mousebox(inttobox(17, 110, 33, 126), 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(17, 110, 33, 126),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.

  2. #2
    Join Date
    Jan 2012
    Location
    East Coast
    Posts
    733
    Mentioned
    81 Post(s)
    Quoted
    364 Post(s)

    Default

    RIP this method since it's posted in public,
    Grats on release though!

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

    Default

    Quote Originally Posted by Ross View Post
    RIP this method since it's posted in public,
    Grats on release though!
    Thanks.Was thinking who the hell else botting Anyways you can always merch or bot support scripts like scrolls used to be better for some time now.

  4. #4
    Join Date
    Feb 2007
    Location
    Alberta, Canada
    Posts
    4,615
    Mentioned
    50 Post(s)
    Quoted
    429 Post(s)

    Default

    Quote Originally Posted by Ross View Post
    RIP this method since it's posted in public,
    Grats on release though!
    Quote Originally Posted by cosmasjdz View Post
    Thanks.Was thinking who the hell else botting Anyways you can always merch or bot support scripts like scrolls used to be better for some time now.
    All bets are off now that it's in public. I now introduce you to the method of short-selling:

    1) Obtain sucker who will lend you red spiders' eggs.
    2) Sell red spiders' eggs for 1k each
    3) Wait until price crash
    4) Buy red spiders' eggs for lower price
    5) Return red spiders' eggs to original owner, pocket the difference.

    It's like reverse merching... anyone know a sucker who wants to give items away?

    Scripts: Edgeville Chop & Bank, GE Merchanting Aid
    Tutorials: How to Dominate the Grand Exchange

    Quote Originally Posted by YoHoJo View Post
    I like hentai.

  5. #5
    Join Date
    Dec 2014
    Posts
    383
    Mentioned
    2 Post(s)
    Quoted
    206 Post(s)

    Default

    wow, i was literally about to go and make a script for this after browsing some wiki.tips on money making.

    guess that's a no go = |

  6. #6
    Join Date
    Jun 2012
    Posts
    44
    Mentioned
    0 Post(s)
    Quoted
    25 Post(s)

    Default

    Thank you very much cosmasjdz !

  7. #7
    Join Date
    May 2012
    Posts
    704
    Mentioned
    4 Post(s)
    Quoted
    147 Post(s)

    Default

    Well I tested it and it runs pretty much flawlessly.



    My first run and I guess it just reached the limit and did not restart itself.

    The only flaws could be that it hovers over the eggs and waits before clicking them, same with the right click. The rest is working without any problems or doubts.

    Awesome script CosmasJDZ!

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

    Default

    Quote Originally Posted by Im New Sry View Post
    Well I tested it and it runs pretty much flawlessly.



    My first run and I guess it just reached the limit and did not restart itself.

    The only flaws could be that it hovers over the eggs and waits before clicking them, same with the right click. The rest is working without any problems or doubts.

    Awesome script CosmasJDZ!
    It should have restart itself. But sometimes smart freezes and fails to log in. Also the hovering is porehover probably and if you using classic camera it seems weird. Its intended to run on rs3 camera. And its pretty stable last weeks i runned it hadnt even sigle bug only connection losts prevented me from 6 hours runs. Botted over 1m eggs more like 1.4m or so banned like ~15 accounts total but on older versions. This version runned few weeks 24 accounts all alive and hapilly botting swamp lizzards now, one guy got 57 summ from 10 doing this, bunch of 40's. Youll notice 25 takes 2weeks > Pretty safe too as i estimate goldfarming scripts last 3 weeks average for me before ban

  9. #9
    Join Date
    May 2012
    Posts
    704
    Mentioned
    4 Post(s)
    Quoted
    147 Post(s)

    Default

    Quote Originally Posted by cosmasjdz View Post
    It should have restart itself. But sometimes smart freezes and fails to log in. Also the hovering is porehover probably and if you using classic camera it seems weird. Its intended to run on rs3 camera. And its pretty stable last weeks i runned it hadnt even sigle bug only connection losts prevented me from 6 hours runs. Botted over 1m eggs more like 1.4m or so banned like ~15 accounts total but on older versions. This version runned few weeks 24 accounts all alive and hapilly botting swamp lizzards now, one guy got 57 summ from 10 doing this, bunch of 40's. Youll notice 25 takes 2weeks > Pretty safe too as i estimate goldfarming scripts last 3 weeks average for me before ban
    How do I change the camera angle though?

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

    Default

    Quote Originally Posted by Im New Sry View Post
    How do I change the camera angle though?
    Game setting->controls-> camera type.

  11. #11
    Join Date
    May 2012
    Posts
    704
    Mentioned
    4 Post(s)
    Quoted
    147 Post(s)

    Default

    Quote Originally Posted by cosmasjdz View Post
    Game setting->controls-> camera type.
    Huh. The type is RS3. Well, the good thing is that it runs well so no problems whatsoever.

  12. #12
    Join Date
    Jun 2007
    Location
    The land of the long white cloud.
    Posts
    3,702
    Mentioned
    261 Post(s)
    Quoted
    2006 Post(s)

  13. #13
    Join Date
    Mar 2015
    Posts
    9
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    Blows my mind!

  14. #14
    Join Date
    Feb 2014
    Posts
    2
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    This looks like a great script! will try it out , thanks cosmas!

  15. #15
    Join Date
    Dec 2014
    Posts
    383
    Mentioned
    2 Post(s)
    Quoted
    206 Post(s)

    Default

    my eyes might be playing tricks on me, but has red spider eggs gone up for 2 days straight? lol

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

    Default

    Quote Originally Posted by theholyone View Post
    my eyes might be playing tricks on me, but has red spider eggs gone up for 2 days straight? lol
    Indeed it did, probably cause of huge banwave monday. Bond rised from 6,1 to 8,5!milion at one point yesterday compared to saturday/sunday. Maybe rivals got banned, you never know. I know one farmer lost over 150 swamp lizzards bots but lizzards going up tho, jagex drop powerbot or whatever injection they use like leaves, never seen anyone above 78 hunting using these while some opengl/color exists and works pretty flawlessly, mine ones *spits 3 times over lef shoulder* 450k lizzys no single ban yet . But still dont regret making it public cause it isnt so good cash now around 350k/h so equivalent to 200k/h in f2p somehow worth botting. Other activities i am doing generating 700k+++money. Yesterday had earned 37m on one account while testing very first phases of script, got ambitious project for next month, maybe two

  17. #17
    Join Date
    Dec 2014
    Posts
    383
    Mentioned
    2 Post(s)
    Quoted
    206 Post(s)

    Default

    tell me about it, i paid 9M for a bond today out of desperation to test my own script =P

  18. #18
    Join Date
    Sep 2014
    Posts
    447
    Mentioned
    10 Post(s)
    Quoted
    203 Post(s)

    Default

    Quote Originally Posted by cosmasjdz View Post
    Indeed it did, probably cause of huge banwave monday. Bond rised from 6,1 to 8,5!milion at one point yesterday compared to saturday/sunday. Maybe rivals got banned, you never know. I know one farmer lost over 150 swamp lizzards bots but lizzards going up tho, jagex drop powerbot or whatever injection they use like leaves, never seen anyone above 78 hunting using these while some opengl/color exists and works pretty flawlessly, mine ones *spits 3 times over lef shoulder* 450k lizzys no single ban yet . But still dont regret making it public cause it isnt so good cash now around 350k/h so equivalent to 200k/h in f2p somehow worth botting. Other activities i am doing generating 700k+++money. Yesterday had earned 37m on one account while testing very first phases of script, got ambitious project for next month, maybe two
    Very well designed script, although some of the antiban stuff may have gone over my head. I won't ask what methods you are doing in particular, but do you have any suggestions on how to think of unique money making methods? I really want to get back into coding and rs, but I'm completely out of ideas.

  19. #19
    Join Date
    Jun 2013
    Posts
    22
    Mentioned
    0 Post(s)
    Quoted
    9 Post(s)

    Default

    having issue just spam clicks spider pouch and spawns banks grabs another and spam clicks it repeadtly

  20. #20
    Join Date
    Jul 2013
    Posts
    91
    Mentioned
    0 Post(s)
    Quoted
    44 Post(s)

    Default

    It won't spam click to spawn the eggs any chance on an update?

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

    Default

    Quote Originally Posted by icode View Post
    It won't spam click to spawn the eggs any chance on an update?
    Summon interface has been changed. Fixed some positions and colors. Make sure your spawn button to be in a red box. And as close as in picture interface width and heigth.



    Script:

    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: http://i.imgur.com/UhRQzL1.png?1

    Graphics mode opengl preffered.

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

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

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

     }


    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, 7822103, inttobox(168 - (5 * i), 145, 169 - (5 * i), 160), 15, colorSetting(2, 0.02, 2.0)) 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;
    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));
            Mousebox(inttobox(17, 110, 33, 126), mouse_left);
            Wait(gaussrangeint(150, 450));
          end;
        1275..3499:
          begin
            Mousebox(inttobox(17, 110, 33, 126), 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));
            Mousebox(inttobox(17, 110, 33, 126), 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(17, 110, 33, 126),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.

    For me tested 15 mins it works fine. Dont forget run on OpenGl graphics mode. If something wrong let me know.

  22. #22
    Join Date
    Jul 2013
    Posts
    91
    Mentioned
    0 Post(s)
    Quoted
    44 Post(s)

    Default

    Quote Originally Posted by cosmasjdz View Post
    Summon interface has been changed. Fixed some positions and colors. Make sure your spawn button to be in a red box. And as close as in picture interface width and heigth.



    Script:

    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: http://i.imgur.com/UhRQzL1.png?1

    Graphics mode opengl preffered.

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

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

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

     }


    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, 7822103, inttobox(168 - (5 * i), 145, 169 - (5 * i), 160), 15, colorSetting(2, 0.02, 2.0)) 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;
    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));
            Mousebox(inttobox(17, 110, 33, 126), mouse_left);
            Wait(gaussrangeint(150, 450));
          end;
        1275..3499:
          begin
            Mousebox(inttobox(17, 110, 33, 126), 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));
            Mousebox(inttobox(17, 110, 33, 126), 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(17, 110, 33, 126),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.

    For me tested 15 mins it works fine. Dont forget run on OpenGl graphics mode. If something wrong let me know.
    I knew it had something to do with the colors I just couldnt figure out how to change it thank you

  23. #23
    Join Date
    Jun 2015
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    nvm im didnt read
    Last edited by zahid; 06-07-2015 at 12:06 AM.

  24. #24
    Join Date
    Sep 2014
    Posts
    447
    Mentioned
    10 Post(s)
    Quoted
    203 Post(s)

    Default

    Quote Originally Posted by zahid View Post
    Have you thought of implementing the use of summoning potions?Just an idea from the wikia i came across.
    ...It already uses summoning potions??? I'm pretty sure this script couldn't exist if it didn't use summoning potions.

  25. #25
    Join Date
    Sep 2014
    Posts
    37
    Mentioned
    0 Post(s)
    Quoted
    18 Post(s)

    Default

    Loot All would be great improvment. When theres 3 and more items on same spot it opens loot window and there you can press loot all and it takes all items on that pile.

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

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

Posting Permissions

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