Self Automated Tradeskill Macros

Post your completed (working) macros here. Only for macros using MQ2Data syntax!

Moderator: MacroQuest Developers

ounvme
a lesser mummy
a lesser mummy
Posts: 61
Joined: Mon Jul 25, 2005 8:36 am

BUGS

Post by ounvme » Sat Aug 20, 2005 5:55 am

Tried updating and still cannot get this working. Anyone have current updates? If not i'l keep playing with it.
-=OUNVME=-

lifeweaver
decaying skeleton
decaying skeleton
Posts: 1
Joined: Tue Aug 23, 2005 7:06 pm

I use tradeskills

Post by lifeweaver » Tue Aug 23, 2005 7:07 pm

Hi, Could you link me the updated Tradeskill stuffs please? I cant seem to find ones that work.

Thank you kindly! :D

Liontooth
decaying skeleton
decaying skeleton
Posts: 1
Joined: Tue Aug 23, 2005 12:54 pm

Post by Liontooth » Sun Aug 28, 2005 4:57 pm

Tried the brewing mac just now but was reciveing error: "Could not send notification to merchant10 leftmouseup" at the point of it trying to buy casks. After reading further on the boards I went and replaced-

#define pinstSelectedItem 0x8A74F8

#define pinstCItemDisplayManager 0x8A7524

in the eqgame.h file then rebuilt the MQ2Main folder as postes had said to do. Now I still get the same errior and it locks up and CTD. Would appreciate any help. Thank You

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 » Sun Aug 28, 2005 5:46 pm

I wonder if anyone else has had this problem... Maybe if I read back a couple pages I'll see if the macro is broken for everyone and not just me.
[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]

Ryatin
decaying skeleton
decaying skeleton
Posts: 5
Joined: Mon Aug 29, 2005 1:33 am

Post by Ryatin » Wed Aug 31, 2005 3:06 pm

Override isn't going to be on for a while so yea it's broken for now. But he said he'd probably fix it. =)

Agripa
a ghoul
a ghoul
Posts: 97
Joined: Tue Nov 23, 2004 10:16 pm

Post by Agripa » Thu Sep 01, 2005 5:59 am

I just started into automating some tradeskill tasks. Here is the code I am using to handle the slow merchant window refresh. From the looks of it, merchants can only have 80 items available.

Code: Select all

   /target ID ${merchant_ID}
   /delay 1s ${Target.ID}==${merchant_ID}

   /for I 1 to 2
      /click right target
      /delay 1s ${Window[MerchantWnd].Open}
      /if ( !${Window[MerchantWnd].Open} ) {
         /varset I 1
      } else {
         /varset I 2
      }
   /next I

   /for I 1 to 120
      /delay 1s ${Window[MerchantWnd].Child[MW_ItemList].List[${I},2].Length}
      /if ( !${Window[MerchantWnd].Child[MW_ItemList].List[${I},2].Length} ) {
         /echo Path_BuyItems: ${Target.CleanName} has ${I} Items
         /varset I 120
      }
   /next I

Slippery
a lesser mummy
a lesser mummy
Posts: 74
Joined: Fri Oct 15, 2004 4:45 pm

Post by Slippery » Tue Oct 04, 2005 10:35 pm

I wish I knew a little more about this coding stuff or I'd try to throw in a fix.

Anyhow, using DKAA's fix on page 23 didnt seem to work for me, after using the code from the above poster, I can open merchant window, but have invalid /call Buy

I wish we could get something going here, these TS macros rule.

armysoldier
a hill giant
a hill giant
Posts: 189
Joined: Mon Jun 27, 2005 2:13 am
Location: Florida (Stationed at FT Carson CO)

post the error

Post by armysoldier » Thu Oct 06, 2005 6:03 pm

but most likely a. you have the old buy file or b. its in the wrong directory

some of the TS macros need the buy, sell, packs and clean packs in a folder common

try that

