Looking for a simple Halas 10lb Meat Pie Macro.

Have a macro idea but not sure where to start? Ask here.

Moderator: MacroQuest Developers

Chanter101
decaying skeleton
decaying skeleton
Posts: 8
Joined: Sun Jan 09, 2005 3:17 am

Looking for a simple Halas 10lb Meat Pie Macro.

Post by Chanter101 » Sun Jan 09, 2005 3:21 am

I kind of ripped off the tradeskill macro and well... it didn't work. Here is some of the stuff I got (Thanks soc-music.com/mq2 for helping with some alot of the coding I tried to put together.

Code: Select all

#event CombineError "#*#There was no place to put that#*#" 
#event CombineError "#*#You cannot combine these items in this container type!#*#" 
#event CombineError "#*#did not accept these items#*#" 
#include common/sell.inc
#include common/buy.inc
#include common/packs.inc
#include common/cleanpacks.inc

Sub Main
    /declare OldSkill int outer
    /declare SkillMaxWanted int outer
    /declare PackCode string outer 
    /declare Component[10] string outer 
    /declare i int outer
    /declare UsingCont int outer
    /declare DoOven int outer
    /declare CompA item outer
    /declare CompB item outer
    /declare CompC item outer
    /declare CompD item outer
    /declare CompE item outer
    /declare CompF item outer
    /declare CompG item outer
    /declare CompH item outer
    /declare CombItemName string outer
    /declare ItemToA string outer
    /declare ItemToB string outer
    /declare ItemToC string outer
    /declare EndingVar int outer
    /declare Levelname int outer
    /declare DelayMult int outer
    /varset OldSkill ${Me.Skill[Baking]}

| ************************************************
| *   Change these settings to what you want.    *
| ************************************************
  
    /varset SkillMaxWanted 230
    /varset DelayMult 1
    /varset DoOven 1

