Results 1 to 5 of 5

Thread: Failsafe

  1. #1
    Join Date
    Dec 2011
    Location
    United States
    Posts
    960
    Mentioned
    21 Post(s)
    Quoted
    504 Post(s)

    Arrow Failsafe

    How would I add a failsafe into this part of my script. I want to add one that would ensure that the script does not somehow miss click and fails to soften the clay.

    Code:
    function SoftenClay:Boolean;
     Var
     X, Y, Clay, SoftClay, Soft:Integer;
    
     Begin
     Clay := DTMFromString('mlwAAAHicY2dgYMhgZWDIBeJSIM4B4hQgTmWFiK9kZGCYC8RLgHg1EK8C4sVAvBCI+8r9gLqZsGJ+IMlIBoYCAAXECRc=');
    
     If FindDTM(Clay, X, Y, MIX1, MIY1, MIX2, MIY2) Then
     Begin
      MMouse(X, Y, 3, 3);
      wait(600 + random(400));
      If IsUpText('lay') Then
      Begin
      Mouse(X, Y, 0, 0, True);
      if FindColorSpiralTolerance(x, y, WellColor, MSX1, MSY1, MSX2, MSY2, 3) then
    Begin
    MMouse(X, Y, 3, 3);
    wait(600 + random(400));
    if(IsUpText('ell'))then
    begin
    Mouse(X, Y, 0, 0, True);
    Wait(3000 + random(500));
    MouseBox(236, 403, 280, 454, 1);
    
    wait(2000 + random(20000));
     MMouseItem(28);
     MarkTime(Soft);
    repeat
    wait(500 + random(500));
    if(IsUpText('oft')) then
      Result := True Or
      (TimeFromMark(Soft) > 30000);
    
    until(Result);
    end;
    end;
    end;
    end;
    end;
    Also..
    What are some failsafes that I could add to the rest of my script before releasing it. (Right now I very small amount)

  2. #2
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Oohhh killed my eyes.. Standards need work:

    Simba Code:
    function SoftenClay:Boolean;
     Var
     X, Y, Clay, SoftClay, Soft:Integer;

    Begin
      Clay := DTMFromString('mlwAAAHicY2dgYMhgZWDIBeJSIM4B4hQgTmWFiK9kZGCYC8RLgHg1EK8C4sVAvBCI+8r9gLqZsGJ+IMlIBoYCAAXECRc=');

      If FindDTM(Clay, X, Y, MIX1, MIY1, MIX2, MIY2) Then
      Begin
        MMouse(X, Y, 3, 3);
        wait(600 + random(400));

        If IsUpText('lay') Then
        Begin
          Mouse(X, Y, 0, 0, True);
          if FindColorSpiralTolerance(x, y, WellColor, MSX1, MSY1, MSX2, MSY2, 3) then
          Begin
            MMouse(X, Y, 3, 3);
            wait(600 + random(400));
            if(IsUpText('ell'))then
            begin
              Mouse(X, Y, 0, 0, True);
              Wait(3000 + random(500));
              MouseBox(236, 403, 280, 454, 1);

              wait(2000 + random(20000));
               MMouseItem(28);
               MarkTime(Soft);
              repeat
                wait(500 + random(500));
                if(IsUpText('oft')) then
                  Result := True Or
                  (TimeFromMark(Soft) > 30000);
              until(Result);
            end;
          end;
        end;
      end;
    end;

    As for failsafes I think it's sorta the scripter's job to figure out what problems there can possibly be no?
    I am Ggzz..
    Hackintosher

  3. #3
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    Could you fix your standards and use Simba tags instead of code tags? Hard to read!

    Basically after your ends (which correspond to the begins after finding something) put failsafe.

    Ex:
    Simba Code:
    If finddtm Then
    Begin
      DoStuff;
    End Else
    Begin
      Writeln('could not find DTM!');
      Logout;
    End;
    Last edited by YoHoJo; 01-10-2012 at 09:48 PM.

  4. #4
    Join Date
    Dec 2011
    Posts
    353
    Mentioned
    3 Post(s)
    Quoted
    8 Post(s)

    Default

    I think a good failsafe would be if it doesn't find the Wellcolor it could retry searching another color. if it still can't find any color log it out and stop script.

  5. #5
    Join Date
    Dec 2011
    Location
    United States
    Posts
    960
    Mentioned
    21 Post(s)
    Quoted
    504 Post(s)

    Default

    I think I should go through my whole script and make it look more eye appealing

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
  •