Results 1 to 3 of 3

Thread: How do I get this to repeat until?

  1. #1
    Join Date
    Dec 2006
    Posts
    908
    Mentioned
    1 Post(s)
    Quoted
    17 Post(s)

    Default How do I get this to repeat until?

    SCAR Code:
    procedure ChopWillows;
    begin
      repeat
      if (not (LoggedIn)) then
        Exit;
        if (not (FindColorTolerance(x, y, WillowTree1, MSX1, MSY1, MSX2, MSY2, 45))) or
           (not (FindColorTolerance(x, y, WillowTree2, MSX1, MSY1, MSX2, MSY2, 45))) or
           (not (FindColorTolerance(x, y, WillowTree3, MSX1, MSY1, MSX2, MSY2, 45))) then
          Wait(550 + Random(450));
          Tries := Tries + 1;
          if (Tries = 20) then
          begin
            Writeln('Failed to find the Willows, checked 20 times. Try setting different colors.');
            LogOut;
            Exit;
          end else
          if (FindColorTolerance(x, y, WillowTree1, MSX1, MSY1, MSX2, MSY2, 45)) or
             (FindColorTolerance(x, y, WillowTree2, MSX1, MSY1, MSX2, MSY2, 45)) or
             (FindColorTolerance(x, y, WillowTree3, MSX1, MSY1, MSX2, MSY2, 45)) then
            MMouse(x, y, 5, 5);
            if IsUpText('illow') then
              begin
                case Random(2) of
                  1:  begin
                        Mouse(x, y, 4, 4, True);
                        FFlag(0);
                        Writeln('Found Willow, left click.');
                        AntiBan;
                        MMouse(x, y, 4, 4);
                        EntFinder;
                        CheckRandoms;
                      end;
                  2:  begin
                        Mouse(x, y, 4, 4, False);
                        FFlag(0);
                        Writeln('Found Willow, right click.');
                        AntiBan;
                        MMouse(x, y, 4, 4);
                        EntFinder;
                        CheckRandoms;
                      end;
                    end;
                  end;
                until (InvFull) or (TimeFromMark(ChoppingDone) > 18000 + Random(2000)) or (FindBlackChatMessage('Your inventory is too full to hold anymore logs.'))
              end;

    Somehow it does not work and then my main loop

    SCAR Code:
    begin
      CreditsAndSetUp;
      ActivateClient;
      repeat
        SetUp;
        WalkToWillows;
        ChopWillows;
      until (False);
    end.

    All it does is go to the willow site (I checked all 3 of my fail safes and they work), then it goes to the trees, click at a Willow Tree, then it suddenly goes to my Setup procedure (like set run etc.) then it runs to the Willow Site, (which it already is in) then clicks the Willow once etc.

    I figure this ChopWillow; procedure of mine doesn't work. May some help me please?

  2. #2
    Join Date
    Oct 2006
    Location
    finland, helsinki
    Posts
    2,501
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    SCAR Code:
    procedure ChopWillows;
    var
      ChoppingDone: integer;
    begin
      ChoppingDone := getsystemtime;
      repeat
        if (not (LoggedIn)) then Exit;
          if (FindColorTolerance(x, y, WillowTree1, MSX1, MSY1, MSX2, MSY2, 45)) or
             (FindColorTolerance(x, y, WillowTree2, MSX1, MSY1, MSX2, MSY2, 45)) or
             (FindColorTolerance(x, y, WillowTree3, MSX1, MSY1, MSX2, MSY2, 45)) then
          Begin
            MMouse(x, y, 5, 5);
            wait(45);
            if IsUpText('illow') then
              begin
                case Random(2) of
                  1:  begin
                        Mouse(x, y, 4, 4, True);
                        FFlag(0);
                        Writeln('Found Willow, left click.');
                      end;
                  2:  begin
                        Mouse(x, y, 4, 4, False);
                        ChooseOption('hop');
                        FFlag(0);
                        Writeln('Found Willow, right click.');
                      end;
                end;
                AntiBan;
                MMouse(x, y, 4, 4);
                EntFinder;
                CheckRandoms;
              end;
          End Else
          Begin
            Wait(550 + Random(450));
            Tries := Tries + 1;
            if (Tries = 20) then
            begin
              Writeln('Failed to find the Willows, checked 20 times. Try setting different colors.');
              LogOut;
              Exit;
            end;
          end;
      until (InvFull) or (TimeFromMark(ChoppingDone) > 18000 + Random(2000)) or (FindBlackChatMessage('Your inventory is too full to hold anymore logs.'))Or(Not LoggedIn);
    end;


    copy and over write the old one.

    Code:
    • Narcle: I recall Jukka releasing a bunch of scripts like this before... Its how he rolls I think. rofl
    • Solarwind: Dude, you are like... t3h s3x.
    • Hy71194: JuKKa you're a machine! You released 3 scripts in 10 minutes! :O
    • benjaa: woah.... Jukka is the man Guildminer pwns all
    • NaumanAkhlaQ: And JuKKa Is my Her0!

  3. #3
    Join Date
    Dec 2006
    Posts
    908
    Mentioned
    1 Post(s)
    Quoted
    17 Post(s)

    Default

    Whats GetSystemTime suppose to do?
    Am i to make a procedure or function?

    And thanks so much, im gonna study it =D

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Repeat?
    By FortAsh in forum OSR Help
    Replies: 9
    Last Post: 01-13-2009, 04:18 PM
  2. repeat until...???
    By Alligaattor in forum OSR Help
    Replies: 12
    Last Post: 10-23-2008, 12:59 AM
  3. repeat help
    By trojan in forum OSR Help
    Replies: 2
    Last Post: 06-15-2007, 03:54 PM
  4. repeat somewhere help thx
    By rkroxpunk in forum OSR Help
    Replies: 4
    Last Post: 03-12-2007, 08:24 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
  •