Results 1 to 5 of 5

Thread: Coal Mining Procedure

  1. #1
    Join Date
    Mar 2009
    Location
    Ireland
    Posts
    111
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Coal Mining Procedure

    Hello, Im making a coal miner, but i find that when the coal is detected it keeps clicking on it even if it has no ore.

    Code:
    procedure CoalColor;
    var
      text:TstringArray;
      color:TintegerArray;
    begin
      text := ['ine', 'ocks'];
    //  color := [3163975, 3361611, 2834496, 2636860];
    //  color := [2834496, 2307124];
    //  color := [3163975];
      color := [1845802];
      repeat
    then
      if FindObjCustom(x, y, text, color, 3) then
        MMouse(x+5,y,0,0);
      until (IsUpText('ine'));
        GetMousePos(x,y);
        MMouse(x,y,4,4);
      if (IsUpText('ine')) then
        RockColor := GetColor(x,y);
    end;
    
    procedure Mine_FindObj;
    begin
      if not LoggedIn then
      begin
        LogInPlayer;
      end;
      if InvFull then
      begin
        Exit;
      end else
        if (FindObj(x,y,'ine',RockColor,0)) then
        begin
          Mouse(x,y,4,4,false);
          ChooseOption('ine');
          Wait(1350);
          WaitwhileMining;
          if (FindBlackChatMessage('currently')) then
            begin
              MakeCompass(IntToStr(random(360)));
            end;
        end;
    end;

    um..... i sorta stole the CoalColor procedure, so i dont really understand it, i just know i changed it to FindObjCustom, because the original function was outdated...

    i tried using TPAs but they were slower in finding the ore...

    so how can i change that autocolor, or just add failsafes, to this to stop it keeping clicking on the ore-less rock?


    P.S. off-topic, but how do you apply scar colouring to your code boxes
    Last edited by mc_teo; 04-07-2009 at 09:54 PM.

  2. #2
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    Use the dark coal colour.

    Try using FindObjTPA as well.
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

  3. #3
    Join Date
    Mar 2009
    Location
    Ireland
    Posts
    111
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Can you explain the parameters


    FindObjTPA(var X:LongInt;var Y:LongInt;Color:LongInt;Tol:LogInt;CTS:LongInt;Obj Width:LongInt;ObjHeight:LongInt;minCount:LongInt;U pText:TStringArray);



    and what colour should i put in?

  4. #4
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    FindObjTPA(x, y, Color, Tolerance of color, CTS (search for it.. Cazax has a good guide), Width, Height of object, Minimum amount of color to be in that width and height box, UpText);

    so..

    FindObjTPA(x, y, 45125314, 7, 2, 50, 50, 3, ['ine', 'oal']);



    the width and height is in pixels..

  5. #5
    Join Date
    Mar 2009
    Location
    Ireland
    Posts
    111
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    thank you for you help all

    im learning ddtm atm so ill release this miner/banker when its done

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
  •