Results 1 to 6 of 6

Thread: Procedure query

  1. #1
    Join Date
    Dec 2011
    Posts
    2
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Procedure query

    When I call a created procedure in my main loop, the mouse just moves over inventory and clicks in a periodic fashion, and does nothing else and I cannot work out why, here is the procedure:
    Simba Code:
    procedure MineOre;
      var x, y, OreCount, i: integer;
    begin
      OreCount:= InvCount + 1;
      if (FindObjCustom(x, y, ['ine', 'ocks'], [16448250, 987409], 3)) then
      begin;
        Writeln('Found Ore');
        Mouse(x, y, 3, 3, true);
        Wait(100 + Random(50));
      end;
      MarkTime(i);
      repeat
        Wait(300);
        if (InvCount=OreCount) then
          Writeln('Mined Ore');
        until (InvCount=OreCount) or (TimeFromMark(i) > 30000);
    end;

  2. #2
    Join Date
    Dec 2011
    Location
    Lubbock, Tx
    Posts
    115
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    For one, on yours, when you use the time counter as a Fail safe you have it set to 30 seconds? I can see where that is actually logical for some ores(Rune, Addy and MAYBE Mith), I was just making sure you knew that that was a pretty long time.

    Try using this:
    Simba Code:
    x:= MSCX;
      y:= MSCY;
    It will make it search for the color nearest the middle of the screen (Where you player stands). Maybe this will help it find it faster.


    Here is what I am using to find Iron Ore, and it basically flawless so far.:


    Simba Code:
    Function MineOre:Boolean;
    Var
      x,y, PlusOne, MineCounter: Integer;
    Begin
      If Not(LoggedIn) Then Exit;
      PlusOne:= InvCount +1;
      x:= MSCX;
      y:= MSCY;

      If FindObjCustom(x, y, ['Mine','Rocks','e R'], [2832738, 2502212, 2701150,2371667], 5) Then
        Begin
          WriteLn('There is ore here.');
          GetMousePos(x, y);
          Case Random(2) of
            0: Mouse(x, y, 5, 5, True);
            1: Begin
                 Mouse(x, y, 5, 5, False)
                 WaitOption('Mine', 500);
               end;
          end;
          Flag;
          Repeat
            FindNormalRandoms;
            MarkTime(MineCounter);
            AntiBan;
            wait(100);
            If InvCount= PlusOne Then
              WriteLn('You got ore');
            Until (InvCount= PlusOne) OR (TimeFromMark(MineCounter) > 5000);
          end;
    end;
    Last edited by HardRockers; 12-30-2011 at 03:57 AM.

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

    Default

    lolololz two new guys making things based on my tutorials, love it!
    @Applezz dodes it ever write Find Ore in the debug box?
    Also make sure your colors are good and toelrance is high enough!

  4. #4
    Join Date
    Dec 2011
    Location
    Lubbock, Tx
    Posts
    115
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    His tolerance is only 3, which is probably really low depending on what he is looking for.

  5. #5
    Join Date
    Dec 2011
    Posts
    2
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by YoHoJo View Post
    lolololz two new guys making things based on my tutorials, love it!
    @Applezz dodes it ever write Find Ore in the debug box?
    Also make sure your colors are good and toelrance is high enough!
    If I just have the first part of the script, it works fine and the mouse moves to the rock, clicks:
    This will work fine:
    Simba Code:
    procedure MineOre;
      var x, y, OreCount, i: integer;
    begin
      if (FindObjCustom(x, y, ['ine', 'ocks'], [16448507, 16448250], 3)) then
      begin;
        Writeln('Found Ore');
        Mouse(x, y, 3, 3, true);
        Wait(100 + Random(50));
      end;
    end;

    But this won't
    Simba Code:
    procedure MineOre;
      var x, y, OreCount, i: integer;
    begin
      OreCount:= InvCount + 1;
      if (FindObjCustom(x, y, ['ine', 'ocks'], [16448250, 987409], 3)) then
      begin;
        Writeln('Found Ore');
        Mouse(x, y, 3, 3, true);
        Wait(100 + Random(50));
      end;

    So it appears to be this line which causes the problem:
    Simba Code:
    OreCount:= InvCount + 1;

  6. #6
    Join Date
    Dec 2011
    Location
    Lubbock, Tx
    Posts
    115
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    move it to below this line:

    Mouse(x, y, 3, 3, true);

    I think that might fix it

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
  •