| ************************************************
| ************************************************

    :start
    /echo Baking is at ${Me.Skill[Baking]}

    /if (${Me.Skill[Baking]}>=${SkillMaxWanted}) {
      /echo Baking is at ${SkillMaxWanted}. Quiting!
      /endmacro
    }

    /if (${Me.Skill[Baking]}<${SkillMaxWanted}) {
      /varset CompA "Wolf Fillet in Cream"
      /varset CompB "Mammoth Fillet in Cream"
      /varset CompC "Bear Fillet in Cream"
      /varset CompD "Lion Fillet in Cream"
      /varset CompE "Sage Leaf"
      /varset CompF "Clump of Dough"
      /varset CompG "Clump of Dough"
      /varset CompH "Pie Tin"
      /varset CombItemName "Halas 10lb Meat Pie"
      /varset ItemToA "Halas 10lb Meat Pie"
    }
  /if (${DoOven}==1) {
    /varset UsingCont 1
    /delay ${Math.Calc[${DelayMult}*1]}s
    /itemtarget "Oven"
    /face
    /look
    /delay ${Math.Calc[${DelayMult}*1]}s
    /nomodkey /click left item
    /delay ${Math.Calc[${DelayMult}*2]}s
    /doevents
    /delay ${Math.Calc[${DelayMult}*1]}s
    /call OpenPacks
    /delay ${Math.Calc[${DelayMult}*2]}s

    /varset EndingVar 1
    /call readIni "${CombItemB}"

    /itemtarget "Oven"
    /face
    /look
    /delay ${Math.Calc[${DelayMult}*1]}s
    /nomodkey /click left item
    /delay ${Math.Calc[${DelayMult}*2]}s
    /doevents
    /delay ${Math.Calc[${DelayMult}*1]}s
    /call OpenPacks
    /delay ${Math.Calc[${DelayMult}*1]}s

    /call readIni "${CombItemA}" 
    :BeginA
       /if (${EndingVar}==1) /call ClearCursor 
       /for i 1 to 10 
             /if (${EndingVar}==1) /call AddComp "${Component[${i}]}" ${i} 
       /next i 
       /if (${EndingVar}==1) /call DoCombine 
       /if (${EndingVar}==1) /goto :BeginA
 
    /delay ${Math.Calc[${DelayMult}*1]}s
    /call ClosePacks
    /nomodkey /keypress esc

    /call readIni "${CombItemName}" 
    :Begin 
       /if (${EndingVar}==1) /call ClearCursor 
       /for i 1 to 10 
             /if (${EndingVar}==1) /call AddComp "${Component[${i}]}" ${i} 
       /next i 
       /if (${EndingVar}==1) /call DoCombine 
       /if (${EndingVar}==1) /goto :Begin
 
    /delay ${Math.Calc[${DelayMult}*1]}s
    /call ClosePacks
    /nomodkey /keypress esc
    /nomodkey /keypress esc

    /delay ${Math.Calc[${DelayMult}*1]}s
    /delay ${Math.Calc[${DelayMult}*1]}s
    /nomodkey /click right target
    /delay ${Math.Calc[${DelayMult}*2]}s
    /call OpenPacks
    /delay ${Math.Calc[${DelayMult}*1]}s
    /delay ${Math.Calc[${DelayMult}*1]}s
    /call ClosePacks

    /goto :start

    /return


Sub readIni(RecipeName) 
    /declare Container string 

    /echo Running ${RecipeName} recipe 

   /if (${Ini["baking.ini","${RecipeName}",-1,"NOTFOUND"].Equal["NOTFOUND"]}) { 
        /echo Recipe ${RecipeName} not found 
        /endmacro 
    } 

   /varset Container ${Ini[baking.ini,${RecipeName},Cont,Enviro]} 

   /if (${Container.Equal[Enviro]}) { 
        /varset PackCode Enviro 
   } else { 
        /varset PackCode ${FindItem[=${Container}].InvSlot} 
       
      /if (${PackCode.Equal[NULL]}) { 
         /echo Could not find container ${Container} 
         /varset EndingVar 2
         /return
      } 
      | pack1 = 22, ... , pack8 = 29 
      /varset PackCode pack${Math.Calc[${PackCode}-21].Int} 
   }  

   /call cleanPack "${Container}"

    /for i 1 to 10 
        /varset Component[${i}] ${Ini[baking.ini,${RecipeName},Comp${Math.Calc[${i}-1].Int},NOTFOUND]} 
    /next i 
    /return 

sub ClearCursor 
    :Loop 
      /if (!${Cursor.ID}) /return 
      /autoinv 
    /delay ${Math.Calc[${DelayMult}*5]}s
      /doevents 
      /goto :Loop 
    /return 

sub DoCombine 
    :Loop 
      /combine ${PackCode} 
      /delay ${Math.Calc[${DelayMult}*1]}s
      /if (${PackCode.Equal[Enviro]}) /delay 1s 
      /doevents 
      /if (${InvSlot[${PackCode}].Item.Items}) /goto :Loop 
    /delay ${Math.Calc[${DelayMult}*5]}s
      /if (${Me.Skill[Baking]}>${OldSkill}) {
        /echo Your Baking Went Up!! It's now ${Me.Skill[Baking]}!
        /varset OldSkill ${Me.Skill[Baking]}
      }
    /return 

sub AddComp(CompName, PackSlot) 
   /if (${CompName.Equal[NOTFOUND]}) /return 

   /if (!${FindItem[=${CompName}].ID}) { 
      /echo Could not find ${CompName} in inventory 
      /beep 
      /varset EndingVar 2
      /return 
    } 

   :Loop 
      /nomodkey /ctrl /itemnotify ${FindItem[=${CompName}].InvSlot} leftmouseup 

      /if (!${Cursor.ID}) { 
         /delay ${Math.Calc[${DelayMult}*1]}s
         /goto :Loop 
      } 

   /if (${PackCode.Equal[Enviro]}) { 
      /nomodkey /itemnotify ${InvSlot[enviro${PackSlot}]} leftmouseup 
   } else { 
      /nomodkey /itemnotify in ${PackCode} ${PackSlot} leftmouseup 
   }    
   /return 

Sub Event_CombineError 
    /varset EndingVar 2
/return


Sub Event_ContUsed
    /echo Container in use. Waiting 30 seconds and trying again.
    /delay 30s
    /if (${UsingCont}==0) /itemtarget "Oven"
    /delay ${Math.Calc[${DelayMult}*1]}s
    /nomodkey /click left item
    /delay ${Math.Calc[${DelayMult}*2]}s
    /doevents
/return 
What am I missing here? #1. The Ovens disappear when I target them, #2 It won't put the items for the Halas 10lb Meat Pies in the oven and #3 It stacks the items together when it puts it in the spit as an alternative to the oven.

User avatar
aChallenged1
a grimling bloodguard
a grimling bloodguard
Posts: 1804
Joined: Mon Jun 28, 2004 10:12 pm

Post by aChallenged1 » Sun Jan 09, 2005 6:59 am

If it doesn't go out and buy the items for you, then I would suggest searchign for and using the combine.mac (once you have the recipe in your list.
Fuck writing MQ2 macros. Go with IS scripts; IS Rules!

Clueless_Coder
a hill giant
a hill giant
Posts: 192
Joined: Wed Aug 25, 2004 3:18 pm

Post by Clueless_Coder » Sun Jan 09, 2005 7:20 am

#3 It stacks the items together when it puts it in the spit
What date MQ2 source are you using? Up to (I believe) the 12/31 release the ItemCount was hosed. (Or at least from what I can tell from a quick read of the posts referring to ItemCount as of 12/27 a fix was "Going to be added to the zip)

There's several posts referring to the stacking problems it caused

xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Looking for a simple Halas 10lb Meat Pie Macro.

Post by xyilla » Mon Mar 17, 2025 1:41 am


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Looking for a simple Halas 10lb Meat Pie Macro.

Post by xyilla » Mon Mar 17, 2025 1:42 am


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Looking for a simple Halas 10lb Meat Pie Macro.

Post by xyilla » Mon Mar 17, 2025 1:44 am


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Looking for a simple Halas 10lb Meat Pie Macro.

Post by xyilla » Mon Mar 17, 2025 1:45 am


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Looking for a simple Halas 10lb Meat Pie Macro.

Post by xyilla » Mon Mar 17, 2025 1:46 am


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Looking for a simple Halas 10lb Meat Pie Macro.

Post by xyilla » Mon Mar 17, 2025 1:47 am


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Looking for a simple Halas 10lb Meat Pie Macro.

Post by xyilla » Mon Mar 17, 2025 1:48 am


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Looking for a simple Halas 10lb Meat Pie Macro.

Post by xyilla » Mon Mar 17, 2025 1:49 am


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Looking for a simple Halas 10lb Meat Pie Macro.

Post by xyilla » Mon Mar 17, 2025 1:50 am


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Looking for a simple Halas 10lb Meat Pie Macro.

Post by xyilla » Mon Mar 17, 2025 1:52 am


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Looking for a simple Halas 10lb Meat Pie Macro.

Post by xyilla » Mon Mar 17, 2025 2:29 am


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Looking for a simple Halas 10lb Meat Pie Macro.

Post by xyilla » Mon Mar 17, 2025 2:30 am