Results 1 to 4 of 4

Thread: Cant figure out why it breaks my loop

  1. #1
    Join Date
    Jul 2007
    Location
    Ottawa, Canada
    Posts
    930
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Cant figure out why it breaks my loop

    Heres the deal: it is supposed to sit there and twitch the screen until it finds the dtm, sometimes it does, but sometimes it clicks at the edge of mmx1 mmy2 and just goes on and ignores all my failsafes. It's like the logoff and exit command dont work in my scar. (im using scar 3.15 with srl 16). Help me?
    SCAR Code:
    function WalkDTM(cDTM : Integer) : boolean;
    var c : TPoint;
    begin
    ii := 0
      if not LoggedIn then Exit;
      Randoms;
      SetRun(True);
      while not DTMRotated(cDTM, c.x, c.y, MMX1, MMY1, MMX2, MMY2) do
      begin
        if ii > 20 then
        begin
          ii := 0
          logout;
          exit;
        end;
        twitch;
        ii := ii + 1;
      end;
      Mouse(c.x, c.y, 0, 0, true);
      fflag(5);
      result := true;
    end;
    ~ Metagen

  2. #2
    Join Date
    Jun 2007
    Location
    La Mirada, CA
    Posts
    2,484
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    try a repeat until loop, ive heard that sometimes the while do loop doesnt work correctly...

    "Failure is the opportunity to begin again more intelligently" (Henry Ford)


  3. #3
    Join Date
    Jul 2007
    Location
    Ottawa, Canada
    Posts
    930
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    i hate you scar

    -1 rep to scar
    ~ Metagen

  4. #4
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Might try this as a replacement along the lines of what Hyper said.
    SCAR Code:
    function WalkDTM(cDTM : Integer) : boolean;
    var c : TPoint;
    begin
    ii := 0
      if not LoggedIn then Exit;
      Randoms;
      SetRun(True);
      If not DTMRotated(cDTM, c.x, c.y, MMX1, MMY1, MMX2, MMY2) then
      begin
       Repeat
        if ii > 20 then
        begin
          ii := 0
          logout;
          exit;
        end;
        twitch;
        ii := ii + 1;
       Until(DTMRotated(cDTM, c.x, c.y, MMX1, MMY1, MMX2, MMY2)) or (ii > 5{??});
      end;
      Mouse(c.x, c.y, 0, 0, true);
      fflag(5);
      result := true;
    end;

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. adding breaks
    By tazzin44 in forum OSR Help
    Replies: 9
    Last Post: 01-20-2009, 02:44 AM
  2. Prefix change breaks smart
    By man slaughter in forum RS has been updated.
    Replies: 22
    Last Post: 10-26-2008, 12:15 PM
  3. Line breaks?
    By skullbr00d in forum OSR Help
    Replies: 4
    Last Post: 06-12-2007, 02:58 AM

Posting Permissions

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