Feedme.inc v2.3
Posted: Thu Nov 04, 2004 5:18 pm
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
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.
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.
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 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