Results 1 to 4 of 4

Thread: Failsafe with ladders

  1. #1
    Join Date
    Mar 2013
    Posts
    39
    Mentioned
    0 Post(s)
    Quoted
    11 Post(s)

    Default Failsafe with ladders

    I made my first own simple script and im kinda stuck at failsafe now.
    Going down ladder doesn't always work due to missclicking so my script fails.

    At the moment it looks like this:

    Code:
    procedure GoDown;
        Var x, y: integer;
    begin
    writeln('Goin doown!');
    if (FindObjCustom(x, y, ['limb-down', 'adder'], [403770, 202786], 5)) then
    begin
                  ClickMouse2(mouse_right);
                  wait(50+random(75));
                  WaitOptionEx('limb-down', 'adder', ClickLeft, 150);
                  sleep(3000);
    Now what i was thinking about was some scanner to see if im in a cave and if i can see alot of black on the minimap.. Any suggestions ?
    I imagine this is pretty simple but i couldn't find a way so far so decided to ask here

    I guess i could just click the ladder again when down to see if theres an option to climb-up but i doubt thats the best way to do it..
    Last edited by Rodelol; 04-23-2013 at 02:31 AM.

  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 Rodelol View Post
    I made my first own simple script and im kinda stuck at failsafe now.
    Going down ladder doesn't always work due to missclicking so my script fails.

    At the moment it looks like this:

    Code:
    procedure GoDown;
        Var x, y: integer;
    begin
    writeln('Goin doown!');
    if (FindObjCustom(x, y, ['limb-down', 'adder'], [403770, 202786], 5)) then
    begin
                  ClickMouse2(mouse_right);
                  wait(50+random(75));
                  WaitOptionEx('limb-down', 'adder', ClickLeft, 150);
                  sleep(3000);
    Now what i was thinking about was some scanner to see if im in a cave and if i can see alot of black on the minimap.. Any suggestions ?
    I imagine this is pretty simple but i couldn't find a way so far so decided to ask here

    I guess i could just click the ladder again when down to see if theres an option to climb-up but i doubt thats the best way to do it..

    You are on the right track with the black on the MM


    Simba Code:
    Function IsInDungeon: Boolean;
    Var
      B: Integer;

    Begin
      B:= CountColorTolerance(394752, MMX1, MMY1, MMX2, MMY2, 30) // Counts the black colour on the MM
      WriteLn('CountColour: ' + IntToStr(B))
      If B > 5000 Then                   // If the count is greater then 5000 then it results true
      Begin
        WriteLn('We are inside the dungeon');
        Result:= True
      End;
    End;


    So for example, you could:
    Simba Code:
    procedure Go Down;

    Begin
       Repeat
       // ladder finding stuff
       Until (IsInDungeon = True)
    End;

    Or even
    Simba Code:
    While Not IsInDungeon Do
       Begin
         //Find ladder stuff here
       End;

  3. #3
    Join Date
    Mar 2013
    Posts
    39
    Mentioned
    0 Post(s)
    Quoted
    11 Post(s)

    Default

    Thanks alot this was very helpful Now back to finding more bugs ^^

  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 Rodelol View Post
    Thanks alot this was very helpful Now back to finding more bugs ^^
    No problem

    Also, I should have mentiond that you shouldn't have infinite loops. E.g., If the ladder is off screen, and it can't find the ladder after X tries then it exits.

    Simba Code:
    Procedure Go Down;
    Var
      i: Integer;

    Begin
       Repeat
          i := i + 1  // it will increase i by 1 after each attempt
          // ladder finding stuff
       Until (IsInDungeon = True) Or (i >= 5);
    End;

    So now it will break out of the loop if it fails after 5 attempts.

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
  •