Results 1 to 15 of 15

Thread: Basic Pest Control Script

  1. #1
    Join Date
    Sep 2015
    Posts
    32
    Mentioned
    1 Post(s)
    Quoted
    4 Post(s)

    Default Basic Pest Control Script

    Well it is not the best Script and is mostly a copy and paste of other people's script but it runs pretty well. Already got full void with it and the main problem i have noticed is that it looks like a bot if the gates are closed. Not really gonna work on it , so don't expect updates unless it a quick fix.

    MY ideas if i continued making the script
    - use the colour of the number in the top right of the screen to indicate which portal is alive and move to an active portal.
    - prioritize spinners more so the game is better for everyone
    - Well i don't know how but really needs a way to open the gate, would be easier if it was a game object and not a wall object.



    Pest.png
    Put the map file in the Aerolib maps folder
    Attached Files Attached Files
    Last edited by lizon; 04-26-2016 at 03:01 AM.

  2. #2
    Join Date
    Apr 2013
    Posts
    680
    Mentioned
    13 Post(s)
    Quoted
    341 Post(s)

    Default

    i will take a look at this =D

    <------------------>



  3. #3
    Join Date
    Dec 2013
    Location
    Sweden
    Posts
    269
    Mentioned
    17 Post(s)
    Quoted
    161 Post(s)

    Default

    Great work! I'm still working on my own PC-script, but if I'm not wrong aren't the gates game objects? IIRC I didn't have a problem finding them that way, tho it has been a while.
    "Once you begin to think, you can't stop."

    Life > 0

  4. #4
    Join Date
    Apr 2016
    Posts
    7
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Get and error message Error: Unknown declaration "Pro_InitSocket" at line 86

    Ive tried updating everyingthing but still get it

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

    Default

    Quote Originally Posted by kristi View Post
    Great work! I'm still working on my own PC-script, but if I'm not wrong aren't the gates game objects? IIRC I didn't have a problem finding them that way, tho it has been a while.
    @Kyle; elf, a lot of people seem to have problems detecting doors with the reflection include.

  6. #6
    Join Date
    Dec 2013
    Location
    Sweden
    Posts
    269
    Mentioned
    17 Post(s)
    Quoted
    161 Post(s)

    Default

    Quote Originally Posted by FkingAhhhh View Post
    Get and error message Error: Unknown declaration "Pro_InitSocket" at line 86

    Ive tried updating everyingthing but still get it

    Try redownloading the include and the prosocks plugin

    Quote Originally Posted by hoodz View Post
    @Kyle; elf, a lot of people seem to have problems detecting doors with the reflection include.
    I've noticed that too, usually closed doors
    "Once you begin to think, you can't stop."

    Life > 0

  7. #7
    Join Date
    Apr 2012
    Posts
    108
    Mentioned
    1 Post(s)
    Quoted
    21 Post(s)

    Default

    Quote Originally Posted by FkingAhhhh View Post
    Get and error message Error: Unknown declaration "Pro_InitSocket" at line 86

    Ive tried updating everyingthing but still get it

    This below is taken from an old thread quoted from flight - It fixed the issue for me when I had it a couple of months back when I had everything up to date, worth a shot:

    I assume you both are using Reflection-based scripts? I don't understand how you're getting the error. It's caused by trying to load the 'ProSocks' plugin twice, once with AeroLib and again in the Reflection include, but the latest reflection update should have taken care of that. I myself am getting no errors from it. I just can't understand it. But for now what you can do is completely remove the part in the Reflection include that loads ProSocks.dll. To do this remove these 3 lines at line 77 in "Includes > Reflection > lib > misc > Misc.Simba":
    Simba Code:
    {$IFNDEF Aerolib}
    {$loadlib prosocks}
    {$ENDIF}

    That's the part that checks if we're using AeroLib or not, if so then it's assumed the ProSocks plugin is already loaded and won't try to load it again. But for some reason it's not doing this...

  8. #8
    Join Date
    Apr 2012
    Posts
    108
    Mentioned
    1 Post(s)
    Quoted
    21 Post(s)

    Default

    Added player Login and break functionality, Hope you don't mind!


    Pest 1.2 (Shadows Mod).simba

  9. #9
    Join Date
    Sep 2015
    Posts
    32
    Mentioned
    1 Post(s)
    Quoted
    4 Post(s)

    Default

    I don't mind if you guys mod and post it

    Also i noticed it goes to the main island if the game ends during the time it is trying to walks to the monsters but 2.0 version of the script should have fixed it, Post progress if you want.

    Well it ran for 3hr so get the newest one if you can
    Capture.PNG
    Last edited by lizon; 04-26-2016 at 02:39 AM.

  10. #10
    Join Date
    Apr 2016
    Posts
    7
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Great bot so far, would love to see updates!

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

    Default

    How is this script? Does it still work and any news on ban rate?

  12. #12
    Join Date
    Apr 2016
    Posts
    7
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    works decent enough, few bugs id like smoothed out. forces you to use prayer, with a 1 prayer account i dont like that. sometimes stands around and looks like a lost boy. Ive ran this all day with breaks have like 100 points atm

  13. #13
    Join Date
    Apr 2014
    Posts
    323
    Mentioned
    0 Post(s)
    Quoted
    131 Post(s)

    Default

    Would it be easier to have the script click the tile point of the doors instead of it as a game object?

    Here's Elfy's old PC script.

    Code:
    program PC;
    {$DEFINE SMART8}
    {$I SRL-OSR/SRL.Simba}
    {$I SRL-OSR\SRL\misc\SmartGraphics.simba}
    {$I SRL-OSR/SRL/misc/al_functions.simba}
    {$I SRL-OSR/SRL/Reflection/Reflection.simba}
    //                Welcome To Elfyyy's PC Script!
    //           Please report any and all bugs to thread
    //          Please Read The Thread For Full Instructions
    //   IF YOU DID NOT DOWNLOAD AL_FUNCTIONS OR REFLECTION INCLUDE
    //  IT WILL NOT RUN! DO NOT POST ON THREAD, READ THE THREAD FIRST
    // NOW USES THE "OFFICIAL" UNOFFICAL REFLECTION INCLUDE...MUST DOWNLOAD <READ THREAD>
    var
      Rewards:Array Of String;
    
    const
      Name = 'Iemz Pc'; //Pest Control Friend chat channel
      TakeBreaks = True;//Take Breaks
      Time2Break = 150; //Time To Play Until Breaking(Randomness Is Added)
      TimeOfBreak = 30; // Length Of Break(Randomness Is Added)
    procedure DeclarePlayer;
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;
      Players[0].Name := 'Usernamer';//Username
      Players[0].Pass := 'Passwordr';//Password
      Players[0].Active := True;//Keep true
      Players[0].Strings := ['eagle eye', 'ultimate strength']; //Prayers To Use.. '' Is None at all, all lowercase
      Players[0].Member := True; //Attack Portals? I Would Only Advise If A High Level
      Rewards := ['hitpoints']; //GO TO LINE 584 OR READ THREAD!!!.  Will Go In Order Until All Bought & Will Stop.
      // If You Only Put One Then It Will Keep Playing & Buying Until Script Is Stopped!
    end;
    
    const
      VERSION          = '3.2';
      USE_AUTO_CHECKER = True;
      DARK_DEFILER     = 0;
      LIGHT_DEFILER    = 1;
      TORCHER          = 2;
      GREEN_SHIFTER    = 3;
      RED_SHIFTER      = 4;
      PUKE_SPLATTER    = 5;
      MID_SPLATTER     = 6;
      BRIGHT_SPLATTER  = 7;
      SPINNER          = 8;
      PORTAL_EAST      = 0;
      PORTAL_WEST      = 1;
      PORTAL_SOUTHEAST = 2;
      PORTAL_SOUTHWEST = 3;
    
    type
      Tmonster = record
        MainColor, SideColor: integer;
        Names: string;
      end;
      Tportal = record
        MainColor, SideColor, DTM, X1, Y1, X2, Y2: integer;
        Names, Message: string;
        Active: Boolean;
        MainColorTPA, SideColorTPA: TPointArray;
      end;
      TmonsterArray = array of Tmonster;
      TportalArray = array of Tportal;
    
    var
      Status: string;
      ProgBMP, BreakTime, Prog2BMP,RewardNum, BreakRounds, TotalBreaks, Bought, TimeGone, BoatAttempts, dtmIBoat, GamesWon, GamesLost, Zeal, ZealPH, CurrentW, HotW, EastCross, WestCross, SouthEastCross, SouthWestCross: integer;
      Monsters: TmonsterArray;
      Portals: TportalArray;
      Center, Home, East, SEast, SWest, West: TPoint;
      CheckPoints: Boolean;
    
    procedure WhichPortal; //Determines Which Portal Is Currently Open
    var
      x, y, Portal: integer;
    begin
      if not LoggedIn then
        Exit;
      for Portal := PORTAL_EAST to PORTAL_SOUTHWEST do
      begin
        if findblackchatmessage(Portals[Portal].Message) then
          Portals[Portal].Active := True;
        if Portals[Portal].Active then
        if (FindDTM(Portals[Portal].Dtm, x, y, Portals[Portal].X1, Portals[Portal].Y1, Portals[Portal].X2, Portals[Portal].Y2)) then
          Portals[Portal].Active := False;
      end;
    end;
    
    procedure CallProg;
    begin
      Cleardebug;
      TimeGone := ((GetTimeRunning - BreakTime) / 1000);
      Zeal := GamesWon * 2;
      ZealPH := (3600 * (Zeal)) / ((TimeGone));
      //SMART_DrawBitmap(True, ProgBMP, Point(396, 273));
      //SMART_DrawTextMulti(False, False, [MsToTime(GetTimeRunning, Time_Short)], Point(411, 314), UpChars, 1);
      writeln('elfyyys Pest Control Script!');
      writeln('Currently using version:' + version);
      Writeln('Time Running: ' + TimeRunning);
      Writeln('Status:' + Status) Writeln('Played ' + IntToStr(GamesWon + GamesLost) + ' Games So Far!');
      Writeln('Won ' + IntToStr(GamesWon) + ' games and Lost ' + IntToStr(GamesLost) + ' games!');
      Writeln('Earned ' + IntToStr(Zeal) + ' Points, Thats ' + IntToStr(ZealPH) + ' Points P/h!');
      Writeln('Bought ' + IntToStr(Bought) + ' Rewards');
    end;
    
    function AmNotCombat: Boolean;
    begin
      CallProg;
      if not LoggedIn then
        Exit;
      WhichPortal;
      Result := True
      if R_WaitForAnimation(2000) then
        Result := False;
    end;
    
    procedure SetupMonsters;
    begin
      SetArrayLength(Monsters, 9);
      with Monsters[DARK_DEFILER] do
      begin
        MainColor := 5059661;
        SideColor := 12506324;
        Names := 'Dark Defiler';
      end;
      with Monsters[LIGHT_DEFILER] do
      begin
        MainColor := 5393488;
        SideColor := 10338240;
        Names := 'Light Defiler';
      end;
      with Monsters[TORCHER] do
      begin
        MainColor := 4868360;
        SideColor := 1121946;
        Names := 'Torcher';
      end;
      with Monsters[GREEN_SHIFTER] do
      begin
        MainColor := 1123584;
        SideColor := 881511;
        Names := 'Green Shifter';
      end;
      with Monsters[RED_SHIFTER] do
      begin
        MainColor := 1319850;
        SideColor := 5664922;
        Names := 'Red Shifter';
      end;
      with Monsters[PUKE_SPLATTER] do
      begin
        MainColor := 6124685;
        SideColor := 5475205;
        Names := 'Puke Splatter';
      end;
      with Monsters[MID_SPLATTER] do
      begin
        MainColor := 6912702;
        SideColor := 6253739;
        Names := 'Mid Splatter';
      end;
      with Monsters[BRIGHT_SPLATTER] do
      begin
        MainColor := 9988277;
        SideColor := 8147606;
        Names := 'Bright Splatter';
      end;
      with Monsters[SPINNER] do
      begin
        MainColor := 7693164;
        SideColor := 8094630;
        Names := 'Spinner';
      end;
    end;
    
    procedure SetupPortals;
    begin
      SetArrayLength(Portals, 4);
      with Portals[PORTAL_EAST] do
      begin
        MainColor := 13296869;
        SideColor := 2604223;
        Names := 'SouthEast Portal';
        Message := 'blue';
        DTM := EastCross;
        Active := False;
        X1 := 392;
        Y1 := 33;
        X2 := 419;
        Y2 := 60;
      end;
      with Portals[PORTAL_WEST] do
      begin
        MainColor := 11773863;
        SideColor := 13377746;
        Names := 'West Portal';
        Message := 'purple';
        DTM := WestCross;
        Active := False;
        X1 := 355;
        Y1 := 31;
        X2 := 387;
        Y2 := 61;
      end;
      with Portals[PORTAL_SOUTHEAST] do
      begin
        MainColor := 12959933;
        SideColor := 10390920;
        Names := 'East Portal';
        Message := 'yellow';
        DTM := SouthEastCross;
        Active := False;
        X1 := 428;
        Y1 := 31;
        X2 := 461;
        Y2 := 60;
      end;
      with Portals[PORTAL_SOUTHWEST] do
      begin
        MainColor := 14344159;
        SideColor := 7820980;
        Names := 'SouthWest Portal';
        Message := 'red';
        DTM := SouthWestCross;
        Active := False;
        X1 := 470;
        Y1 := 30;
        X2 := 500;
        Y2 := 60;
      end;
    end;
    
    procedure ElfMouse(x, y: integer);//AntiBan Mouse Function
    var
      Cx, Cy: Integer;
    begin
      GetMousePos(Cx, Cy);
      AL_SetMouseSpeed(20);
      case Random(5) of
        0: AL_BrakeWindMouse(Cx, Cy, x, y, 15 + Random(10), 5 + Random(15), 5, 10, 5, True);
        1: AL_HumanWindMouse(Cx, Cy, x, y, 15 + Random(10), 5 + Random(15), 5, 10, 5);
        2: AL_AccurateMMouse(IntToPoint(x, y), 2, 2);
        3: AL_HumanMMouse(IntToPoint(x, y), 2, 2);
        4: AL_ShiftWindMouse(Cx, Cy, x, y, 15 + Random(10), 5 + Random(15), 5, 10, 20, 5);
        5: AL_MissMouse(IntToPoint(x, y), 2, 2);
      end;
    end;
    
     function SetMyRun(Run: Boolean): Boolean;
    var
      CCount: Integer;
    begin
      Result := False;
      if (GameTab(tab_Options)) then
      begin
        CCount := CountColorTolerance(2369440, 649, 415, 680, 446, 20);
        if (Run) then
        begin
          if (CCount<1) then
            MouseBox(654, 420, 677, 443, mouse_left);
          Result := True;
        end else
        begin
          if (CCount>1) then
            MouseBox(654, 420, 677, 443, mouse_left);
          Result := True;
        end;
      end;
    end;
    
    procedure JoinClan(Name: string);
    var
      x, y, l, w, wx: integer;
    begin
      if not LoggedIn then
        exit;
      FTab(tab_Clan);
      if FindColorSpiralTolerance(x, y, 6619135, 605, 225, 675, 245, 5) then
        Exit;
      ElfMouse(600, 450)
      wait(randomRange(590,760));
      ClickMouse2(Mouse_Left);
      TypeSendEx(Name, True);
      CallProg;
      MarkTime(l);
      Repeat
      if not LoggedIn then
        Exit;
      Wait(100);
      if FindColorSpiralTolerance(x, y, 6619135, 605, 225, 675, 245, 5) then
        exit;
      if FindChatBoxText('anned',8,clBlack) then
      begin
        wait(randomrange(1600, 2800));
        Status := 'BANNED...From Friend chat ;) Waiting 1 hour to try again';
        CallProg;
        Logout;
        w := (60 * 60000);
        wx := (10 * 60000);
        wait(w + random(wx));
        LogInPlayer;
        SetAngle(0);
        CurrentW := (CurrentWorld);
        Joinclan(Name);
        Wait(RandomRange(5000, 7500));
      end;
      Until(FindColorSpiralTolerance(x, y, 6619135, 605, 225, 675, 245, 5)or (TimeFromMark(l) > 20000))
    end;
    
    procedure MyLogIn;
    begin
      if not LoggedIn then
      begin
        LogInPlayer;
        SetAngle(0);
        CurrentW := (CurrentWorld);
        Joinclan(Name);
        Wait(RandomRange(5000, 7500));
      end;
    end;
    
    function BreakHandler(BreakIn, BreakFor, RandBreakIn, RandBreakFor: Integer): Boolean;// Writen By Echo, Edited By Me
    var
      w, x, y, z: Integer;
    begin
      if not LoggedIn then
        Exit;
      if not TakeBreaks then
        Exit;
      w := (BreakIn * 60000);
      x := (BreakFor * 60000);
      y := RandomRange( - RandBreakIn * 60000, RandBreakIn * 60000);
      z := RandomRange( - RandBreakFor * 60000, RandBreakFor * 60000);
      begin
        if (GetTimeRunning < ((w) + (y) + BreakRounds)) then
          Exit
        else if (GetTimeRunning > ((w) + (y) + BreakRounds)) then
        begin
          CallProg;
          BreakTime := BreakTime + (W + Z);
          Status := ('Taking a break');
          Writeln('It is ' + thetime);
          writeln('Taking a break for ' + IntToStr(((x) + (z)) / 60000) + ' minutes.');
          writeln('The next break will occur in ' + IntToStr(((w) + (x)) / 60000) + ' minutes.');
          Logout;
          Wait((x) + (z));
          MyLogIn;
          Result := LoggedIn;
          IncEx(BreakRounds, (w) + (x));
          IncEx(TotalBreaks, 1);
        end;
      end;
    end;
    
    function OpenWScreen: Boolean;
    var
      x, y: integer;
    begin
      CallProg;
      Result := False;
      if findcolortolerance(x, y, 3166829, 350, 190, 435, 220, 10) then
        Result := True;
      if Loggedin then
        Exit;
      if not result then
      begin
        CallProg;
        Mmouse(54, 475, 1, 1);
        wait(200);
        ClickMouse2(Mouse_Left);
        Wait(1500);
        Result := True;
      end;
    end;
    
    procedure MyWorld(W: Integer);//Pick World On WOrld Screen
    var
      WArray: array of Integer;
      I: Integer;
    begin
      CallProg;
      Warray := [301, 302, 303, 304, 305, 306, 308, 309, 310, 311, 312, 313, 314, 316, 317, 318, 319, 320, 321, 322, 325, 326, 327, 328, 329, 330, 333, 334, 335, 336, 337, 338, 341, 342, 343, 344, 345, 346, 349, 350, 351, 352, 353, 354, 357, 358, 359, 360, 361, 362, 365, 366, 367, 368, 369, 370, 373, 374, 375, 376, 377, 378];
      if InIntArrayEx(WArray, i, W) then
      begin
        ElfMouse(250 + ((i / 16) * 90), 80 + (24 * (i mod 16)));
        Wait(1000)
        ClickMouse2(Mouse_Left);
        Exit;
      end
      else
      i := 28;
      ElfMouse(250 + ((i / 16) * 90), 80 + (24 * (i mod 16)));
      Wait(1000)
      ClickMouse2(Mouse_Left);
      Exit;
    end;
    
    function World: Integer;//Determines What World Most People Are In If They Are Not In Our World-Credit Turpinator
    var
      j, i, x, y, tens, ones, L, dcount, maxloc, finalloc: Integer;
      Main, dif, ZeroToNine: TIntegerArray;
    begin
      CallProg;
      if not LoggedIn then
        Exit;
      SetLength(Main, 10);
      SetLength(ZeroToNine, 10);
      ZeroToNine[0] := BitmapFromString(5, 8, 'meJxjYGBI+f8fghjAbAYYgAtShcuAahEAGQoq5Q==');
      ZeroToNine[1] := BitmapFromString(3, 8, 'meJxjYGBI+f+fAUxCGAwwEWIYEF1ABABdJBo3');
      ZeroToNine[2] := BitmapFromString(5, 8, 'meJxjYGBI+f8fghjAbAYYQGbjkSKGzYBkCwQBAMlcI78=');
      ZeroToNine[3] := BitmapFromString(4, 8, 'meJxjYGBI+f8fiBjADAYwgDPgbLgaNHE4G00vXAQAxUoe+w==');
      ZeroToNine[4] := BitmapFromString(4, 8, 'meJxL+f+fAQZS8LKxknCESxcAfc4e+w==');
      ZeroToNine[5] := BitmapFromString(4, 8, 'meJxL+f8/BQkxwAAaG00WqwJkcbgIAGUwI78=');
      ZeroToNine[6] := BitmapFromString(5, 8, 'meJxjYACBlP//gYgBxmbAEESWgouj6UJWjMmFC0LYAHSRKuU=');
      ZeroToNine[7] := BitmapFromString(4, 8, 'meJxL+f8/BYYYYADOplAQCAAoQRo3');
      ZeroToNine[8] := BitmapFromString(5, 8, 'meJxjYGBI+f8fghjAbAYYgAvCuQykKMavFwC6dy1H');
      ZeroToNine[9] := BitmapFromString(5, 8, 'meJxjYGBI+f8fghjAbAYYgAvCucgKkBloKtHMwcoFAJogI78=');
      for j := 0 to 9 do
      begin
        tens := 0;
        ones := 0;
        for i := 9 downto 0 do
        begin
          if FindBitmapIn(ZeroToNine[i], x, y, 690, 269 + j * 15, 700, 278 + j * 15) then
            tens := i;
          if FindBitmapIn(ZeroToNine[i], x, y, 698, 269 + j * 15, 704, 278 + j * 15) then
            ones := i;
        end;
        Main[j] := tens * 10 + ones;
      end;
      for i := 0 to 9 do
        FreeBitmap(ZeroToNine[i]);
      begin
        SetLength(dif, length(Main));
        for L := 0 to length(Main) - 1 do
          dif[L] := 1;
        QuickSort(Main);
        dcount := 0;
        for L := 0 to length(Main) - 2 do
          if Main[L] = Main[L + 1] then
            inc(dif[dcount])
          else
            inc(dcount);
        maxloc := 0;
        for L := 0 to length(dif) - 1 do
          if (dif[L] > dif[maxloc]) then
            maxloc := L;
        finalloc := 0;
        for L := 0 to maxloc - 1 do
          finalloc := finalloc + dif[L];
        result := Main[finalloc];
      end;
    end;
    
    procedure PraySelect;
    var
      Prayer: array of string;
      i, t, S, h: Integer;
      TPA: TPointArray;
    begin
      CallProg;
      if Length(Players[CurrentPlayer].Strings) = 0 then
        Exit;
      SetArrayLength(TPA, 29);
      for i := 0 to 28 do
        Tpa[i] := IntToPoint(568 + (37 * (i / 6)), 230 + (37 * (i mod 6)));
      begin
        CallProg;
        Prayer := ['thick skin', 'rock skin', 'protect item', 'incredible reflexes', 'mystic might', 'piety', 'burst of strength', 'superhuman strength', 'hawk eye', 'protect from magic', 'retribution', 'no', 'clarity of thought', 'improved reflexes', 'mystic lore', 'protect from missiles', 'redemption', 'no', 'sharp Eye', 'rapid restore', 'steel skin', 'protect from melee', 'smite', 'no', 'mystic will', 'rapid heal', 'ultimate strength', 'eagle eye', 'chivalry'];
        h := High(Players[CurrentPlayer].Strings) for T := 0 to h do
        begin
          for S := 0 to 28 do
            if Prayer[S] = lowercase(Players[CurrentPlayer].Strings[T]) then
            begin
              CallProg;
              FTab(tab_Prayer);
              ElfMouse(TPA[S].x, TPA[S].y);
              wait(500);
              ClickMouse2(Mouse_Left);
            end;
        end;
        Ftab(tab_inv);
      end;
    end;
    
    procedure AutoUpdateMe;//Credit Shuttleu
    var
      ThisFile: integer;
      OnlineVersion, NewScript, FileNew: string;
    begin
      if USE_AUTO_CHECKER then
      begin
        writeln('Checking for script updates...');
        OnlineVersion := GetPage('http://pastebin.com/raw.php?i=b4sF5MBD');
        writeln(OnlineVersion);
        writeln(Version) if (trim(OnlineVersion) > Version) then
        begin
          writeLn('Using Outdated Script!!');
          writeLn('Updating to New Version.');
          NewScript := GetPage('http://pastebin.com/raw.php?i=MHrcUdf1');
          FileNew := ScriptPath + 'ElfyyyPc-V' + OnlineVersion + '.simba';
          ThisFile := Rewritefile(FileNew, true);
          try
            WriteFileString(ThisFile, NewScript);
          except
            begin
              writeLn('Failed writting to ' + FileNew + '!!');
              terminatescript;
            end;
          end;
          CloseFile(ThisFile);
          writeLn('New script downloaded to ' + FileNew + '!! Please use this one!!');
          TerminateScript;
        end;
        if (trim(OnlineVersion) = Version) then
          writeLn('You Are Updated To the Lastest Version!');
      end
      else
        WriteLn('!!!!! Not checking for latest version, you may be outdated!');
      if (trim(OnlineVersion) < Version) then
      begin
        Writeln('You Are Using a Beta Version!!! Babysit!!');
        Writeln('Give any and ALL feedback to Elfyyy!!!');
        wait(5000);
      end;
    end;
    
    procedure DeclareDTM;
    begin
      dtmIBoat := DTMFromString('mbQAAAHicY2VgYOABYnkGBJCBikkAsSQQM0LFOwsdGFL9JBim17gxTK1yYahLt2KQA4pzoGFGLBgMAICRBp4=');
      SouthWestCross := DTMFromString('mbQAAAHicY2VgYJjOyMAwAYjnAnE/EC8AYh2guAkQKwOxChAbA/FhTQkGUSEhFCwHFOdBw4xYMBgAAOHgBhM=');
      EastCross := DTMFromString('mbQAAAHicY2VgYJjOyMAwAYjnAnE/EC8AYh2guAkQKwOxChAbA/FhTQkGUSEhFCwHFOdBw4xYMBgAAOHgBhM=');
      WestCross := DTMFromString('mbQAAAHicY2VgYJjOyMAwAYjnAnE/EC8AYh2guAkQKwOxChAbA/FhTQkGUSEhFCwHFOdBw4xYMBgAAOHgBhM=');
      SouthEastCross := DTMFromString('mbQAAAHicY2VgYJjOyMAwAYjnAnE/EC8AYh2guAkQKwOxChAbA/FhTQkGUSEhFCwHFOdBw4xYMBgAAOHgBhM=');
      ProgBmp := BitmapFromString(125, 71, 'meJztXGtQlNcZ9m6sGPECioigIBBAJY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BzN84yWMgBCG7zTEyuusJAa9FzezItmJZGbVt1DE5OI/Y1ZlNceFs4C+6L0aOPYV25B1e5WWyGGb6lhgEuRHLopIyYijPYtBMxjMsr6dwehYXgJObk5FxLHjIWu0mxtA2WZzJeEqkTFwGxHvBpGSwkzF9nsyioXCNrVUa8TQhWi+hRrA2L0qY68VC1rROQPbJQ2m214FPtrNy4qjM/tLeTbhBE4SyS8YIskrTXMSZjO5tiWRILlfTFVJhaso2LJ1sjLlE3o+qUx3wsODk2i3xoSo/Cpygn2G0Lna9H5bJQijDtMh6ENBV6tS5n64YPkH1IS3JuV7dx1WGRjQuZYYPSviuQRfJMq8aSe+/WDQ5OJgEm9zh7j7C3zurMr3PO3dO11pJYcCo8BmA5jlm3ktaikwgEadcMoKY7ry28OpnhJWKhnaVnEod/663wXrB65YeFdlDNPFK2lPywwP2L/XMZfy9cHvLDIhQs/ChY+FGw8KNg4UfBwo+ChR8FCz8KFn4ULPwoWPhRsPCjRbIYHBysxdGQA6muz6Kjo6PZPrbKgVTXZ0EcsTtKPZDexYCII4444ogjjjjiiGNJx//PPfez');
    end;
    
    procedure FreeTheDTM;
    begin
      FreeDTM(dtmIBoat);
      FreeDTM(SouthWestCross);
      FreeDTM(EastCross);
      FreeDTM(WestCross);
      FreeDTM(SouthEastCross);
      FreeBitmap(Prog2Bmp);
      FreeBitmap(ProgBmp);
    end;
    
    function GetLocation: string;
    var
      x, y: Integer;
    begin
      if not LoggedIn then
        Exit;
      Result := '';
      CallProg;
      if FindColorSpiralTolerance(x, y, 5855173, MMX1, MMY1, MMX2, MMY2, 45) and FindColorSpiralTolerance(x, y, 197048, MMX1, MMY1, MMX2, MMY2, 45) and FindColorSpiralTolerance(x, y, 60395, MMX1, MMY1, MMX2, MMY2, 45) and FindColorSpiralTolerance(x, y, 12161149, MMX1, MMY1, MMX2, MMY2, 45) then
      begin
        Result := 'HomeLand';
      end;
      if FindColorSpiralTolerance(x, y, 63488, 352, 10, 514, 89, 5) and FindColorSpiralTolerance(x, y, 3355647, 352, 10, 514, 89, 10) and FindDTM(dtmIBoat, x, y, MSX1, MSY1, MSX2, MSY2) then
      begin
        Result := 'IslandBoat';
        Exit;
      end;
      if FindColorSpiralTolerance(x, y, 16777113, 0, 0, 150, 100, 3) then
      begin
        Result := 'Boat';
        Exit;
      end;
    end;
    
    function OpenPestPoints: Boolean;//Goes To Knight And Opens Pest Points Screen
    var
      x, y, q, i, h: integer;
      TPA: Tpointarray;
      TheATPA: T2DPointArray;
      MainBox: Tbox;
    begin
      CallProg;
      Result := False;
      if FindColorTolerance(x, y, 2070783, 142, 14, 368, 38, 10) then
        Result := True;
      if Result then
        Exit;
      R_BlindWalk(Point(2662, 2649));
      repeat
        CallProg;
        if not LoggedIn then
          Exit;
        MarkTime(q);
        if FindColorsTolerance(TPA, 2631722, MSX1, MSY1, MSX2, MSY2, 15) then
        begin
          TheATPA := SplitTPAEx(TPA, 10, 30);
          H := high(TheATPA);
          for i := 0 to H do
          begin
            MainBox := GetTPABounds(TheATPA[i]);
            if FindColorsTolerance(TPA, 2381214, MainBox.x1, MainBox.Y1, MainBox.X2, MainBox.Y2, 15) then
            begin
              MiddleTPAEx(TPA, x, y);
              ElfMouse(x, y);
              if WaitUpText('alk', 1) then
              begin
                ClickMouse2(Mouse_Right);
                ChooseOption('xchang');
                Wait(2000);
                if FindColorTolerance(x, y, 2070783, 142, 14, 368, 38, 25) then
                  Result := True;
              end;
            end;
          end;
        end;
      until (Result);
    end;
    
    procedure PickReward(R: string);//Chooses Reward From Knight
    var
      RArray: TstringArray;
      i, x, y: Integer;
    begin
      if not LoggedIn then
        Exit;
      RArray := ['attack', 'defence', 'magic', 'prayer', 'strength', 'ranged', 'hitpoints', 'mace', 'robe', 'mage helm', 'mele helm', 'top', 'gloves', 'range helm', 'seal'];
      if InstrArrEx(lowercase(R), RArray, i) then
      begin
        inc(Bought);
        if i < 7 then
        begin
          ElfMouse(205 + ((i / 4) * 215), 70 + (38 * (i mod 4)));
          Wait(500);
          ClickMouse2(Mouse_Left);
          Wait(1000);
          if FindColorTolerance(x, y, 65535, 223, 282, 282, 300, 15) then
          begin
            ElfMouse(x, y);
            Wait(500);
            ClickMouse2(Mouse_Left);
            Wait(250);
            Exit;
          end;
        end;
        if i >= 7 then
        begin
          HoldMouse(487, 257, mouse_left);
          wait(2000);
          ReleaseMouse(487, 257, mouse_Left);
          i := i - 7
          ElfMouse(100 + ((i / 4) * 215), 125 + (39 * (i mod 4)));
          Wait(500);
          ClickMouse2(Mouse_Left);
          if FindColorTolerance(x, y, 65535, 223, 282, 282, 300, 15) then
          begin
            ElfMouse(x, y);
            Wait(1000);
            ClickMouse2(Mouse_Left);
            Wait(250);
            Exit;
          end;
        end;
      end
      else
        Writeln('Invalid Reward Choosen!');
      TerminateScript;
    end;
    
    function WalkPath1(Path: TPointArray): boolean;//Taken From MiniReflection, Modified By Me
    var
      I, H, T, D, Fails, lP: integer;
      P, MM, MMF: TPoint;
    begin
      ColorToleranceSpeed(1);
      H := High(Path);
      T := GetSystemTime + 10000 + Random(2000);
      Fails := 0;
      lP := 0;
      if not LoggedIn then
        Exit;
      if (GetLocation = 'HomeLand') then
        Exit;
      while (not Result) and (GetSystemTime < T) and (Fails < 5) do
      begin
        if (GetLocation = 'HomeLand') then
          Exit;
        WhichPortal;
        if (not LoggedIn()) then
          Exit;
        P := R_GetTileGlobal;
        for I := H downto 0 do
        begin
          if (GetLocation = 'HomeLand') then
            Exit;
          WhichPortal;
          if ((I - lP) > 3) then
            Continue
          else
            lP := I;
          MM := R_TileToMM(Path[I]);
          if MM = MMF then
            Inc(Fails);
          if (GetLocation = 'HomeLand') then
            Exit;
          if (MM.X > 0) and (MM.Y > 0) then
            D := Distance(MM.X, MM.Y, MMCX, MMCY);
          if (D < 20) then
            break
          else if (D < 70) then
          begin
            WhichPortal;
            CallProg;
            ElfMouse(MM.x,MM.y);
            AL_FastClick(mouse_left);
            if (GetLocation = 'HomeLand') then
              Exit;
            WhichPortal;
            WaitFunc(@ AL_playerWalking, 10, 20000);
            if (GetLocation = 'HomeLand') then
              Exit;
            MMF := MM;
            if (I = H) then
              FFlag(25)
            else
              FFlag(25);
            T := getSystemTime + 7000 + Random(1000);
            Break;
          end;
        end;
        CallProg;
        Result := (I = H);
      end;
      CallProg;
      FFlag(25);
    end;
    
    function BlindWalk1(P: TPoint): Boolean;//Taken From MiniReflection, Modified By Me
    var
      Tries: Integer;
      L, M: TPoint;
      ctrlPoints: TPointArray;
    begin
      L := R_GetTileGlobal;
      repeat
        CallProg;
        if (GetLocation = 'HomeLand') then
          Exit;
        if (not LoggedIn()) then
          Exit;
        M := R_GetTileGlobal;
        if (M.X = - 1) then
        begin
          L := M;
          Continue;
        end;
        if not loggedIn then
          Exit;
        if (Length(ctrlPoints) = 0) then
          ctrlPoints := TPABetweenPoints(M, P, 5 + Random(2), 2);
        Inc(Tries);
        if (Tries > 20) then
          Exit;
        Result := walkPath1(ctrlPoints);
        if (GetLocation = 'HomeLand') then
          Exit;
      until (Result or (GetLocation = 'HomeLand'));
    end;
    
    procedure AttackMonsters;
    var
      MainColorTPA, SideColorTPA: TPointArray;
      TheATPA: T2DPointArray;
      MainBox: TBox;
      i, H, Monster, x, y: integer;
      MSCTP: Tpoint;
    begin
      WhichPortal;
      if not LoggedIn then
        Exit;
      MSCTP := Point(MSCX, MSCY);
      for Monster := DARK_DEFILER to SPINNER do
        if FindColorsTolerance(MainColorTPA, Monsters[Monster].MainColor, MSX1, MSY1, MSX2, MSY2, 5) then
        begin
          TheATPA := TPAtoATPAEx(MainColorTPA, 30, 30);
          SortATPASize(TheATPA, True);
          H := high(TheATPA) for i := 0 to H do
          begin
            if length(TheATPA[i]) > 50 then
              continue;
            MainBox := GetTPABounds(TheATPA[i]);
            if FindColorsTolerance(SideColorTPA, Monsters[Monster].SideColor, MainBox.x1, MainBox.Y1, MainBox.X2, MainBox.Y2, 15) then
            begin
              MiddleTPAEx(SideColorTPA, x, y);
              ElfMouse(x, y);
              if WaitUpText('ttack', 10) then
              begin
                Status := ('Attacking a ' + ToStr(Monsters[Monster].Names)) CallProg;
                CallProg;
                clickmouse2(mouse_left);
                WaitFunc(@ AmNotCombat, 250, 20000);
              end;
            end;
          end;
        end;
    end;
    
    function AttackPortals: Boolean;
    var
      MAinColorTPA, SideColorTPA: TPointArray;
      TheATPA: T2DPointArray;
      MainBox: TBox;
      i, H, x, y, Portal: integer;
      MSCTP: Tpoint;
    begin
      Result := False;
      WhichPortal;
      if not LoggedIn then
        Exit;
      MSCTP := Point(MSCX, MSCY);
      for Portal := PORTAL_EAST to PORTAL_SOUTHWEST do
        if FindColorsTolerance(MainColorTPA, Portals[Portal].MainColor, MSX1, MSY1, MSX2, MSY2, 5) then
        begin
          TheATPA := SplitTPAEx(MainColorTPA, 30, 30);
          SortATPAFrom(TheATPA, MSCTP);
          H := High(TheATPA) for i := 0 to H do
          begin
            MainBox := GetTPABounds(TheATPA[i]);
            if FindColorsTolerance(SideColorTPA, Portals[Portal].SideColor, MainBox.x1, MainBox.Y1, MainBox.X2, MainBox.Y2, 15) then
            begin
              MiddleTPAEx(SideColorTPA, x, y);
              ElfMouse(x, y);
              if WaitUpText('ttack', 20) then
              begin
                Result := True;
                Status := ('Attacking a ' + ToStr(Portals[Portal].Names)) CallProg;
                CallProg;
                ClickMouse2(mouse_left);
                WaitFunc(@ AmNotCombat, 250, 20000);
                WhichPortal;
              end;
            end;
          end;
        end;
    end;
    
    procedure GetInBoat;
    var
      T, x, y, lo,tmpCTS: Integer;
      TPA: TPointArray;
      MSCTP, TP: Tpoint;
    begin
      MarkTime(lo);
      if not LoggedIn then
        Exit;
      Repeat
      CallProg;
      wait(50);
      until(FindNPCChatText('Congratulations!', nothing) or FindNPCChatText('noticed', nothing) or FindNPCChatText('lost.', nothing) or (TimeFromMark(lo) > 4000));
      if CheckPoints then
      begin
        if FindNPCChatText('Congratulations!', nothing) then
          GamesWon := (GamesWon + 1);
        if FindNPCChatText('noticed', nothing) or FindNPCChatText('lost.', nothing) then
          GamesLost := (GamesLost + 1);
        status := ('Getting in Boat');
        CallProg;
        CheckPoints := False;
      end;
      if not R_NearTile(point(2657, 2639), 10) then
        R_BlindWalk(point(2657, 2639));
      tmpCTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      FindColorsTolerance(TPA, 3496051, msX1, msy1, msX2, msY2, 5);
      ColorToleranceSpeed(tmpCTS);
      SetColorSpeed2Modifiers(0.2, 0.2);
      SortTPAFrom(TPA, MSCTP);
      inc(BoatAttempts)
      CallProg;
      if Length(TPA) > 100 then
      begin
        CallProg;
        TP := MedianTPA(TPA);
        ElfMouse((TP.x - 10), TP.y);
        if WaitUpTextMulti(['Cross', 'plank'], 180) then
        begin
          CallProg;
          MarkTime(T);
          repeat
            CallProg;
            if not LoggedIn then
              Break;
            AL_FastClick(Mouse_Left);
            if (timefrommark(T) > 3000) and findcolortolerance(x, y, 128, 209, 370, 302, 392, 10) then
            begin
              if OpenPestPoints then
              begin
                if Length(Rewards) = 1 then
                begin
                  PickReward(Rewards[0]);
                  Exit;
                end;
                CallProg;
                PickReward(Rewards[RewardNum]);
                Inc(RewardNum);
              end;
              if RewardNum = Length(Rewards) then
              begin
                CallProg;
                Writeln('All Rewards Bought, You Better Thank Elfyyy :)');
                Status := ('All Rewards Bought');
                CallProg;
                TerminateScript;
              end;
              Exit;
            end;
            if not WaitUpTextMulti(['Cross', 'plank'], 180) then
            begin
              CallProg;
              Wait(1200);
              Exit;
            end;
            if TimeFromMark(T) > 10000 then
            begin
              R_BlindWalk(point(2657, 2639));
              GetInBoat;
              CallProg;
            end;
          until (GetLocation = 'Boat');
          Exit;
        end;
        if BoatAttempts > 20 then
        begin
          GetInBoat;
        end;
      end
      else
        R_BlindWalk(point(2657, 2639));
      GetInBoat;
    end;
    
    procedure WaitInBoat;
    var
      s, k, l: integer;
    begin
      CheckPoints := True;
      CallProg;
      if not LoggedIn then
        Exit;
      Ftab(tab_clan);
      CallProg;
      Wait(800);
      Joinclan(Name);
      HotW := (World + 300);
      for k := 0 to 1 do
      begin
        if HotW = 300 then
          Break;
        Logout;
        OpenWScreen;
        wait(1000);
        MyWorld(HotW);
        wait(1000);
        MyLogin;
       end;
       setmyrun(True);
      begin
        MarkTime(l);
          if TimeFromMark(l) > 200000 then
            terminatescript;
        Ftab(Tab_Inv);
        repeat
          CallProg;
          if not LoggedIn then
            Break;
          wait(randomrange(30, 250));
          Status := ('Waiting in boat, Start AntiBan');
          CallProg;
          if not (GetLocation = 'Boat') then
            Exit;
          case Random(100) of
            1: HoverSkill('strength', False);
            2: HoverSkill('hitpoints', False);
            3: HoverSkill('magic', False);
            4: HoverSkill('ranged', False);
            5: RandomMovement;
            6..15:
              begin
                CallProg;
                MarkTime(s);
                AL_HumanRandomMouse;
                repeat
                  CallProg;
                  wait(RandomRange(30, 200))
                until (GetLocation = 'IslandBoat') or (TimeFromMark(s) > randomrange(5000, 20000))
              end;
          end;
        until (GetLocation = 'IslandBoat')
          Exit;
      end
    end;
    
    procedure AttackSeries;
    begin
      CallProg;
      if Players[CurrentPlayer].Member then
        if not AttackPortals then
      AttackMonsters;
    end;
    
    procedure Enterance;
    begin
      writeln('******************************************************************');
      writeln('************Thanks For Using Elfyyy'' Pest Control!!!*************');
      writeln('**The Only Fully Functional, Portal & Point Supported PC Script***');
      writeln('READ DIRECTIONS @ http://villavu.com/forum/showthread.php?t=100729');
      writeln('******If You Don''t, It May Not Work Completley As It Should******');
      writeln('************Enjoy & Post All Proggies On The Thread!!!************');
      Disguise('Elfyyy''s Flawless Pest Control');
      wait(4000);
    end;
    
    procedure TestMe;
    begin
      ClearDebug;
      Writeln('THIS IS NOT AN ERROR,DO NOT POST THAT IT IS');
      Writeln('I Completely Changed Script, Please Read Thread');
      Writeln('http://villavu.com/forum/showthread.php?t=100729&highlight=');
      Writeln('It Says How To Run Script & Remove This');
      Writeln('Have Fun Kiddies ;)  -Elfyyy)');
      TerminateScript;
    end;
    
    procedure MainLoop;
    begin
      MyLogIn;
      while (GetLocation = 'HomeLand') do
        GetInBoat;
      while (GetLocation = 'Boat') do
      begin
        SetupPortals;
        WaitInBoat;
      end;
      while (GetLocation = 'IslandBoat') do
      begin
        PraySelect;
        BreakHandler(Time2Break, TimeOfBreak, 25, 25);
        Home := R_GetTileGlobal;
        Center := Point(Home.x, (Home.y - 17));
        East := Point((Home.x + 21), (Home.y - 21));
        SEast := Point((Home.x + 10), (Home.y - 38));
        SWest := Point((Home.x - 10), (Home.y - 38));
        West := Point((Home.x - 27), (Home.y - 17));
        BlindWalk1(Center);
      end;
      WhichPortal;
      if Portals[PORTAL_EAST].Active then
      begin
        WhichPortal;
        Status := ('Going To East Port') CallProg;
        BlindWalk1(East);
        repeat
          if not LoggedIn then
            exit;
          if Players[CurrentPlayer].Member then
            if R_NearTile(East, 10) then
              BlindWalk1(East);
          WhichPortal;
          AttackSeries;
          if (Portals[PORTAL_EAST].Active = False) and (Length(GetMMDotsOnMS('npc')) < 2) then
            Break;
        until ((GetLocation = 'IslandBoat') or (GetLocation = 'HomeLand'))
      end;
      if Portals[PORTAL_WEST].Active then
      begin
        WhichPortal;
        Status := ('Going To West Port') CallProg;
        BlindWalk1(West);
        repeat
          if not LoggedIn then
            exit;
          if Players[CurrentPlayer].Member then
            if R_NearTile(West, 10) then
              BlindWalk1(West);
          WhichPortal;
          AttackSeries;
          if (Portals[PORTAL_WEST].Active = False) and (Length(GetMMDotsOnMS('npc')) < 2) then
            break;
        until ((GetLocation = 'IslandBoat') or (GetLocation = 'HomeLand'))
      end;
      if Portals[PORTAL_SOUTHEAST].Active then
      begin
        WhichPortal;
        Status := ('Going To SouthEast Port') CallProg;
        BlindWalk1(SEast);
        repeat
          if not LoggedIn then
            exit;
          if Players[CurrentPlayer].Member then
            if R_NearTile(SEast, 10) then
              BlindWalk1(SEast);
          WhichPortal;
          AttackSeries;
          if (Portals[PORTAL_SOUTHEAST].Active = False) and (Length(GetMMDotsOnMS('npc')) < 2) then
            break;
        until ((GetLocation = 'IslandBoat') or (GetLocation = 'HomeLand'))
      end;
      if Portals[PORTAL_SOUTHWEST].Active then
      begin
        WhichPortal;
        Status := ('Going To SouthWest Port') CallProg;
        BlindWalk1(SWest);
        repeat
          if not LoggedIn then
            exit;
          if Players[CurrentPlayer].Member then
            if R_NearTile(SWest, 10) then
              BlindWalk1(SWest);
          WhichPortal;
          AttackSeries;
          if (Portals[PORTAL_SOUTHWEST].Active = False) and (Length(GetMMDotsOnMS('npc')) < 2) then
            break;
        until ((GetLocation = 'IslandBoat') or (GetLocation = 'HomeLand'))
      end;
    end;
    
    begin
      TestMe;
      SetupSRL();
      SetupReflection;
      DeclarePlayer;
      DeclareDTM;
      AutoUpdateMe;
      CallProg;
      wait(5000);
      Enterance;
      wait(5000);
      SMART_ClearCanvas;
      CallProg;
      if not LoggedIn then
        LogInPlayer;
      SetAngle(0)
      CurrentW := (CurrentWorld);
      Joinclan(Name);
      wait(1000);
      setmyrun(true);
      Retaliate(true);
      GameTab(tab_Inv);
      SetupMonsters;
      SetupPortals;
      Addonterminate('FreeTheDTM');
      CheckPoints := true;
      RewardNum := 0;
      Bought := 0;
      BreakTime := 0;
      repeat
        MyLogIn;
        MainLoop;
      until (false);
      FreeTheDTM;
    end.
    maybe we could use some of his old code to beef up this script.
    If all pork-chops were perfect, we wouldn't have hot-dogs.

  14. #14
    Join Date
    Aug 2014
    Posts
    15
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    how would i change this script to ensure that it does not do any action before finishing to kill what its currently killing?

  15. #15
    Join Date
    Sep 2015
    Posts
    32
    Mentioned
    1 Post(s)
    Quoted
    4 Post(s)

    Default

    i Haven't tested it but, Try changing the fight procedure with this

    procedure Fight;
    var
    bank, barrel, anvil, banner :TReflectObject;
    Npc: TReflectNpc;
    RsTile,Point: TPoint;
    begin

    if not LocP.IsUnderAttack then
    repeat
    if not LocP.IsUnderAttack and not TreeObject.Find(ObjGame,14315,5) then begin
    if R_TryInteractNPC([1709,1710,1711], 'Spinner', true, 6) or
    R_TryInteractNPC([1747,1748,1749,1750], 'Portal', true, 3) or
    R_TryInteractNPC([1694,1695,1696,1697], 'Shifter', true, 6) or
    R_TryInteractNPC([1734,1735,1736,1737], 'Brawler', false, 1) or
    R_TryInteractNPC([1724,1725,1726,1727], 'Defiler', true, 6) or
    R_TryInteractNPC([1714,1715,1716,1717], 'Torcher', true, 5) or
    R_TryInteractNPC([1704,1705,1706,1707], 'Ravager', true, 6) then
    begin
    FFlag(0);
    sleep(500+random(500));
    AntiBan;
    while (LocP.GetAnimation <> -1) do sleep(25);
    end;
    if LocP.IsUnderAttack then
    exit;
    end;
    afterClick2;
    until TreeObject.Find(ObjGame,14315,20) or
    Objecttt.Find(ObjGame,14266,20) or
    bank.Find(ObjGame,14367,30) or
    barrel.Find(ObjGame,14374,30) or
    anvil.Find(ObjGame,2087,30) or
    banner.Find(ObjGame,25621,30);
    breakhandler();
    end;

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
  •