Results 1 to 5 of 5

Thread: Help with failsafe?

  1. #1
    Join Date
    Feb 2012
    Location
    UK
    Posts
    64
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Help with failsafe?

    I want to add a failsafe into my script to do the following, click on minimap at selected point ( i have the DTM for it) If wait exceeds a set time.

    Im unsure what and where to add in this.
    Simba Code:
    var
      Xi, Yi, X1, Y1, X2, Y2: Integer;
    begin
     //Writeln('Checking for bones');
       if FindObjEx(Xi, Yi, ['ake', 'ke'], BoneColours, 3, 50, 1, 5, 689, 390) then
    begin
     GetMousePos(Xi, Yi);
     Mouse(Xi, Yi, 0, 0, false);
       if WaitOptionMulti(['ake Bone', 'ake B'], 200) then
      Wait(RandomRange(700, 1200));
       while IsMoving do
    begin
      Wait(250);
      antiban;
    end;
      If not(invfull) then
    begin
      FindBones;
      or if FindObjEx
    end;
    end;
    end;

    Thanks in advance

  2. #2
    Join Date
    Jan 2010
    Posts
    1,414
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Simba Code:
    procedure Example;
    var
      T, maxT: Integer;
    begin
      T := 0;
      maxT := (RandomRange(8500, 10000)); // Minimum and maximum amount of wait time

      MarkTime(T);

      while (TimeFromMark(T) < maxT) do
      begin
        WriteLn('Waiting.');
        Wait(1000);
      end;
    end;

    Is an example of what you could do. If you need anything to be explained, feel free to ask! We don't mind at all.


    E: For a further example of what you want to do specifically:
    Simba Code:
    procedure Example;
    var
      T, maxT: Integer;
    begin
      T := 0;
      maxT := (RandomRange(8500, 11500));

      MarkTime(T)

      repeat
        if (TimeFromMark(T) >= maxT) then
          WriteLn('T is greater than or equal to maxT.'); // Replace with fail-safe(s)

        WriteLn('Waiting.');
        Wait(1000);
      until(False);
    end;
    Last edited by RISK; 02-23-2012 at 09:31 PM.
    Simba Code:
    (* Main *)

    repeat
      WriteLn('I am an idiot!');
    until(False);

  3. #3
    Join Date
    Feb 2012
    Location
    UK
    Posts
    64
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks for the advice, i couldn't find anything about waiting times :P
    Does T stand for the time or something else? T := 0;
    I can't do DTM's walking and its annoying. Any other simple clicker, it only needs to walk to one spot if wait exceeds a certain time.. :3

    Sorry for being a noob.
    Last edited by Gl3nn IV; 02-23-2012 at 10:09 PM.

  4. #4
    Join Date
    Jan 2010
    Posts
    1,414
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    T := 0; is to simply set the integer 'T' to 0. It's a habit of mine to set all the integers and such to default values at the procedure/function's start.

    maxT := (); sets the maximum amount of time to wait before it does the fail-safe in mind. We set it there as each time the if (TimeFromMark(T), etc) gets called, it will create a random value for it to choose from. But if we set it at the start of the script as a set integer, it won't be random each time the if .. then comes up.

    MarkTime(T); will begin to mark the time that will pass after calling this in to the integer we place in between the parenthesis. In this case, 'T'.

    We use TimeFromMark(T) to get the value of 'T' in a way that we can compare it to maxT and see if we need to initiate a fail-safe or not.


    You could use SPS, by the way, for the walking. If you're having trouble with DTM walking, that is.
    Simba Code:
    (* Main *)

    repeat
      WriteLn('I am an idiot!');
    until(False);

  5. #5
    Join Date
    Feb 2012
    Location
    UK
    Posts
    64
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ahh, thanks you explain really well. I just compiled the DTM method so it may work... If not i'll just rage.
    I may use SPS if this doesn't work.
    Thanks for all the help again

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
  •