Page 1 of 3

Feedme.inc v2.3

Posted: Thu Nov 04, 2004 5:18 pm
by A_Druid_00
5/9 Put up v2.3 fix by onetimehero. No one says it's broken, so I guess it's good!
12/3 v2.2 Changed the logic around so that it now puts the food down in the bag which it retrieved it from, closing the bag as a result. If there is no mypack, it just right clicks on the food in it's current inventory slot.
11/24 Added a FeedMeDeclares Sub which defines an alias and toggle value to turn feedme on and off while running your macro. This way you won't have to end your macro when you run out of force feeding food to prevent the NULL spam. You now need to add a

Code: Select all

/call FeedMeDeclares 
in the declares section of the calling macro in order to get things running.
11/24 Changed the drink threshold back to 5,000, forgot to change it back after bug testing
11/23 Feedme is now ini driven!! Sample ini is posted below, feel free to add any junk food I don't happen to have.

Figured I'd post a .inc for this, since it really isn't a spectacular .mac all by itself. It basically eats the food and drink you specify when your hunger/thirst falls below the threshold of 5000. You can define the food to eat and drink to drink in an ini file named feedme.ini.

If any of you .inc gurus see an area that can be improved, feel free to point it out.

Code: Select all

|Feedme.inc v2.3 compliments of onetimehero
#Event SetFeedMe "[MQ2] SetFeedMe#*#" 

Sub FeedMeDeclares 
/declare DoFeedMe int outer 1 

/squelch /alias /feedme     /echo SetFeedMe 
/return 

Sub FeedMe 
/if (${Me.Casting.ID}) /return 
/if (${DoFeedMe}==1) { 
  /if (${Me.Hunger}<=5000) /call Consume Food 
  /if (${Me.Thirst}<=5000) /call Consume Drink 
} 
/return 

Sub Consume(string what) 
/declare mypack         string local 
/declare myslot         string local 
/declare i              int    local 
/declare foodcount      int    local 
/declare food       string local 

/autoinventory 
/if (${Cursor.ID}) /return 
/varset foodcount ${Ini[feedme.ini,${what}].Count[${what}]} 
/for i 1 to ${foodcount} 
/varset food ${Ini[feedme.ini,${what},${what}${i}]} 
/if (${FindItemCount[${food}]}>0) { 
  /varset mypack ${FindItem[${food}].InvSlot.Pack} 
  /varset myslot ${FindItem[${food}].InvSlot} 
  /if (${mypack}) { 
    /if (!${Window[${InvSlot[${mypack}].Name}].Open}) /nomodkey /itemnotify ${mypack} rightmouseup 
    :WaitForBagOpen 
    /nomodkey /ctrl /itemnotify ${myslot} leftmouseup 
    /if (!${Cursor.ID}) /goto :WaitForBagOpen 
    /nomodkey /itemnotify ${mypack} leftmouseup 
    /nomodkey /itemnotify ${mypack} rightmouseup 
    /nomodkey /itemnotify ${mypack} leftmouseup 
  } else { 
    /nomodkey /itemnotify ${myslot} rightmouseup 
  } 
} else { 
  /next i 
} 
/return 

Sub Event_SetFeedMe(string Line) 
/if (!${Line.Arg[3].Length}) { 
  /if (${DoFeedMe}==1) { 
    /varset DoFeedMe 0 
    /echo Auto Force Feeding is now OFF 
  } else { 
    /varset DoFeedMe 1 
    /echo Auto Force Feeding is now ON 
  } 
} 
/if (${Line.Arg[3].Equal[ON]} || ${Line.Arg[3].Equal[TRUE]} || ${Line.Arg[3].Equal[1]}) { 
  /varset DoFeedMe 1 
  /echo Auto Force Feeding is now ON 
} 
/if (${Line.Arg[3].Equal[OFF]} || ${Line.Arg[3].Equal[FALSE]} || ${Line.Arg[3].Equal[0]}) { 
  /varset DoFeedMe 0 
  /echo Auto Force Feeding is now OFF 
} 
/return 
Just to explain my reasoning for using returns after the Cursor.ID check: I don't think eating is a very huge priority in the grand sceme of things, so I let it /return in order to give control back to the calling macro until the next time this inc is called. This way, if something important needs to be adressed by the parent macro, this sub won't hold it up much.

Posted: Tue Nov 23, 2004 7:23 pm
by A_Druid_00
Here's the feedme.ini I currently have setup, feel free to post any other junk foods I may have missed

feedme.ini

Code: Select all

