Page 7 of 7 FirstFirst ... 567
Results 151 to 170 of 170

Thread: Adieux's Pest Control

  1. #151
    Join Date
    Sep 2015
    Location
    The Netherlands
    Posts
    30
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    I have a problem when starting up the script:
    Error: Expected variable of type "array [0..1] of Int32", got "Int32" at line 748, column 12 at line 748
    Compiling failed.

  2. #152
    Join Date
    May 2015
    Posts
    25
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    Code:
    Error: Expected variable of type "array [0..1] of Int32", got "Int32" at line 748, column 12 at line 748
    Compiling failed.
    Simba Code:
    ogl.setup();

  3. #153
    Join Date
    Aug 2015
    Posts
    27
    Mentioned
    1 Post(s)
    Quoted
    14 Post(s)

    Default

    Quote Originally Posted by Guiri View Post
    Code:
    Error: Expected variable of type "array [0..1] of Int32", got "Int32" at line 748, column 12 at line 748
    Compiling failed.
    Simba Code:
    ogl.setup();
    You need to pass values in, so it should be ogl.setup(800,600);



    I'm having issues even getting the script started.

    Here's the message I'm getting:

    22:36:25 | Adieuxs PestControl v2.4 > debug
    22:36:25 | Adieuxs PestControl v2.4 > tSmart.setPair() successful
    Were outside starting script
    Reset camera
    Crossing plank
    WARNING: Did not make it onto the boat, checking one more time
    Still not in boat after searching, terminating...
    Terminating...
    Successfully executed.

    It's not crossing the plank, and so it just terminates. Sometimes it goes 2 squares away towards the island and fails like this:
    https://gyazo.com/761128eee62419d02e02f676e4301ebf

    I have it all correctly set up, and latest versions of ogLib and other files.
    Last edited by chickenfoot911; 11-10-2015 at 04:42 AM.

  4. #154
    Join Date
    Feb 2014
    Posts
    58
    Mentioned
    1 Post(s)
    Quoted
    28 Post(s)

    Default

    Quote Originally Posted by recs7168 View Post
    Never mind, I got it to work. However, there is an access violation that occurs in method every once in a while. Not every game. Normally happens after three games but it has run for hours before.

    Error: Access violation at line 561

    Line 561 in method: begin exit(tPoint([self.x,self.y]));end;

    Occasionally one will occur in actionBar too.

    Line 718: if (funcPointer^.id=79816) and (funcPointer^.colourID=15419436) then


    ---
    Aside from errors,

    I've been running this for almost 9000 points. Approximated from the 1100+ thalor I have and having never played during spotlight.

    In 2.3, the actionBar method occurred often. But normally wouldn't occur until late (around the 50+ games). Also, the script would also take me to the main island and then fail pretty often. Have not tested 2.4 enough to see if this still happens.

    In 2.4, I've been able to run for 4 hours once. But for now, errors pop up after a handful of games.
    Hey bro, did you figure out how to make this run? I am still getting the same error and wish to fix it

  5. #155
    Join Date
    Aug 2015
    Posts
    27
    Mentioned
    1 Post(s)
    Quoted
    14 Post(s)

    Default

    For those looking for a fix to all the compiling and graphical errors, this got it working for me.
    Code:
    program AdieuxsPestControl;
    {$i ogLib\lib\core\core.simba}
    {
      Pestcontrol Script by: Adieux at Villavu
    
      Please make sure to visit the forum post here: https://villavu.com/forum/showthread.php?t=114186
      if you have any questions or comments.
    
      Set up is simple.
      Step 1: Read the forum post
      Step 2: Change the 2 Constants below to what you desire them to be
      Step 3: Hit run, let SMART load, stop the script, log into account
      Step 4: Start outside the boat near the plank, or inside the boat, or inside Pestcontrol and hit Run again
      Step 5: Enable Debug in SMART if you want to see progress screen/paint
    
      If you get any bugs or errors please report them, also please post any progress reports/give feedback.
    
    
      Shoutouts to Obscurity for being such an awesome and helpful person.
      This script wouldn't be nearly as good without him
    
    
      Thank you for using my script!
    }
    
    ////////////////////////////IMPORTANT SETUP////////////////////////////////////////////////////////////////////////////////////////////
    
    const
      GAMES_TO_PLAY := 200;    //Change this value to how many games you want to play, will terminate after said amount
      QUICK_PRAYERS := false;  //Do you want to use Quick Prayers?
      USING_ABILITIES := false; //Do you want to use abilities? If false, then ignore the bottom bit.
    
    
      ///Fill out if using abilities, just input the name of the ability you're using, ability bar must be open and ability must be on bar
      //DO NOT USE SPACES, OR CAPITALIZE
      THRESHOLD_1 := '';
      THRESHOLD_2 := '';
      THRESHOLD_3 := '';
      THRESHOLD_4 := '';
      ULTIMATE := 'metamorphosis';
    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    
      //This scripts version
      LOCAL_VERSION := 2.4;
    
    
    
    
    
    
    
    var
      gamesPlayed, timesResetCamera, deathCounter, timesRotatedCamera, timesCompleted, timesFailed, timesKnightDied, whereDidWeStart, scriptPaintBMP: integer;
      rewardsLady, knightChatModel, damageModel, allModels, allPortals, veteranFlagModel, bootsModel: glModelArray;
      failedChat: glTextureArray;
      distanceFrom: extended;
      paintTimer, canAttack, canRotate, canUseAbility: tCountDown;
      ability: char;
      clientCenter: TPoint := ogl.getClientMidPoint ();
      x,y: int32;
    {
     Override until Obscurity fixes the ID's
    }
    
    function tDialogue.clickContinue():boolean;
    override;
    var
      funcPointer:^glTexture;
      funcPointerSize:uInt32;
    begin
      funcPointer:=glTextures(funcPointerSize)+(oglTextureSize*(funcPointerSize-2));
      for 1 to funcPointerSize-1 do
      begin
        if funcPointer^.id=142800 then
        begin
          mouse.click(funcPointer^.bounds);
          result:=true;
          break;
        end;
        funcPointer-=oglTextureSize;
      end;
      exit(result);
    end;
    {
    Procedure: waitFlag;
    Description: Waits for the flag on the mini-map to go away, while walking, tweaked some from original.
    Credit: Ross ---> https://villavu.com/forum/member.php?u=148198
    }
    procedure waitFlag;
    var
      timeWalking: tCountDown;
    begin
      timeWalking.setTime(random(20000,30000));
      wait(500);
      while ((not ogl.getTextures(1275).isEmpty()) and (not damageModel.isEmpty()) and (not timeWalking.isFinished())) do
      begin
        wait(randomRange(500, 700));
        damageModel := ogl.getModels(2263255518);
      end;
    end;
    {
    Function: tileWalk
    Description: Walks to the tiles sent to the function, has some randomization.
    Credit: Ross ---> https://villavu.com/forum/member.php?u=148198
    }
    function tileWalk(randomization: integer; offSetTiles: TPointArray): boolean;
    var
      rx, ry, i: integer;
    begin
      for i := 0 to high(offSetTiles) do
      begin
        rx := randomrange( - (randomization), randomization);
        ry := randomrange( - (randomization), randomization);
        mouse.click(minimap.getScreenPosition(minimap.getLocalPosition().adjustposition(offsetTiles[i].x + rx, offsetTiles[i].y + ry)), 1);
        if ((offSetTiles[i].y > 20) or (offSetTiles[i].y < - 20)) or ((offSetTiles[i].x > 15) or (offSetTiles[i].x < - 15)) then
          wait(3500)
        else
          wait(1000);
        waitflag;
      end;
    end;
    {
    Procedure: antiBan
    Description: Will perform antiban, pretty simple anti ban
                Just walks to somewhere on the boat, randomly.
                If anyone has any other suggestions for antiban, let me know
    }
    procedure antiBan(doWePerform: boolean);
    var
      skillTab, backPackTab: glTextureArray;
      skillHover: tPoint;
    begin
      if (doWePerform) then
      begin
        writeLn('Performing anti-ban');
        case random(100) of
          0..25:
            begin
              tileWalk(3, [[ - 2, - 3]]);
            end;
          26..50:
            begin
              tileWalk(3, [[3, - 3]]);
            end;
          51..75:
            begin
              tileWalk(3, [[4, 5]]);
            end;
          76..100:
            begin
              tileWalk(3, [[ - 6, 5]]);
            end;
        end;
      end
      else if (not doWePerform) then
      begin
        writeLn('No antiban right now');
        exit;
      end;
    end;
    {
    Procedure: doWePerformAntiBan
    Description: Desides if we do or do not perform antiban
                 most of the time will decide not to
                 If you prefer more anti ban, change the values below
    }
    procedure doWePerformAntiBan();
    var
      doWe: boolean;
    begin
      case random(100) of
        0..80:
          begin
            doWe := false;
            antiBan(doWe);
          end;
        81..100:
          begin
            doWe := true;
            antiBan(doWe);
          end;
      end;
    end;
    {
    Procedure: convertTheTime
    Description: Converts the time from milliseconds to more formal time
                 receives getTimeRunning
    }
    function convertTheTime(time: uInt32): string;
    var
      seconds, minutes, hours: extended;
    begin
      seconds := (time mod 3600000 mod 60000 div 1000);
      minutes := (time mod 3600000 div 60000);
      hours := (time div 3600000);
      result := (ToStr(hours) + ' hour(s)  ' + toStr(minutes) + ' minutes  ' + ToStr(seconds) + ' seconds');
    end;
    {
    Procedure: progressReport
    Description: Prints out a simple progress report to the use
    }
    procedure progressReport();
    var
      time: string;
      pointsEarned: integer;
    begin
      if (paintTimer.isFinished()) then
      begin
        time := ConvertTheTime(GetTimeRunning());
        pointsEarned := (((timesCompleted) * 4));
        smart.Graphics.Clear;
        smart.graphics.drawBitmap(scriptPaintBMP, Point(0, 465));
        smart.Graphics.DrawText('Time Running: ' + time, 'upCharsEx', point(5, 490), clWhite);
        smart.Graphics.DrawText('Points Earned: ' + toStr(pointsEarned), 'upCharsEx', point(5, 510), clAqua);
        smart.Graphics.DrawText('Times Knight Died: ' + toStr(timesKnightDied), 'upCharsEx', point(5, 530), clRed);
        smart.Graphics.DrawText('Times Failed: ' + toStr(timesFailed), 'upCharsEx', point(5, 550), clRed);
        smart.Graphics.DrawText('Version: ' + toStr(LOCAL_VERSION), 'smallChars', point(5, 580), clWhite);
        paintTimer.setTime(15000);
      end
      else
        exit;
    end;
    {
    Procedure: terminateTheScript
    Description: Terminates and frees bitmap
    }
    procedure terminateTheScript();
    begin
      FreeBitmap(scriptPaintBMP);
      writeLn('Terminating...');
      TerminateScript;
    end;
    {
    Procedure: rotateCamera
    Description: Rotates the camera, has a random range of rotation
    }
    procedure rotateCamera();
    begin
      wait(randomRange(200,300));
      mainScreen.setDegrees(random(0, 360), random(10,35));
      canRotate.setTime(random(1500,2000));
      timesRotatedCamera := timesRotatedCamera + 1;
    end;
    {
    Procedure: selectBoots
    Description: Selects minigame boots randomly
    Credit: Obscurity ---> https://villavu.com/forum/member.php?u=102053
    }
    procedure selectBoots;
    begin
      writeLN('[procedure] selectBoots');
      if length(bootsModel := ogl.getModels(tCardinalArray([940746976,432722987,3341867181]))) then
      begin
        if random(5)=0 then
          mouse.rightClickOption(bootsModel[random(3)].randomizePointEllipse(30),'Select')
        else
          mouse.click(bootsModel[random(3)].randomizePointEllipse(30));
      end;
      wait(randomRange(4000,5000));
      dialogue.clickContinue();
      wait(randomRange(1500,2000));
    end;
    {
    Procedure: crossGangplank
    Description: Crosses the gangplank, randomly selects between right clicking
                 and left clicking.
    }
    procedure crossGangplank();
    var
      modelArray: glModelArray;
      plankModel: glModelArray;
    begin
      writeLn('Crossing plank');
      begin
        case random(100) of
          0..100:
            begin
              modelArray := ogl.getModels(tCardinalArray([1781393848,2892440677,3763942768,4136683396,4168949912]));
              plankModel := modelArray.closestTo(ogl.getclientMidPoint());
              plankModel[0].toPoint();
              mouse.click(plankModel[0].adjustPosition(0,5).randomizePointEllipse(4))
            end;
           {  disabled for right now due to minigame spotlight causing a lot of people to play
              which causes right click to be
              filled with a bunch of
              player names
          0..:
            begin
              mouse.rightClickOption(plankTPA[0].adjustPosition(0,5).randomizePointEllipse(4),['Cross','Gangplank >']);
            end;
           }
        end;
      end
    end;
    {
    Procedure: startGame
    Description: Starts the game, calls crossGangplank and sets the
                 variables needed for the paint.
    }
    procedure startGame();
    var
      plankPosition: tPoint = [67,63];
    begin
    
      wait(RandomRange(2000,2500));
      rewardsLady := ogl.getModels(1538643377);
      knightChatModel := ogl.getModels(3360933869);
      failedChat := ogl.getTextures(714000);
      bootsModel := ogl.getModels(tCardinalArray([940746976,432722987,3341867181])).getVisible();
    
      if (not bootsModel.isEmpty()) then
        selectBoots;
    
      if (not rewardsLady.isEmpty()) then
      begin
        writeLn('We won, +4 points');
        timesCompleted := timesCompleted + 1;
        gamesPlayed := gamesPlayed + 1;
      end
      else if (not knightChatModel.isEmpty()) then
      begin
        writeLn('Knight died, RIP.');
        timesKnightDied := timesKnightDied + 1;
        gamesPlayed := gamesPlayed + 1;
      end
      else if (not failedChat.isEmpty()) then
      begin
        writeLn('We failed to get enough damage, will try harder next time');
        timesFailed := timesFailed + 1;
        gamesPlayed := gamesPlayed + 1;
      end;
    
      if (dialogue.hasDialogue()) then
      begin
        writeLn('Clicking continue');
        repeat
          dialogue.clickContinue();
          wait(randomRange(1000,1200));
        until (not dialogue.hasDialogue());
      end;
      wait(RandomRange(1200,1500));
      if (timesResetCamera < 1) then
      begin
        case random(100) of
          0..50: begin
                  minimap.clickResetCamera();
                  timesResetCamera := timesResetCamera + 1;
                 end;
          51..100: begin
                    mainscreen.setDegrees(0,50);
                    timesResetCamera := timesResetCamera + 1;
                   end;
        end;
        writeLn('Reset camera');
      end;
    
      distanceFrom := (minimap.getLocalPosition().distanceFrom(plankPosition));
      if (distanceFrom > 3) and (timesResetCamera <= 1) then
      begin
        writeLn('Distance from plank ' + ToStr(distanceFrom) + ' walking there now');
        mouse.click(minimap.getScreenPosition([67,63]).randomizePointEllipse(12));
        wait(round(distanceFrom * 1000));
      end;
      wait(randomRange(2000,2200));
      bootsModel := ogl.getModels(tCardinalArray([940746976,432722987,3341867181])).getVisible();
      if (not bootsModel.isEmpty()) then
        selectBoots;
    
      crossGangplank();
    end;
    {
    Procedure: areWeInBoat
    Description: Checks for the veteran flag minigame model that shows up
                when we get into the boat, if its not there will try to look
                for it again, since sometimes lag causes issues, if it cant find that
                checks to see if were inside pest control because sometimes
                the boat leaves so fast the model doesnt show up
                IF none of those two check out, will terminate.
    }
    
    procedure areWeInBoat();
    begin
      wait(round((2 + distanceFrom) * 500));
      veteranFlagModel := ogl.getModels(3040129356);
      if not veteranFlagModel.isEmpty() then
        writeLn('We made it onto the boat, cool')
      else if veteranFlagModel.isEmpty() then
      begin
        writeLn('WARNING: Did not make it onto the boat, checking one more time');
        wait(randomRange(3000,5000));
        veteranFlagModel := ogl.getModels(3040129356);
        damageModel := ogl.getModels(2263255518);
    
        if (not veteranFlagModel.isEmpty()) then
          writeLn('We actually made it in, never mind...')
        else if (not damageModel.isEmpty()) then
          writeLn('Were inside pest control...LAG?')
        else if (veteranFlagModel.isEmpty()) and (damageModel.isEmpty()) then
          begin
            writeLn('Still not in boat after searching, terminating...');
            TerminateTheScript();
          end;
      end;
      timesRotatedCamera := 0;
    end;
    {
    Procedure: waitForGameToStart
    Description: Waits until it finds the damage icon model from pest control
                (thanks obscurity for the idea to use that model)
    }
    procedure waitForGameToStart();
    var
      timeWaiting: tCountDown;
    begin
      timeWaiting.setTime(random(240000, 270000));
      doWePerformAntiBan();
      writeLn('Waiting for game to start...');
      actionBar.setQuickPrayer(false);
      repeat
        progressReport();
        damageModel := ogl.getModels(2263255518);
        wait(randomRange(500, 700));
      until not damageModel.isEmpty() or timeWaiting.isFinished();
      if (not damageModel.isEmpty()) then
        writeLn('Game started!');
      if timeWaiting.isFinished() then
      begin
        writeLn('Took too long to start game, terminating...');
        TerminateTheScript();
      end
      else
        exit;
    end;
    {
    Procedure: whereDoWeWalkTo
    Description: Decides what side of the game to walk to, favors the south more
                 you can change the values to whatever you want
                 Note: if we died, will just wait longer to start walking because of animation
    }
    procedure whereDoWeWalkTo();
    begin
      begin
        damageModel := ogl.getModels(2263255518);
    
        if damageModel.isEmpty() then
          exit;
    
        wait(RandomRange(900, 1100));
        case random(60) of
          0..30:
            begin
              wait(randomRange(1000, 1500));
              writeLn('Walking to the south');
              tileWalk(2, [[0, 18], [0, 10], [0, 10]]);
            end;
          31..45:
            begin
              wait(randomRange(1000, 1500));
              writeLn('Walking to the west');
              tileWalk(2, [[ - 10, 20], [ - 10, 5]]);
            end;
          46..60:
            begin
              wait(randomRange(1000, 1500));
              writeLn('Walking to the east');
              tileWalk(2, [[15, 15], [10, 10]]);
            end;
        end
      end
    end;
    {
    Procedure: weDied
    Description: Dang we died, will just call whereDoWeWalkTo
    }
    procedure weDied();
    begin
      writeLn('We died.');
      repeat
        wait(randomRange(600,700));
      until ((actionbar.getLifePoints > 0)<>0) or (dialogue.hasDialogue());
      if (not dialogue.hasDialogue()) then
        whereDoWeWalkTo()
      else
        exit;
      deathCounter := 0;
    end;
    {
    Procedure: attackPest
    Description: Clicks on the sent model, checks after clicking to see if we have
                 a target or not, if we do it waits till we dont, if we dont have one
                 will just exit
    }
    procedure attackPest();
    var
      pestModelArray: glModelArray;
      timeAttacking: tCountDown;
      pestModel: glModelArray;
    begin
      case random(100) of
        0..50:
          begin
            pestModel := ogl.getModels(TCardinalArray([1731643360,2782989724,2899052740,3489785670,3915285997,547053328,617765920])).closestTo(ogl.getClientMidPoint).getVisible();
            pestModel[0].toPoint();
            mouse.rightClickOption(pestModel[0].adjustPosition(0,-25).randomizePointEllipse(20),['Attack Brawler','Attack Defiler','Attack Shifter','Attack Spinner','Attack Splatter','Attack Torcher']);
          end;
        51..100:
          begin
            pestModel := ogl.getModels(TCardinalArray([1731643360,2782989724,2899052740,3489785670,3915285997,547053328,617765920])).closestTo(ogl.getClientMidPoint).getVisible();
            pestModel[0].toPoint();
            mouse.click(pestModel[0].adjustPosition(0,-25).randomizePointEllipse(20));
          end;
      end;
    
      canAttack.setTime(random(1500,1800));
    end;
    procedure attackPortal();
    var
      portalModelArray: glModelArray;
      timeAttacking: tCountDown;
      portalModel: glModelArray;
    begin
    begin
      case random(100) of
        0..50:
          begin
            writeLn('Portal is open, attacking');
            portalModel := ogl.getModels(TCardinalArray([2547232634, 1446295722])).closestTo(ogl.getClientMidPoint).getVisible();
            portalModel[0].toPoint();
            mouse.rightClickOption(portalModel[0].adjustPosition(0,-25).randomizePointEllipse(20),['Attack Portal']);
          end;
        51..100:
          begin
            writeLn('Portal is open, attacking');
            portalModel := ogl.getModels(TCardinalArray([2547232634, 1446295722])).closestTo(ogl.getClientMidPoint).getVisible();
            portalModel[0].toPoint();
            mouse.click(portalModel[0].adjustPosition(0,-25).randomizePointEllipse(20));
          end;
      end;
    end;
      canAttack.setTime(random(3000,3400));
    end;
    {
    Procedure: useAbilities
    Description: Will randomly use one of the abilities that were selected on setup
                 Checks for cooldowns, etc
    }
    procedure useAbilities(adrenaline: int32);
    begin
      wait(randomRange(400, 600));
    
    
      if (adrenaline >= 100) then
      begin
        if (actionbar.isAbilityQueued(ULTIMATE)) then
        begin
          exit;
        end;
        writeLn('Using ultimate');
        sendKeys(LowerCase(actionBar.getAbilityKey(ULTIMATE)), 10 + normalRandom(0, 20) * 5, 10 + normalRandom(0, 20) * 5);
        canUseAbility.setTime(random(6000, 8000));
      end;
    
      case random(200) of
        0..50:
          begin
            if (actionbar.isAbilityQueued(THRESHOLD_1)) then
              exit;
            writeLn('Using threshold number 1');
            sendKeys(LowerCase(actionBar.getAbilityKey(THRESHOLD_1)), 10 + normalRandom(0, 20) * 5, 10 + normalRandom(0, 20) * 5);
          end;
        51..100:
          begin
            if (actionbar.isAbilityQueued(THRESHOLD_2)) then
              exit;
            writeLn('Using threshold number 2');
            sendKeys(LowerCase(actionBar.getAbilityKey(THRESHOLD_2)), 10 + normalRandom(0, 20) * 5, 10 + normalRandom(0, 20) * 5);
          end;
        101..150:
          begin
            if (actionbar.isAbilityQueued(THRESHOLD_3)) then
              exit;
            writeLn('Using threshold number 3');
            sendKeys(LowerCase(actionBar.getAbilityKey(THRESHOLD_3)), 10 + normalRandom(0, 20) * 5, 10 + normalRandom(0, 20) * 5);
          end;
        151..200:
          begin
            if (actionbar.isAbilityQueued(THRESHOLD_4)) then
              exit;
            writeLn('Using threshold number 4');
            sendKeys(LowerCase(actionBar.getAbilityKey(THRESHOLD_4)), 10 + normalRandom(0, 20) * 5, 10 + normalRandom(0, 20) * 5);
          end;
      end;
    end;
    {
    Procedure: insidePestControl
    Description: Loop for when inside pest control, will stop looping when it
                 doesnt find the damage model inside of PC
                 (the chat box that says we failed, the lady telling us we did good, and the kngiht)
    }
    procedure insidePestControl();
    var
      timeSpentInGame, timeWaitingForNewGame: tCountDown;
      adrenaline: int32;
    begin
      timesResetCamera := 0;
      whereDoWeWalkTo();
      mainScreen.setDegrees(random(0,20),random(10,20));
      actionbar.setQuickPrayer(QUICK_PRAYERS);
      if (not actionbar.getAutoRetaliate()) then
        actionbar.setAutoRetaliate(true);
      timeSpentInGame.setTime(random(360000, 420000));
      repeat
        progressReport();
        wait(randomRange(300,700));
        allModels := ogl.getModels(TCardinalArray([1731643360,2782989724,2899052740,3489785670,3915285997,547053328,617765920])).getVisible();
        allPortals := ogl.getModels(TCardinalArray([2547232634, 1446295722])).getVisible();
        damageModel := ogl.getModels(2263255518);
    
        if (not allPortals.isEmpty()) and (canAttack.isFinished()) then
            attackPortal()
        else if (combat.hasTarget()) then
        begin
          writeLn('In combat, waiting...');
          repeat
            adrenaline := actionbar.getAdrenaline();
    
            if (adrenaline >= 50 <>0) and (canUseAbility.isFinished()) then
              begin
                useAbilities(adrenaline);
                canUseAbility.setTime(random(6000, 8000));
              end;
            wait(RandomRange(500,600));
            allPortals := ogl.getModels(TCardinalArray([2547232634, 1446295722])).getVisible();
            damageModel := ogl.getModels(2263255518);
          until (not combat.hasTarget()) or (timeSpentInGame.isFinished()) or ((actionbar.getLifePoints <= 0)<>0) or (not allPortals.isEmpty()) or (damageModel.isEmpty());
        end
        else if (not combat.hasTarget()) then
        begin
          if (allModels.isEmpty()) and (canRotate.isFinished()) then
          begin
            writeLn('Rotating to find pest');
            rotateCamera();
          end
          else if (not allModels.isEmpty()) and (canAttack.isFinished()) then
            attackPest();
        end;
    
        if (actionbar.getLifePoints <= 0) then
          weDied();
    
        if (timesRotatedCamera = 5) then
        begin
          writeLn('Couldnt find pests...walking south a bit to see if we can find anything');
          tileWalk(2, [[0, 8]]);
          timesRotatedCamera := timesRotatedCamera + 1;
        end;
    
      until (timeSpentInGame.isFinished()) or (dialogue.hasDialogue()) or  (timesRotatedCamera >= 10);
    
      if (timesRotatedCamera >= 10) then
      begin
        writeLn('Couldnt find pests after multiple camera rotates, waiting for new game [area most likely clear]');
        actionbar.setQuickPrayer(false);
        timeWaitingForNewGame.setTime(random(210000,230000));
        repeat
          wait(RandomRange(500,600));
          damageModel := ogl.getModels(2263255518);
        until (timeWaitingForNewGame.isFinished()) or (damageModel.isEmpty());
    
        if (timeWaitingForNewGame.isFinished()) then
        begin
          writeLn('Game took too long to start again');
          terminateTheScript();
        end;
      end;
    
      if (timeSpentInGame.isFinished()) then
      begin
        writeLn('Time in game lasted too long');
        terminateTheScript();
      end;
    end;
    {
    Procedure: whereAreWe();
    Description: Detects where we are based on certain models
                 will call the appropriate procedure or function
                 (only runs once)
    }
    procedure whereAreWe();
    begin
      wait(randomRange(500, 600));
      veteranFlagModel := ogl.getModels(3040129356);
      damageModel := ogl.getModels(2263255518);
      if (veteranFlagModel.isEmpty()) and (damageModel.isEmpty()) then
      begin
        writeLn('Were outside starting script');
        whereDidWeStart := 1;
      end
      else if (not veteranFlagModel.isEmpty()) then
      begin
        writeLn('Were in the boat...starting script');
        whereDidWeStart := 2;
      end
      else if (not damageModel.isEmpty()) then
      begin
        writeLn('Were inside pestcontrol...starting script');
        whereDidWeStart := 3;
      end;
    end;
    {
      Procedure: autoUpdateMe();
      Description: Checks to see if you have the lastest version of the script
      Credit: Fady --> https://villavu.com/forum/member.php?u=152795
    }
    procedure autoUpdateMe();
    var
      newFile: integer;
      newScript, newFilePath: string;
      online_Version: extended;
    begin
      writeLn('Checking for updates...');
      online_Version := strToFloat(getPage('http://static.frement.net/proxy.php?u=https://raw.githubusercontent.com/Introvertt/Adieuxs-Pestcontrol/master/Version.txt'));
      writeLn('Local Version ' + toStr(LOCAL_VERSION) + ', Online Version: ' + toStr(online_Version)+'.');
    
      if online_Version > Local_Version then
      begin
        writeLn('Downloading the latest script version from GitHub');
        newScript := getPage('http://static.frement.net/proxy.php?u=https://raw.githubusercontent.com/Introvertt/Adieuxs-Pestcontrol/master/Adieuxs%20Pestcontrol.simba');
        newFilePath := scriptPath+ 'Adieuxs Pestcontrol v' + toStr(online_Version) +'.simba';
        newFile := rewriteFile(newFilePath, true);
    
        if not writeFileString(newFile, newScript) then
        begin
          writeLn('Could not write to ' + newFilePath);
          terminateTheScript();
        end;
    
        closeFile(newFile);
        writeLn('Latest script downloaded to ' + newFilePath);
        writeLn('Please use the new one to run the latest version!');
        terminateScript();
      end else
        writeLn('Local version is already up to date!');
    end;
    begin
    
      autoUpdateMe();
      ogl.setup(800,600);
      GLXViewPort(x,y,x,y);
      ogl.setDebugMode(0);
      scriptPaintBMP := loadBitmap( AppPath + 'scripts\Adieuxs Pestcontrol\AdieuxsPestcontrolPaint.jpg');
      whereAreWe();
      repeat
    
        case (whereDidWeStart) of
          1: begin
              startGame();
              areWeInBoat();
              waitForGameToStart();
              insidePestControl();
              whereDidWeStart := 0
             end;
          2: begin
              waitForGameToStart();
              insidePestControl();
              whereDidWeStart := 0;
             end;
          3: begin
              insidePestControl();
              whereDidWeStart := 0;
             end;
        end;
    
        startGame();
        areWeInBoat();
        waitForGameToStart();
        insidePestControl();
    
      until (gamesPlayed = GAMES_TO_PLAY);
    
      if (gamesPlayed = GAMES_TO_PLAY) then
        begin
          ClearDebug();
          writeLn('We finished playing all our games. Terminating');
          TerminateTheScript();
        end;
    
    end.
    Thanks to Turpinator for aiding me in this process.
    Undercover Jagex Employee

    http://i.imgur.com/TsQJ7RP.jpg

  6. #156
    Join Date
    Apr 2012
    Posts
    15
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    The script compiles but just sits there in front of the plank.

    Were outside starting script
    Reset camera
    Distance from plank 91.9673855233474 walking there now

    Thats the only thing that shows whenever I start the script.

  7. #157
    Join Date
    Aug 2015
    Posts
    27
    Mentioned
    1 Post(s)
    Quoted
    14 Post(s)

    Default

    Quote Originally Posted by EarthAbove View Post
    The script compiles but just sits there in front of the plank.

    Were outside starting script
    Reset camera
    Distance from plank 91.9673855233474 walking there now

    Thats the only thing that shows whenever I start the script.
    Stop the script, log out and close out of SMART.

    START THE SCRIPT again, to get it to open the client. As soon as the client opens, PAUSE the script.
    Wait for it to load, log into your account, and go to the square directly next to the starting plank.
    Click the camera to face NORTH, then click ENABLE SMART.
    Finally, unpause the script, and it should work.

    If not, the retry this process again, maybe next time starting in the boat, etc.
    Undercover Jagex Employee

    http://i.imgur.com/TsQJ7RP.jpg

  8. #158
    Join Date
    Dec 2011
    Posts
    118
    Mentioned
    0 Post(s)
    Quoted
    17 Post(s)

    Default

    Thank you so much!
    It's working now!

  9. #159
    Join Date
    Dec 2011
    Posts
    118
    Mentioned
    0 Post(s)
    Quoted
    17 Post(s)

    Default

    Still not working
    Error: You are accessing an invalid point, (0,465) at bitmap[0] at line 247
    Execution failed.
    The following bitmaps were not freed: [0, 1]

  10. #160
    Join Date
    May 2012
    Posts
    59
    Mentioned
    0 Post(s)
    Quoted
    22 Post(s)

    Default

    doesn't work for me :/

  11. #161
    Join Date
    May 2011
    Location
    In an Island.
    Posts
    1,413
    Mentioned
    2 Post(s)
    Quoted
    149 Post(s)

    Default

    Well, the scripts works really smooth to me. Read the OP and follow the instructions. This script still works.
    ''If you want something you've never had, you have to do something you've never done''


    total leve 2715/1b exp +... exterminated.

  12. #162
    Join Date
    Dec 2015
    Posts
    35
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    Anyone know the fix for the access violation on line 561? I tried installing a new oglib and it didn't work.

  13. #163
    Join Date
    Dec 2011
    Posts
    118
    Mentioned
    0 Post(s)
    Quoted
    17 Post(s)

    Default

    Quote Originally Posted by onilika View Post
    Well, the scripts works really smooth to me. Read the OP and follow the instructions. This script still works.
    Code:
    15:23:52 | Adieuxs PestControl v2.4 > setup
    15:23:52 | Adieuxs PestControl v2.4 > debug
    15:23:52 | Adieuxs PestControl v2.4 > tSmart.setPair() was successful (PID: 15652)
    Were in the boat...starting script
    No antiban right now
    Waiting for game to start...
    Error: You are accessing an invalid point, (0,465) at bitmap[0] at line 247
    Execution failed.
    The following bitmaps were not freed: [0, 1]
    Any fix?

  14. #164
    Join Date
    May 2011
    Location
    In an Island.
    Posts
    1,413
    Mentioned
    2 Post(s)
    Quoted
    149 Post(s)

    Default

    Quote Originally Posted by Mew View Post
    Code:
    15:23:52 | Adieuxs PestControl v2.4 > setup
    15:23:52 | Adieuxs PestControl v2.4 > debug
    15:23:52 | Adieuxs PestControl v2.4 > tSmart.setPair() was successful (PID: 15652)
    Were in the boat...starting script
    No antiban right now
    Waiting for game to start...
    Error: You are accessing an invalid point, (0,465) at bitmap[0] at line 247
    Execution failed.
    The following bitmaps were not freed: [0, 1]
    Any fix?
    Read the OP closely, run as admin (I always run it like that). If doesn't work, I will team view it
    ''If you want something you've never had, you have to do something you've never done''


    total leve 2715/1b exp +... exterminated.

  15. #165
    Join Date
    Dec 2011
    Posts
    118
    Mentioned
    0 Post(s)
    Quoted
    17 Post(s)

    Default

    Quote Originally Posted by Trash View Post
    Anyone know the fix for the access violation on line 561? I tried installing a new oglib and it didn't work.
    Same thing here :/

  16. #166
    Join Date
    Dec 2011
    Posts
    118
    Mentioned
    0 Post(s)
    Quoted
    17 Post(s)

    Default

    Quote Originally Posted by onilika View Post
    Read the OP closely, run as admin (I always run it like that). If doesn't work, I will team view it
    I always run as admin

  17. #167
    Join Date
    May 2016
    Posts
    3
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Simply can't get this script working. Only works if I start in a game and even then I'll get an error.

  18. #168
    Join Date
    Dec 2015
    Posts
    35
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    Guys go through they have answered every error its working perfectly. i will be almost suicide botting this on double points next weekend.

  19. #169
    Join Date
    May 2016
    Posts
    1
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    did you get this to work with the updated island? it just gets stuck at we're outside no matter where i start the script

  20. #170
    Join Date
    Dec 2016
    Posts
    6
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    ha. I think in nowdays biggest problem is to find a worlds where people actually playing this minigame.

Page 7 of 7 FirstFirst ... 567

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
  •