armysoldier
a hill giant
a hill giant
Posts: 189
Joined: Mon Jun 27, 2005 2:13 am
Location: Florida (Stationed at FT Carson CO)

Post by armysoldier » Thu Oct 06, 2005 6:05 pm

also .. i have posted on the brewing.. baking and smithing threads.. the fixed code...

do a search for each one and there is a thread dedicated to them

bobbb
decaying skeleton
decaying skeleton
Posts: 6
Joined: Thu Sep 22, 2005 8:27 pm

Post by bobbb » Fri Oct 07, 2005 6:19 pm

working on the baking one. with the replaced sets you posted. Does not work however. Instead of replying with what the fixed code is, maybe repost the entire rewritten sets with replaced code so there isn't any confusion?

I have it set up with .inc files in "common directory". I face the merchant, open up to buy, dont buy any bread... cant find meat, close her pack. If i open her manually and click on the bread, I will buy bread in a continual endless loop.

harjenbbj
orc pawn
orc pawn
Posts: 13
Joined: Fri Oct 15, 2004 2:13 pm

Post by harjenbbj » Wed Oct 12, 2005 7:39 pm

done button returned to merchant windows, should fix this

Leffe
a ghoul
a ghoul
Posts: 86
Joined: Mon Feb 14, 2005 4:59 pm

Post by Leffe » Sun Oct 16, 2005 10:17 am

that should mean that the old macros should work now right?

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 » Sun Oct 16, 2005 10:41 am

No. The old merchante window wasn't a list box like this one. It will make re-engineering this macro a little easier since you don't need to /keypress esc and close the merchant window though.
[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]

Badfish
decaying skeleton
decaying skeleton
Posts: 8
Joined: Mon May 23, 2005 9:17 pm

Post by Badfish » Sat Oct 22, 2005 3:21 pm

Any idea when the sites gonna be back up?
Macro Newb...

jblow
decaying skeleton
decaying skeleton
Posts: 5
Joined: Fri Feb 11, 2005 8:03 am

Post by jblow » Mon Oct 31, 2005 2:43 am

Here's my version of the brewing macro and buy.inc that's working fine for me. You can get sell.inc and packs.inc elsewhere as they do not require any modification.

brewing.mac

Code: Select all

| 
| brewing.mac 
| Takes you from 1 to 248 in Brewing 
| Version 2.5 
| Date: August 3, 2004 
| 
| Please be sure to get the lastest updates at http://www.soc-music.com/mq2/index.htm 
| 
| Before are the settings you need to change for you. 
| This Macro can take you up to 248 in brewing. 
| SkillMaxWanted can be change to what skill you want to stop at. 
| MerchantNameA is which merchant has the brewing components. 
| MerchantNameB is which merchant has the water and short beer components. 
| 
| This Macro works best in the Abysmal Sea since all the components are there. 
| You WILL need to be between both merchants to be able to use this macro. 
| 
| Disclaimer: 
| Code was used from other programers also from the MQ Forums. 
| This macro may not work any other place then the Abysmal Sea. 
| 

#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#*#" 
#event ContUsed "#*#Someone else is using that. Try again later.#*#" 
#include common/sell.inc 
#include common/buy.inc 
#include common/packs.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 MerchantNameA string Outer 
    /declare MerchantNameB string Outer 
    /declare CompA item outer 
    /declare CompB item outer 
    /declare CompC item outer 
    /declare CompD item outer 
    /declare CompE 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 
    /varset OldSkill ${Me.Skill[Brewing]} 

