Page 28 of 29 FirstFirst ... 1826272829 LastLast
Results 676 to 700 of 702

Thread: ChaosMossKiller

  1. #676
    Join Date
    Jan 2012
    Posts
    1,104
    Mentioned
    18 Post(s)
    Quoted
    211 Post(s)

    Default

    Quote Originally Posted by Nomads View Post
    Hey there,

    First time posting. I Noticed earlier that someone posted
    'It has been 3 minutes and Runescape is not yet ready... Terminating.'

    I am wondering if the problem has been worked out? I'm getting anywhere from 1-3 hours before this happens.
    Its not solved yet, I get it too.

  2. #677
    Join Date
    Nov 2012
    Posts
    10
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I did catch it before saying 'We have been logged out' when still logged in, I sat and observed it for a bit, it then let itself time out in the lobby.

    I am unsure of what could be causing it to think it has been logged out?
    Last edited by Nomads; 11-20-2012 at 03:23 AM. Reason: Poor English :P

  3. #678
    Join Date
    Jan 2012
    Posts
    1,104
    Mentioned
    18 Post(s)
    Quoted
    211 Post(s)

    Default

    Quote Originally Posted by Nomads View Post
    I did catch it before saying 'We have been logged out' when still logged in, I sat and observed it for a bit, it then let itself time out in the lobby.

    I am unsure of what could be causing it to think it has been logged out?
    The srl function LoggedIn which should determine wether we are logged in or not does not work properly. The script calls the function many many times, so theres is a low chance the script will stuck cause of that.

  4. #679
    Join Date
    Nov 2012
    Posts
    161
    Mentioned
    2 Post(s)
    Quoted
    72 Post(s)

    Default

    First thanks for making this script. It works nearly flawlessly and has helped me immensely. i was wondering though if you could incorperate the abilities bar into it somehow. After EOC this script still works fine but it seems the xp rate was nearly halved since it doenst utilize that abilities bar. Also it doesnt always finish killing the mossgiant which matter now since you only get xp upon a monster death. thanks again man

  5. #680
    Join Date
    Oct 2012
    Posts
    20
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by nkd2009 View Post
    First thanks for making this script. It works nearly flawlessly and has helped me immensely. i was wondering though if you could incorperate the abilities bar into it somehow. After EOC this script still works fine but it seems the xp rate was nearly halved since it doenst utilize that abilities bar. Also it doesnt always finish killing the mossgiant which matter now since you only get xp upon a monster death. thanks again man
    Yes this bot still works fine for me, but i look forward to seeing what you will do with the abilities bar. Thanks for a great script man.

  6. #681
    Join Date
    Jan 2012
    Posts
    1,104
    Mentioned
    18 Post(s)
    Quoted
    211 Post(s)

    Default

    Quote Originally Posted by Paradox122 View Post
    Yes this bot still works fine for me...
    Really? I doubt it works fine, cause you get xp after a kill, not after a hit.

  7. #682
    Join Date
    Nov 2012
    Posts
    161
    Mentioned
    2 Post(s)
    Quoted
    72 Post(s)

    Default

    Quote Originally Posted by Shatterhand View Post
    Really? I doubt it works fine, cause you get xp after a kill, not after a hit.
    well even if it doesnt kill the guy the first attempt, it usually auto retaliates or reclicks on the monster and you end up killing him in one hit. But yes it doesnt work as well. My xp/hour went from 50k down to around 22k after the update. Do you think you will rework the script to work with the EOC?

  8. #683
    Join Date
    Jul 2012
    Posts
    113
    Mentioned
    7 Post(s)
    Quoted
    34 Post(s)

    Default

    I've reworked this script to use momentum when it detects a full yellow bar of adrenaline (Basically a copy of the RedBar function). This allows for better xp rates.. as for the InFight boolean, just set it to like 10 seconds and it works ok-ish. I'll work out a solid fix for it by tomorow though.

  9. #684
    Join Date
    Jan 2012
    Posts
    1,104
    Mentioned
    18 Post(s)
    Quoted
    211 Post(s)

    Default

    Quote Originally Posted by nkd2009 View Post
    well even if it doesnt kill the guy the first attempt, it usually auto retaliates or reclicks on the monster and you end up killing him in one hit. But yes it doesnt work as well. My xp/hour went from 50k down to around 22k after the update. Do you think you will rework the script to work with the EOC?
    Well, I dont think I will rework this. But I'm working on another combat script, probably an AIO one. As I dont plan getting members again, Ill stick to f2p monsters.
    EDIT: Theres no high leve monsers in f2p. Like impossible to train combat in f2p...
    Last edited by Shatterhand; 11-23-2012 at 11:12 AM.

  10. #685
    Join Date
    Nov 2012
    Posts
    161
    Mentioned
    2 Post(s)
    Quoted
    72 Post(s)

    Default

    Quote Originally Posted by Shatterhand View Post
    Well, I dont think I will rework this. But I'm working on another combat script, probably an AIO one. As I dont plan getting members again, Ill stick to f2p monsters.
    EDIT: Theres no high leve monsers in f2p. Like impossible to train combat in f2p...
    well good luck with the new script. I look forward to testing it. and ya their really arnt many good F2P monsters to train on.

  11. #686
    Join Date
    Jul 2012
    Location
    London
    Posts
    1,549
    Mentioned
    0 Post(s)
    Quoted
    86 Post(s)

    Default

    Quote Originally Posted by Shatterhand View Post
    Well, I dont think I will rework this. But I'm working on another combat script, probably an AIO one. As I dont plan getting members again, Ill stick to f2p monsters.
    EDIT: Theres no high leve monsers in f2p. Like impossible to train combat in f2p...
    You should create the script while you still have mems and if anything messes up we will pay for your mems

  12. #687
    Join Date
    Jan 2012
    Posts
    1,104
    Mentioned
    18 Post(s)
    Quoted
    211 Post(s)

    Default

    Quote Originally Posted by Mr[S] View Post
    You should create the script while you still have mems and if anything messes up we will pay for your mems
    I dont have membs, and dont wanna get again. I kind of lost my motivation to runescape since levels means nothing for pking, all you need is level 50s in f2p to unlock all the items/abilities...
    I would make a combat scipt for f2p, but because of the low level monsters and weaknesses its hard to make decent xp.

  13. #688
    Join Date
    Jan 2012
    Posts
    160
    Mentioned
    0 Post(s)
    Quoted
    19 Post(s)

    Default

    Quote Originally Posted by Shatterhand View Post
    I dont have membs, and dont wanna get again. I kind of lost my motivation to runescape since levels means nothing for pking, all you need is level 50s in f2p to unlock all the items/abilities...
    I would make a combat scipt for f2p, but because of the low level monsters and weaknesses its hard to make decent xp.
    you could attempt an f2p revenant/hellhound/greater demon slayer.

  14. #689
    Join Date
    Jan 2012
    Posts
    1,104
    Mentioned
    18 Post(s)
    Quoted
    211 Post(s)

    Default

    Quote Originally Posted by Ilya View Post
    you could attempt an f2p revenant/hellhound/greater demon slayer.
    They are all in wilderness?

  15. #690
    Join Date
    Jan 2012
    Location
    in a galaxy far far away
    Posts
    371
    Mentioned
    3 Post(s)
    Quoted
    48 Post(s)

    Default

    idk ankou, or a hill giant killer with bonecrusher support. im not sure, not too many ideas for f2p that arent taken
    >:)

  16. #691
    Join Date
    Oct 2011
    Location
    Australia, Vic
    Posts
    1,517
    Mentioned
    2 Post(s)
    Quoted
    120 Post(s)

    Default

    Quote Originally Posted by chief herb View Post
    idk ankou, or a hill giant killer with bonecrusher support. im not sure, not too many ideas for f2p that arent taken
    I could surely lend one of my accounts to you so you could get this up and running again with abilities.

  17. #692
    Join Date
    Jan 2012
    Posts
    1,104
    Mentioned
    18 Post(s)
    Quoted
    211 Post(s)

    Default

    Quote Originally Posted by John View Post
    I could surely lend one of my accounts to you so you could get this up and running again with abilities.
    There is no point to kill Moss giants anymore. They are too low level, with level 140+ you wont get any good xp from them.
    I managed to get my AIO fighter working on red spiders. It seems they are the best monsters to train on, but needs a lot of food, so its not that effective. The script uses abilities.
    Heres a proggy I got in F2P!
    Progress Report:
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     ShatterFighter v1.0
     * Time Running: 22 Minutes and 14 Seconds
     * ATK XP Gained: 23203 (62583)
     * ATK Level: 8x
     * XP till next: 35441
     * Food: 5   Hops: 0
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Failed to eat.

    Another problem is the crashers, if you attack a monster first, you will get the xp. There are many annoying players who tag all the monsters so we get no xp...

  18. #693
    Join Date
    Jul 2010
    Posts
    62
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default fix one add actionbar,use momentum at no.1

    Code:
    {$DEFINE SMART}
    program ChaosMossKiller;
    {$i srl/srl.simba}
    {$i sps/sps.simba}
    {$i srl/srl/misc/SmartGraphics.simba}
    {$i srl/srl/misc/debug.simba}
    
    const
    //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    //==============================================================================
    //=====================ChaosMossKiller by ShatterHand=======================v7.2
    //=========================================================================9 Nov
      SRLStats_User       =   '';                                                   // Your SRL Stats ID (If you dont have one then just leave it as it is)
      SRLStats_Password   =   '';                                                   // Your SRL Stats Password (If you dont have one then just leave it as it is)
    
      Username        =     '';
      Password        =     '';
    
      TrainedSkill    =     'Strength';                                             // Level tracking: 'Attack', 'Strength', 'Defence', 'Range', 'Hitpoints'. Use 'TOTAL' for no level tracking, all xp will be counted.
      GoalLevel       =     99;                                                     // Script will stop when goal reached.
      XPCounter       =     2;                                                      // Right click on XP button, and set up a counter for Trained Skill. You can have 3 counters maximum. XPCounter should be 1, 2 or 3.
    
      EatAt           =     2000;
      BonesToPeaches  =     True;                                                   // B2P must be on the 28th slot!
      PickUpLoots     =     False;                                                   // Loots items from the list (line 1344). Drop junks and move items to first slots before start!
    
      UseSpecAttacks  =     False;                                                   // Only primary weapons. Dont use Korasi! (multi spec)
      SpecUsage       =     50;                                                     // 25, 50, 55, 60, 100
    
      AmmoType        =     'Broad';                                                // UpText for Ammo (will equip it if looted accidently)
    
      TakeScreenShots =     False;                                                   // Takes screenshots on levelups and stops. Small sized jpg.
      ScreenShotsPath =     'C:\Simba\Screenshots\ChaosMossKiller\';                // Create the folder manually!!!
    
    
      PaintStatus     =     True;
      PaintReport     =     True;
      PaintDebug      =     True;
    
      DebugWindow = False;
      DebugLines  = False;
    //==============================================================================
    //===========UPDATES: http://villavu.com/forum/showthread.php?t=74029===========
    //==============================================================================
    //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    
      Version = 'v7.2';
    
    
    
    var                                                                             //global variables
      BonesX, BonesY, X, Y,
      StartTime, StartXp, NextLevelAt, TrainedLevel, HpLevel,
      WorldHops, B2PUsed, FoodUsed, GoldCharms, GreenCharms, BlueCharms, CrimsonCharms,
      SpecWait, SpecTime, SpecNumber,
      LastHitXP, LastHitTime,
      InvIndex : Integer;
      LevelString : String;
      DoReport, b2p : Boolean;
      Loots : Array of String;
    
    
    
    procedure DeclarePlayers;                                                       //for login
    begin
      NumberOfPlayers(1);
      CurrentPlayer := 0;
      with Players[0] do
      begin
        Name := UserName;
        Pass := Password;
        Active := True;
        Member := True;
      end;
    end;
    
    
    
    //CREDITS TO FLIGHT
    procedure BrakeWindMouse(xs, ys, xe, ye, gravity, wind, minWait, maxWait, targetArea: extended);
    var
      veloX, veloY, windX, windY, veloMag, dist, randomDist, lastDist, D : extended;
      lastX, lastY, MSP, W, TDist, T : integer;
      sqrt2, sqrt3, sqrt5, PDist, maxStep : extended;
    begin
      MSP  := MouseSpeed;
      sqrt2:= sqrt(2);
      sqrt3:= sqrt(3);
      sqrt5:= sqrt(5);
    
      TDist := Distance(Round(xs), Round(ys), Round(xe), Round(ye));
      if (TDist < 1) then
        TDist := 1;
      MarkTime(T);
      repeat
        if (TimeFromMark(T)>5000) then
          break;
    
        dist:= hypot(xs - xe, ys - ye);
        wind:= minE(wind, dist);
        if (dist < 1) then
          dist := 1;
        PDist := (dist/TDist);
        if (PDist < 0.01) then
          PDist := 0.01;
    
        {
          These constants seem smooth to me, but
          feel free to modify these settings however
          you wish.
        }
    
        if (PDist >= 0.15) then                                 //15% (or higher) dist to destination
        begin
          D := (Round((Round(dist)*0.3))/5);
          if (D < 20) then
            D := 20;
        end else if (PDist < 0.15) then
        begin
          if ((PDist <= 0.15) and (PDist >= 0.10)) then         //10%-15%
            D := RandomRange(8, 13)
          else if (PDist < 0.10) then                           //< 10%
            D := RandomRange(4, 7);
        end;
    
        if (D <= Round(dist)) then
          maxStep := D
        else
          maxStep := Round(dist);
    
        if dist >= targetArea then
        begin
          windX:= windX / sqrt3 + (random(round(wind) * 2 + 1) - wind) / sqrt5;
          windY:= windY / sqrt3 + (random(round(wind) * 2 + 1) - wind) / sqrt5;
        end else
        begin
          windX:= windX / sqrt2;
          windY:= windY / sqrt2;
        end;
    
        veloX:= veloX + windX;
        veloY:= veloY + windY;
        veloX:= veloX + gravity * (xe - xs) / dist;
        veloY:= veloY + gravity * (ye - ys) / dist;
    
        if (hypot(veloX, veloY) > maxStep) then
        begin
          randomDist:= maxStep / 2.0 + random(round(maxStep) div 2);
          veloMag:= sqrt(veloX * veloX + veloY * veloY);
          veloX:= (veloX / veloMag) * randomDist;
          veloY:= (veloY / veloMag) * randomDist;
        end;
    
        lastX:= Round(xs);
        lastY:= Round(ys);
        xs:= xs + veloX;
        ys:= ys + veloY;
    
        if (lastX <> Round(xs)) or (lastY <> Round(ys)) then
          MoveMouse(Round(xs), Round(ys));
    
        W := (Random((Round(100/MSP)))*6);
        if (W < 5) then
          W := 5;
        W := Round(W*1.2);
        wait(W);
        lastdist:= dist;
      until(hypot(xs - xe, ys - ye) < 1)
    
      if (Round(xe) <> Round(xs)) or (Round(ye) <> Round(ys)) then
        MMouse(Round(xe), Round(ye), 0, 0);
    
      MouseSpeed := MSP;
    end;
    
    
    
    //CREDITS TO FLIGHT
    procedure BrakeMMouse(eX, eY, ranX, ranY: Integer);
    var
      randSpeed : extended;
      X, Y, MS : integer;
    begin
      MS := MouseSpeed;
      randSpeed := (random(MouseSpeed) / 2.0 + MouseSpeed) / 10.0;
      GetMousePos(X, Y);
      BrakeWindMouse(X, Y, RandomRange(eX-ranX, eX+ranX), RandomRange(eY-ranY,eY+ranY), 8, 5, 10.0 / randSpeed, 15.0 / randSpeed, 10.0 * randSpeed);
      MouseSpeed := MS;
    end;
    
    
    
    procedure RandomMMouse(eX, eY, ranX, ranY: Integer);
    begin
      case Random(2) of
        0: BrakeMMouse(eX,eY,ranX,ranY);
        1: MMouse(eX,eY,ranX,ranY);
      end;
    end;
    
    
    
    procedure MakeScreenShot(const FilePath : String);                              //makes small sized jpg screenshot
    var                                                                             //example for FilePath 'C:\Simba\Screenshots\ChaosMossKiller\levelups'
      fileName : String;
      Year, Month, Day : Word;
      i : Integer;
    begin
      if TakeScreenShots then
      begin
        if not DirectoryExists(ScreenShotsPath) then
          CreateDirectory(ScreenShotsPath);
        if not DirectoryExists(FilePath) then
          CreateDirectory(FilePath);
        DecodeDate(Date,Year,Month,Day);
        i := 0;
        repeat
          i := i+1;
          FileName := ToStr(Year) + '-' + ToStr(Month) + '-' + ToStr(Day) + ' (' + IntToStr(i) + ').jpg';
        until not FileExists(FilePath + FileName)
        SaveScreenShot(FilePath + FileName);                                        //example for filename '2012-3-21 (1).jpg'
      end;
    end;
    
    
    
    procedure DebugMossies(TPA: TPointArray; ATPA: Array of TPointArray; Box: TBox);
    var
      BMP, Color, x, y, i : Integer;
      TPABox : TBox;
    begin
      BMP := BitmapFromClient(0,0,MSX2,MSY2);                                       //making a bitmap, adding the mainscreen image to it
      DrawTPABitmap(BMP,TPA,ClRed);                                                 //adding TPA to the bitmap
    
      if TPABox.x1 < 0 then TPABox.x1 := 0;
      if TPABox.x1 > MSX2 then TPABox.x1 := MSX2;
    
      if TPABox.x2 < 0 then TPABox.x2 := 0;
      if TPABox.x2 > MSX2 then TPABox.x2 := MSX2;
    
      if TPABox.y1 < 0 then TPABox.y1 := 0;
      if TPABox.y1 > MSY2 then TPABox.y1 := MSY2;
    
      if TPABox.y2 < 0 then TPABox.y2 := 0;
      if TPABox.y2 > MSY2 then TPABox.y2 := MSY2;
    
      if Box.x1 < 0 then Box.x1 := 0;
      if Box.x1 > MSX2 then Box.x1 := MSX2;
    
      if Box.x2 < 0 then Box.x2 := 0;
      if Box.x2 > MSX2 then Box.x2 := MSX2;
    
      if Box.y1 < 0 then Box.y1 := 0;
      if Box.y1 > MSY2 then Box.y1 := MSY2;
    
      if Box.y2 < 0 then Box.y2 := 0;
      if Box.y2 > MSY2 then Box.y2 := MSY2;
    
      for i := 0 to high(ATPA) do
      begin
        if i = 0 then
          Color := ClYellow
        else
          Color := ClBlack;
    
        TPABox := GetTPABounds(ATPA[i]);                                            //getting the box of the TPAs
        for x := TPABox.x1 to TPABox.x2 do
        begin
          FastSetPixel(BMP,x,TPABox.y1,Color)
          FastSetPixel(BMP,x,TPABox.y2,Color)
        end;
        for y := TPABox.y1 to TPABox.y2 do
        begin
          FastSetPixel(BMP,TPABox.x1,y,Color)
          FastSetPixel(BMP,TPABox.x2,y,Color)
        end;
      end;
    
      for x := Box.x1 to Box.x2 do                                                  //this is for the dead Moss giant
      begin
        FastSetPixel(BMP,x,Box.y1,ClRed)
        FastSetPixel(BMP,x,Box.y2,ClRed)
      end;
      for y := Box.y1 to Box.y2 do
      begin
        FastSetPixel(BMP,Box.x1,y,ClRed)
        FastSetPixel(BMP,Box.x2,y,ClRed)
      end;
    
      DebugBitmap(BMP);
      FreeBitmap(BMP);
    end;
    
    
    
    procedure DebugPoints(TPA: TPointArray; ATPA: Array of TPointArray);
    var
      BMP, Color, x, y, i : Integer;
      TPABox : TBox;
    begin
      BMP := BitmapFromClient(0,0,MSX2,MSY2);                                       //making a bitmap, adding the mainscreen image to it
      DrawTPABitmap(BMP,TPA,ClRed);                                                 //adding TPA to the bitmap
    
      for i := 0 to high(ATPA) do
      begin
        if i = 0 then
          Color := ClYellow
        else
          Color := ClBlack;
    
        TPABox := GetTPABounds(ATPA[i]);                                            //getting the box of the TPAs
        for x := TPABox.x1 to TPABox.x2 do
        begin
          FastSetPixel(BMP,x,TPABox.y1,Color)
          FastSetPixel(BMP,x,TPABox.y2,Color)
        end;
        for y := TPABox.y1 to TPABox.y2 do
        begin
          FastSetPixel(BMP,TPABox.x1,y,Color)
          FastSetPixel(BMP,TPABox.x2,y,Color)
        end;
      end;
    
      DebugBitmap(BMP);
      FreeBitmap(BMP);
    end;
    
    
    
    procedure StatusWithPaint(What: String);
    begin
      Status(What);
      if PaintStatus then
      begin
        SMART_ClearCanvasArea(IntToBox(MSX1,320+50,MSX2,343+50));                   //clears the previous text
        SMART_DrawTextEx(false,8,322,UpChars,What,ClWhite);                         //draws the new text
      end;
    end;
    
    
    
    function CurrentTime: String;                                                   //function for time display, example: [17:53:59]
    var
      Hour, Mins, Sec, MSec: Word;
    begin
      DecodeTime(Now, Hour, Mins, Sec, MSec);
      Result := ('['+Padz(IntToStr(Hour), 2) + ':' + Padz(IntToStr(Mins), 2) + ':' + Padz(IntToStr(Sec), 2)+'] ');
    end;
    
    
    
    procedure EndScript(Reason: String);                                            //function for terminating, message box will pop up
    begin
      MakeScreenShot(ScreenShotsPath + 'stops\');
      Disguise('Stopped');
      Writeln(CurrentTime + Reason);
      PlaySound('C:\Simba\sound.wav');
      //MessageBox(CurrentTime + Reason,'ChaosMossKiller',0);
    end;
    
    
    
    procedure Antiban;                                                              //basic antibans
    begin
      case Random(2400) of
        0..1:
        begin
          if TrainedSkill = 'TOTAL' then Exit;
          StatusWithPaint('Checking trained level.');
          HoverSkill(TrainedSkill,false);
          Wait(RandomRange(1000,3000));
          GameTab(tab_Inv);
        end;
        10..11:
        begin
          StatusWithPaint('Checking random level.');
          HoverSkill('random',false);
          Wait(RandomRange(1000,3000));
          GameTab(tab_Inv);
        end;
        20..21:
          PickUpMouse;
        30..39:
          CompassMovement(-180,180,false);
        40:
        begin
          if LevelString = 'RNG' then
          begin
            StatusWithPaint('Checking equipments.');
            GameTab(tab_Equip);
            Wait(RandomRange(1000,3000));
            GameTab(tab_Inv);
          end;
        end;
        100..400:
          SleepAndMoveMouse(RandomRange(300,1200));
      end;
    end;
    
    
    
    procedure AmmoCheck;                                                            //removes weapon if needed to prevent death, then terminates
    var
      i : Integer;
      done : Boolean;
    begin
      if LevelString = 'RNG' then
        if FindChatBoxText('You have no ammo',8,ClBlack) then
        begin
          StatusWithPaint('Out of ammo.');
          Wait(1000);
          if srl_inFight then
          begin
            StatusWithPaint('Still fighting, removing weapon.');
            GameTab(tab_Inv);
            if InvFull then
            begin
              i := 1;
              done := False;
              repeat
                MMouseItem(i);
                if IsUpTextMultiCustom(['Bury','Eat']) then
                  if DropItem(i) then
                    done := True;
                Inc(i);
              until done
            end;
            GameTab(tab_Equip);
            if WearingItem(5) then
              TakeOff(5);
            StatusWithPaint('Removed weapon.');
            EndScript('Out of ammo.');
          end;
        end;
    end;
    
    
    
    procedure BreakB2P;                                                             //breaks b2p tablet, terminates if out of it
    var
      X, Y, PeachDTM, FailTime : Integer;
    begin
      PeachDTM := DTMFromString('78DA632C60626070626440069B3B52194480344C94310FA8C60C550D030313AA9A32A01A0B026A6A806A1C08A8A906AA7127A006E4663F026A52883007A4C69E809A4CC2FE0200D76708C1');
    
      MarkTime(FailTime);
      repeat
        MarkTime(FailTime);                                                       //extending time for fails
        GameTab(tab_Inv);
        InvMouse(28,mouse_move);                                                    //b2p must be on 28th slot (had some problems creating DTM for it...)
        if WaitUpText('Break',200) then
        begin
          StatusWithPaint('Breaking B2P.');
          ClickMouse2(mouse_left);
          if WaitFindDTMEx(PeachDTM,X,Y,MIX1,MIY1,MIX2,MIY2,100,10000) then         //peach found
          begin
            Inc(B2PUsed);
            FreeDTM(PeachDTM);
            Exit;
          end else
            if FindChatBoxText('any bones',8,ClBlack) then
              EndScript('Ouf of bones.');
        end;
        if (TimeFromMark(FailTime) > 10000) then
          EndScript('Cant find B2P tablets.');
      until False
    
      FreeDTM(PeachDTM);
    end;
    
    
    
    function EatFood(FoodString: String): Boolean;                                  //returns False if no food found
    var
      X, Y, FoodDTM, EatTime, WaitTime, i : Integer;
    begin
      FoodDTM := DTMFromString(FoodString);
    
      Result := True;
      GameTab(tab_Inv);
      if WaitFindDTMEx(FoodDTM,X,Y,MIX1,MIY1,MIX2,MIY2,100,1000) then               //food found
      begin
        StatusWithPaint('Eating.');
        i := InvCount;
        Mouse(X,Y,5,5,mouse_left);
        WaitTime := RandomRange(2000,3000);
        MarkTime(EatTime);
        repeat
          if (InvCount < i) then
          begin
            Inc(FoodUsed);
            Dec(i);
          end;
        until (TimeFromMark(EatTime) > WaitTime)
      end
      else
        Result := False;
                                                                                    //no food found
      FreeDTM(FoodDTM);
    end;
    
    
    
    procedure HpCheck;                                                              //eats if HP is below EatAt. uses b2p. eats to full without wasting
    var
      colorstring, Lobster, Peach : String;
      Amount : Integer;
      done : Boolean;
    begin
    
      if (GetMMLevels('hp', colorstring) < EatAt) then
      begin
        repeat
          if not b2p then                                                           //eats lobsters first
          begin
            Amount := 120;                                                          //healing amount of lobster
            Lobster := 'mggAAAHicY2NgYPjPxMDAzczAwMcMYX8E4p9ALMbIwMAKxNxArMAI4fMC8f4EGaAuJgwsAiSxYUYcGAIAcgoGSA==';
            if not EatFood(Lobster) then                                            //if cant find lobster
            begin
              if not BonesToPeaches then                                            //if not using B2P, then terminates
                EndScript('Out of food.')
              else
                b2p := True;                                                        //turns on b2p
            end;
          end;
          if b2p then
          begin
            Amount := 80;                                                           //healing amount of peach
            Peach := '78DA633CCCC4C0F0809101196C6E4F66F802148289321E02AAB982AA8681810955CD59A09AEB986AB81890D45C00AAB94F40CD49A09AD704D4EC02AA794140CD0EA09A3BF8D500007F980F5F'
            if not EatFood(Peach) then                                              //if out of peaches
            begin
              BreakB2P;
              EatFood(Peach);
            end;
          end;
          if (GetMMLevels('hp', colorstring) + Amount) > (HpLevel * 10 ) then       //if no need to eat more (CurrentHP + HealAmount > MaxHP)
            done := True;
        until done
      end;
    end;
    
    
    
    function FindMoss(ClickOnIt: Boolean) : Boolean;                                //returns True if clicked on a Moss giant
    var
      TPA, TempTPA : TPointArray;
      ATPA : Array of TPointArray;
      X, Y, RedX, RedY, ExcX, ExcY, i, MinPoints, DetectTime, UptextTime, RedBarDTM : Integer;
      Colors, Tolerances : Array of Integer;
    begin
      Result := False;
      MarkTime(DetectTime);
      MinPoints := 100;
      //6257521 (8)   portal színe, tökéletes
      //2173227 (5)   nincs már sötét fal (eddig 7 jó volt)
      //2372406 (8)   nincs már (12 volt) nagyon kicsi barna fából
      //2309694 (7)   nincs nagyon nagyon kicsi barna fából
      //3303025 (14)  sárgásbarna, tökéletes
      //4482405 (13)
      Colors     := [6257521, 2173227, 2372406, 2309694, 3303025, 4482405];
      Tolerances := [8,       5,       8,       7,       15,      13     ];
    
      for i:=0 to High(Colors) do
      begin
        FindColorsTolerance(TempTPA,Colors[i],MSX1,MSY1,MSX2,MSY2,Tolerances[i]);
        AppendTPA(TPA,TempTPA);
      end;
    
      if (High(TPA)> 0) then
      begin
    
        RedBarDTM := DTMFromString('mWAAAAHicY2FgYNgCxOeh+AIQRwFxOBDHQtk7GTgYrNmZ4FgEKIaMGdEwCAAAoEoGcA==');
        if WaitFindDTMex(RedBarDTM,X,Y,MSX1,MSY1,MSX2,MSY2,10,100) then             //excluding points near RedHpBar
        begin
          RedX := X;                                                                //middle of the redbar
          RedY := Y+50;
          ExcX := 35;                                                               //excluding distance
          ExcY := 60;
          SortTPAFrom(TPA,Point(RedX,RedY));
          InvertTPA(TPA);
          for i:=0 to High(TPA) do
            if (Abs(TPA[i].x - RedX) < ExcX) and (Abs(TPA[i].y - RedY) < ExcY) then
              Break;
          if i = 0 then
          begin
            FreeDTM(RedBarDTM);
            Exit;
          end;
          SetArrayLength(TPA,i);
        end;
        FreeDTM(RedBarDTM);
    
        SortTPAFrom(TPA,Point(MSCX,MSCY));                                          //excluding points near middle
        InvertTPA(TPA);
        for i:=0 to High(TPA) do
        if (Abs(TPA[i].x - MSCX) <  25) and (Abs(TPA[i].y - MSCY) <  25) then
          Break;
        if i = 0 then Exit;
        SetArrayLength(TPA,i);
    
        ATPA := SplitTPA(TPA,10);                                                   //splitting TPAs
    
        SortATPASize(ATPA,True);                                                    //excluding TPAs with less than MinPoints points
        for i:=0 to High(ATPA) do
        begin
          if High(ATPA[i]) < MinPoints then
            Break;
        end;
        if i = 0 then Exit;
        SetArrayLength(ATPA,i);
    
        SortATPAFromFirstPoint(ATPA,Point(MSCX,MSCY));                              //making the closest TPA the first in the array
    
        if DebugWindow then                                                         //DebugWindow
          DebugMossies(TPA,ATPA,IntToBox(RedX-ExcX,RedY-ExcY,RedX+ExcX,RedY+ExcY));
    
        if ClickOnIt then
        begin
          if MiddleTPAEx(ATPA[0],X,Y) then                                          //getting the middle point of the TPA, moving mouse there then looking for uptext
          begin
            MMouse(X,Y,0,0);
            MarkTime(UptextTime);
            if WaitUpTextMulti(['Attack','ttack','Moss'],200) then
            begin
              if DebugLines then                                                    //DebugLines
                Writeln('Found Moss in ' + IntToStr(TimeFromMark(DetectTime)) + ' ms. Uptext was ' + IntToStr(TimeFromMark(UptextTime)) + ' ms.');
              case Random(6) of                                                     //random left or right click (5:1)
                0..4:
                begin
                  ClickMouse2(mouse_left);
                  if DidRedClick then
                    Result := True;                                                 //clicked on moss
                  Exit;
                end;
                5:
                begin
                  ClickMouse2(mouse_right);
                  if ChooseOption('Attack') then
                    Result := True;
                  Exit;
                end;
              end;
            end else
              if DebugLines then                                                    //DebugLines
                Writeln('Found Moss in ' + IntToStr(TimeFromMark(DetectTime)) + ' ms, but failed to find UpText.');
          end;
        end else
          if DebugLines then                                                        //DebugLines
            Writeln('Found Mosses in ' + IntToStr(TimeFromMark(DetectTime)) + ' ms.');
      end;
    end;
    
    
    
    function FindBones(): Array of TPoint;                                          //returns the bones' middle points as a TPA
    var
      TPA, TempTPA : TPointArray;
      ATPA : Array of TPointArray;
      CTS, Time, MinPoints, i, Which : Integer;
      Colors, Tolerances : Array of Integer;
      HueMods, SatMods : Array of Extended;
    begin
    
      MarkTime(Time);
    
      MinPoints := 10;
      Colors      := [12895698, 13356502, 12567496];
      Tolerances  := [11,       6,        6       ];
      HueMods     := [0.11,     0.43,     0.20    ];
      SatMods     := [0.76,     0.85,     0.60    ];
    
      CTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      for i:=0 to High(Colors) do
      begin
        SetToleranceSpeed2Modifiers(Huemods[i],SatMods[i]);
        FindColorsTolerance(TempTPA,Colors[i],MSX1,MSY1,MSX2,MSY2,Tolerances[i]);
        AppendTPA(TPA,TempTPA);
      end;
      ColorToleranceSpeed(CTS);
    
      if (High(TPA)> 0) then
      begin
    
        SortTPAFrom(TPA,Point(MSCX,MSCY));                                          //excluding points near middle
        InvertTPA(TPA);
        for i:=0 to High(TPA) do
          if (Abs(TPA[i].x - MSCX) <  15) and (Abs(TPA[i].y - MSCY) <  15) then
            Break;
        if i = 0 then Exit;
        SetArrayLength(TPA,i);
    
        ATPA := SplitTPA(TPA,10);                                                    //splitting the TPA
    
        SortATPASize(ATPA,true);                                                    //excluding TPAs with less than MinPoints points
        for i:=0 to High(ATPA) do
        begin
          if High(ATPA[i]) < MinPoints then
            Break;
        end;
        if i = 0 then Exit;
        SetArrayLength(ATPA,i);
    
        SortATPAFromFirstPoint(ATPA,Point(MSCX,MSCY));                              //first TPA is the closest to middle
    
        if DebugWindow then                                                         //DebugWindow
          DebugPoints(TPA,ATPA);
    
        SetLength(Result,Length(ATPA));                                             //setting up the Result array
        if (Length(ATPA) > 0) then
          for i:=Low(ATPA) to High(ATPA) do
          begin
            if MiddleTPAEx(ATPA[i],X,Y) then
            begin
              Result[i] := Point(X,Y);                                              //copying the values
            end;
          end;
      end;
    
    end;
    
    
    
    function WaitInvChange(Timeout: Integer) : Boolean;                             //returns True if pixels changed in inventory (usage: counting charms)
    var
      Time : Integer;
    begin
      MarkTime(Time);
      repeat
        if (PixelShift(IntToBox(MIX1,MIY1,MIX2,MIY2),50) > 1) then
        begin
          Result := True;
          Exit;
        end;
     until (TimeFromMark(Time) > TimeOut)
     Result := False;
    end;
    
    
    
    function WaitInFight(Timeout: Integer) : Boolean;                               //returns True if XP is increased or blue shield is found
    var
      X, Y, XP1, XP2, ShieldDTM, Time : Integer;
    begin
      MarkTime(Time);
      ShieldDTM := DTMFromString('mbQAAAHicY2VgYFBhhGAtIDaE0q+B4l+A+DcQvwTir0DMYu0Jx3///mXgqN/KwAUUR8eMWDAYAAD4KAuS');
      repeat
        if (XP2 > XP1) then
        begin
          if DebugLines then
            Writeln('XP is increased, we are fighting.');
          if PaintDebug then
          begin
            SMART_DrawBoxEx(false,false,IntToBox(524,104-50,543,123-50),ClYellow);  //drawing box on xp button
            Wait(50);
            SMART_ClearCanvasArea(IntToBox(520,100,547,127));
          end;
          Result := True;
          FreeDTM(ShieldDTM);
          Exit;
        end;
        if (TimeFromMark(Time) > 3000) and FindDTM(ShieldDTM,X,Y,MSX1,MSY1,MSX2,MSY2) then
        begin
          if DebugLines then
            Writeln('Blue shield found, we are fighting.');
          Result := True;
          FreeDTM(ShieldDTM);
          Exit;
        end;
      until (TimeFromMark(Time) > Timeout)
      FreeDTM(ShieldDTM);
      Result := False;
    end;
    
    
    
    function InFight: Boolean;                                                      //returns True if fighting
    begin                                    //LastHitXP and LastHitTime are global variables
      begin
        MarkTime(LastHitTime);
        Result := True;
        Exit;
      end;
      if (TimeFromMark(LastHitTime) > 10000) then
      begin
        Result := False;
        Exit;
      end;
      Result := True;
    end;
    
    
    
    function FindRedBar : Boolean;                                                  //returns True if a full red hp bar is found
    var
      X, Y, RedBarDTM1, RedBarDTM2 : Integer;
    begin
      Result := False;
      RedBarDTM1 := DTMFromString('mlwAAAHicY2dgYDBnZmCQBWIZKB0ExQpA3AiUr2OA0C1QDOPvZOBgsGZnwsBdDIwM+AAjHgwFAAvPB5w='); //two DTMs just in case
      RedBarDTM2 := DTMFromString('mlwAAAHicY2dgYDBnZmCQBWIZKB0ExQpA3AiUr2OA0C1QDOPvZOBgsGZnwsBdDIwM+AAjHgwFAAvPB5w=');
    
      if FindDTM(RedBarDTM1,X,Y,MSX1,MSY1,MSX2,MSY2) or
         FindDTM(RedBarDTM2,X,Y,MSX1,MSY1,MSX2,MSY2) then
      begin
        if DebugLines then
          Writeln('Found redbar, we killed it.');
        if PaintDebug then
        begin
          SMART_DrawBoxEx(false,false,IntToBox(X-30,Y-10,X+30,Y+10),ClYellow);      //drawing box around the redbar
          Wait(50);
          SMART_ClearCanvasArea(IntToBox(0,MSY1+49,520,MSY2+50));
        end;
        Result := True;
      end;
      FreeDTM(RedBarDTM1);
      FreeDTM(RedBarDTM2);
    end;
    
    
    
    procedure ClearInv;                                                             //arranges inventory, keeps the slot of InvIndex empty, drops accidently picked up junks
    var
      i : Integer;
      DropItems : Array of String;
    begin
      if not PickUpLoots then
        Exit;
    
      if InvIndex = 28 then
        EndScript('Inventory is full.');
    
      DropItems :=[
        'Whiteberry s','Jangerberry','Marrentill','Black sq','Black f','Magic st','Air r','Chaos r','Earth r',
        'Steel b','Mithril s'
      ];
    
      if ExistsItem(InvIndex) then
      begin
        MouseItem(InvIndex,mouse_move);
    
        if IsUptext('Use') and not IsUpText('Bury') and not IsUpText('Eat') then
        begin
          MakeScreenShot(ScreenShotsPath + 'invinc\');
          Inc(InvIndex);
          Wait(RandomRange(300,800));
        end
        else
          if InvFull then
          begin
            ClickMouse2(mouse_right);
            ChooseOption('Drop');
            Wait(RandomRange(300,800));
            Exit;
          end
          else
            for i:=InvIndex+1 to 27 do
            begin
              if not ExistsItem(i) then
              begin
                DragItem(InvIndex,i);
                Wait(RandomRange(300,800));
                Exit;
              end;
            end;
    
    
    
      end;
    
      if PaintDebug then
      begin
        SMART_ClearCanvasArea(IntToBox(MIX1,MIY1+50,MIX2,MIY2+50));
        SMART_DrawBoxEx(false,false,InvBox(InvIndex),ClBlack);
      end;
    end;
    
    
    
    function Loot(PickUpBones: Boolean): Integer;                                   //-1: nothing looted, else number of items left to loot
    var
       B: TBox;
       i, j, x: Integer;
       T: TPoint;
       Options: Array of TOptions;
       HowManyToLoot, OptionsArrayNumber, LootsArrayNumber : Integer;
    begin
      Result := -1;
      HowManyToLoot := 0;
      OptionsArrayNumber := -1;
    
      Options := GetChooseOptions('action');
      if (Length(Options) < 1) then
        Exit;
    
      if PickUpLoots then
      begin
        for i := 0 to High(Loots) do                                                //checking each items wether they match with the options
          for j := 0 to High(Options) do
          begin
            if Pos('Take ' + Loots[i], Options[j].Str) > 0 Then
            begin
              Inc(HowManyToLoot);                                                   //+ 1 to loot
              if OptionsArrayNumber = -1 then                                       //if its first match it will be the first to loot
              begin
                LootsArrayNumber := i;                                              //the item's number in the loots list
                OptionsArrayNumber := j;                                            //the items's number in the options list
              end;
            end;
          end;
      end;
    
      if not (OptionsArrayNumber = -1) then                                         //-1 means nothing to loot
      begin
        case LootsArrayNumber of
          0..3:   StatusWithPaint('Found a ' + Loots[LootsArrayNumber] + ' charm!');
          4..36:  StatusWithPaint('Found item: ' + Loots[LootsArrayNumber]);
        end;
    
        B := Options[OptionsArrayNumber].Bounds;
        GetMousePos(T.x, T.y);
        if PointInBox(T, B) then
          ClickMouse2(mouse_left)
        else
          MouseBoxEx(B.x1+5,B.Y1,B.x2-5,B.Y1+5,5,mouse_left);
    
        if WaitInvChange(5000) then
        begin
          case LootsArrayNumber of
            0: Inc(GoldCharms);
            1: Inc(GreenCharms);
            2: Inc(CrimsonCharms);
            3: Inc(BlueCharms);
          end;
        end;
        Result := HowManyToLoot-1;
        Exit;
      end;
    
      if PickUpBones then
        for i := 0 to High(Options) do
        begin
          if Pos('Take Big', Options[i].Str) > 0 Then
            begin
              StatusWithPaint('Found bones.');
    
              B := Options[i].Bounds;
              GetMousePos(T.x, T.y);
              if PointInBox(T, B) then
                ClickMouse2(mouse_left)
              else
                MouseBoxEx(B.x1+5,B.Y1,B.x2-5,B.Y1+5,5,mouse_left);
    
              WaitInvChange(5000);
              //repeat until not IsMoving
              Result := 0;
              Exit;
            end;
        end;
    
      //B := Options[0].BigBox;
      //x := Max(B.X1-52,0);
      //if x = 0 then
        //x := B.X2+10;
      //MMouse(x,Max(B.Y1-50,0),40,B.Y2-B.Y1);
    
      GetMousePos(X,Y);                                                             //more human-like 'moving mouse away'
      B := Options[0].BigBox;
      MMouse(RandomRange(X-30,X+30),RandomRange(B.Y1-40,B.Y1-80),0,0);
    
      Wait(RandomRange(300,800));
    end;
    
    
    
    procedure LootPileCheck;                                                        //checks more bones randomly, exits after 1 pickup
    var
      i, Res : Integer;
      Bones : Array of TPoint;
      LootBones : Boolean;
    begin
      ClearInv;
    
      if InvCount < 27 then
        LootBones := True
      else
        LootBones := False;
    
      Bones := FindBones;
      if (Length(Bones) > 0) then
      begin
        StatusWithPaint('Checking loots.');
        for i:=Low(Bones) to High(Bones) do
        begin
          case Random(2) of
            0:
            begin
              RandomMMouse(Bones[i].x,Bones[i].y,0,0);
              ClickMouse2(mouse_right);
              Res := Loot(LootBones);
              ClearInv;
              if Res > 0 then
              begin
                for i:=1 to Res do
                begin
                  repeat until not IsMoving
                  RandomMMouse(MSCX,MSCY,5,5);
                  ClickMouse2(mouse_right);
                  Loot(False);
                  ClearInv;
                end;
              end;
              if not (Res = -1) then
                Exit;                                                               //positions changed, cant check more
            end;
          end;
        end;
      end;
    end;
    
    
    
    procedure HopWorld;
    begin
      StatusWithPaint('Hopping.');
      WorldHops := WorldHops+1;
    
      repeat
        ExitToLobby;
        LoginPlayerToLob;                                                           //in case we get kicked out to login screen
      until LobbyScreen;
    
      OpenWorldScreen;
      SelectWorld(RandomWorld(true,false));
    
      repeat
        LoginPlayer;
      until LoggedIn
    
      Wait(RandomRange(3000,6000));
    
      SmartSetDebug(True);
      SmartSetRefresh(100);
      if not SmartEnabled then
        SmartSetEnabled(True);
    
      ExitSquealOfFortune;
      SetAngle(SRL_ANGLE_HIGH);
    
    end;
    
    
    
    procedure WalkToCenter;                                                         //simple SPS
    begin
      StatusWithPaint('Walking to center.');
      SPS_WalkToPos(Point(335, 374));
    end;
    
    
    
    procedure SpecialAttack;                                                        //does special attacks in random times
    var
      X, Y, DTM100, DTM75, DTM60, DTM55, DTM50, DTM25, FailTime : Integer;
    begin
      if (UseSpecAttacks) and ((TimeFromMark(SpecTime) > SpecWait) or (SpecNumber > 0)) then //if specials are turned on and (if its time to check for special or we have remaining specials to do)
      begin
        StatusWithPaint('Checking special attack.');
        DTM100 := DTMFromString('mWAAAAHicY2FgYHBgYmCwB+IjULyQkYFhHRAvAOI1QFyzIo9BSl+EwT/XkiGi2oGBC6gHGTOiYRAAAPnmCNY=');   //DTMS for 100%,75% ... special bars
        DTM75  := DTMFromString('mQwAAAHicY2ZgYLBnguAFIMzIwLAWiJcBsXOyIYOmpwJDep83AxdQHQwzImEgAAD6tQXo');
        DTM60  := DTMFromString('mQwAAAHicY2ZgYHBgYmCwB+IuIF7EyMCwhhFCt2wuZTDyUmWYcKSegQuoDoYZkTAQAAAooAdH');
        DTM55  := DTMFromString('mQwAAAHicY2ZgYGhmgeDjQCzNxMCgCcSyQOycbMggpS/CMOFIPQMXUB0MMyJhIAAA5cgFbA==');
        DTM50  := DTMFromString('mQwAAAHicY2ZgYHBgYmCwB+JaIF7EyMCwhhFCt2wuZTDyUmWYcKSegQuoDoYZkTAQAAAl1Qc6');
        DTM25  := DTMFromString('mQwAAAHicY2ZgYHBgYmCwB+IoIF7EyMCwhhFCt2wuZTDyUmWYcKSegQuoDoYZkTAQAAAeUAcX');
        SpecNumber := 0;
        MarkTime(FailTime);
    
        GameTab(tab_Combat);
        SpecNumber := 0;                                                            //determining how many specials we can do
        case SpecUsage of
          100:
            if FindDTM(DTM100,X,Y,MIX1,MIY1,MIX2,MIY2) then
              SpecNumber := 1;
          75:
            if FindDTM(DTM75,X,Y,MIX1,MIY1,MIX2,MIY2) then
              SpecNumber := 1;
          60:
            if FindDTM(DTM60,X,Y,MIX1,MIY1,MIX2,MIY2) then
              SpecNumber := 1;
          55:
            if FindDTM(DTM55,X,Y,MIX1,MIY1,MIX2,MIY2) then
              SpecNumber := 1;
          50:
          begin
            if FindDTM(DTM50,X,Y,MIX1,MIY1,MIX2,MIY2) then
              SpecNumber := 1;
            if FindDTM(DTM100,X,Y,MIX1,MIY1,MIX2,MIY2) then
              SpecNumber := 2;
          end;
          25:
          begin
            if FindDTM(DTM25,X,Y,MIX1,MIY1,MIX2,MIY2) then
              SpecNumber := 1;
            if FindDTM(DTM50,X,Y,MIX1,MIY1,MIX2,MIY2) then
              SpecNumber := 2;
            if FindDTM(DTM75,X,Y,MIX1,MIY1,MIX2,MIY2) then
              SpecNumber := 3;
            if FindDTM(DTM100,X,Y,MIX1,MIY1,MIX2,MIY2) then
              SpecNumber := 4;
          end;
        end;
        MarkTime(SpecTime);
        SpecWait := RandomRange(15000,60000);                                       //next spec check in 15-60 seconds
        if SpecNumber > 0 then                                                      //if we have enough spec
        begin
          StatusWithPaint('Using special attack.');
          MouseBox(574,416,706,428,mouse_left);
          Dec(SpecNumber);
        end else                                                                    //if not enough
          StatusWithPaint('Not enough special.');
    
        Wait(RandomRange(1000,1500));
    
        GameTab(tab_Inv);
        FreeDTM(DTM100);
        FreeDTM(DTM75);
        FreeDTM(DTM60);
        FreeDTM(DTM55);
        FreeDTM(DTM50);
        FreeDTM(DTM25);
      end;
    end;
    
    
    
    procedure NoobCheck;                                                            //looks for people around, waits a bit then changes world. exits if they are gone for 3 seconds
    var
      MX, MY, NoobsAround, Time, WaitTime, Count : Integer;
    begin
    
      MX := 627;                                                                    //minimap's middle point
      MY := 136-50;
      NoobsAround :=  Length(GetMinimapDotsin('player',MX-28,MY-28,MX+28,MY+28));
    
      if NoobsAround > 0 then
      begin
        if PaintDebug then
          SMART_DrawBoxEx(false,false,IntToBox(MX-28,MY-28,MX+28,MY+28),ClRed);
        WaitTime := RandomRange(8000,12000);
    
        MarkTime(Time);
        repeat
          StatusWithPaint('Noobs around, waiting... ' + IntToStr((WaitTime-TimeFromMark(Time))/1000));
          NoobsAround :=  Length(GetMinimapDotsin('player',MX-28,MY-28,MX+28,MY+28));
          if NoobsAround = 0 then
            Inc(Count);
          if Count > 5 then                                                         //if cant see noobs anymore for 3 seconds
          begin
            StatusWithPaint('Noobs gone.');
            if PaintDebug then
              SMART_ClearCanvasArea(IntToBox(MMX1,MMY1+50,MMX2,MMY2+50));
            Exit;
          end;
          Wait(500);                                                                //6x500=3000
        until (TimeFromMark(Time) > WaitTime)
    
        if PaintDebug then
          SMART_ClearCanvasArea(IntToBox(MMX1,MMY1+50,MMX2,MMY2+50));
        HopWorld;
      end;
    end;
    
    
    
    procedure SetupScript;
    begin
      Disguise('ChaosMossKiller');
      ClearDebug;
    
      SRL_SixHourFix := True;
      Smart_FixSpeed := True;
    
      SetupSRL;
      DeclarePlayers;
      ClearDebug;
    
      SmartSetRefresh(100);
      if not SmartEnabled then
        SmartSetEnabled(True);
      SMART_ClearCanvas;
    
      SetupSRLStats(680, SRLStats_User, SRLStats_Password);
      SPS_Setup(RUNESCAPE_OTHER,['chaos_tunnels']);
    
      LoginPlayer;
    end;
    
    
    
    procedure OpenActionBar();
    begin
      writeln('Action bar is closed, opening it');
      mmouse(509,335,4,1);
      wait(randomrange(10,300));
      ClickMouse2(mouse_left);
    end;
    
    
    
    procedure SetupBar(); //working
      var x,y:integer;
    begin
      if (findcolortolerance(x,y,4013496,40,275,50,287,5)) then
      begin
        //writeln(inttostr(x)); Testing Purposes
        //writeln(inttostr(y)); testing purposes
        writeln('Action bar is already open.')
        exit;
      end;
      OpenActionBar;
    end;
    
    
    
    procedure CheckMomentum();   //checks if adrenaline is full, then activates momentum
      var x,y:integer;
    begin
      if(findcolortolerance(x,y,10221561,465,272,485,292,10)) then
      begin
        wait(randomrange(1,2000))
        mmouse(64,312,5,5)
        clickmouse2(mouse_left);
        writeln('using momentum')
        wait(randomrange(500,1000));
        mmouse(404,125,50,50)    ;
        exit;
      end;
    end;
    
    
    
    procedure Startup;
    var
      CombatLevel, XPTillNext, i : Integer;
    begin
    
      Loots :=[
          'Gold', 'Green', 'Crimson', 'Blue',
          'Yew', 'orstol', 'napdragon', 'Palm', 'Magic se', 'Saradomin', 'toadflax',
          'n ranarr', 'Ranarr', 'Rune b', 'Runite', 'Adamant b', 'Adamantite', 'Raw s',
          'Blood', 'Death', 'Nature r', 'Pure', 'Earth t', 'Vecna', 'orb', 'Battle',
          'Onyx', 'Rune a', 'Dragon d', 'Dragon h', 'Shield l', 'Starved', 'Spin T',
          'f weed s', 'me seed', 'Law r', 'Anag'
      ];
    
    
      SetChat('off',2);
      ExitSquealOfFortune;
      SetRun(True);
      SetupBar;
    
      CombatLevel := GetCombatLevel;
      //if CombatLevel < 85 then
        //ShowMessage('WARNING: Your combat level is too low, it is not advised to use this script.');
    
      if srl_inFight then
      begin
        StatusWithPaint('Waiting till fight is over.');
        repeat until not srl_InFight
      end;
    
      if not (TrainedSkill = 'TOTAL') then
      begin
        repeat
          StatusWithPaint('Getting trained level.')
          TrainedLevel := GetSkillLevel(TrainedSkill);
        until not (TrainedLevel = -1)
      end;
    
      repeat                                                                        //need to know hp level for eating
        StatusWithPaint('Getting hitpoints level.');
        HpLevel := GetSkillLevel('hitpoints');
      until not (HpLevel = -1)
    
      if not (TrainedSkill = 'TOTAL') then
      begin
        if TrainedLevel = 99 then
          XPTillNext := 0
        else
        begin
          repeat
            StatusWithPaint('Reading XP till next.');
            XPTillNext := XPTillNextLevel(TrainedSkill);
          until not (XPTillNext = -1);
        end;
      end;
    
      repeat
        StatusWithPaint('Reading XP counter.');
      until not (StartXP = -1);
    
      if not (TrainedSkill = 'TOTAL') then
        NextLevelAt := StartXP + XPTillNext;
    
      case TrainedSkill of
        'Attack'   : LevelString := 'ATK';
        'Strength' : LevelString := 'STR';
        'Defence'  : LevelString := 'DEF';
        'Range'    : LevelString := 'RNG';
        'Hitpoints': LevelString := 'HP';
        'TOTAL'    : LevelString := 'TOTAL';
      end;
    
      case DebugLines of
        true:   DoReport := False;
        false:  DoReport := True;
      end;
    
      b2p := False;
      WorldHops := 0;
      B2PUsed := 0;
      FoodUsed := 0;
      GoldCharms := 0;
      GreenCharms := 0;
      BlueCharms := 0;
      CrimsonCharms := 0;
    
      if UseSpecAttacks then
      begin
        SpecNumber := 0;
        SpecWait := RandomRange(15000,45000);
        MarkTime(SpecTime);
      end;
    
      MarkTime(StartTime);
      SetAngle(SRL_ANGLE_HIGH);
      GameTab(tab_Inv);
    
      for i:=1 to 28 do
      begin
        MouseItem(i,mouse_move);
        if IsUptextMultiCustom(['Eat','Bury'])or (not ExistsItem(i)) then
        begin
          InvIndex := i;
          Break;
        end
      end;
    
      ClearDebug;
      WriteLn(' ChaosMossKiller ' + Version);
      Writeln('');
      Writeln(' - Combat level  : ' + IntToStr(CombatLevel));
      if not (TrainedSkill = 'TOTAL') then
      begin
        if LevelString = 'HP' then
          Writeln(' - ' + LevelString + ' level      : ' + IntToStr(TrainedLevel))
        else
          Writeln(' - ' + LevelString + ' level     : ' + IntToStr(TrainedLevel));
        Writeln(' - XP till next  : ' + IntToStr(XPtillNext));
      end else
      begin
        WriteLn(' - No level tracking.');
        WriteLn(' - Counting all xp.');
      end;
      Writeln(' - XP Bar        : ' + IntToStr(StartXP));
      Writeln(' - Inv Index     : ' + IntToStr(InvIndex));
      WriteLn(' - Starting script...');
    
    end;
    
    
    
    procedure Main;
    var
      DetectTime, KillTime : Integer;
      done : Boolean;
    begin
      repeat
    
        StatusWithPaint('Looking for Mosses.');
        done := False;
        MarkTime(DetectTime);
        repeat
          if (TimeFromMark(DetectTime) > 300000) then                               //300 seconds failsafe (SMART restart needs time)
            EndScript('Not in fight for too long.');
    
          NoobCheck;
    
          checkmomentum();
    
          if FindMoss(true) then                                                    //if clicked on moss
          begin
            if WaitInFight(6000) then                                               //if xp is increased or blue shield found
              done:=True
          end
          else                                                                      //if failed to attack moss
          begin
            StatusWithPaint(IntToStr(Round(TimeFromMark(DetectTime)/1000)));
            case Random(20) of
              0: CompassMovement(-120,120,false);                                   //rotating camera for better view
            end;
            if (TimeFromMark(DetectTime) > 10000) then                              //walking back to middle
              WalkToCenter;
          end;
        until done
    
                                             //for InFight
        MarkTime(LastHitTime);                                                      //for InFight
        MarkTime(KillTime);
        repeat
          StatusWithPaint('Fighting.');
          Antiban;
          AmmoCheck;
          checkmomentum();
          if (TimeFromMark(KillTime) < 5000) then                                   //using specials only in the first 5 seconds to avoid wasting it on small hit
            SpecialAttack;
          if ((TimeFromMark(KillTime) > 3500) and (FindRedBar)) then                //looking for redbar after 5 seconds of fighting, to avoid detecting the previous moss giant's redbar
            Break;
          Wait(500);
        until not InFight
    
    
        StatusWithPaint('Killed Moss. Took '+MsToTime(TimeFromMark(KillTime),Time_Formal)+'.');
        stats_Commit;                                                               //committing stats (no variebles yet, only time)
    
    
        LootPileCheck;
    
    
        HpCheck;
        NoobCheck;
        checkmomentum();
    
    
      until False
    end;
    
    
    begin
    
      SetupScript;
      Startup;
      Main;
    
    end.
    eat at 2000.
    add actionbar
    momentum at n0.1
    this maybe good exp for low levels
    Last edited by qingqinghd; 12-03-2012 at 04:23 PM.

  19. #694
    Join Date
    Mar 2006
    Location
    NW US
    Posts
    210
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    Finally got my hands on a Saradomin Godsword, and knew just what I would do next....

    Update/tinker with this script! I added momentum support, and took out all looting/eating/b2p capabilities (I just commented them out in the main loop). It ended up making the combat a lot snappier.

    Anyways, if anyone wants to PM me i'll send them the version of the script I'm currently using.

    here's a proggy.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ChaosMossKiller v6.0
    * Time Running: 2 Hours, 25 Minutes and 53 Seconds
    * STR XP Gained: 90437 (37192)
    * STR Level: 73, XP till next: 50094
    * B2P: 0 Food: 0
    * Not picking up charms.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


    Shatterhand, your moss giant finding procedure still boggles my mind... I hope to understand it and adapt your methods to an AIO fighter that I will start soon...

    For this AIO fighter I plan on making in-combat detection by using the top left menu (crossed swords) and seeing if the player has a target there... should make for efficient fighting... Even though your findDTM method of looking for the red bar is great; it just doesn't allow the script to operate while other players are around.

    Anyways, thanks for the great script. Already at 85+ attack, 75+ defense, and working on strength now .

  20. #695
    Join Date
    Mar 2006
    Location
    NW US
    Posts
    210
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    Someone wanted the script, and I can't figure out how to attach it in a PM, so here it is...

    have momentum in your first slot of action bar, and have the action bar open.

    keep in mind this script does not eat. have a ring of life equipped (just in case) and you're going to need guthans or a saradomin godsword, or some other method of auto-self healing.
    Last edited by mr. pali; 12-11-2012 at 12:35 AM.

  21. #696
    Join Date
    Dec 2012
    Posts
    27
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I have this problem with the script! Whilest fighting, it keeps clicking the XP counter! Any ideas what might be causing this?

  22. #697
    Join Date
    Jan 2012
    Posts
    1,104
    Mentioned
    18 Post(s)
    Quoted
    211 Post(s)

    Default

    Quote Originally Posted by The Divided View Post
    I have this problem with the script! Whilest fighting, it keeps clicking the XP counter! Any ideas what might be causing this?
    Im sure you did not set up the XP counter properly. Read the "How to set up" part on the first post.
    Also the script is currently outdated, I take no responsibility for the fixes in the previous posts.

  23. #698
    Join Date
    Dec 2012
    Posts
    27
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Shatterhand View Post
    Im sure you did not set up the XP counter properly. Read the "How to set up" part on the first post.
    Also the script is currently outdated, I take no responsibility for the fixes in the previous posts.
    Thanks! this solved it. But i don't see how this script could be outdated since it's working all fine?

  24. #699
    Join Date
    Mar 2008
    Posts
    426
    Mentioned
    1 Post(s)
    Quoted
    116 Post(s)

    Default

    spiders under varrok are ok xp

  25. #700
    Join Date
    Dec 2012
    Posts
    2
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by mr. pali View Post
    Someone wanted the script, and I can't figure out how to attach it in a PM, so here it is...

    have momentum in your first slot of action bar, and have the action bar open.

    keep in mind this script does not eat. have a ring of life equipped (just in case) and you're going to need guthans or a saradomin godsword, or some other method of auto-self healing.
    much appreciated, currently using this one. First fighting script ive been able to get to work with no problem, probably because i didnt need to do any edits myself LoL

Page 28 of 29 FirstFirst ... 1826272829 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
  •