[Food]
Food1=Summoned: Black Bread
Food2=Arctic King Crab
Food3=Arctic Mussels
Food4=Arctic Scallop
Food5=Basilisk Eggs
Food6=Berries
Food7=Brasha Berries
Food8=Cactus Pulp
Food9=Chameleon Rat
Food10=Cobalt Rock Crab
Food11=Cockatrice Egg
Food12=Emerald Orange
Food13=Frontier Stink Beetles
Food14=Frost Turnip
Food15=Fruit
Food16=Ginseng
Food17=Green Radish
Food18=Griffon Eggs
Food19=Habanero Pepper
Food20=Handful of Tea Twigs and Leaves
Food21=Hermit Crab
Food22=Honey Berry
Food23=Lichen Roots
Food24=Mint
Food25=Moldy Tea Leaf
Food26=Mud Crabs
Food27=Mushroom
Food28=Nifilik Egg
Food29=Phoenix Egg
Food30=Rabbit Meat
Food31=Ro Dates
Food32=Rockweed Bulb
Food33=Roots
Food34=Ruhiri Berries
Food35=Rujarkian Potato
Food36=Spikerattle Root
Food37=Sylvan Berries
Food38=Twisted Tuber
Food39=Vegetables
Food40=Vein Worm
Food41=Wild Cabbage
Food42=1 lb. Cragbeast Meat
Food43=1 lb. Hynid Meat
Food44=2 lb. Cragbeast Meat
Food45=2 lb. Hynid Meat
Food46=3 lb. Cragbeast Meat
Food47=3 lb. Hynid Meat
Food48=4 lb. Cragbeast Meat
Food49=4 lb. Hynid Meat
Food50=5 lb. Cragbeast Meat
Food51=5 lb. Hynid Meat
Food52=6 lb. Cragbeast Meat
Food53=6 lb. Hynid Meat
Food54=7 lb. Cragbeast Meat
Food55=7 lb. Hynid Meat
Food56=8 lb. Cragbeast Meat
Food57=8 lb. Hynid Meat
Food58=9 lb. Cragbeast Meat
Food59=9 lb. Hynid Meat
Food60=10 lb. Cragbeast Meat
Food61=10 lb. Hynid Meat
Food62=11 lb. Cragbeast Meat
Food63=11 lb. Hynid Meat
Food64=12 lb. Cragbeast Meat
Food65=12 lb. Hynid Meat
Food66=13 lb. Cragbeast Meat
Food67=14 lb. Cragbeast Meat
Food68=15 lb. Cragbeast Meat
Food69=15 lb. Hynid Meat
Food70=Dragon Egg
Food71=Drake Egg
Food72=Wurm Egg
Food73=Rye of Eternity
[Drink]
Drink1=Brackish Water
Drink2=Glob of Slush Water
Drink3=Pod of Water
Drink4=Water Flask
Drink5=Water of Eternity

Posted: Tue Nov 23, 2004 10:46 pm
by Neolesh
Only thing I see right away I would change is the variable "i" because it is used in spell_routines.inc which I use in most of my macro's.

Posted: Tue Nov 23, 2004 11:39 pm
by fearless
I am pretty sure that looks like it is set local to the sub, so unless spell_routines puts it out as a outer or global it should be fine.

Or I could be crack smoker.

Posted: Wed Nov 24, 2004 12:33 am
by Goofmester1
Both includes have the i declared local so the only chance of them causing problems with each other is if the value of i gets set by one and not cleared before the other one wants to use it. may want to set a start value for i when you declare it or before you first use it would be all that is needed in both includes.

Posted: Wed Nov 24, 2004 2:38 am
by Neolesh
I always end up with problems in my macs if I use "i" but it's probably because I'm declaring it outer... never thought about it hehe always just changed it to "ii" or "a"

Posted: Sat Dec 04, 2004 7:22 pm
by storekeeper
All I have to do is add the /call FeedmeDeclares line and make an inc file with the stuff noted? Cause it doesn't seem to be eatting anything. I can turn it on and off. About only thing I have seen it was responding at all.

Some of those varibles I have to set or what?

Posted: Sun Dec 05, 2004 1:12 am
by A_Druid_00
storekeeper wrote:All I have to do is add the /call FeedmeDeclares line and make an inc file with the stuff noted? Cause it doesn't seem to be eatting anything. I can turn it on and off. About only thing I have seen it was responding at all.

Some of those varibles I have to set or what?
You /call feedme declares before your main loop to set the variables. you /call feedme in the main loop to actually eat the food when you get hungry.

Posted: Sun Feb 27, 2005 9:09 am
by outlander
Hey A_Druid_00 Nice Include, I found Cr4zyb4rd's brute force first, made it into a kluge include, then decided to search one more time and got your include.

Have not tested it yet but it was one of the features I wanted in my new Hunting macro.

Yours is more than I was going to do so great job.

Posted: Sun Feb 27, 2005 9:49 am
by A_Druid_00
Thanks, this was my first real attempt at making anything macro related, and it's still one of my favorites. Between this and buffbeg, at lot of the more tedious things I hated about EQ were eliminated.

Posted: Sun Feb 27, 2005 4:44 pm
by aChallenged1

Code: Select all

drink=Fuzzlecutter Formula 5000

Posted: Sun Feb 27, 2005 6:44 pm
by notadruid

Code: Select all

drink=Bottle of Milk
drink=Milk

Posted: Sat Mar 26, 2005 10:44 am
by hendrix04
this would be an awsome plugin

Posted: Thu Apr 28, 2005 10:33 pm
by Twen
is there a command to tell what your hunger and thirst currently is?and at what value do you auto eat?

Posted: Fri Apr 29, 2005 1:22 am
by Hihi
/echo ${Me.Hunger}
/echo ${Me.Thirst}

Is right in the manual >.<


Can't recall offhand what # causes you to auto-eat/drink though.

Edit: Looking at the mac, it seems that 5k is just about the cutoff for auto-eat/drink.