Self Automated Tradeskill Macros

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

Moderator: MacroQuest Developers

lil6rasca
orc pawn
orc pawn
Posts: 15
Joined: Mon Feb 28, 2005 12:53 am

Post by lil6rasca » Fri May 27, 2005 1:45 am

yea it isnt updated yet

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

update

Post by harjenbbj » Fri May 27, 2005 9:18 am

any update override?

Teh_Hidden
a lesser mummy
a lesser mummy
Posts: 43
Joined: Wed Mar 16, 2005 12:42 am

Post by Teh_Hidden » Fri May 27, 2005 10:08 am

/windowstate MerchantWnd close
This was a posted fix. Do it yourself...it's one of the simplest things a text editor can do.

Then, if the fix doesn't work, come back and whinge.

Incite
decaying skeleton
decaying skeleton
Posts: 1
Joined: Mon May 30, 2005 7:32 am

Post by Incite » Mon May 30, 2005 7:35 am

hi, i just started using mq2, so am a total noobie w/ all this stuff. Everyhting posted is very helpful, but can someone link me the "exact" link i replace with "/windowstate MerchantWnd close "?. much thanks in advance.

Jimpatrick
orc pawn
orc pawn
Posts: 29
Joined: Thu Oct 07, 2004 1:27 pm

Post by Jimpatrick » Mon May 30, 2005 12:18 pm

/nomodkey /notify MerchantWnd DoneButton leftmouseup

should be replaced, I did it in several of the tradeskill macros and still won't buy at all.

bertbert
orc pawn
orc pawn
Posts: 19
Joined: Thu May 26, 2005 5:56 pm

Post by bertbert » Tue May 31, 2005 4:10 pm

Is it just me or is anyone else finding problems using

Code: Select all

/windowstate MerchantWnd close
When I use it, the merchant windows closes OK, but will not open again unless I use

Code: Select all

/windowstate MerchantWnd open
I am using

Code: Select all

keypress esc
instead, although it loses the target. Quite handy for the macros I am writing. Saves me doing a /target clear.

fallenkal
decaying skeleton
decaying skeleton
Posts: 6
Joined: Tue May 31, 2005 7:42 pm
Contact:

hiya...

Post by fallenkal » Tue May 31, 2005 9:29 pm

it would seem that even after applying the fix i recieve a "could not send notification to merchantxx leftmouseup" error then it stops... cant buy anything. the xx is a number after the merchant depending on which merchant im at... ive tried multiple and still noluck. any ideas?

adesheer
a lesser mummy
a lesser mummy
Posts: 64
Joined: Mon Mar 28, 2005 12:06 pm

Post by adesheer » Wed Jun 01, 2005 3:07 pm

Its a bug with /itemnotify in the new merchant window..I'm not up on the syntax for /itemnotify I looked it up in Wiki but it didn't help much..Hopefully someone can find the fix for it.

fallenkal
decaying skeleton
decaying skeleton
Posts: 6
Joined: Tue May 31, 2005 7:42 pm
Contact:

Post by fallenkal » Thu Jun 02, 2005 10:50 am

ive started this Thread reguarding help on the coading of a new buy command... looks promising, im very new to this so gimme some time, patience and alot of help :?

fallenkal
decaying skeleton
decaying skeleton
Posts: 6
Joined: Tue May 31, 2005 7:42 pm
Contact:

Post by fallenkal » Thu Jun 02, 2005 2:16 pm

Aiight, so i got a command that should fix it...

Code: Select all

 /notify MerchantWnd MW_ItemList ${Window[MerchantWnd].Child[ItemList].List[=${Name},2]} 
now how do i use that in the script? Lol sorry but i'm a little dense when it comes to programing...

PS: i know i should search and read and pour over the code and all that stuff trying to make sense of it but i just can't seem to figgure out how this stuff pieces together...

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 » Thu Jun 02, 2005 2:43 pm

fallenkal wrote:Aiight, so i got a command that should fix it...

Code: Select all

 /notify MerchantWnd MW_ItemList ${Window[MerchantWnd].Child[ItemList].List[=${Name},2]} 
now how do i use that in the script? Lol sorry but i'm a little dense when it comes to programing...

PS: i know i should search and read and pour over the code and all that stuff trying to make sense of it but i just can't seem to figgure out how this stuff pieces together...
I'll try to break down each piece for you, though I never really did a ton of manipulating windows or their children. Someone feel free to hop in anytime and point out where I'm wrong.

Code: Select all

/notify
Self explanatory, RTFM if you can't figure this one out

Code: Select all

MerchantWnd
This is the actual object you wanted to send the /notify to, there's a whole appendix in TFM listing the many window names that can be used, while not a lot of description as to exactly what window they are.

Code: Select all

MW_ItemList 
This is the child of the object you're trying to /notify. Not all windows have these, but a lot of them do, so get used to referencing them.

Code: Select all

${Window[MerchantWnd].Child[ItemList].List[=${Name},2]}
This is the important part of the whole notify command that you're probably having trouble with. It's also the part I'm not used to dealing with, so I may be off a bit, but you're trying to select an item in the merchant's list of items:
${Window[MerchantWnd] tells it what window
.Child[ItemList] is the child of the window as explained above
.List[=${Name},2]} is where I'm kind of lost too. The ${Name} portion needs to be replaced with the name of the item you're trying to select I believe, but the ,2 is where I'm confused personally. I'm not even sure that part is necessary.

