Results 1 to 17 of 17

Thread: idea for wait time

  1. #1
    Join Date
    Feb 2009
    Posts
    2,155
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default idea for wait time

    ok so i ahd this idea for wait time


    what if i had a script that would count the ore of a dtm in my inventory and then when the number of ores was greater then mines (my fail safe) it would move on to the next ore would that work???


    i will script it later i jsut don't have time right now i g2g to church for ym bros first communion but leave your comments advice or whatever\


    -JP


    edit i had sometime to script it it took maybe 5 minutes but i get this error how do i fix it

    Line 201: [Error] (17064:5): Unknown identifier 'CountItemsDTM'


    SCAR Code:
    if (not LoggedIn) then Exit;
        for i := 0 to 3 do
          if FindObjTPA(x, y, orecolors[i], 10, 2, 15, 25, 10, ['Mine', 'ine']) then
          begin
            FindObjTPA(x, y, orecolors[i], 10, 2, 15, 25, 10, ['Mine', 'ine'])
            Wait(100 + Random(300));
            begin
              Mouse(x, y, 4, 4, True);
              repeat
                h:= (IntToStr(CountItemsDTM('Inv',PHatDTM)));
                wait(300 + random(500));
              until ( h > mines)
                inc(mines);
            end;
          end;
    Last edited by JPHamlett; 04-26-2009 at 12:56 AM.

  2. #2
    Join Date
    Mar 2007
    Location
    <3
    Posts
    2,683
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I really didn't get your idea, but for the error, Post your whole script..

    No way i can see it from 10 lines.

  3. #3
    Join Date
    Feb 2009
    Posts
    2,155
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default

    ok ill explain it in detail i was looking at waddos tut on dtms

    http://www.villavu.com/forum/showthread.php?t=32573

    and i read that you can have scar count how many of the dtm u have in your inventory if you declare it i used the code he had and i got this error


    Line 201: [Error] (17064:5): Unknown identifier 'CountItemsDTM'



    SCAR Code:
    {So here my first script it runs pretty well

    only bugs so far is thta sumtimes it clicks sumwhere else and doesnt drop allt he ore
    (ong thts not to bad)

    ty tickyy i looked on to your miner for proggy help and antibans and more
    ____________________setup__________________________
    1. set up declareplayers
    2. set ore type in line 38
    3. setup player by rock you want to mine
    3. save
    4. run
    5. post proggies and any bugs


    btw it posts proggies all the way though so only post them t the end and takes 5-10 minute breaks every 50 loads

    and enjoy   :0
    ______________________________________________________}



    program SimplePowerMiner;
    {.Include SRL\SRL\Misc\SMART.SCAR}
    {.include SRL\SRL.scar}

    {agenda
     0. fix DTMs
     3. anti randoms
     4. multi ores???
     5. release it}


    var
      u,l,j,x,y,g,i,y,z,f,switches,oredtm,gemdtm: Integer;

    const
      NumOfPlayers = 1;
      StartPlayer = 0;
      minetime = 5000;//time to mine a rock
     
    procedure DeclarePlayers;//add more if needed
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;
      Players[0].Name       := '';
      Players[0].Pass       := '';
      Players[0].Nick       := '';
      Players[0].Active     := True;    // Use this account?
      Players[0].Integers[1]:= 1; // How many Loads
      Players[0].Booleans[0]:= false//drop gems
      Players[CurrentPlayer].strings[0]:='copper';
      Players[0].BoxRewards := ['Xp', 'ostume', 'gem', 'mote', 'ithril', 'oal'];
     
      {Players[1].Name       := '';
      Players[1].Pass       := '';
      Players[1].Nick       := '';
      Players[1].Active     := True;    // Use this account?
      Players[1].Integers[1] := 40; // How many Loads
      Players[0].Booleans[0]:= false//drop gems}

    end;

    procedure AntiBanz;
    begin
      If(not LoggedIn)then Exit;
      Case Random(12) of
        0:  MMouse(Random(MSX2),Random(MSY2),0,0);
        1:  HoverSkill('random',false);
        2:  PickupMouse;
        3:  GameTab(1+Random(12));
        4:  SleepAndMoveMouse(400+Random(1500));
        5:  if Random(2) = 1 then MMouse(1, 338, 515, 165);
        6:  if Random(2) = 1 then MMouse(515, 1, 250, 503);
        7:  RandomMovement;
     8..11:
    begin
      case Random(3) of
       0: begin
            KeyDown(VK_RIGHT);
            Wait(500+Random(2000));
            KeyUp(VK_RIGHT);
        end;
       1: begin
            KeyDown(VK_Left);
            Wait(500+Random(2000));
            KeyUp(VK_Left);
          end;
       2: begin
            case Random(2) of
              0: begin
                   KeyDown(VK_RIGHT);
                   Wait(500+Random(1400));
                   KeyUp(VK_RIGHT);
                 end;
              1: begin
                   KeyDown(VK_Left);
                   Wait(500+Random(1400));
                   KeyUp(VK_Left);
                   z:=z + 1;
                end;
              end;
            end;
          end;
        end;
      end;
    end;

    procedure loaddtms;
    begin
         OreDTM := DTMFromString('78DA637463626078C28002FC0C54181E02694' +
         '620FE0F048CEE40353718D000231209A403816AEE1350E30D54F3' +
         '86801A7BA09A4F04D49800D53C26C29CEBF8D5000045B70DB0');
         
         
         GemDTM := DTMFromString('78DA8DD2510E82300C06E06E814C144C500E0' +
         '3461F603199E869B83127C17F3324F3616BFBB026DB97656BAB46' +
         '4D6414C5715E2EB422FBDD0DA15E30EADFFC4EF71579862918F38' +
         '6A904C630E603734A9BC2670BD3A54DE9F324307DFE5FC10C304D' +
         'DA1CF67B8E02A31933E47B11CC4347D54A182B30BE3E1BE58D13B' +
         'C87998D60EE3057C6DC605A410D6BC68CF9BE7782F909E629308E' +
         '375FE5310F20');
    end;

    procedure findrandoms;
    begin
      LampSkill := 'mining';
      FindNormalRandoms;
      solvesrlrandoms:=true;
    end;
     
    procedure Setup;
    begin
      disguise('TY for using jps powerminer')
      ClearDebug;
      SMARTSetupEx(149, False, True, False);
      Wait(5000);
      SetTargetDC(SmartGetDC);
      repeat
        wait(100);
      until(SmartGetColor(253, 233)<>1118604);
      SetupSRL
    end;

    procedure SkillCheck;
    begin
    If Not LoggedIn then
        begin
          NextPlayer(Players[CurrentPlayer].Active);
          skillcheck;
        end;
      disguise('checking stats')
      HoverSkill('mining',false);
      wait(500+(300));
      findrandoms;
    end;



    Function MineTheOre : Boolean;
    var
        i, x,y,m,mines,dist,h: integer;
        orecolors: array [0..3] of integer;
        OreNames: array [0..2] of String;

    begin
         if Players[CurrentPlayer].strings[0]='tin'then begin
          orecolors[0]:= 9737632;
          orecolors[1]:= 9737632;
          orecolors[2]:= 10263976;
          orecolors[3]:= 9737632;
          End Else
          if Players[CurrentPlayer].strings[0]='gold'then begin
          orecolors[0] := 1815517;
          orecolors[1] := 939132;
          orecolors[2] := 4313339;
          orecolors[3] := 1748951;
          End Else
          if Players[CurrentPlayer].strings[0]='iron'then begin
          orecolors[0]:= 1712696;
          orecolors[1]:= 1844541;
          orecolors[2]:= 937587;
          orecolors[3]:= 2239819;
          End Else
          if Players[CurrentPlayer].strings[0]='copper' then begin
          orecolors[0]:= 5344484;
          orecolors[1]:= 4948948;
          orecolors[2]:= 4025005;
          orecolors[3]:= 4420796;
          End;

      mines := 0;
      repeat
        if (not LoggedIn) then Exit;
        for i := 0 to 3 do
          if FindObjTPA(x, y, orecolors[i], 10, 2, 15, 25, 10, ['Mine', 'ine']) then
          begin
            FindObjTPA(x, y, orecolors[i], 10, 2, 15, 25, 10, ['Mine', 'ine'])
            Wait(100 + Random(300));
            begin
              Mouse(x, y, 4, 4, True);
              repeat
                h:= (IntToStr(CountItemsDTM('Inv',oreDTM))); <-------  error line
                wait(300 + random(500));
              until ( h > mines)
                inc(mines);
            end;
          end;
        AntiBanz;
        FindRandoms;
        if not (LoggedIn) then
        begin
          NextPlayer(False);
          LoginPlayer;
        end;
      inc(mines)
              AntiBanz;
              FindRandoms;
              if not (LoggedIn) then
                  begin
                NextPlayer(False);
                LoginPlayer;
              end;

      until invfull or (mines > 35);
    End;
    procedure OreDropping;

    var OreDTM,drops:integer;
    begin
     drops:=0;
      If Not LoggedIn then
        begin
          NextPlayer(Players[CurrentPlayer].Active);
          skillcheck;
        end;
      repeat
       If Not LoggedIn then
        begin
          NextPlayer(Players[CurrentPlayer].Active);
          skillcheck;
        end;
        Disguise('dropping ores');
       If FindDTM(OreDTM,x,y,MIX1,MIY1,MIX2,MIY2) then
       Begin
        Mouse(x,y,2,2,False);
        wait(random(200));
        ChooseOption('Drop');
        wait(500 + random(100))
        findrandoms;
        Inc(drops);
       end;
      Until not FindDTM(OreDTM,x,y,MIX1,MIY1,MIX2,MIY2) or (drops=29);
    end;


    procedure GemDroping;
    var GemDrops,GemDTM:integer;
    begin
    If Not LoggedIn then
        begin
          NextPlayer(Players[CurrentPlayer].Active);
          skillcheck;
        end;
      GemDrops:=0;
      repeat
      Disguise('dropping gems');
      if  findDTM(GemDTM,x,y,MIX1,MIY1,MIX2,MIY2) then
      Begin
        Mouse(x,y,2,2,False);
        wait(random(200));
        ChooseOption('Drop');
        wait(500 + random(100))
        findrandoms;
        GemDrops:= GemDrops + 1;
        Inc(f);
      end;
     Until not FindDTM(GemDTM,x,y,MIX1,MIY1,MIX2,MIY2) or (gemdrops = 5);//dont think your gonna get more than 1 a tie but just incase
    end;

    procedure Proggy;
    begin
      WriteLn('             _____  ______')
      WriteLn('            |     ||      \')
      WriteLn('            |     ||      |')
      WriteLn('            |     ||   ___/')
      WriteLn('           /_____/ |__|   ')
      writeLn('____________________________________________')
      writeln('Script has been running for ' +TimeRunning);
      WriteLn('Player '+ Players[CurrentPlayer].Nick);
      WriteLn('loads done '+ IntToStr(g));
      WriteLn('ores mined ' +inttostr(g *27)) ;
      WriteLn('gems dropped ' + IntToStr(f));
      WriteLn('plsyers used ' +inttostr(switches));
      writeLn('plz post the proggie here [url]http://www.villavu.com/forum/showthread.php?p=542565#post542565[/url]');
    end;




    procedure Freeeverything;
    var oreDTM,GemDTM,ClayBMP:integer;
    begin
      FreeDTM(OreDTM);
      FreeDTM(GemDTM);
      FreeBitmap(ClayBMP);
    end;

    procedure break;
    begin
      disguise('breaking now')
      logout;
      wait(300000+random(300000));
      inc(switches)
      NextPlayer(Players[CurrentPlayer].Active);
      LoginPlayer;
    end;



    begin
      g:= 0;
      l:=0;
      u:=0;
      j:=0;
      f:=0;
      switches:=1;
      Setup;
      DeclarePlayers;
      GraphicsSet := true;
      LoginPlayer;
      loaddtms;
      repeat
        repeat
          findrandoms;
          GetTimeRunning;
          {ClearDebug;}
          Proggy;
          if g = 25 + random(25) then
          break;
          SkillCheck;
          findrandoms;
          MineTheore;
          findrandoms;
          OreDropping;
          findrandoms;
          if Players[CurrentPlayer].Booleans[0]=true then
          Gemdroping;
          findrandoms;
          Inc(g);
        until (g= (Players[CurrentPlayer].Integers[1])) or (not LoggedIn);
       { if NumOfPlayers = 1 then
        begin
          break;
        end;
        if NumOfPlayers > 1 then
        begin}

        NextPlayer(Players[CurrentPlayer].Active);
        //end;
      until(AllPlayersInactive);
      Freeeverything;
    end.
    Last edited by JPHamlett; 04-26-2009 at 01:23 AM.

  4. #4
    Join Date
    Oct 2007
    Location
    Denmark
    Posts
    409
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You mean like?
    SCAR Code:
    procedure Failsafe;
    var
      Inv: Integer;
    begin
      Inv := InvCount;
    while (Inv = InvCount) then
      Wait(20);  
    end;

  5. #5
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    Quote Originally Posted by Frt View Post
    You mean like?
    SCAR Code:
    procedure Failsafe;
    var
      Inv: Integer;
    begin
      Inv := InvCount;
    while (Inv = InvCount) then
      Wait(20);  
    end;
    ...all that does is keep repeating:
    Code:
    Wait(20);

    and the reason your getting "Unknown identifier 'CountItemsDTM'" is because its not being declared anywhere so my guess would be it was taken out of SRL in revision#32.

    Instead, try this:
    Code:
    {*******************************************************************************
    function ItemAmount(Area, ItemType: string; Item: Integer; Tol: TIntegerArray): Integer;
    By: masquerader modified by ZephyrsFury
    Description: Counts the number of items found with a color in a certain area. (Counts stacks)
    Parameters:
      Area - 'inv', 'shop', 'bank', 'trade', 'your trade'.
      ItemType - 'dtm', 'bmp', 'color', 'bmpmask'.
      Item - name/value of your dtm/bmp/color/bmpmask.
      Tol - 'dtm' - [] (dtm's can't have tolerance).
            'bmp' - [BMPTol].
            'color' - [COLOUR Tol, Min Colour Count].
            'bmpmask' - [BMPTol, ContourTol].
    *******************************************************************************}
    or just check Amount.scar for other options.
    Last edited by NCDS; 04-26-2009 at 02:52 AM.

  6. #6
    Join Date
    Oct 2007
    Location
    Denmark
    Posts
    409
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    InvCount is dynamic?

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

    Default

    Oh, I see what you're doing now I think that would work.

  8. #8
    Join Date
    Feb 2007
    Location
    PA, USA
    Posts
    5,240
    Mentioned
    36 Post(s)
    Quoted
    496 Post(s)

    Default

    Quote Originally Posted by J_Pizzle View Post
    ok so i ahd this idea for wait time


    what if i had a script that would count the ore of a dtm in my inventory and then when the number of ores was greater then mines (my fail safe) it would move on to the next ore would that work???


    i will script it later i jsut don't have time right now i g2g to church for ym bros first communion but leave your comments advice or whatever\


    -JP


    edit i had sometime to script it it took maybe 5 minutes but i get this error how do i fix it

    Line 201: [Error] (17064:5): Unknown identifier 'CountItemsDTM'


    SCAR Code:
    if (not LoggedIn) then Exit;
        for i := 0 to 3 do
          if FindObjTPA(x, y, orecolors[i], 10, 2, 15, 25, 10, ['Mine', 'ine']) then
          begin
            FindObjTPA(x, y, orecolors[i], 10, 2, 15, 25, 10, ['Mine', 'ine'])
            Wait(100 + Random(300));
            begin
              Mouse(x, y, 4, 4, True);
              repeat
                h:= (IntToStr(CountItemsDTM('Inv',PHatDTM)));
                wait(300 + random(500));
              until ( h > mines)
                inc(mines);
            end;
          end;
    rofl. you get that error because there is no such thing as CountItemsDTM

  9. #9
    Join Date
    Feb 2009
    Location
    Hungary (GMT + 1)
    Posts
    1,774
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thats not my main idea what I have posted in the script's thread? It is just with DTM counting.

    http://www.villavu.com/forum/showpos...8&postcount=30

  10. #10
    Join Date
    Feb 2009
    Posts
    2,155
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default

    Quote Originally Posted by Sabzi View Post
    Thats not my main idea what I have posted in the script's thread? It is just with DTM counting.

    http://www.villavu.com/forum/showpos...8&postcount=30
    i know im jsut tring to think of new ways to make it for everyminer regardless of thier mining lvl


    and if i cant get it ill go back to your idea

  11. #11
    Join Date
    Feb 2009
    Location
    Hungary (GMT + 1)
    Posts
    1,774
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    The problem with this (except the error you have posted), that if somebody mines the rock out before you it will be an endless loop. So a time failsafe recommended.

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

    Default

    Sabzi, (just now understood what you said ) all you'd have to do is before the repeat add MarkTime(T); and then repeat Wait(RandomRange(1, 100)); until(Inv<>InvCount or TimeFromMark(T) > 30000);

  13. #13
    Join Date
    Feb 2009
    Location
    Hungary (GMT + 1)
    Posts
    1,774
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Yup! That's what I got. But the 30000 should be calculated(what ore you mine, what mining lvl you got and what pickaxe you use) or just make a constant then users can set it. The only reason I don't got it in my version because I use it myself for only iron.

  14. #14
    Join Date
    Feb 2009
    Posts
    2,155
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default

    ok so here it is but it goes crazy whitht he clicking any help

    SCAR Code:
    Function MineTheOre : Boolean;
    var
        i, x,y,m,mines,dist,h,amount,inv: integer;
        orecolors: array [0..3] of integer;
        OreNames: array [0..2] of String;

    begin
         if Players[CurrentPlayer].strings[0]='tin'then begin
          orecolors[0]:= 9737632;
          orecolors[1]:= 9737632;
          orecolors[2]:= 10263976;
          orecolors[3]:= 9737632;
          End Else
          if Players[CurrentPlayer].strings[0]='gold'then begin
          orecolors[0] := 1815517;
          orecolors[1] := 939132;
          orecolors[2] := 4313339;
          orecolors[3] := 1748951;
          End Else
          if Players[CurrentPlayer].strings[0]='iron'then begin
          orecolors[0]:= 1712696;
          orecolors[1]:= 1844541;
          orecolors[2]:= 937587;
          orecolors[3]:= 2239819;
          End Else
          if Players[CurrentPlayer].strings[0]='copper' then begin
          orecolors[0]:= 5344484;
          orecolors[1]:= 4948948;
          orecolors[2]:= 4025005;
          orecolors[3]:= 4420796;
          End;
      mines := 0;
      if Players[currentplayer].Booleans[1]= false then
      begin
        inv:=1;
      end else;
      inv:=0;
      repeat
        if (not LoggedIn) then Exit;
        for i := 0 to 3 do
          if FindObjTPA(x, y, orecolors[i], 10, 2, 15, 25, 10, ['Mine', 'ine']) then
          begin
            FindObjTPA(x, y, orecolors[i], 10, 2, 15, 25, 10, ['Mine', 'ine'])
            Wait(100 + Random(300));
            begin
              Mouse(x, y, 4, 4, True);
              Marktime(m);
              repeat
                inv:=invcount;
                wait (10);
                findrandoms;
              until (inv > mines) or (M > 15000);
             inc(mines);
            end;
          end;
        AntiBanz;
        FindRandoms;
        if not (LoggedIn) then
        begin
          NextPlayer(False);
          LoginPlayer;
        end;
      inc(mines)
              AntiBanz;
              FindRandoms;
              if not (LoggedIn) then
                  begin
                NextPlayer(False);
                LoginPlayer;
              end;
      until invfull or (mines > 35);
    End;

  15. #15
    Join Date
    Feb 2009
    Location
    Hungary (GMT + 1)
    Posts
    1,774
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    The mines variable can increase when you don't get the ore too and after it has happened once it will mess up the whole thing. Also if you got something other in your inventory the invcount wil be bigger but the mines won't. Maybe this cause the problem. Try using this:

    Code:
    until ((inv > InvCount) or (TimeFromMark(m) > 15000));
    quick edit:
    Oh almost forget. Place the inv:=invcount; line before the loop start.
    Last edited by Sabzi; 04-26-2009 at 06:43 AM. Reason: grammar ...

  16. #16
    Join Date
    Feb 2009
    Posts
    2,155
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default

    that wont work will it cause if inv = invcount or w/e it can never be bigger

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

    Default

    J_Pizzle, what? >.> InvCount is a function in SRL that is dynamic, if you don't have Inv := InvCount in the repeat loop, then it will work. And you have a time check, so it won't get stuck

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
  •