Results 1 to 9 of 9

Thread: Script wont chop down tree again

  1. #1
    Join Date
    Dec 2011
    Posts
    183
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Script wont chop down tree again

    I have made myself a script and it is able to chop down a tree and firemake on the spot for a Runescape Private Server. However it only chops down the tree once and then stops. I have no idea what I am doing wrong. Help me out please.
    Simba Code:
    program WCandFM;
    {$i SRL/SRL.simba}

    var
      x,y:Integer;

    const
     TreeColour = 22664;
     TreeColourTolerance = 3;
     StumpColour = 4489384;
     StumpColourTolerance = 10;
     TreeX1 = 0
     TreeY1 = 0
     TreeX2 = 515
     TreeY2 = 337


    procedure AntiBan;
    begin
     Case Random (20) of
        1: Begin SleepAndMoveMouse(5000 + Random(750)); End;
        2: Begin RandomRClick; End;
        3: Begin PickUpMouse; End;
        4: Begin MissMouse(100,100); End;
        5: Begin RandomRClick; End;
        6: Begin PickUpMouse; End;
        7: Begin RandomMovement; End;
        8: Begin BoredHuman; End;
        9: Begin RandomRClick; End;
        End;
     end;

     procedure ChopTree;
     begin
     repeat
           if FindColorSpiralTolerance(x, y, TreeColour, TreeX1, TreeY1, TreeX2, TreeY2,  TreeColourTolerance) then //finds tree and chops it down
           begin
           writeln('Found tree and chopping it down.');
           Mouse (x ,y ,0 , 0, True);
           end;
           repeat
           Wait(RandomRange(1000, 2000));
           AntiBan;
           Until (FindColorSpiralTolerance(x, y, StumpColour, TreeX1, TreeY1, TreeX2, TreeY2, StumpColourTolerance) or (FindColorSpiralTolerance (x, y, 3029313, 653, 438, 669, 449, 20)) = False) //detects stump or inventory full so it can chop down the tree again, however it doesnt
           until not(FindColorSpiralTolerance(x, y, 3029313, 653, 438, 669, 449, 20)); //detects full inventory
           Writeln('Full inventory, starting to firemake.');
          end;

    Procedure Firemake;
    begin
    repeat
    Mouse(706, 444, 10, 10, True);
    wait (200+Random(100));
    Mouse(663, 444, 10, 10, True);
    wait (1600+Random(100));
    until (FindColorSpiralTolerance (x, y, 3029313, 653, 438, 669, 449, 20));
    Writeln('Finished lighting all the logs, finding tree.');
    end;

    procedure main;
    begin
      repeat
        ChopTree;
        Firemake;
      until(false);
    end;

    begin
      ClearDebug;
      SetUpSrl;
      ActivateClient;
      main;
    end.

  2. #2
    Join Date
    Jan 2012
    Posts
    713
    Mentioned
    3 Post(s)
    Quoted
    9 Post(s)

    Default

    Simba Code:
    begin
      ClearDebug;
      SetUpSrl;
      ActivateClient;
      Repeat
      main;
      Until(False)
    end.

    Sorry that was right -.- try that.
    Last edited by Google; 04-18-2012 at 11:55 PM.

  3. #3
    Join Date
    Mar 2012
    Location
    127.0.0.1
    Posts
    3,383
    Mentioned
    95 Post(s)
    Quoted
    717 Post(s)

    Default

    Don't use
    Simba Code:
    Until(False)
    Turn False to AllPlayersInactive
    And for this line,
    Simba Code:
    until not(FindColorSpiralTolerance(x, y, 3029313, 653, 438, 669, 449, 20)); //detects full inventory

    How does that detect logs in inventory, wouldn't it be better to do:
    Simba Code:
    Until(InvCount = 28);

    It's detecting the full inventory early, so it's saying it's done, I think.
    Add a repeat look at the end, by the way.
    Last edited by NKN; 04-19-2012 at 01:39 AM.

  4. #4
    Join Date
    May 2008
    Location
    ;)
    Posts
    576
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by NKN View Post
    wouldn't it be better to do:
    Simba Code:
    Until(InvCount = 28);
    or just
    Simba Code:
    until(invfull)

    But this was (likely) your problem. Or an infinite loop (hadn't actually checked for that :P). Use more writeln()s to help find errors!

  5. #5
    Join Date
    Dec 2011
    Posts
    183
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    i think the problem is actually that it doesnt detect the stump and so it does not go forth with the script. however it can detect full inventory and it will start the firemaking procedure. is there a reason that it WONT detect the stump?

  6. #6
    Join Date
    Mar 2012
    Location
    MW3
    Posts
    76
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    why do you need antiban in a private server?
    Script(s) by me:

  7. #7
    Join Date
    Dec 2011
    Posts
    183
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Bobby Boo View Post
    why do you need antiban in a private server?
    practise and you can never be too sure

  8. #8
    Join Date
    Dec 2011
    Posts
    183
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    oh and guys i cant use (invfull) ive already tried it, so i have to do something like
    until (findcolourtolerance..(empty inventory colour)) = false

  9. #9
    Join Date
    Mar 2012
    Location
    127.0.0.1
    Posts
    3,383
    Mentioned
    95 Post(s)
    Quoted
    717 Post(s)

    Default

    Zulo, you're inventory has to be open for InvFull to work.

    Try InvFull or InvCount = 28

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
  •