Feedme.inc v2.3

A forum for macro code snippets to be used in writing other macros. Post routines or .inc files here only, completed macros go to the Macro Depot. MQ2Data format only!

Moderator: MacroQuest Developers

Some Guy
a ghoul
a ghoul
Posts: 119
Joined: Thu Apr 29, 2004 5:32 pm

Post by Some Guy » Fri Apr 29, 2005 1:37 am

You auto eat/drink when those are below 2900ish. (Somewhere between 2900 and 3000).
You can force eat/drink below 6000.

A_Druid_00
Macro Maker Extraordinaire
Posts: 2378
Joined: Tue Jul 13, 2004 12:45 pm
Location: Rolling on the Lawn Farting

Post by A_Druid_00 » Fri Apr 29, 2005 8:23 am

Twen wrote:is there a command to tell what your hunger and thirst currently is?and at what value do you auto eat?
If you read the description in the first post it tells you that it eats/drinks when your hunger/thirst falls below 5000. Some Guy is right that EQ auto-consumes at around 3000.
[quote]<DigitalMocking> man, A_Druid_00 really does love those long ass if statements
<dont_know_at_all> i don't use his macro because i'm frightened of it[/quote]
[quote][12:45] <dont_know_at_all> never use a macro when you can really fuck up things with a plugin[/quote]

onetimehero
a ghoul
a ghoul
Posts: 105
Joined: Fri Sep 05, 2003 2:42 pm

ver 2.3

Post by onetimehero » Mon May 02, 2005 2:40 pm

I removed a bit of redundant code, stripped out the loading of items into an array for no apparent reason 8-). This is untested btw...somebody try it and tell me where it's broken.

Code: Select all

|Feedme.inc v2.3
#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 
Not that A_Druid_00's code is broken...i'm just bored.
Hmm. That's odd.

A_Druid_00
Macro Maker Extraordinaire
Posts: 2378
Joined: Tue Jul 13, 2004 12:45 pm
Location: Rolling on the Lawn Farting

Post by A_Druid_00 » Tue May 03, 2005 9:21 am

Thanks man, I never really got into carrying over strings from sub to sub. It's always nice to see where my code can be improved.

One question about finding stuff in the ini every time the sub is called. Wouldn't that cause the sub to access the ini every time it needs to consume? I used an array in order to get around that and reduce any disk access associated with this inc. If that's not the case, boy am I a dummy :)

Edit: Never mind, I am a dummy. I wasn't even using the array at all even though I was loading it.

Someone confirm this works without any issues and I'll update the main post.
[quote]<DigitalMocking> man, A_Druid_00 really does love those long ass if statements
<dont_know_at_all> i don't use his macro because i'm frightened of it[/quote]
[quote][12:45] <dont_know_at_all> never use a macro when you can really fuck up things with a plugin[/quote]

User avatar
Synicasm
Custom Builder
Custom Builder
Posts: 132
Joined: Fri Apr 23, 2004 6:34 pm

Post by Synicasm » Wed May 04, 2005 1:10 pm

Had a minor problem with this last night and carrying a Large Sewing kit .

By default...
When you rt click on some carried Tradeskill containers they will open in the newer trade skill combine window ( the one with the recipies listed ).
When the macro tries to open the contaier via the following in the code ...

Code: Select all

/if (!${Window[${InvSlot[${mypack}].Name}].Open}) /nomodkey /itemnotify ${mypack} rightmouseup 
it will freak out and continue to loop the errors for sometime untill a /endmacro or a /mqpause etc gets parsed.

The quickest and easiest fix is to open the container using the newer combine window ( with the recipe list etc. ) and there is a button at the bottom to change the window to be opened with ctrl Rt click. Once that is set the problem goes away.

A_Druid_00
Macro Maker Extraordinaire
Posts: 2378
Joined: Tue Jul 13, 2004 12:45 pm
Location: Rolling on the Lawn Farting

Post by A_Druid_00 » Wed May 04, 2005 2:12 pm

If you work out a fix for it, post it and I'll update the main post. I personally had my tradeskill containers set up to open up just like bage by default.
[quote]<DigitalMocking> man, A_Druid_00 really does love those long ass if statements
<dont_know_at_all> i don't use his macro because i'm frightened of it[/quote]
[quote][12:45] <dont_know_at_all> never use a macro when you can really fuck up things with a plugin[/quote]

