RM Power Cutter!

Discussion in 'RuneScape Scripts' started by Rasta Magician, May 14, 2008.

RM Power Cutter!
  1. Unread #1 - May 14, 2008 at 3:45 PM
  2. Rasta Magician
    Joined:
    Jan 5, 2008
    Posts:
    8
    Referrals:
    0
    Sythe Gold:
    0

    Rasta Magician Newcomer

    RM Power Cutter!

    hello everyone, I'm Rasta Magician at Srl Forums, I'm one of the Yellow members, and this is a script i posted there :) have a good look, enjoy and keep your eyes out for when i start Selling my Every Tree Banker and PowerChopper on these forums.

    You Need Rev #16 and Scar 3.15 for this script. Get Them Here

    RM Extreme Cutter
    By Rasta Magician, For all your cutting needs

    [​IMG]


    A Smart Cutter, the longer it runs, the better it gets!



    Features:
    !! Each Player can cut a different tree!
    !! Smart tree finding! New way to find trees!
    !! Fully AutoColor!
    ** Does not click ent and if tree turns into an ent it gets away from it and looks for another one!
    ** Realizes when your not cutting!
    ** AntiRandoms and AntiBan!
    ** MultiPlayer!
    ** SRL Stats!
    ** Good Progress Report!

    How To Use:
    - Fill in DeclarePlayers
    - Place your Players close to the desired trees
    - Axe in Inv or Equipped (or both)
    - Click Run!


    SRL Rev 16, Scar 3.15

    Enjoy! Post Proggies!

    ~RM

    Code:
    program RMPowerCutter;
    {.include srl/srl.scar}
    {.include srl/srl/skill/WoodCutting.scar}
    
    Const
      LoadsWanted = 2;
      YourSRLId = '4066'; //your srl stats ID
      YourSRLPass = 'helloworld';  // your srl stats pass
      ScriptName = 'RM Power Cutter JM';
      ScriptVersion = '1.21';
      RMDebug = True;
    
    {
    everything should be ready to roll?
    }
    
    
    
    Procedure DeclarePlayers;
    begin
      NumberOfPlayers(2);
      CurrentPlayer := 0;
    
      Players[0].Name :='';
      Players[0].Pass :='';
      Players[0].Nick :='';
      Players[0].Active := true;
      Players[0].Strings[0] := 'Willow'; //Tree, Oak, Willow, Yew;
    
      Players[1].Name :='';
      Players[1].Pass :='';
      Players[1].Nick :='';
      Players[1].Active := True;
      Players[1].Strings[0] := 'Willow'; //Tree, Oak, Willow, Yew;
           {
      Players[2].Name :='';
      Players[2].Pass :='';
      Players[2].Nick :='';
      Players[2].Active := true;
      Players[2].Strings[0] := 'Willow'; //Tree, Oak, Willow, Yew;
    
      Players[3].Name :='';
      Players[3].Pass :='';
      Players[3].Nick :='';
      Players[3].Active := true;
      Players[3].Strings[0] := 'Willow'; //Tree, Oak, Willow, Yew;
    
      Players[4].Name :='';
      Players[4].Pass :='';
      Players[4].Nick :='';
      Players[4].Active := true;
      Players[4].Strings[0] := 'Willow'; //Tree, Oak, Willow, Yew;
    
      Players[5].Name :='';
      Players[5].Pass :='';
      Players[5].Nick :='';
      Players[5].Active := True;
      Players[5].Strings[0] := 'Willow'; //Tree, Oak, Willow, Yew;
    
      Players[6].Name :='';
      Players[6].Pass :='';
      Players[6].Nick :='';
      Players[6].Active := True;
      Players[6].Strings[0] := 'Willow'; //Tree, Oak, Willow, Yew;
    
      Players[7].Name :='';
      Players[7].Pass :='';
      Players[7].Nick :='';
      Players[7].Active := True;
      Players[7].Strings[0] := 'Oak'; //Tree, Oak, Willow, Yew;
       }
    end;
    
    procedure Intro;
    
    var
    TSA, s:TStringArray;
    i, h, j:integer;
    begin
      ChangeReportWidth(1);
        SetLength(TSA, 5);
        SetLength(s, 5);
          TSA[0]:='RRRRRR      AA     SSSSSSSS TTTTTTTTTTTT   AA     ';
          TSA[1]:='RR   R     AAAA    SS           TT        AAAA   ';
          TSA[2]:='RR RR     AA  AA   SSSSSSS      TT       AA  AA  ';
          TSA[3]:='RR   R   AAAAAAAA       SS      TT      AAAAAAAA ';
          TSA[4]:='RR    R AA      AA SSSSSSS      TT     AA      AA';
    
        repeat
          ClearDebug;
          for i:= 0 to High(TSA) do
          begin
            ClearDebug;
            Inc(h);
            s[i]:= TSA[i];
            SetLength(s[i], h);
            for j:= 0 to High(s) do
              writeln(s[j]);
            wait(50);
          end;
        until(h >= length(TSA[4]))
    
        wait(500);
        ClearDebug;
    
        TSA[0]:='MMMM     MMMM     AA     GGGGGGGG  IIIIII   CCCCCC IIIIII     AA     NNNN   NN   ';
        TSA[1]:='MM MM   MM MM    AAAA    GG          II    CC        II      AAAA    NN NN  NN   ';
        TSA[2]:='MM  MM MM  MM   AA  AA   GG  GGGGG   II   CC         II     AA  AA   NN  NN NN   ';
        TSA[3]:='MM    M    MM  AAAAAAAA  GG     GG   II    CC        II    AAAAAAAA  NN    NNN   ';
        TSA[4]:='MM         MM AA      AA GGGGGGGGG IIIIII   CCCCCC IIIIII AA      AA NN     NN   ';
        h:=0;
        repeat
          ClearDebug;
          for i:= 0 to High(TSA) do
          begin
            ClearDebug;
            Inc(h);
            s[i]:= TSA[i];
            SetLength(s[i], h);
            for j:= 0 to High(s) do
              writeln(s[j]);
            wait(50);
          end;
        until(h >= length(TSA[4]))
    
        wait(500);
        ClearDebug;
        writeln('Thank you for using RM Cutter!');
        ChangeReportWidth(350);
        wait(500);
    end;
    
    
    type
      Monster = record
      Name: string;
      UpText: TStringArray;
      Colors: TIntegerArray;
      AutoColor: boolean;
      RG, RB, GB: integer;
    end;
    var
      Find: Array of Monster;
      AllTIA: Array[0..3] of TIntegerArray;
      LoadsDone, TotalLoads, OakBMP, TreeBMP, SpotMark:integer;
    
    //by RM
    
    Function NoRandoms: boolean;
    begin
      if not LoggedIn then exit;
      if FindNormalRandoms then Result:=true;
      ClickToContinue;
      if FindFight then
      begin
        RunAway('s', True, 1, (22000+Random(5000)));
        Result:=True;
        NoRandoms;
      end;
    end;
    
    Function HowManyActive: integer;
    var i, t, p:integer;
    begin
      p := High(Players);
      for i:=0 to p do
        if Players[i].Active then Inc(t);
    
      Result := t;
    end;
    
    procedure Proggy;
    var i:integer;
    begin
      ClearReport;
      SrlRandomsReport;
    
      AddToReport('[[[[[[    '+ScriptName+' '+ScriptVersion+'     ]]]]]]');
      AddToReport('[ Total Loads: '+IntToStr(TotalLoads));
      AddToReport('[ Total Logs: '+IntToStr(TotalLoads*27));
      AddToReport('[ Time Running: '+TimeRunning);
      AddToReport('[[[[[[    '+ScriptName+' '+ScriptVersion+'     ]]]]]]');
      AddToReport('[           By: Rasta Magician            ]');
      AddToReport('[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]');
      AddToReport('');
      AddToReport('Nick, Tree, Logs, Active');
    
      for i:=0 to High(Players) do
      
        AddToReport(Players[i].Nick+', '+Players[i].Strings[0]+', '+
                    IntToStr(Players[i].Integers[0])+', '+
                    BoolToStr(Players[i].Active));
    
      Disguise(' A: '+IntToStr(HowManyActive)+'/'+IntToStr(Length(Players))+' Logs: '+IntToStr(TotalLoads*27));
    end;
    
    procedure DropAllLogs;
    
    var x, y, logs, i, t, k, tries:integer;
    begin
      if RMDebug then writeln('Dropping Logs');
      if not LoggedIn then exit;
    
      Inc(LoadsDone);
      Inc(ReportVars[0]);
      Inc(TotalLoads);
      try begin
        case lowercase(Players[CurrentPlayer].Strings[0]) of
          'tree', 'normal': i:= 56;
          'oak': i:= 57;
          'willow': i:= 58;
          'yew': i:= 60;
        end;
        logs := CountItems(srl_GetBitmap(i), 'bmp', [10])
        if logs = 0 then logs := 27;
        wait(150);
        MMouse(0, 0, MSX2, MSY2);
        if RMDebug then writeln('counted bitmaps');
      end except
        logs := 27;
        if RMDebug then writeln('added default 27 logs');
      end;
      if RMDebug then writeln('logs: '+IntToStr(logs));
    
      case lowercase(Players[CurrentPlayer].Strings[0]) of
        'tree', 'normal': IncEx(ReportVars[1], logs);
        'oak': IncEx(ReportVars[2], logs);
        'willow': IncEx(ReportVars[3], logs);
        'yew': IncEx(ReportVars[4], logs);
      end;
      IncEx(Players[CurrentPlayer].Integers[0], logs)
    
      tries:= 0;
      repeat
        NoRandoms;
        if not LoggedIn then exit;
        for i:=2 to 28 do
        begin
          if (i mod 5) = 0 then
          begin
            NoRandoms;
            wait(150);
          end;
          if ExistsItem(i) then
          begin
            MMouseItem(i);
            for k:= 0 to 4 do
            begin
              wait(200);
              if IsUpText('log') then break;
              if lowercase(Players[CurrentPlayer].Strings[0]) = 'tree' then
                if IsUpText('Logs') then break;
            end;
            if not IsUpText('axe') then
            begin
              GetMousePos(x, y);
              Mouse(x, y, 1, 1, False);
              Wait(170 + Random(50));
              if (ChooseOption('rop')) then
                Wait(RandomRange(50, 200));
            end else
              DragItem(i, 1);
            wait(Random(150));
          end;
        end;
        t:= 0;
        for i:=2 to 28 do
          if ExistsItem(i) then
          begin
            Inc(t);
            break;
          end;
      Inc(Tries);
      ArrangeInv;
      if tries >= 3 then break; //failsafe not to drop axe in case it's in middle of inv
      until(t = 0);
    
      Proggy;
    end;
    
    
    
    // By Frozen Soul
    Function PosArray(SubStr : Array of String; S : String) : Boolean;
    var i:integer;
    Begin
      for i := 0 to GetArrayLength(SubStr) - 1 do
      Begin
        Result := Pos(SubStr[i], Lowercase(S)) > 0;
        if Result then exit;
      end;
    end;
    
    procedure InactiveMove;
    var x, y, i, h:integer;
    begin
      GetMousePos(x, y);
      IncEx(MouseSpeed, 10);
      i := GetCurrentTab;
      repeat
        h := 1+Random(12);
      until(h <> i)
      GameTab(h);
      wait(500+Random(500));
      GameTab(i);
      MMouse(x, y, 3, 3);
      DecEx(MouseSpeed, 10);
    end;
    
    procedure AntiBan;
    var i, p:integer;
    begin
      if not LoggedIn then exit;
      p:=Random(100);
      if p < 2 then
      begin
        if RMDebug then writeln('Anti-Ban');
        i := Random(16);
        case i of
          0, 1: HoverSkill('woodcutting', False);
          2, 3: HoverSkill('firemaking', False);
          4, 5: HoverSkill('fletching', False);
          6, 7: MMouse(0, 0, 700, 700);
          8, 9: GameTab(1+Random(14));
          10, 11: AlmostLogout;
          12, 13: PickUpMouse;
          14, 15: HoverSkill('random', False);
        end;
        GameTab(4);
      end;
    end;
    
    Function CheckAndClick(var x, y:integer; text:TStringArray): boolean;
    var
      m:integer;
      FoundIt:boolean;
    begin
      if not LoggedIn then exit;
      wait(100);
      MMouse(x, y, 3, 3);
      wait(100);
      for m:=0 to high(text) do
      begin
        if IsUpText(text[m]) then
        begin
          if RMDebug then writeln('text is up, '+text[m]);
          FoundIt:=True;
          break;
        end;
      end;
    
      if FoundIt then
      begin
        GetMousePos(x, y);
        if FindEnt(x, y, False) then
        begin
          Result := False;
          Inc(EntsAvoided);
          wait(1000);
          if RMDebug then writeln('exiting');
          exit;
          if RMDebug then writeln('exited');
        end;
        if RMDebug then writeln('moving mouse to tree');
        Mouse(x, y, 0, 0, True);
        Result := True;
      end else
        Result := False;
    
    end;
    
    //Smart Colors By Tarajunky, Custom by Rasta Magician
    Function SmartColorsCustom(name:string; UpText:TStringArray; colors:TIntegerArray):boolean;
    var
      j, k:integer;
      b, Found:boolean;
    var RMInt, RMx, RMy:integer;
    var x,y,TestColor,a,l,m,i,red,green,blue, ClickColor:integer;
    var p: array of Tpoint;
    
    begin
      if not LoggedIn then exit;
      for i:=0 to High(Find) do
      begin
        if lowercase(name) = Find[i].Name then
        begin
          b := True;
          k := i;
        end;
      end;
    
      if not b then //we have to add it.
      begin
        k:=GetArrayLength(Find);
        SetArrayLength(Find, k+1);
        Find[k].Name:= lowercase(name);
        Find[k].UpText := UpText;
        Find[k].Colors := colors;
      end;
    
      {autocoloring}
      if not Find[k].AutoColor then
      begin
        for i:=0 to High(Find[k].Colors) do
        begin
          ColorToRGB(Find[k].Colors[i], j, l, m)
          IncEx(Find[k].RG, (j-l));
          IncEx(Find[k].RB, (j-m));
          IncEx(Find[k].GB, (l-m));
        end;
        Find[k].RG := (Find[k].RG/Length(Find[k].Colors))
        Find[k].RB := (Find[k].RB/Length(Find[k].Colors))
        Find[k].GB := (Find[k].GB/Length(Find[k].Colors))
        Find[k].Autocolor := True;
      end;
    
      FFlag(0);
      Wait(50);
      if RMDebug then writeln('Finding '+name);
      l:=GetArrayLength(Find[k].Colors);  //Checks known colors first
      if l>0 then
      begin
        for i:= 0 to l-1 do
        begin
          if RMDebug then writeln('finding color: '+IntToStr(Find[k].Colors[i]));
          FindColorsSpiralTolerance(MSCX,MSCY,p,Find[k].Colors[i],MSX1,MSY1,MSX2,MSY2,0);
          m:=GetArrayLength(p);
          if m>0 then
          begin
            if m > 30 then exit;
            for a:= 0 to m-1 do
            begin
              if CheckAndClick(p[a].x,p[a].y, Find[k].UpText) then  //Moves mouse to position, checks uptext and clicks if correct.
              begin
                result:=true;
                if i>0 then  //if the color is not in the first position of the array...
                  Swap(Find[k].Colors[i], Find[k].Colors[i-1]);
                  // Swap found color with the one ahead of it in the array
                exit;  // We found our color, so we exit the function completely.
              end;
            end;
          end;
        end;
      end;
      //We didn't find any known colors, so continue on to the tolerance search
      for j:=0 to High(Find[k].Colors) do
      begin
        if j >= 3 then break; //only wanna look for 3 colors with tol
        if RMDebug then writeln('finding color '+IntToStr(Find[k].Colors[j])+' with tol ');
        FindColorsSpiralTolerance(MSCX, MSCY, p, Find[k].Colors[j],MSX1,MSY1,MSX2,MSY2,25);
        l:=GetArrayLength(p);
        if (l>0)and(not l>30) then
        begin
    
          for i:= 0 to l-1 do
          begin
            TestColor:=GetColor(p[i].x,p[i].y);  //Additional autocoloring to reduce wrong points.  (Optional)
            {turning it to RGB}
            red:=(TestColor mod 256);
            green:=((TestColor/256) mod 256);
            blue:=((TestColor/256) / 256);
            {comparing colors}
            if ((green-blue)<=(Find[k].GB+20)) then if ((green-blue)>=(Find[k].GB-20)) then
            if ((red-green)>=(Find[k].RG-20)) then if ((red-green)<=(Find[k].RG+20)) then
            if ((red-blue)>=(Find[k].RB-20)) then if ((red-blue)<=(Find[k].RB+20)) then
            begin
              Wait(20);
              ClickColor:=GetColor(p[i].x,p[i].y);
    
              for RMInt:=0 to High(Find[k].Colors) do
              begin
                if RMInt <> j then
                  if FindColorSpiralTolerance(RMx, RMy, Find[k].Colors[RMInt],x-5,y-5,x+5,y+5, 20) then
                  begin
                    Found:=True;
                    break;
                  end;
              end;
    
              If Found then
                if CheckAndClick(p[a].x,p[a].y, Find[k].UpText) then  //Move mouse, check uptext and click
                begin
                  result:=true;
                  FindColorsSpiralTolerance(x,y,p,ClickColor,MSX1,MSY1,MSX2,MSY2,0);
                  if GetArrayLength(p)<20 then  //Make sure that the color is somewhat rare, and doesn't take up half the screen
                  begin
                    a:=GetArrayLength(Find[k].Colors);
                    for i:= 0 to a-1 do
                    begin
                      if ClickColor=Find[k].Colors[i] then  //If color is already in the array...
                      begin
                        if i>0 then
                        begin  // Move it up one spot in the array search priority
                          Swap(Find[k].Colors[i], Find[k].Colors[i-1]);
                        end;
                        exit;
                      end;
                    end;
                  // if it's not in the array yet, then add it to the end of the array
                    SetArrayLength(Find[k].Colors,a+1);
                    Find[k].Colors[a]:=ClickColor;
                    if RMDebug then Writeln(IntToStr(ClickColor)+' added to '+name+' array');
                  end;
                  exit;
                end;
            end;
          end;
        end;
      end;
    end;
    
    Function ScanColors: TIntegerArray;
    var
      x, y, i, h, j, k:integer;
      RMColors, GoodColors:TIntegerArray;
      p: TPointArray;
    begin
      if not LoggedIn then exit;
      j := 0;
      GetMousePos(x, y);
      SetArrayLength(RMColors, 441);
      for i:=x-10 to x+10 do //getting all the colors
      begin
        for h:=y-10 to y+10 do
        begin
          RMColors[j] := GetColor(i, h);
          Inc(j);
        end;
      end;
      ClearSameIntegers(RMColors);
      h := High(RMColors)
      k:=0;
      SetArrayLength(GoodColors, h);
      for i:= 0 to h do //checking out which colors are good;
      begin
        if k > 7 then break;
        FindColorsSpiralTolerance(x, y, p, RMColors[i], MSX1, MSY1, MSX2, MSY2, 0);
        j := Length(p);
        if (j > 0)and(j < 30) then
        begin
          GoodColors[k]:= RMColors[i];
          Inc(k);
        end;
      end;
      //now we still need to sort them to see which ones are the best.
      //or is that too much work, seeing that smart colors will end up doing it?
      SetArrayLength(GoodColors, 7);
      Result:=GoodColors;
    end;
    
    procedure CutTrees; forward;
    
    Function CheckAxe(StringArray: TStringArray):boolean;
    begin
      Result:=True;
      if (PosArray(['do not have an axe'], StringArray[7])) or
         (PosArray(['do not have an axe'], StringArray[8])) or
         (PosArray(['need an axe to chop'], StringArray[7]))or
         (PosArray(['need an axe to chop'], StringArray[8]))then
      begin       //Withdraw Axe
        Players[CurrentPlayer].Active := False;
        Players[CurrentPlayer].loc := 'No Axe';
        if RMDebug then writeln('axe broke');
        LogOut;
        Result := False;
      end;
    end;
    
    procedure RunAwayEnt;
    var
      Rx, Ry, RBoolx, RBooly:integer;
    begin
      if not LoggedIn then exit;
      if RMDebug then writeln('running from ent');
      RBoolx := Random(100)+1;
      RBooly := Random(100)+1;
    
      if RBoolx < 51 then
        Rx := RandomRange(-15, -10)
      else
        Rx := RandomRange(10, 15);
    
      if RBooly < 51 then
        Ry := RandomRange(-15, -10)
      else
        Ry := RandomRange(10, 15);
    
      Mouse(MMCX+Rx, MMCY+Ry, 0, 0, True);
      wait(1000+Random(1000));
      Inc(EntsAvoided);
      AntiBan;
    
      //returning to place
      Mouse(MMCX-Rx, MMCY-Ry, 0, 0, True);
      wait(1000+Random(1000));
    
      CutTrees;
    end;
    
    procedure WaitUntilCut(name:string); forward;
    
    procedure GetToTree(name:string; WaitForTree:boolean);
    var
      x, y, x1, x2, y1, y2, i:integer;
      ChatMessage: string;
    begin
      if not LoggedIn then exit;
      GetMousePos(x, y);
      if FindEnt(x, y, False) then
      begin
        RunAwayEnt;
        Exit;
      end;
      NoRandoms;
      name := lowercase(name);
       if RMDebug then writeln('getting to tree '+name);
      if (abs(MSCX - x)>30) then
        if x > MSCX then //tree is to the right
        begin
          if RMDebug then writeln('tree is to the right');
          x1 := MSCX + 20;
          if name='oak' then IncEx(x1, 10);
          if name='willow' then IncEx(x1, 5);
          if name='yew' then IncEx(x1, 25);
          x2 := x1+30;
        end else
        begin
          if RMDebug then writeln('tree is to the left');
          x1 := MSCX - 55;
          if name='oak' then DecEx(x1, 15);
          if name='willow' then DecEx(x1, 10);
          if name='yew' then DecEx(x1, 30);
          x2 := x1+30;
        end
      else
      begin
        if RMDebug then writeln('x: tree is in the middle');
        x1 := MSCX-30;
        x2 := x1 +60;
      end;
    
      //the bigger y the further down it is
      if (abs(MSCY - y)>40) then
        if y > MSCY then //it's under the player
        begin
          if RMDebug then writeln('tree is under the player');
          y1 := MSCY+25;
          if name='oak' then IncEx(y1, 30);
          if name='willow' then IncEx(y1, 20);
          if name='yew' then IncEx(y1, 35);
          y2 := y1+20;
        end else
        begin
          if RMDebug then writeln('tree is over the player');
          y1 := MSCY - 50;
          if name='oak' then DecEx(y1, 35);
          if name='willow' then DecEx(y1, 25);
          if name='yew' then DecEx(y1, 40);
          y2 := y1 + 20;
        end
      else
      begin
        if RMDebug then writeln('y: tree is in the middle');
        y1 := MSCY-40;
        y2 := y1 +80;
      end;
    
      FFlag(0);
      wait(500+Random(100));
      if RMDebug then writeln('decided where tree should be');
      for i:= 0 to 5 do
      begin
        if RMDebug then writeln('trying to find tree');
        wait(100);
        ChatMessage:=GetBlackChatMessage;
        if PosArray(['Ent'], ChatMessage) then RunAwayEnt;
        if (name = 'tree') then
          if (ChatMessage = 'You get some logs.') then
            exit;
        if i = 0 then
          MMouse((x1+x2)/2, (y1+y2)/2, 3, 3)
        else
          MouseBox(x1, y1, x2, y2, 3);
        wait(100);
        if IsUpText(Capitalize(name)) then
          break;
        if i >= 5 then exit;
      end;
      NoRandoms;
      wait(300);
      if InvFull then DropAllLogs;
      if WaitForTree then WaitUntilCut(name);
    end;
    
    Function ChooseAnyTree:boolean;
    var x, y:integer;
    begin
      if RMDebug then writeln('Choosing Any Tree');
      if FindObjTPA(x, y, 2772296, 11, -1, 7, 7, 15, ['hop']) then
      begin
        Result := True;
        if IsUpText('Tree') then Players[CurrentPlayer].Strings[0] := 'Tree' else
        if IsUpText('Oak') then Players[CurrentPlayer].Strings[0] := 'Oak' else
        if IsUpText('Willow') then Players[CurrentPlayer].Strings[0] := 'Willow' else
        if IsUpText('Yew') then Players[CurrentPlayer].Strings[0] := 'Yew';
      end else
        Result:=False;
    end;
    
    procedure AutoColorTree(name:string);
    var
      i, x, y:integer;
      Found:boolean;
    begin
      i := 10;
      name := Capitalize(name);
      case name of
        'Tree', 'Normal': i:= 0;
        'Oak': i:= 1;
        'Willow': i:= 2;
        'Yew': i:= 3;
      end;
    
      if i = 10 then
      begin
        writeln('tree name incorrect');
        exit;
      end;
    
      if (Length(AllTIA[i]) > 0) then
      begin
        if RMDebug then writeln('already AutoColored');
        exit;
      end;
    
      if RMDebug then writeln('autocoloring '+name);
      repeat
        NoRandoms;
        if not LoggedIn then break;
        if FindObjTPA(x, y, 2772296, 11, -1, 7, 7, 15, [ name ]) then
        begin
          if IsUpText(name) then
          begin
            AllTIA[i]:=ScanColors;
            if AllTIA[i][0] <> 0 then Found:=True;
          end;
        end;
      until(found)
      wait(1000);
      if RMDebug then writeln(name+' color: '+IntToStr(AllTIA[i][0]));
    end;
    
    Function NextSpot: integer;
    var
      i:integer;
    begin
      if not LoggedIn then exit;
      Result := 1;
      for i:=1 to 28 do
        if not ExistsItem(i) then
        begin
          Result:= i;
          exit;
        end;
    end;
    
    function FindTree(name:string): boolean;
    begin
      if not LoggedIn then exit;
    
      AutoColorTree(Players[CurrentPlayer].Strings[0]);
    
      case lowercase(name) of
        'normal', 'tree':
          Result := SmartColorsCustom('normal', ['Tree'], AllTIA[0]);
        'oak':
          Result:=SmartColorsCustom('oak', ['Oak'], AllTIA[1]);
        'willow':
          Result:=SmartColorsCustom('willow', ['Willow'], AllTIA[2]);
        'yew':
          Result:=SmartColorsCustom('yew', ['Yew'], AllTIA[3]);
      end;
    end;
    
    procedure WaitUntilCut(name:string);
    var
      x, y, i, j, k, t, CheckSpot, CutMark:integer;
      p:TPointArray;
      Found : boolean;
      TSA:TStringArray;
    begin
      if not LoggedIn then exit;
      if RMDebug then writeln('waiting until cut');
      wait(500);
      MarkTime(CutMark);
      GetMousePos(x, y);
      if FindEnt(x, y, False) then
      begin
        RunAwayEnt;
        exit;
      end;
      wait(250);
      NoRandoms;
      wait(150);
      MarkTime(t);
      repeat
        NoRandoms;
        if not LoggedIn then break;
        if InvFull then
        begin
          wait(10);
          DropAllLogs;
          MarkTime(CutMark);
        end;
        TSA:=ChatsBlackText;
        if not CheckAxe(TSA) then exit;
        wait(300);
        NoRandoms;
        if (PosArray(['swing your axe'], TSA[7]))or
           (PosArray(['swing your axe'], TSA[8]))or
           (PosArray(['get some'], TSA[8]))then
            begin
              if RMDebug then writeln('found TSA');
              break;
            end;
        if name = 'tree' then
          if (PosArray(['get some'], TSA[8])) then
            exit;
    
        if (TimeFromMark(t) > 3000) then
        begin
          wait(100);
          if RMDebug then writeln('tree took too long');
          Exit;
        end;
    
      until(false);
      if RMDebug then writeln('cutting tree');
      GetMousePos(x, y);   //let's keep our mouse over the tree now.
      wait(100);
      MarkTime(SpotMark);
      CheckSpot := NextSpot;
      repeat
        if not LoggedIn then exit;
        NoRandoms;
        if InvFull then
        begin
          wait(50);
          DropAllLogs;
          MarkTime(CutMark);
        end;
        if ExistsItem(CheckSpot) then
        begin
          CheckSpot := NextSpot;
          wait(50);
          MarkTime(SpotMark);
        end;
        if (TimeFromMark(SpotMark) > 30000) then
        begin
          wait(100);
          if RMDebug then
          begin
            writeln('i dont think were cutting, but we should be!')
            writeln('lets try finding that tree again!');
          end;
          exit;
        end;
    
        if (name='tree') then
          if (GetBlackChatMessage = 'You get some logs.') then
            exit;
        wait(100);
        NoRandoms;
        wait(100);
        Found:=False;
        if IsUpText('hop') then
        begin
          if FindEnt(x, y, False) then
          begin
            RunAwayEnt;
            exit;
          end;
          Found := True;
          wait(200);
        end else
        begin
          if RMDebug then writeln('tree seems to be gone..?');
          NoRandoms;
          GetMousePos(x, y);
          //if looking for one trre then one color if looking for other tree then other color
          i := Find[0].Colors[0];
          FindColorsSpiralTolerance(x, y, p, i, x-5, y-5, x+5, y+5, 10);
          j := High(p);
          if j > 0 then
            if j > 10 then j := 10;
            for k:=0 to j do
            begin
              if (name='tree')and(GetBlackChatMessage = 'You get some logs.') then exit;
              if ((abs(x-p[k].x))>2)or((abs(y-p[k].y))>2) then
                MMouse(p[k].x, p[k].y, 0, 0);
              wait(150);
              Found := IsUpText('hop');
              if Found then break;
              wait(50);
            end;
          wait(100);
        end;
        if not LoggedIn then exit;
        NoRandoms;
        wait(150);
        GetMousePos(x, y);
        if FindEnt(x, y, False) then
        begin
          RunAwayEnt;
          break;
        end;
        wait(150);
        if InvFull then
        begin
          wait(100);
          DropAllLogs;
          MarkTime(CutMark);
        end;
        if (TimeFromMark(CutMark) > 45000) then
        begin
          InactiveMove;
          MarkTime(CutMark);
        end;
      until(not Found);
      if RMDebug then writeln('tree gone');
    end;
    
    procedure PlayerSetup;
    var AllGood:boolean;
    begin
    //check for axe, wc lvl etc
      if not LoggedIn then exit;
      repeat
        if NoRandoms then
        begin
          Players[CurrentPlayer].Active := False;
          exit;
        end;
        LoadsDone:=0;
        Players[CurrentPlayer].Level[20] := GetSkillLevel('woodcutting');
        if FindAxe then
        begin
          if RMDebug then writeln('Axe found');
          wait(500+Random(1000));
          SetAngle(True);
          AllGood := True;
        end else
          NextPlayer(False);
      until(AllGood);
        GameTab(4);
    end;
    
    procedure ScriptSetup;
    begin
      SetupSRL;
      writeln('setting up script');
      DeclarePlayers;
      ScriptID := '709';
      SRLID := YourSRLID;
      SRLPassword := YourSRLPass;
    
      ActivateClient;
      wait(2500);
      LoginPlayer;
      if not LoggedIn then LoginPlayer;
      wait(3000);
      PlayerSetup;
      MMouse(MSCX, MSCY, 3, 3);
    end;
    
    
    procedure CutTrees;
    var i:integer;
    begin
      NoRandoms;
      if not (LoadsDone >= LoadsWanted) then
      begin
        if RMDebug then writeln('not loadsDone >= loadswanted');
        repeat
          if LoadsDone >= LoadsWanted then break;
          if Not LoggedIn then Exit;
          NoRandoms;
          wait(Random(1000));
          if InvFull then DropAllLogs;
          if LoadsDone >= LoadsWanted then break;
          if FindTree(Players[CurrentPlayer].Strings[0]) then
          begin
            wait(500);
            Players[CurrentPlayer].Integers[1] := 0;
            i:=0;
            NoRandoms;
            wait(300);
            GetToTree(Players[CurrentPlayer].Strings[0], True);
          end else
          begin
            writeln('couldnt find tree');
            NoRandoms;
            wait(3000);
            InactiveMove;
            inc(i);
          end;
          if i >= 5 then
          begin
            NoRandoms;
            writeln('pretty sure there are no damn trees around.');
            LoadsDone := LoadsWanted + 1;
            Inc(Players[CurrentPlayer].Integers[1]);
            if Players[CurrentPlayer].Integers[1] >= 2 then
            begin
              if not ChooseAnyTree then
                Players[CurrentPlayer].Active := False
              else
                CutTrees;
            end;
            exit;
          end;
          NoRandoms;
        until(False);
      end;
    end;
    
    procedure ScriptTerminate;
    begin
      srl_FreeBitmaps;
    end;
    
    begin
      ClearDebug;
    
      SetupSRL;
      Intro;
      ActivateClient;
      ScriptSetup;
      repeat
    
        ActivateClient;
        if (not loggedIn) then break;
        writeln('cut trees');
        CutTrees;
    
        if LoggedIn then
          writeln(Players[CurrentPlayer].Name+' logged in, Switching player')
        else
          writeln(Players[CurrentPlayer].Name+' not logged in, Switching Player');
    
        NextPlayer(Players[CurrentPlayer].Active);
    
        if HowManyActive = 0 then break;
        PlayerSetup;
      until(false);
    
      writeln('Script Stopping. Thank you for using RM Cutter! Please Post Proggie!');
      DisGuise('Done.');
    end.
    
     
  3. Unread #2 - May 14, 2008 at 8:57 PM
  4. ian41721
    Referrals:
    0

    ian41721 Guest

    RM Power Cutter!

    it gives me this thing..
    [Runtime Error] : Exception: Access violation at address 006CF132 in module 'scar.exe'. Read of address FFFFFFFC in line 227 in script C:\Program Files\SCAR 3.15\includes\SRL/SRL/Core/Login.scar

    i have scar 3.15 and new srls but ne help there?
     
  5. Unread #3 - May 15, 2008 at 2:33 AM
  6. Rasta Magician
    Joined:
    Jan 5, 2008
    Posts:
    8
    Referrals:
    0
    Sythe Gold:
    0

    Rasta Magician Newcomer

    RM Power Cutter!

    did you set up the Player Names and Nicks correctly in the procedure DeclarePlayers? i'll add a form and use ScarPack for next version ;)

    ~RM
     
  7. Unread #4 - May 15, 2008 at 7:52 PM
  8. ian41721
    Referrals:
    0

    ian41721 Guest

    RM Power Cutter!

    what version of scar is it for?
     
  9. Unread #5 - May 16, 2008 at 2:39 AM
  10. Rasta Magician
    Joined:
    Jan 5, 2008
    Posts:
    8
    Referrals:
    0
    Sythe Gold:
    0

    Rasta Magician Newcomer

    RM Power Cutter!

    Scar 3.15, Srl Rev#16. check the top of the page, link is where i wrote "Get Them Here"

    ~RM
     
  11. Unread #6 - May 16, 2008 at 5:43 PM
  12. cazax
    Joined:
    Nov 13, 2007
    Posts:
    457
    Referrals:
    0
    Sythe Gold:
    0

    cazax Forum Addict

    RM Power Cutter!

    Wow you released it on sythe :D
     
  13. Unread #7 - May 25, 2008 at 12:36 PM
  14. Go L Den
    Joined:
    May 1, 2007
    Posts:
    84
    Referrals:
    0
    Sythe Gold:
    0

    Go L Den Member
    Banned

    RM Power Cutter!

    Sorry if this sounds newb but what am I supposed to type for DeclarePlayers?
     
  15. Unread #8 - May 28, 2008 at 10:55 PM
  16. patman16
    Joined:
    May 28, 2008
    Posts:
    11
    Referrals:
    0
    Sythe Gold:
    0

    patman16 Newcomer

    RM Power Cutter!

    good looking code, but whenever i run the script, it always checks some of the tabs, then logs out and says i dont have an axe, even though i have it equipped or in my inventory

    i would greatly appreciate it if someone could help me find the right way to solve this
     
  17. Unread #9 - May 30, 2008 at 10:07 PM
  18. hØpe
    Joined:
    May 30, 2008
    Posts:
    162
    Referrals:
    0
    Sythe Gold:
    0

    hØpe Active Member

    RM Power Cutter!

    Include file J:\SCAR 3.15\includes\srl\srl.scar does not exist.
    Include file J:\SCAR 3.15\includes\srl\srl\skill\WoodCutting.scar does not exist.
    Failed when compiling

    What am i ment to do?
     
  19. Unread #10 - May 31, 2008 at 8:15 AM
  20. Rasta Magician
    Joined:
    Jan 5, 2008
    Posts:
    8
    Referrals:
    0
    Sythe Gold:
    0

    Rasta Magician Newcomer

    RM Power Cutter!

    patman, thank you, what axe were you using? it doesn't recognize dragon axe.
    was your brightness on max?

    Go L Den:
    Players[0].Name := 'YOUR Runescape Name'; eg: 'Rasta Magician 37'
    Players[0].Pass := 'YOUR Runescape Password'; eg: 'helloworld'
    Players[0].Nick := '3 or 4 letters of YOUR RS Name'; eg: 'asta'
    Players[0].Strings[0] := 'Tree Name'; eg: 'willow'

    hope: downlaod srl.

    ~RM
     
  21. Unread #11 - May 31, 2008 at 12:40 PM
  22. harrrocks
    Joined:
    Feb 20, 2008
    Posts:
    40
    Referrals:
    3
    Sythe Gold:
    9

    harrrocks Member

    RM Power Cutter!

    hey got this error on the first line! =[

    Line 1: [Error] (1:1): Unable to register function function FindGapsTPA(TPA : TPointArray; MinPixels: Integer): T2DPointArray; in script


    getting alot of these dont know why

    any answers ?
     
  23. Unread #12 - May 31, 2008 at 2:40 PM
  24. j035m03
    Referrals:
    0

    j035m03 Guest

    RM Power Cutter!

    [Runtime Error] : Out Of Range in line 30 in script
    i get that now.
     
  25. Unread #13 - May 31, 2008 at 4:29 PM
  26. Rasta Magician
    Joined:
    Jan 5, 2008
    Posts:
    8
    Referrals:
    0
    Sythe Gold:
    0

    Rasta Magician Newcomer

    RM Power Cutter!

    harrocks: download rev #16 of srl.
    use this get if you don't know how to

    http://www.sythe.org/showthread.php?t=388739

    j035m03:

    in DeclarePlayers have you changed NumberOfPlayers(2) to the appropriate number?

    if so, did you delete the extra ones?

    also, from player 2-7 it's in comments, so to take the comment out, delete the ' { ' before the player number 2 and add it after your last player.

    ~RM
     
  27. Unread #14 - Jun 1, 2008 at 2:30 PM
  28. patman16
    Joined:
    May 28, 2008
    Posts:
    11
    Referrals:
    0
    Sythe Gold:
    0

    patman16 Newcomer

    RM Power Cutter!

    actually, i was using a black axe, and my brightness was not on high

    EDIT: turned brightness on high, and now it works perfectly!

    great job
    -----------------------
    by patman16

    [ Total Loads: 2
    [ Total Logs: 54
    [ Time Running: 7 Minutes and 54 Seconds

    will post more soon
     
  29. Unread #15 - Jun 2, 2008 at 3:36 AM
  30. Rikkk
    Joined:
    Sep 3, 2007
    Posts:
    59
    Referrals:
    0
    Sythe Gold:
    0

    Rikkk Member

    RM Power Cutter!

    Ok works nice :D But after 5 minutes i got a random so it logged me off -.-

    But great script :D !! i love it
     
  31. Unread #16 - Jun 6, 2008 at 5:53 PM
  32. lolcracker
    Referrals:
    0

    lolcracker Guest

    RM Power Cutter!

    When I do it I get :


    Thank you for using RM Cutter!
    File access error
    SRL Compiled in 10015 msec
    setting up script
    [Runtine Error] : line 30 in script



    What do I do?
     
  33. Unread #17 - Jun 22, 2008 at 11:41 AM
  34. drumm3r7
    Referrals:
    0

    drumm3r7 Guest

    RM Power Cutter!

    yo RM, you got mad skills, it looks awsome ( trying it in about 20 seconds) usually people just post the scripts but you troubleshooted for people A LOT.
     
  35. Unread #18 - Jun 22, 2008 at 12:04 PM
  36. drumm3r7
    Referrals:
    0

    drumm3r7 Guest

    RM Power Cutter!

    hey, i need help with the script.
    I have the latest scar, and srl.
    and i filled everything out, but when i start the script it compiles, but then it says that it was successfuly exicuted. I have no idea how to fix this, or even whats causing the problem. I REALLY NEED HELP. i dont have any srl stat id or pass and i dont know how to get them, or what they do. please help!
     
  37. Unread #19 - Jun 22, 2008 at 7:47 PM
  38. irmoathlete
    Joined:
    Jun 19, 2008
    Posts:
    9
    Referrals:
    0
    Sythe Gold:
    0

    irmoathlete Newcomer

    RM Power Cutter!

    i got an error for your script when i tried to run it.

    Nickname isnt set, taking the username instead..
    [Runtime Error] : Exception: in line 58 in script C:\Documents and Settings\Chris Hennighan\Desktop\SCAR 3.15\includes\SRL/SRL/Core/Math.scar
     
  39. Unread #20 - Jun 23, 2008 at 4:31 AM
  40. weazlemaster
    Joined:
    Feb 1, 2007
    Posts:
    68
    Referrals:
    0
    Sythe Gold:
    0

    weazlemaster Member

    RM Power Cutter!

    This is a really good script it has eddiceint cutting and it is just a good script all round.
     
< Need Help With Scar Script | Nebels's Catherby Lobby Fisher [Smart(w/ Reflection)] >

Users viewing this thread
1 guest


 
 
Adblock breaks this site