Results 1 to 12 of 12

Thread: Can someone help me with my chop procedure?

  1. #1
    Join Date
    Dec 2007
    Location
    Michigan, USA
    Posts
    280
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Can someone help me with my chop procedure?

    SCAR Code:
    procedure Cut;
    var
      Inv: Integer;
    begin
      repeat
        if(FindObj(x,y,'ree',TreeColor,15)) and not(InvFull) then
        begin
          Mouse(x,y,5,5,true);
          Writeln('Walking to Tree');
          Flag;
          Writeln('Cutting Tree');
          Inv := InvCount;
          Clicks := Clicks + 1
          AntiRandoms;
            repeat
              wait(500);
            until(InvCount = Inv + 1);
          Writeln('Tree Cut');
          AntiRandoms;
        end;
      until (InvFull);
    end;
    it will cut one load, then it will click on a tree and just sit there, like it freezes at the repeat.... anyone know whats wrong/how to make it better? ... ok now 11! people have looked at this, but no help? why ..... WHY I SAY!?!?!?!
    Kindof Inactive...

  2. #2
    Join Date
    Dec 2007
    Location
    Michigan, USA
    Posts
    280
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ok.... i tried to fix, its still not functioning right.... someone please mind helping me out her'??
    Kindof Inactive...

  3. #3
    Join Date
    Jun 2007
    Location
    Wednesday
    Posts
    2,446
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    Firstly (on improving), the script will currently only work for (normal) trees (as it only waits until it cuts a log) and still only then if you cut the tree (and not someone else). You should instead make it randomly check if the tree is still there after clicking and if it isn't, then find another tree.
    Also, in the main 'Repeat' 'Until' loop, you should make add a wait in if it can't find the tree so it doesn't run it a million times and crash the scar (even a wait/sleep 50 would do).
    Another thing, instead of doing 'clicks:= clicks+1;', you should use 'Inc(clicks);' or 'Dec(clicks);'.
    Second to last, you should really only put the AntiRandoms in the wait loop as that's where you (should) spend the most time, so where a random is most likely to come up.
    Lastly (on improving), for the 'until', you should include a failsafe in case the tree disappears for whatever reason and you should make it 'Until(InvCount > Inv)' as if you get another item (such as from a dwarf) then it will still recognise that you have a new item, though looking through the actual RS chat would be a lot more reliable if you only wanted the 1 log from each tree.

    On why it freezes, I would suggest adding writeln's after every step so you can get a more accurate reason as to why it freezes. Include InvCount, Clicks etc. in them to make sure nothing is going wrong there. Also, it could be that it can't find the exact tree colour (especially if you set it each time before testing), so it just keeps on repeating nothing.

  4. #4
    Join Date
    Dec 2007
    Location
    Michigan, USA
    Posts
    280
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by mixster05 View Post
    Firstly (on improving), the script will currently only work for (normal) trees (as it only waits until it cuts a log) and still only then if you cut the tree (and not someone else). You should instead make it randomly check if the tree is still there after clicking and if it isn't, then find another tree.
    Also, in the main 'Repeat' 'Until' loop, you should make add a wait in if it can't find the tree so it doesn't run it a million times and crash the scar (even a wait/sleep 50 would do).
    Another thing, instead of doing 'clicks:= clicks+1;', you should use 'Inc(clicks);' or 'Dec(clicks);'.
    Second to last, you should really only put the AntiRandoms in the wait loop as that's where you (should) spend the most time, so where a random is most likely to come up.
    Lastly (on improving), for the 'until', you should include a failsafe in case the tree disappears for whatever reason and you should make it 'Until(InvCount > Inv)' as if you get another item (such as from a dwarf) then it will still recognise that you have a new item, though looking through the actual RS chat would be a lot more reliable if you only wanted the 1 log from each tree.

    On why it freezes, I would suggest adding writeln's after every step so you can get a more accurate reason as to why it freezes. Include InvCount, Clicks etc. in them to make sure nothing is going wrong there. Also, it could be that it can't find the exact tree color (especially if you set it each time before testing), so it just keeps on repeating nothing.
    thanks for this, ill try to understand what your wrote ... ill get part of it, you don't think you can edit it a little to help me understand? or make a few lines to help me understand?
    i kindof fixed it and came up with this....
    SCAR Code:
    procedure Cut;
    var
      a,b: Integer;
    begin
      repeat
        if(FindObj(x,y,'ree',TreeColor1,15)) and not(InvFull) then
        begin
          Mouse(x,y,5,5,true);
          Flag;
          a := InvCount;
          Clicks := Clicks + 1
          AntiRandoms;
            repeat
              wait (random(1000));
              b := InvCount;
            until(b > a);
          AntiRandoms;
        end;
      until (InvFull);
    end;
    it works but it like clicks every 2-5 secs or so....
    Kindof Inactive...

  5. #5
    Join Date
    Feb 2007
    Location
    Estonia.
    Posts
    1,938
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    SCAR Code:
    procedure Cut;
    var
      a,b,chopstart: Integer;       //added chopstart
    begin
      repeat
        if(FindObj(x,y,'ree',TreeColor1,15)) and not(InvFull) then
        begin
          Mouse(x,y,5,5,true);
          Flag;
          MarkTime(chopstart);  //added marktime
          a := InvCount;
          Clicks := Clicks + 1
          AntiRandoms;
            repeat
              wait (random(1000));
              b := InvCount;
            until(b > a);
          AntiRandoms;
        end;
      until (not loggedIn) or (Not isuptext('hop')) or (TimeFromMark(Chopstart) > (30000+ random(15000)));
    end;                        //this should be better;)

    This should be a bit better,
    Eerik.

  6. #6
    Join Date
    Dec 2007
    Location
    Michigan, USA
    Posts
    280
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by heavenzeyez1 View Post
    SCAR Code:
    procedure Cut;
    var
      a,b,chopstart: Integer;       //added chopstart
    begin
      repeat
        if(FindObj(x,y,'ree',TreeColor1,15)) and not(InvFull) then
        begin
          Mouse(x,y,5,5,true);
          Flag;
          MarkTime(chopstart);  //added marktime
          a := InvCount;
          Clicks := Clicks + 1
          AntiRandoms;
            repeat
              wait (random(1000));
              b := InvCount;
            until(b > a);
          AntiRandoms;
        end;
      until (not loggedIn) or (Not isuptext('hop')) or (TimeFromMark(Chopstart) > (30000+ random(15000)));
    end;                        //this should be better;)

    This should be a bit better,
    Eerik.
    Wow, thanks thats better then a paragraph, ill try formating mine like that and posting if it works. (btw, this will only cut one log...)
    Kindof Inactive...

  7. #7
    Join Date
    Dec 2007
    Location
    Michigan, USA
    Posts
    280
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ok now everything is screwed up.... can someone please fix this? ill give rep to whomever helps me out here...
    SCAR Code:
    {/////|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||\\\\\
    /////|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||\\\\\
    |||||                                                                     |||||
    |||||                   PowerCutter Ver 1 by Mikevskater                  |||||
    |||||                  This ver only cuts normal trees...                 |||||
    |||||                                                                     |||||
    \\\\\|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||/////
     \\\\\|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||/////
    }

    program FirstScript;
    {.include srl/srl.scar}

    var
      x,y: Integer;
      Loads: Integer;
      Clicks: Integer;
     
    const
      Tree = 4621949;
    ////////////////////////////////////////////////////////////////////////////////
    procedure Anti;
    begin
      if (Findfight = true) then
      begin
        runaway('N', false, 3, 9000+random(1000));
      end;
      case random(10) of
        0: BoredHuman;
        2: RandomMovement;
        4: PickUpMouse;
        6: HoverSkill('woodcutting', false);
        8: RandomRClick;
      end;
    end;
    ////////////////////////////////////////////////////////////////////////////////
    procedure Cut;
    var
      a,b,chopstart: Integer;
    begin
      repeat
        if(FindObj(x,y,'ree',Tree,15)) and not(InvFull) then
        begin
          Mouse(x,y,5,5,true);
          Flag;
          MarkTime(chopstart);
          a := InvCount;
          Clicks := Clicks + 1
          Anti;
            repeat
              wait (random(1000));
              b := InvCount;
            until(b > a);
          Anti;
        end;
      until (not loggedIn) or (Not isuptext('hop')) or (TimeFromMArk(Chopstart) > (30000+random(15000)));
    end;
    ////////////////////////////////////////////////////////////////////////////////
    Procedure Drop;
    var
      Logs: Integer;
    begin
    Logs := DTMFromString('78DA63CC65626078C68002F2428DC0342394C' +
           'F580254F396010D30A2AAA906AA794A404D1950CD2D026A92806A' +
           'EE1250130754F386809A34A09A8FF8D500000D2D0A5C');
      if(FindDTM(logs,x,y,MIX1,MIY1,MIX2,MIY2))then
      begin
        DropAll;
        wait(1000+random(500));
        Writeln('Dropped');
        Anti;
        Loads := Loads + 1
      end;
    end;
    ////////////////////////////////////////////////////////////////////////////////
    procedure Proggy;
    begin
      ClearDebug;
      Writeln('/-----------------------------------\');
      Writeln('|    PowerCutter by MikeVSkater     |');
      Writeln('\-----------------------------------/');
      Writeln('/-----------------------------------\');
      writeln('           Clicks: '+inttostr(clicks));
      Writeln('            Logs: '+inttostr(loads));
      Writeln('        Time: '+TimeRunning);
      Writeln('\-----------------------------------/');
    end;
    ////////////////////////////////////////////////////////////////////////////////
    procedure Signature;
    begin
      ClearDebug;
      Writeln('PowerCutter made by Mikevskater');
      wait(500);
      Writeln('This is my first script so please help me '+
       'on anything you know that I dont?');
      Wait(1000+random(500))
    end;
    ////////////////////////////////////////////////////////////////////////////////
    begin
      SetupSRL;
      Signature;
      Disguise('iTunes');
      ActivateClient;
      wait(2000);
      repeat
      If (Not loggedin)then
        Terminatescript;
      Cut;
      Anti;
      Drop;
      Proggy;
      until(False)
    end.
    put it in scar and try it..... its not working i screwed something up.... and i get this error now...
    SCAR Code:
    [Runtime Error] : Out Of Range in line 1443 in script C:\Program Files\SCAR 3.13\includes\SRL/SRL/Core/AntiRandoms/AntiRandoms.scar
    Please Help Me!
    Kindof Inactive...

  8. #8
    Join Date
    Feb 2007
    Location
    EST (US East Coast)
    Posts
    250
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Well line 1443 is part of FindTalk. If you try to call any function or procedure that uses FindTalk without declaring your player array, you will get an error like that.

    However... I tried compiling and running your script and both worked fine. I wasn't logged in so the script immediately terminated itself. Don't know what else to tell you.
    Temporarily inactive.

  9. #9
    Join Date
    Dec 2007
    Location
    Michigan, USA
    Posts
    280
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by ducels View Post
    Well line 1443 is part of FindTalk. If you try to call any function or procedure that uses FindTalk without declaring your player array, you will get an error like that.

    However... I tried compiling and running your script and both worked fine. I wasn't logged in so the script immediately terminated itself. Don't know what else to tell you.
    thanks about the first part, and the script works, it just epic fails like horribly... mind trying on a newb account?
    Kindof Inactive...

  10. #10
    Join Date
    Feb 2007
    Location
    EST (US East Coast)
    Posts
    250
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Worked fine... It moved the mouse around the farming patch and yew tree I was near, went to skills tab and didn't do anything. I stopped it there.

    Are you sure you didn't have FindNormalRandoms or something similar in there?

    If you put FindNormalRandoms after SetupSRL on your script and hit run you get the EXACT same error.
    Temporarily inactive.

  11. #11
    Join Date
    Dec 2007
    Location
    Michigan, USA
    Posts
    280
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by ducels View Post
    Worked fine... It moved the mouse around the farming patch and yew tree I was near, went to skills tab and didn't do anything. I stopped it there.
    I know, thats why im trying to get help, caus i cant get it to cut anymore....
    Kindof Inactive...

  12. #12
    Join Date
    Dec 2007
    Location
    Michigan, USA
    Posts
    280
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I'm sorry for dp'ing, but no one is helping me out here, and i cant figure out why it just keeps the skill tab open and just highlights trees..... will someone please help me out here?
    Kindof Inactive...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Chop Chop 2.0
    By NiCbaZ in forum RS3 Outdated / Broken Scripts
    Replies: 246
    Last Post: 09-09-2009, 07:39 PM
  2. chop chop 2.0
    By ashender in forum OSR Help
    Replies: 3
    Last Post: 03-02-2009, 10:05 PM
  3. GrettleNet SMART CHOP CHOP!!!
    By Fosscape in forum First Scripts
    Replies: 3
    Last Post: 01-19-2009, 03:59 PM
  4. Chop procedure help!!!
    By gerauchert in forum OSR Help
    Replies: 22
    Last Post: 07-15-2007, 07:08 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •