Fixed arrows.mac

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

Moderator: MacroQuest Developers

Sparr
a hill giant
a hill giant
Posts: 159
Joined: Mon Jun 24, 2002 5:41 am

Fixed arrows.mac

Post by Sparr » Sat Jul 24, 2004 8:30 pm

This is the default arrows.mac that comes with MQ2, updated to open the new tradeskill combiners correctly (ctrl+click) and also to look for Vanes as well as Fletchings. I also gave the v## variables names.

Code: Select all

|
| - Arrows.mac -
|
| you need a fletching kit, fletchings/vanes, nocks, shafts and points in your 
| inventory.  this macro combines until it runs out of fletchings.
|
#turbo
#event CombineFail "#*#You lacked the skills to fashion the items together.#*#"
#event CombineSuceed "#*#You have fashioned the items together to create something new!#*#"

Sub Main

/declare kitslot int outer 99
/declare islot int outer
/declare combineresult int outer
/declare x int outer

    /call FindCombiner Fletching
    /varset kitslot ${Macro.Return}
    /if (${kitslot}==99) {
        /echo could not find a Fletching combiner!
        /return
    }

    /cleanup
    /delay 1s

    | open inv and packs

    /keypress i
    /delay 1s

    /for x 0 to 7 
        /ctrl /itemnotify ${Math.Calc[22+${x}]} rightmouseup
        /delay 1
    /next x

    | assume that the combiner is open and empty now

:MakeArrows


    /varset islot ${FindItem[Vanes].InvSlot}
    /if (${islot}) {
            /ctrl /itemnotify ${islot} leftmouseup
            /itemn in pack${kitslot} 1 leftmouseup
    } else {
        /varset islot ${FindItem[Fletchings].InvSlot}
        /if (${islot}) {
            /ctrl /itemnotify ${islot} leftmouseup
            /itemn in pack${kitslot} 1 leftmouseup
        } else {
            /echo could not find Fletchings
            /endm
        }
    }

    /varset islot ${FindItem[Nock].InvSlot}
    /ctrl /itemnotify ${islot} leftmouseup
    /itemn in pack${kitslot} 2 leftmouseup

    /varset islot ${FindItem[Shaft].InvSlot}
    /ctrl /itemnotify ${islot} leftmouseup
    /itemn in pack${kitslot} 3 leftmouseup

    /varset islot ${FindItem[Arrowhead].InvSlot}
    /ctrl /itemnotify ${islot} leftmouseup
    /itemn in pack${kitslot} 4 leftmouseup


    /doevents flush

    /varset combineresult 0

:redo

    /notify pack${kitslot} Container_Combine leftmouseup

    /delay 5
    /doevents

    | limiter on the combines per second so keep retrying
    /if (${Me.Inventory[pack${kitslot}].Item[1].ID}) /goto :redo
    
    /if (${combineresult}==2) {
:WaitCursor
        /delay 1
        /if (${Cursor.ID}) {
            /notify InventoryWindow IW_CharacterView leftmouseup
            /delay 3
            /goto :WaitCursor
        }
    }
    /goto :MakeArrows 
/return

Sub Event_CombineFail 
   /varset combineresult 1
/return 

Sub Event_CombineSuceed 
   /varset combineresult 2 
/return 

Sub FindCombiner 
/declare pack int local

   /for pack 1 to 8 
      /if (${Me.Inventory[pack${pack}].Type.Equal[${Param0}]}) /return ${pack}
   /next pack 

/return 99