discip1e
a ghoul
a ghoul
Posts: 133
Joined: Wed Dec 21, 2005 6:32 am

Post by discip1e » Wed Jun 27, 2007 7:32 am

can i change the "i" to anything else, perchance?

or does it need to be that for any reason?
Virtual arguments with Virtual people in Virtual space is Virtually the most retarded thing in existence. . .

jacensolo
a snow griffon
a snow griffon
Posts: 427
Joined: Wed Feb 14, 2007 8:51 am
Location: Right behind you

Post by jacensolo » Wed Jun 27, 2007 9:37 pm

You should be able to change "i" to whatever you want, provided it doesn't match any other variable names and you change all the instances of "i". Just out of curiosity, why do you want to change "i"?

MareDK
a snow griffon
a snow griffon
Posts: 329
Joined: Mon Jan 31, 2005 12:01 pm

Post by MareDK » Thu Jun 28, 2007 3:37 am

Synicasm wrote:Had a minor problem with this last night and carrying a Large Sewing kit .

By default...
When you rt click on some carried Tradeskill containers they will open in the newer trade skill combine window ( the one with the recipies listed ).
When the macro tries to open the contaier via the following in the code ...

Code: Select all

/if (!${Window[${InvSlot[${mypack}].Name}].Open}) /nomodkey /itemnotify ${mypack} rightmouseup 
it will freak out and continue to loop the errors for sometime untill a /endmacro or a /mqpause etc gets parsed.

The quickest and easiest fix is to open the container using the newer combine window ( with the recipe list etc. ) and there is a button at the bottom to change the window to be opened with ctrl Rt click. Once that is set the problem goes away.
well you could make a check if it is a combine container before opening and then I think it is CTRL + rightclick to open it and passing the new tradeskill window
[quote="dont_know_at_all"]Not implemented.[/quote]

Chyld989
a ghoul
a ghoul
Posts: 88
Joined: Mon Dec 22, 2003 3:29 pm

Post by Chyld989 » Thu Jun 28, 2007 4:03 am

Code: Select all

/if (${Window[TradeskillWnd].Open}) /nomodkey /notify TradeskillWnd ExperimentButton leftmouseup 
/delay 5s !${Window[TradeskillWnd].Open}
Put this code (taken directly from packs.inc) after it opens the bag; if it's open to the tradeskill window it'll go to the regular one, and if it's already on the regular one it will go ahead like it's supposed to.

discip1e
a ghoul
a ghoul
Posts: 133
Joined: Wed Dec 21, 2005 6:32 am

Post by discip1e » Thu Jun 28, 2007 7:40 am

jacensolo wrote:You should be able to change "i" to whatever you want, provided it doesn't match any other variable names and you change all the instances of "i". Just out of curiosity, why do you want to change "i"?
having a problem with bags closing after food is consumed. Was thinking maybe it's a spell_routines conflict. Was gonna try this first.
Virtual arguments with Virtual people in Virtual space is Virtually the most retarded thing in existence. . .

jacensolo
a snow griffon
a snow griffon
Posts: 427
Joined: Wed Feb 14, 2007 8:51 am
Location: Right behind you

Post by jacensolo » Thu Jun 28, 2007 4:08 pm

The "i" isn't the problem. It's set as a local variable in both, so no possible conflict. Which version of FeedMe are you using?

discip1e
a ghoul
a ghoul
Posts: 133
Joined: Wed Dec 21, 2005 6:32 am

Post by discip1e » Thu Jun 28, 2007 9:10 pm

jacensolo wrote:The "i" isn't the problem. It's set as a local variable in both, so no possible conflict. Which version of FeedMe are you using?
The one on page 1
Virtual arguments with Virtual people in Virtual space is Virtually the most retarded thing in existence. . .

discip1e
a ghoul
a ghoul
Posts: 133
Joined: Wed Dec 21, 2005 6:32 am

Post by discip1e » Thu Jun 28, 2007 9:19 pm

is there another version I am not wary of. . .mebbe posted elsewhere?
Virtual arguments with Virtual people in Virtual space is Virtually the most retarded thing in existence. . .

jacensolo
a snow griffon
a snow griffon
Posts: 427
Joined: Wed Feb 14, 2007 8:51 am
Location: Right behind you

Post by jacensolo » Thu Jun 28, 2007 10:16 pm

I use the version posted above by onetimehero. Well, I did a week or 2 ago. Then I donated, now I use MQ2FeedMe, the plugin. Works perfectly.