Results 1 to 8 of 8

Thread: Checking for food.

  1. #1
    Join Date
    Dec 2011
    Location
    Kosovo
    Posts
    831
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default Checking for food.

    I have an idea, After no food to start teleport to Varrock.
    The inv will not be empty. I thought to make a function like checking for uptext eat, if there is none then result = false;

    If NoFood
    Begin
    // bla bla bla to teleport to varrock.

    Then walk to bank and deposit all.


    What I need is someone help me making a checker for food.

    Thanks
    Goals:
    Understanding TPAs
    Making Proggy for fighting
    Getting on SRL members
    Get 500 posts

  2. #2
    Join Date
    Dec 2011
    Location
    Kosovo
    Posts
    831
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    No idea. Or should try my own.
    Goals:
    Understanding TPAs
    Making Proggy for fighting
    Getting on SRL members
    Get 500 posts

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

    Default

    Simba Code:
    // Checks for food in the inventory based on (a) dtm(s).
    function HasFood(): Boolean;
    var
      X, Y, DTM: Integer; // We the set required integers for the function here
    begin
      if (not(LoggedIn())) then // If we are not logged in, exit the function
        Exit;
      FindNormalRandoms; // Searches for any randoms and attempts to solve them if they are found

      GameTab(25); // Switches to the inventory tab
      DTM := (DTMFromString('')); // Insert the DTM string here

      // Searches for the DTM in the inventory, results 'True' if found
      Result := (FindDTM(DTM, X, Y, MIX1, MIY1, MIX2, MIY2));

      FreeDTM(DTM); // Frees the DTM after using it
    end;
    Simba Code:
    (* Main *)

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

  4. #4
    Join Date
    Dec 2011
    Location
    Kosovo
    Posts
    831
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Thanks a million. Gonna try this
    Goals:
    Understanding TPAs
    Making Proggy for fighting
    Getting on SRL members
    Get 500 posts

  5. #5
    Join Date
    Nov 2011
    Posts
    1,532
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Alternatively if you don't use a DTM system to check your food, you should use an uptext system to look for the word 'Eat'.

    But instead of looping everytime, you might want to remember what your inventory has to reduce the time spent on checking. That I suppose is the beginning of a smart food inventory system or whatever.
    Current activity: Recovering from vacation
    - Nulla pars vitae vacare officio potest -
    SRL membership? Can I buy that?
    Scripts - AGS - SWF - WAR - EMS - W100S-EM
    If you need scripting help, you can pm me. Remember, if you need help you have to ask for it properly though

  6. #6
    Join Date
    Feb 2012
    Posts
    20
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You could rahter do this -
    Simba Code:
    function HasFood(DTM:Integer): Boolean;
    var
      X, Y: Integer; // We the set required integers for the function here
    begin
      if (not(LoggedIn())) then // If we are not logged in, exit the function
        Exit;
      FindNormalRandoms; // Searches for any randoms and attempts to solve them if they are found

      GameTab(25); // Switches to the inventory tab

      // Searches for the DTM in the inventory, results 'True' if found
      Result := (FindDTM(DTM, X, Y, MIX1, MIY1, MIX2, MIY2));

      FreeDTM(DTM); // Frees the DTM after using it
    end;

  7. #7
    Join Date
    Dec 2011
    Location
    Kosovo
    Posts
    831
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Thanks to three of you. Mark solved and close this
    Goals:
    Understanding TPAs
    Making Proggy for fighting
    Getting on SRL members
    Get 500 posts

  8. #8
    Join Date
    Feb 2012
    Location
    SRL Jail
    Posts
    1,319
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    or
    findDTM for your food say salmon (x,y....)
    then

    if not findDTM then
    walkBank;

    that should work

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
  •