| ************************************************ 
| *   Change these settings to what you want.    * 
| ************************************************ 
  
    /varset MerchantNameA "Galidnus Corkpopper" 
    /varset MerchantNameB "Dray Cuves" 
    /varset SkillMaxWanted 248 

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

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

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

    /if (${Me.Skill[Brewing]}<${SkillMaxWanted}) { 
      /varset CompA "cask" 
      /varset CompB "malt" 
      /varset CompC "short beer" 
      /varset CompD "water flask" 
      /varset CompE "yeast" 
      /varset CombItemName "MHB" 
      /varset ItemToA "Minotaur Hero's Brew" 
      /varset ItemToB "bottle" 
      /varset ItemToC "cask" 
    } 


    /varset EndingVar 1 
    /call GoToMerchant 
    /delay 1s 
    /target ${MerchantNameA} 
|    /face 
    /delay 1s 
    /click right target 
    /delay 1s 
    /call Buy ${CompA} 40 
    /delay 1s 
    /call Buy ${CompB} 120 
    /delay 1s 
    /call Buy ${CompE} 40 
    /delay 1s 
     /notify MerchantWnd MW_Done_Button leftmouseup

    /delay 2s 
    /target ${MerchantNameB} 
|    /face 
    /delay 1s 
    /click right target 
    /delay 1s 
    /call Buy ${CompC} 80 
    /delay 1s 
    /call Buy ${CompD} 100 
    /delay 1s 
    /notify MerchantWnd MW_Done_Button leftmouseup
    /delay 1s 

    /call GoToBarrel 
    /look 
    /delay 1s 
    /click left item 
    /delay 2s 
    /doevents 
    /delay 1s 
    /nomodkey /notify TradeskillWnd ExperimentButton leftmousehold 
    /nomodkey /notify TradeskillWnd ExperimentButton leftmouseup 
    /delay 2s 
    /call OpenPacks 

    /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 1s 
    /call ClosePacks 
    /keypress esc 
    /keypress esc 

    /call GoToMerchant 
    /delay 1s 
    /target ${MerchantNameA} 
|    /face 
    /delay 1s 
    /click right target 
    /delay 1s 
    /call OpenPacks 
    /delay 2s 
    /call Sell ${ItemToA} 
    /delay 1s 
    /call Sell ${ItemToB} 
    /delay 1s 
    /call Sell ${ItemToC} 
    /delay 1s 
    /call ClosePacks 
    /keypress esc 
    /keypress esc 

    /goto :start 

    /return 

Sub readIni(RecipeName) 
    /declare Container string 

    /echo Running ${RecipeName} recipe, which makes ${ItemToA}. 

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

   /varset Container ${Ini[brewing.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} 
   }  

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

sub ClearCursor 
    :Loop 
      /if (!${Cursor.ID}) /return 
      /autoinv 
|      /destroy    
      /delay 5 
      /doevents 
      /goto :Loop 
    /return 

sub DoCombine 
    :Loop 
      /combine ${PackCode} 
      /delay 1s 
      /if (${PackCode.Equal[Enviro]}) /delay 1s 
       /doevents 
      /if (${InvSlot[${PackCode}].Item.Items}) /goto :Loop 
      /delay 5 
      /if (${Me.Skill[Brewing]}>${OldSkill}) { 
        /echo Your Brewing Went Up!! It's now ${Me.Skill[Brewing]}! 
        /varset OldSkill ${Me.Skill[Brewing]} 
      } 
    /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 1 
         /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 
    /itemtarget "Brew Barrel" 
    /delay 1s 
    /click left item 
    /delay 2s 
    /doevents 
/return 


Sub GoToMerchant 
  /echo Going to Merchants. 
  :PullMoveLoop 
  /if (${Me.State.Equal[SIT]}) /stand 
  /face nolook loc -165.30,178.83 
  /if (${Math.Distance[-165.30,178.83]}>2) /keypress forward hold 
  /if (${Math.Distance[-165.30,178.83]}<=2) { 
    /keypress forward 
    /return 
  } 
  /goto :PullMoveLoop 
/return 