I would have to assume that there should be a leftmouseup at the end of the statement too, in order to actually select the item in question. And then another statement to /notify the MerchantWnd BuyButton(Not sure if that's the button name BTW) leftmouseup after you've selected the item with the first statement.

OK, I'm spent... maybe someone else can help you further.
[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]

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

Post by jblow » Tue Jun 07, 2005 5:29 am

I'll try to shed a ittle more light on this.
The ${Name} portion needs to be replaced with the name of the item you're trying to select I believe, but the ,2 is where I'm confused personally. I'm not even sure that part is necessary.
With the new type of merchant lists, there are now two types of ItemList objects. ItemList for the old school square box item lists, and MW_ItemList for the newer row/column style item lists. In the new MW_ItemList objects, two fields must be referenced. So in this case, [=${name},2] means match ${name} in column 2. Column 1 is an icon, 2 is the name, 3 is the number of plat, 4 the number of gold, and so on... So, the answer to your question is Yes, it is necessary.

I've spent a couple of hours messing around with this and wrote some scripts to dump data and so on and I'm fairly convinced there's a bug in MQ2 that is preventing the /notify command from executing the leftmouseup event on the correct window in an MW_ItemList. My gut feeling is that there's a function somewhere that's expecting an ItemList object and is not handling an MW_ItemList object properly. I'm probably wrong but I'll see what I can find.

One question I have is why did Lax use MW_ItemList and ItemList in the same command? Does referencing an MW_ItemList as an ItemList typecast it?

User avatar
dont_know_at_all
Developer
Developer
Posts: 5450
Joined: Sun Dec 01, 2002 4:15 am
Location: Florida, USA
Contact:

Post by dont_know_at_all » Tue Jun 07, 2005 5:48 am

jesus!

Code: Select all

|
| buy.mac 
| /macro buy <name>
|
sub main(string Name)

/declare l2 local int
          
    /varset l2 ${Window[MerchantWnd].Child[ItemList].List[=${Name},2]}
    /if (!${l2}) { 
        /echo couldn't find slot for ${Name}
        /endm
    } else {
        /notify MerchantWnd ItemList listselect ${l2}
        /delay 2
        /notify MerchantWnd ItemList leftmouse ${l2}
        /delay 4
    }

    /if (!${Window[MerchantWnd].Child[MW_SelectedItemLabel].Text.Equal[${Name}]}) {
        /echo bad select
        /beep
        /beep
        /beep
        /endm
    }
    /delay 5
    /shift /notify MerchantWnd MW_Buy_Button leftmouseup

/return 
--
<Thedude> I have to say your there retarded one.

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

Post by jblow » Wed Jun 08, 2005 6:17 am

Here's something that might work for the time being. I havn't tested it that much but it seems to work pretty well for the fletching macro.

To use this macro, it is necessary to add a 3rd parameter to the buy call to specify whether or not to close the merchant window. For Example, If in your favorite macro there are 4 buy calls in a row, they are all probalby expecting the buy window to be open but after the fourth there's a "/notify MerchantWnd DoneButton leftmouseup" that will fail since they removed the Done button. So for the 4th call you would want to pass a 1 as the third parameter so 'buy' will close the tradeskill window and your combines won't get screwed up because you're still in merchant mode. A '0' will leave the merchant window open, a '1' will close it. Let me know if this works.

Code: Select all

/call Buy ${AShafts} 40 0
/delay 1s 
/call Buy ${GrooveN} 40 0
/delay 1s 
/call Buy ${CFletching} 40 0
/delay 1s 
/call Buy ${AHeads} 40 1     <-- This should close the merchant window
/delay 1s 
/notify MerchantWnd DoneButton leftmouseup   <-- Since this will fail

The same should probably be done for sell.inc but most people sell right after they combine so it hasn't been a problem.

Code: Select all

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

Sub Buy(item ItemToBuy, int amount, int CloseMerchant) 

/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
	/if (${CloseMerchant}) {
		/call CloseWindows
		/delay 2s
		/call OpenPacks
		/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

| This is bad but works and I'm tired. When I find a better 
|   way to close the merchant window I'll implement it
Sub CloseWindows
	/keypress esc
	/delay 5
	/keypress esc
	/delay 5
	/keypress esc
	/delay 5
	/keypress esc
	/delay 5
	/keypress esc
	/delay 5
	/keypress esc
	/delay 5
	/keypress esc
	/delay 5
	/keypress esc
	/delay 5
	/keypress esc
	/delay 10
/return


Fabolous1
a ghoul
a ghoul
Posts: 134
Joined: Sun Jun 27, 2004 12:44 am

Post by Fabolous1 » Wed Jun 22, 2005 5:56 pm

I'm still getting this error...

Code: Select all

[MQ2] Please Wait........ Cleaning out Fletching Kit container
[MQ2] Done Cleaning Fletching Container. Thank you for waiting!

Code: Select all

I'll give you 5 copper per Large Groove Nocks (Spammed till I end Macro)
[url=http://www.macroquest2.com/phpBB2/viewtopic.php?t=16277]CastingBuilderMulti.mac (2.2)[/url]
[url=http://www.macroquest2.com/phpBB2/viewtopic.php?p=143350#143350]Generalstuff.mac (6.0)[/url]