Macro SpellsToBuy.mac

|Usage:
| /macro spellstobuy
| lists every spell to be bought
| /macro spellstobuy <level>
| lists every level <level> spell to be bought
| /macro spellstobuy <minlevel> <maxlevel>
| lists every level <minlevel> to level <maxlevel> spell to be bought

Might be borked
 
Nope, I use it. Once it takes a while to go through the entire spell index, then it tells you what to echo to mq2 chat to make it do something else.
 
Nope, I use it. Once it takes a while to go through the entire spell index, then it tells you what to echo to mq2 chat to make it do something else.

Could you tell me the exact command to buy? Not getting something right and it is causing the macro to restart over.

Edit: Figured it out, I had an extra space that I guess did not parse too well. Typing "/echo BuySpells" worked!
 
Last edited:
A bit spammy inspecting spells but it worked about 6 months ago.

Code:
Sub Main
	/echo STARTING: BuySpells  - will check merchant for spells your missing and buy them.
	/if ( !${Merchant} ) {
		/popup Browse merchant window and rerun
		/end
	}

	/declare b int local 
	/declare x int local 
	/declare i int local 
	/declare v string
	/declare s string
	/declare l2 int 

	/varset x 1

	:loop
		/varset b 0
		/varset v ${Window[MerchantWnd].Child[ItemList].List[${x},2]} 

|		/echo ${v} ${v.Length} b = ${b}

		/if ( !${v.Length} ) /goto :done

		/if ( ${v.Mid[1,5].Equal[Song:]})	/varset b 1
		/if ( ${v.Mid[1,6].Equal[Spell:]}) 	/varset b 1
		/if ( ${v.Mid[1,7].Equal[Scroll:]}) 	/varset b 1

		/if ( ${v.Mid[1,5].Equal[Song:]})	/varset v ${v.Mid[6,30]}
		/if ( ${v.Mid[1,6].Equal[Spell:]}) 	/varset v ${v.Mid[7,31]}
		/if ( ${v.Mid[1,7].Equal[Scroll:]}) 	/varset v ${v.Mid[8,32]}


		/if ( ${b} && !${Me.Book[${v}]} ) {
			/varset b 0
			/echo ${v}

			/notify MerchantWnd ItemList listselect ${x} 
			/delay 3
			/notify MerchantWnd ItemList rightmouse ${x}
			/delay 3

			/echo testing popup name ${v} -> ${DisplayItem.Name}
			
			/for i 1 to ${DisplayItem.Classes}
				/varset s ${DisplayItem.Class[${i}]}
				/if ( ${s.Equal[${Me.Class}]} ) /varset b 1
			/next i

			/if (${b}) {
				/echo BUY: ${v} -> ${DisplayItem.Name} = ${DisplayItem.Class[1]}

				/notify MerchantWnd ItemList leftmouse ${x} 
				/ctrlkey /notify MerchantWnd MW_Buy_Button leftmouseup
				/delay 5
			}
		}

		/varcalc x ${x}+1
		/goto :loop
	:done


/end
 
Last edited:
and here is one to mem them all

Code:
|| Macro ScribeAll.mac
||
|| Originally coded by gimp 
|| Modified 2012-12-03 by Dewey2461 to add autoclicking of spell book slot. 

Sub Main
   /echo scribe all macro by gimp started

   /declare i int local
   /declare j int local
   /declare b int local 0
   /declare p int local 1
   /declare s int local -1
   
   
   /if (${Cursor.ID}) /inventory

   /if (!${Window[SpellBookWnd].Open}) /squelch /windowstate SpellBookWnd open
  

   /for i 1 to 10
      /if (${InvSlot[pack${i}].Item.Container}) {

         /if (!${Window[Pack${i}].Open}) /itemnotify pack${i} rightmouseup
         | need a small delay so bag content can load
         /delay 1

         /for j 1 to ${InvSlot[pack${i}].Item.Container}
            /if (${InvSlot[pack${i}].Item.Item[${j}].Type.Equal["Scroll"]} && ${InvSlot[pack${i}].Item.Item[${j}].Spell.Level} <= ${Me.Level} && !${Me.Book[${InvSlot[pack${i}].Item.Item[${j}].Spell.Name}]}) {

				/echo Please scribe ${InvSlot[pack${i}].Item.Item[${j}].Spell.Name} on cursor
				/itemnotify in pack${i} ${j} leftmouseup

				| Need a small delay so pickup event can happen
				/delay 1

				| Logic for finding which spell book page and slot next spell should go. 
				:FindNextBlankSpot
				/varcalc b ${b}+1
				/varcalc s ${s}+1
				/if (${s}>15) {
					/varset s 0
					/varcalc p ${p}+2
				}

				|/echo Me.Book[${b}] = page ${p} , slot ${s} = ${Me.Book[${b}]}
				/if (${Me.Book[${b}].Name.NotEqual[NULL]}) /goto :FindNextBlankSpot

				/book ${p}
				/delay 2
				/notify SpellBookWnd SBW_Spell${s} leftmouseup
			   
				| Loop while user scribes the spell
				:WaitForScribe
				/if (${Cursor.ID}) /goto :WaitForScribe
            }
         /next j

         /if (${Window[Pack${i}].Open}) /itemnotify pack${i} rightmouseup
      }
   /next i

   /if (${Window[SpellBookWnd].Open}) /squelch /windowstate SpellBookWnd close
/return
 
I don't know about any of the other features. But I tried to use it on my zerker and it said I was missing everything period. So I updated it to check for Discs properly.

Only thing I changed was the max index to at least higher than the highest index for the Zerker discs I had, as well as added

Code:
 && !${Me.CombatAbility[${Spell[${x}].RankName}]}
to the search to see if you had it or not.

Now it properly reports if you're missing a disc.

While I realize this thread is ancient, a quick search brought me here and I'm pretty sure it's in the compile still (because I got it from there)
 

Attachments

  • SpellsToBuy.mac
    11.8 KB · Views: 19