Sub GoToBarrel 
  /echo Going to Brewing Barrel. 
  /itemtarget "Brew Barrel" 
  :PullMoveLoop 
  /if (${Me.State.Equal[SIT]}) /stand 
  /face fast 
  /if (${Target.Distance}>10) /keypress forward hold 
  /if (${Target.Distance}<=10) { 
    /keypress forward 
    /return 
  } 
  /goto :PullMoveLoop 
/return 
buy.inc

Code: Select all

#event Broke "#*#can't afford to buy them#*#" 

Sub Buy(item ItemToBuy, int amount) 

/echo Buying ${ItemToBuy} 

/declare TotalMItems int Inner 
/varset TotalMItems ${Merchant.Items} 
/declare x int Inner 
/declare ItemSlotNum int Inner 
/varset ItemSlotNum 0 
/declare ItemSlot local int 
/declare ItemStacks local int 

/for x 1 to ${TotalMItems} 
  /if (${ItemToBuy.Equal[${Merchant.Item[${x}]}]}) { 
    /varset ItemSlotNum ${x} 
  } 
/next x 

/if (${ItemSlotNum}==0) { 
  /echo Not on Merchant 
  /return 
} 

| Try to find the item in inventory. If not found buy one unit 
/if (!${Window[InventoryWindow].Open}) { 
   /windowstate InventoryWindow open 
} 
/if (!${FindItem[${ItemToBuy}].InvSlot}) { 
   /delay 4 
   /varset ItemSlot ${Window[MerchantWnd].Child[ItemList].List[=${ItemToBuy},2]} 
   /notify MerchantWnd ItemList listselect ${ItemSlot} 
   /delay 2 
   /notify MerchantWnd ItemList leftmouse ${ItemSlot} 
   /delay 4 
   /buyitem 1 
} 
/delay 4 

| Target the unit in inventory and get needed attributes 
/call OpenPacks 
/itemnotify ${FindItem[=${ItemToBuy}].InvSlot} leftmouseup 
/varset ItemStacks ${SelectedItem.Stackable} 
/delay 4 

| Go back to the Merchant and continue as usual 
/varset ItemSlot ${Window[MerchantWnd].Child[ItemList].List[=${ItemToBuy},2]} 
/notify MerchantWnd ItemList listselect ${ItemSlot} 
/delay 2 
/notify MerchantWnd ItemList leftmouse ${ItemSlot} 
/delay 4 

:Buy 
   /if (${FindItemCount[=${ItemToBuy}]}>=${amount}) { 
      /goto :EndBuy 
   }        

:StackLoop 
   /if (${Math.Calc[${amount}-${FindItemCount[=${ItemToBuy}]}]}<=20) /goto :RegLoop 
   /buyitem ${If[${ItemStacks},20,1]} 
   /doevents 
   /goto :StackLoop 

:RegLoop 
   /if (${Math.Calc[${amount}-${FindItemCount[=${ItemToBuy}]}]}<=0) { 
     /goto :EndBuy 
   }        
   /buyitem ${If[${ItemStacks},${Math.Calc[${amount}-${FindItemCount[=${ItemToBuy}]}]},1]} 
   /doevents 
   /goto :RegLoop 

:EndBuy 
   /echo Done! 
   /delay 2s 
/return 

Sub Event_Broke 
   /echo Error: You are out of money! 
   /beep 
   /endmacro 
/return 

Sub OpenPacks 
| Open all packs (stolen from packs.inc) 
   /declare bag int local 0 
   /newif (!${Window[InventoryWindow].Open}) /keypress inventory 
   /delay 1 
   /for bag 1 to 8 step 1 
      /newif (!${Window[pack${bag}].Open}) /itemnotify pack${bag} rightmouseup 
   /next bag 
   /delay 1 
/return 

brewing.ini

Code: Select all

[MHB] 
Comp0=Cask 
Comp1=Malt 
Comp2=Malt 
Comp3=Malt 
Comp4=Short Beer 
Comp5=Short Beer 
Comp6=Water Flask 
Comp7=Water Flask 
Comp8=Yeast