Results 1 to 16 of 16

Thread: why wont it cut willows

  1. #1
    Join Date
    Feb 2009
    Posts
    2,155
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default why wont it cut willows

    ok so im in the process of updating my power skillz script to what everyone was saying i should do and now it loads fine but i wont cut willows

    Code:
    {.include srl/srl/misc/smart.scar}
    {.include srl/srl.scar}
    
    
    
    
    var
      I, H, x, y, m, loads, inv, invset: Integer;
      CTS: Integer;
      TPA: TPointArray;
      ATPA: T2DPointArray;
    
    
    
    procedure DeclarePlayers;
    begin
      HowManyPlayers := 1; // If you add more players , make sure you set this correct, ;)
      NumberOfPlayers(HowManyPlayers);
    
      Players[0].Name := ''; //Your username
      Players[0].Pass := ''; //Your password
      Players[0].Nick := 'nubs'; //Nickname from you username
      Players[0].Active := True; //Active->True or False.
      Players[0].Integers[0] := 99; //Loads to do.
      Players[0].Strings[1] := 'woodcutting'; //what skill do u want to do mining, wcing , or prayer
      Players[0].Strings[2] := '';//where r u mining or what bank r u at for prayer
      Players[0].strings[3] := 'willow' //what tree or ore or bone do u want to power skill
      Players[0].strings[4] := '0000' // pin number
      Players[0].BoxRewards := ['Xp', 'ostume', 'gem', 'mote', 'ithril', 'oal'];//What do u want out of randomns
      { woodcutting
         tree =  normal   oak =oak  willow= willow yew = yew
         
      mining
        all the normal ore name must be spelled perfectly
    
        prayer
        'feb' (Falador East Bank)
        'fwb' (Falador West Bank)
        'veb' (Varrock East Bank)
        'vwb' (Varrock West Bank)
        'db'  (Draynor Bank)
        'akb' (Al-Kharid Bank)
        'lb'  (Lumbridge Bank)
          }
    end;
    
    
    procedure antibanz;
    begin
      If(not LoggedIn)then Exit;
      Case Random(9) of
        0:  MMouse(Random(MSX2),Random(MSY2),0,0);
        1:  PickupMouse;
        2:  SleepAndMoveMouse(400+Random(1500));
        3:  if Random(2) = 1 then MMouse(1, 338, 515, 165);
        4:  if Random(2) = 1 then MMouse(515, 1, 250, 503);
        5:  RandomMovement;
     6..9:
    begin
      case Random(3) of
       0: begin
            KeyDown(VK_RIGHT);
            Wait(500+Random(2000));
            KeyUp(VK_RIGHT);
        end;
       1: begin
            KeyDown(VK_Left);
            Wait(500+Random(2000));
            KeyUp(VK_Left);
          end;
       2: begin
            case Random(2) of
              0: begin
                   KeyDown(VK_RIGHT);
                   Wait(500+Random(1400));
                   KeyUp(VK_RIGHT);
                 end;
              1: begin
                   KeyDown(VK_Left);
                   Wait(500+Random(1400));
                   KeyUp(VK_Left);
                end;
              end;
            end;
          end;
        end;
      end;
    end;
    
    
    procedure findrandoms;
    begin
      LampSkill := 'mining';
      FindNormalRandoms;
      solvesrlrandoms:=true;
    end;
    
    
    procedure chopwillows;
    begin
      disguise('willows');
      CTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.2, 0.2);
      FindColorsTolerance(TPA, 3429467, MSX1, MSY1, MSX2, MSY2, 3);
      if (Length(TPA) = 0) then Exit;
      ATPA := SplitTPAEx(TPA, 9, 9);
      SortATPAFrom(ATPA, Point(MSCX, MSCY));
      H := High(ATPA) - 1;
      for I := 0 to H do
      begin
         MiddleTPAEx(ATPA[i], x, y);
         MMouse(x, y, 3, 3);
         Wait(100 + Random(200));
         if IsUpText('llo') then
         begin
           Mouse(x, y, 3, 3, True);
           repeat
             MMouse(x, y, 3, 3);
             wait (100);
             findrandoms;
           until not (isuptext('llo'))
           findrandoms;
         end;
      end;
    end;
    
    
    procedure choptrees;
    begin
      disguise('normal');
      CTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.2, 0.2);
      FindColorsTolerance(TPA, 4754045, MSX1, MSY1, MSX2, MSY2, 3);
      if (Length(TPA) = 0) then Exit;
      ATPA := SplitTPAEx(TPA, 9, 9);
      SortATPAFrom(ATPA, Point(MSCX, MSCY));
      H := High(ATPA) - 1;
      for I := 0 to H do
      begin
         MiddleTPAEx(ATPA[i], x, y);
         MMouse(x, y, 3, 3);
         Wait(100 + Random(200));
         if IsUpText('ree') then
         begin
           Mouse(x, y, 3, 3, True);
           Marktime(m);
           invset:=invcount;
           repeat
             inv:=invcount;
             wait (100);
             findrandoms;
           until ((invset < Inv) or (TimeFromMark(m) > 15000));
           findrandoms;
         end;
      end;
    end;
    
    procedure chopoaks;
    begin
      disguise('oak');
      CTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.2, 0.2);
      FindColorsTolerance(TPA, 3101259, MSX1, MSY1, MSX2, MSY2, 3);
      if (Length(TPA) = 0) then Exit;
      ATPA := SplitTPAEx(TPA, 9, 9);
      SortATPAFrom(ATPA, Point(MSCX, MSCY));
      H := High(ATPA) - 1;
      for I := 0 to H do
      begin
         MiddleTPAEx(ATPA[i], x, y);
         MMouse(x, y, 3, 3);
         Wait(100 + Random(200));
         if IsUpText('Oak') then
         begin
           Mouse(x, y, 3, 3, True);
           repeat
             MMouse(x, y, 3, 3);
             wait (100);
             findrandoms;
           until not (isuptext('Oak'));
           findrandoms;
         end;
      end;
    end;
    
    
    
    procedure woodcutting;
    var
      i , m: integer;
      treecolors: array [0..3] of integer;
      treeNames: array [0..2] of String;
    begin
      Players[CurrentPlayer].Loc := 'trees';
      repeat
        if Players[CurrentPlayer].strings[2] = 'willow' then
          chopwillows;
          if Players[CurrentPlayer].strings[2] = 'tree' then
            choptrees;
          if Players[CurrentPlayer].strings[2] = 'oak' then
            chopoaks;
            AntiBanz;
            FindRandoms;
          if not (LoggedIn) then
            begin
              NextPlayer(False);
              LoginPlayer;
            end;
         until invfull or inchat('full to')
         inc(loads)
    end;
    
    procedure logdropping;
    var
      logdtm:integer;
    begin
      repeat
        logDTM := DTMFromString('78DA63CC66626078C28002EA12AD181E02694' +
                '620FE0F048C1940357718D000231209A48B806A6E1250530654F3' +
                '88809A6AA09A6704D45400D5BC21A0A618A8E62D0135E940351F0' +
                '9A84924C29C58A09AA7B8D570C0CCB94F404D32FE7006A90100DC' +
             'FE160C');
        If FindDTM(logDTM,x,y,MIX1,MIY1,MIX2,MIY2) then
        Begin
          Mouse(x,y,2,2,False);
          wait(random(200));
          ChooseOption('Drop');
          wait(500 + random(100))
          findrandoms;
       end;
      Until not FindDTM(logDTM,x,y,MIX1,MIY1,MIX2,MIY2);
    end;
    
    
    
    {procedure mineores;
    begin
      repeat
        if Players[CurrentPlayer].strings[2] = 'rimmington' then
        begin
          if Players[CurrentPlayer].strings[3] = 'tin' then
          begin
            disguise('mining rimmington tin');
            rminetin;
          end;
          if Players[CurrentPlayer].strings[3] = 'copper' then
          begin
            disguise('mining rimmington copper');
            rminecopper;
          end;
          if Players[CurrentPlayer].strings[3] = 'iron' then
          begin
            disguise('mining rimmington iron');
            rmineiron;
          end;
          if Players[CurrentPlayer].strings[3] = 'gold' then
          begin
            disguise('mining rimmington gold');
            rminegold;
          end;
        end;
        if Players[CurrentPlayer].strings[2] = 'varrock' then
        begin
          if Players[CurrentPlayer].strings[3] = 'tin' then
          begin
            disguise('mining varrock tin');
            vminetin;
          end;
          if Players[CurrentPlayer].strings[3] = 'copper' then
          begin
            disguise('mining varrock copper');
            vminecopper;
          end;
          if Players[CurrentPlayer].strings[3] = 'iron' then
          begin
            disguise('mining varrock iron');
            vmineiron;
          end;
          if Players[CurrentPlayer].strings[3] = 'silver' then
          begin
            disguise('mining varrock silver');
    //        vminesilver;
          end;
        end;
        AntiBanz;
        FindRandoms;
        if not (LoggedIn) then
        begin
          NextPlayer(False);
          LoginPlayer;
        end;
      until invfull or inchat('full to')
    end;
           }
    
    procedure OreDropping;
    
    var OreDTM:integer;
    begin
      OreDTM := DTMFromString('78DA637463626078C28002FC0C54181E02694' +
         '620FE0F048CEE40353718D000231209A403816AEE1350E30D54F3' +
         '86801A7BA09A4F04D49800D53C26C29CEBF8D5000045B70DB0');
      repeat
        Disguise('dropping ores');
       If FindDTM(OreDTM,x,y,MIX1,MIY1,MIX2,MIY2) then
       Begin
        Mouse(x,y,2,2,False);
        wait(random(200));
        ChooseOption('Drop');
        wait(500 + random(100))
        findrandoms;
       end;
      Until not FindDTM(OreDTM,x,y,MIX1,MIY1,MIX2,MIY2);
      inc(loads);
    end;
    
    
    
    
    procedure proggy;
    begin
      cleardebug;
      SrlRandomsReport;
     WriteLn('              _____  ______')
      WriteLn('            |     ||      \    ')
      WriteLn('            |     ||       |  ')
      WriteLn('            |     ||   ___/   ')
      WriteLn('           /_____/ |__|    Power Skiller')
      WriteLn('_________________________________________________')
      WriteLn('           Ran for ' + timerunning               )
      WriteLn('        Skill trained ' + Players[CurrentPlayer].Strings[1] )
      WriteLn('        Loads done ' + inttostr(loads));
      WriteLn('        Thank You For Using JP Power skiller')
    end;
    
    begin
      SmartSetupEx(49, false, false, false);
      while not SmartActive do wait(100);
      SetTargetDC(SmartGetDC);
      setupsrl;
      activateclient;
      GraphicsSet := true;
      declareplayers;
      Login_SetAudio(1, 1, 1, NoChange);
      loginplayer;
      loads:=0;
      repeat
        GetTimeRunning;
        proggy
        if Players[CurrentPlayer].strings[1] = 'woodcutting' then
          woodcutting;
          if Players[CurrentPlayer].strings[1] = 'woodcutting' then
          logdropping;
          if Players[CurrentPlayer].strings[1] = 'mining' then
     //       mineores;
            if Players[CurrentPlayer].strings[1] = 'mining' then
            oredropping;
      until(loads = Players[CurrentPlayer].Integers[0])
    end.

  2. #2
    Join Date
    Dec 2008
    Location
    In a galaxy far, far away...
    Posts
    584
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Are you sure its even finding the willows? What does it do instead of chopping it?



    ~NS

  3. #3
    Join Date
    Apr 2009
    Location
    California!
    Posts
    280
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Yea, maybe your TPA's need to be updated?
    ~Penguin
    Semi-active
    http://i44.tinypic.com/33vk9aq.jpg
    SELL AUTOED GOODS AT MID-MAX! DON'T LET PRICES FALL AND GIVE US LESS PROFIT. (Put this in your sig)

  4. #4
    Join Date
    Feb 2009
    Posts
    2,155
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default

    it doesn;'t even find it

  5. #5
    Join Date
    Dec 2008
    Location
    In a galaxy far, far away...
    Posts
    584
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Then its your colors

    Debug your points, use DebugTPA(); or DebugATPA(); by Wizzup? You can find them in SRL/SRL/misc/Debug.scar



    ~NS

  6. #6
    Join Date
    Dec 2006
    Location
    Program TEXAS home of AUTOERS
    Posts
    7,934
    Mentioned
    26 Post(s)
    Quoted
    237 Post(s)

    Default

    Does the mouse move atleast?

  7. #7
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Such great help in explaining to us the problem...
    Use Debug(A)TPA or at least use writelns to see where it stops.

  8. #8
    Join Date
    Feb 2009
    Posts
    2,155
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default

    Quote Originally Posted by ~~Joker~~ View Post
    Does the mouse move atleast?
    ok so it doesn't move the mouse it wont even go tot he procedure it just sits there and spins forever

  9. #9
    Join Date
    Apr 2009
    Location
    California!
    Posts
    280
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Da 0wner View Post
    Such great help in explaining to us the problem...
    Use Debug(A)TPA or at least use writelns to see where it stops.
    I agree with Da 0wner. Use the writelns to see where it stops.
    ~Penguin
    Semi-active
    http://i44.tinypic.com/33vk9aq.jpg
    SELL AUTOED GOODS AT MID-MAX! DON'T LET PRICES FALL AND GIVE US LESS PROFIT. (Put this in your sig)

  10. #10
    Join Date
    Feb 2009
    Posts
    2,155
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default

    i figured it out im a n idiot i had if string[2] when the thing was in string[3]

  11. #11
    Join Date
    Apr 2009
    Location
    California!
    Posts
    280
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Lol, well good thing you found it out
    ~Penguin
    Semi-active
    http://i44.tinypic.com/33vk9aq.jpg
    SELL AUTOED GOODS AT MID-MAX! DON'T LET PRICES FALL AND GIVE US LESS PROFIT. (Put this in your sig)

  12. #12
    Join Date
    Aug 2008
    Location
    Finland
    Posts
    2,851
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    pick 2 colors: 1 from willow leaves, 1 from trees.
    then combine these 2:
    SCAR Code:
    var
      WillowPoints, TreePoints: TPointArray;

     FindColorsTolerance(WillowPoints, WillowColor, MSX1, MSY1, MSX2, MSY2, 5);
     FindColorsTolerance(TreePoints, TreeColor, MSX1, MSY1, MSX2, MSY2, 5);
     TPA := CombineTPA(WillowPoints, TreePoints);

    this is a possible endless loop. add there a timer like this:
    SCAR Code:
    MarkTime(t);
           repeat
             MMouse(x, y, 3, 3);
             wait (100);
             findrandoms;
           until ((not isuptext('Oak')) or (TimeFromMark(t)>10000));

    also don't make own function for each tree. do like this:
    SCAR Code:
    procedure chop;
    var
      x, y, H: integer;
      TreeUptext: string;
      WillowPoints, TreePoints, TPA: TPointArray;
      ATPA: T2DPointArray;
    begin
      case lowercase(players[currentplayer].strings[3]) of
       'willow': TreeUptext := 'illo';
       'oak': TreeUptext := 'Oak';
       'yew': TreeUptext := 'ew';
       'tree': TreeUptext := 'ree';
      end;
      CTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.2, 0.2);
      FindColorsTolerance(WillowPoints, WillowColor, MSX1, MSY1, MSX2, MSY2, 5); //lets get both willow and
      FindColorsTolerance(TreePoints, TreeColor, MSX1, MSY1, MSX2, MSY2, 5);     //normal tree colors
      TPA := CombineTPA(WillowPoints, TreePoints);
      if (Length(TPA) = 0) then Exit;
      ATPA := SplitTPAEx(TPA, 9, 9);
      SortATPAFrom(ATPA, Point(MSCX, MSCY));
      H := High(ATPA) - 1;
      for I := 0 to H do
      begin
         MiddleTPAEx(ATPA[i], x, y);
         MMouse(x, y, 3, 3);
         Wait(100 + Random(200));
         if IsUpText(TreeUptext) then  // <---
         begin
           Mouse(x, y, 3, 3, True);
           repeat
             MMouse(x, y, 3, 3);
             wait (100);
             findrandoms;
           until not (isuptext(TreeUptext)); //<---
           findrandoms;
         end;
      end;
    end;

    you should also avoid using global variables, check my function above
    ( add there timer yourself )
    Last edited by marpis; 05-15-2009 at 12:37 PM.

  13. #13
    Join Date
    Feb 2009
    Posts
    2,155
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default

    ^^^ ok so can u explain thi spart beter i get all of the other stuff jsut not this part

    Code:
     FindColorsTolerance(WillowPoints, WillowColor, MSX1, MSY1, MSX2, MSY2, 5); //lets get both willow and  
    FindColorsTolerance(TreePoints, TreeColor, MSX1, MSY1, MSX2, MSY2, 5);     //normal tree colors  
    TPA := CombineTPA(WillowPoints, TreePoints);
    is the willowpoints the leave color and is willow color the trunk or wut

  14. #14
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You don't even need to search for both. Searching for the trunk will make it try to cut trees already cut down. Just use the leaves on top.

    Also, WillowColor is the color of willows (a const or var or something). WillowPoints is a TPointArray variable that the colors for the willow are stored. Then it combines both into one TPointArray and splits it into an ATPA (most likely).

  15. #15
    Join Date
    Feb 2009
    Posts
    2,155
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default

    Quote Originally Posted by Da 0wner View Post
    You don't even need to search for both. Searching for the trunk will make it try to cut trees already cut down. Just use the leaves on top.

    Also, WillowColor is the color of willows (a const or var or something). WillowPoints is a TPointArray variable that the colors for the willow are stored. Then it combines both into one TPointArray and splits it into an ATPA (most likely).
    your right about the willow point thing i just didnt look at the var

    what your saying is just get the color of the trunk of the tree and the leaves for if its looking down on them?

  16. #16
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    What I am saying is ignore getting the trunk's color and just use the leaves. That way, it won't try to chop it if it is gone. So just use the FindColorsTolerance and use the leaves color.

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
  •