Results 1 to 5 of 5

Thread: Beginner WC Script Help

  1. #1
    Join Date
    Mar 2013
    Posts
    23
    Mentioned
    0 Post(s)
    Quoted
    15 Post(s)

    Default Beginner WC Script Help

    Hi Guys,

    I'm trying to write a line in my script to avoid spam clicking the tree when my character is already chopping the logs.

    As such, I've written this line after my chop procedure:

    Until not IsUpText('eak') or (InvFull);

    Sometimes the uptext will read "eak" however my guy won't be chopping so it just sits there till AFK logout. I was wondering how I would go about adding an "or 20000" or something so that there is a time fallback incase an error happens. I tried this:

    Until not IsUpText('eak') or (InvFull) or Wait(20000);

    However it does not work.

    If anyone could assist that would be greatly appreciated.

    Thanks!
    Last edited by Bizketben; 06-24-2013 at 10:25 PM.

  2. #2
    Join Date
    Jun 2007
    Location
    The land of the long white cloud.
    Posts
    3,702
    Mentioned
    261 Post(s)
    Quoted
    2006 Post(s)

    Default

    Quote Originally Posted by Bizketben View Post

    If anyone could assist that would be greatly appreciated.

    Thanks!
    You would need something like a TimeFromMark for that, not a wait.

    Simba Code:
    procedure whatever;
    var
      t: Integer;

    begin
      MarkTime(t)
      repeat
        wait(100) //or what ever you have here
      until not IsUpText('eak') or InvFull or (TimeFromMark(t) > 20000)
    end;

  3. #3
    Join Date
    Mar 2013
    Posts
    23
    Mentioned
    0 Post(s)
    Quoted
    15 Post(s)

    Default

    Quote Originally Posted by The Mayor View Post
    You would need something like a TimeFromMark for that, not a wait.
    Thanks for the fast response!

    So I did this:

    Code:
    procedure ChopTree;
    var x, y, t: integer;
    begin
      MarkTime(t)
        repeat
        if FindObj(x, y, 'own', 7382981, 10) then
        begin
           Mouse(x, y, 2, 2, true);
           ChooseOption('hop');
           wait(randomrange (7000, 9000));
        end;
        repeat
        Until not IsUpText('eak') or (InvFull) or (TimeFromMark(t) > 20000);
          Until(InvFull);
    end;
    Testing now, I will let you know if it doesn't work!

    Thanks for your help

  4. #4
    Join Date
    Jun 2007
    Location
    The land of the long white cloud.
    Posts
    3,702
    Mentioned
    261 Post(s)
    Quoted
    2006 Post(s)

    Default

    Quote Originally Posted by Bizketben View Post
    Thanks for the fast response!

    So I did this:

    Code:
    procedure ChopTree;
    var x, y, t: integer;
    begin
      MarkTime(t)
        repeat
        if FindObj(x, y, 'own', 7382981, 10) then
        begin
           Mouse(x, y, 2, 2, true);
           ChooseOption('hop');
           wait(randomrange (7000, 9000));
        end;
        repeat
        Until not IsUpText('eak') or (InvFull) or (TimeFromMark(t) > 20000);
          Until(InvFull);
    end;
    Testing now, I will let you know if it doesn't work!

    Thanks for your help

    Actually I see this is for teaks. I helped another member make a Teak chopper for OSR once. It's hard to tell when your character is chopping because your character doesn't move (or something like that, I've never cut teaks before ). If the inventory count doesn't increase within 10 seconds, it clicks the tree again.

    Simba Code:
    procedure Chop;

    begin
      i := InvCount + 1;

        if FindObj(x, y, 'own', 7382981, 35) then
        begin
          Case random(1) of
          0: Mouse(x, y, 5, 5, true);

          1: begin
              Mouse(x, y, 5, 5, false);
              ChooseOption('Chop');
             end;
          end;
        end;
    end;

    begin  // This is like your main loop
      repeat
        If Not WaitInvCount(I, 10000, ExactCT) then
        Begin
          WriteLn('No logs for 10s, clicking tree again');
          Chop;
        End;
      until(InvFull);
    end.

  5. #5
    Join Date
    Mar 2013
    Posts
    23
    Mentioned
    0 Post(s)
    Quoted
    15 Post(s)

    Default

    Quote Originally Posted by The Mayor View Post
    Actually I see this is for teaks. I helped another member make a Teak chopper for OSR once. It's hard to tell when your character is chopping because your character doesn't move (or something like that, I've never cut teaks before ). If the inventory count doesn't increase within 10 seconds, it clicks the tree again.
    Sweet - I sent you a PM. Your method works with the MarkTime suggestion you made above, getting an error when I try what you just posted, sent you a PM.

    Thnx

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
  •