Bard-Change item to pri/sec slot, twist a song, change back

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

Moderator: MacroQuest Developers

BardsAreTooEasy
a lesser mummy
a lesser mummy
Posts: 39
Joined: Sun Feb 27, 2005 3:01 pm

Bard-Change item to pri/sec slot, twist a song, change back

Post by BardsAreTooEasy » Wed Dec 21, 2005 3:03 pm

This macro will switch an item out of your inventory into your primary or secondary slot, then twist a song, then change the item back. I use this for my run song. It moves my thunderous drum of karana into my main hand, twists selo`s, then moves it back. It will refresh selo`s as needed. You can pause the macro with /echo pause and unpause the macro with /echo unpause. If you want to change the song it twists or the item it moves, change the name to your item. The variables are set on the first few lines. Also set which slot to switch to, primary or secondary.

Code: Select all


#turbo
#event Pause "[MQ2] Pause"
#event Unpause "[MQ2] Unpause"

Sub Main
||||||||Define the song you'd like to twist as RunSong.  Define the item you'd like to switch as ItemName.  
||||||||Define if you'd like to switch ItemName into primary or secondary slot.
	/if (!${Defined[RunSong]}) /declare RunSong string outer Selo`s Accelerating Chorus
	/if (!${Defined[ItemName]}) /declare ItemName string outer Thunderous Drum of Karana
	/if (!${Defined[PriSec]}) /declare PriSec string outer primary
	/if (${PriSec.Equal[primary]}) {
		/varset PriSec 13
} else {
		/varset PriSec 14
}
||||||||Make a song duration variable.
	/if (!${Defined[SongDur]}) /declare SongDur timer outer 100
	:Run
	/doevents
||||||||Do nothing if sitting.
	/if (${Me.State.Equal[SIT]}) {
		/delay 2s
		/goto :Run	
}
||||||||If you already have RunSong and SongDur is not 0, then do nothing.
	/if (${Me.Buff[${RunSong}].ID} && ${SongDur}!=0) /goto :Run
||||||||Make sure RunSong is memorized.
/if (!${Defined[RunSlot]}) /declare RunSlot int local 
	/varset RunSlot ${Me.Gem[${RunSong}]}
	/if (!${RunSlot}) {
		/echo ${RunSong} is not memorized.
		/delay 10s
		/goto :Run
}
||||||||Switch items.
	/call Switch
	/goto :Run
/return

Sub Switch
||||||||SwitchBack is to switch the item back if needed.  NeedToSwitch checks if the item needs to be switched.  ItemSlot is the item's slot.
||||||||ItemName is the item that needs to be switched
	/if (!${Defined[SwitchBack]}) /declare SwitchBack int local 0
	/if (!${Defined[NeedToSwitch]}) /declare NeedToSwitch int local 0
	/if (!${Defined[ItemName]}) /declare ItemName string outer Thunderous Drum of Karana
	/if (!${Defined[ItemSlot]}) /declare ItemSlot int local ${FindItem[${ItemName}].InvSlot}
	/if (${ItemSlot}==${PriSec}) /varset NeedToSwitch 1
||||||||Switch item if needed.
	/squelch /twist off
	:Switch
	/if (${NeedToSwitch}==0) {
||||||||ItemPack is the backpack ItemName is in if it is in a backpack at all.
		/if (!${Defined[ItemPack]} && ${FindItem[${ItemName}].InvSlot.Pack}) /declare ItemPack int local ${FindItem[${ItemName}].InvSlot.Pack}
		/if (${Defined[ItemPack]}) /itemnotify ${ItemPack} rightmouseup
		/delay 2
		/itemnotify ${ItemSlot} leftmouseup
		/delay 2
		/itemnotify ${PriSec} leftmouseup
		/delay 2
		/itemnotify ${ItemSlot} leftmouseup
		/delay 2
		/if (${Defined[ItemPack]}) /itemnotify ${ItemPack} rightmouseup
}
||||||||Second time through this will switch the item back.
	/if (${SwitchBack}==1) /return
	/delay 2
||||||||Find RunSong's slot, set it to RunSlot, and twist it.
	/if (!${Defined[RunSlot]}) /declare RunSlot int local 
	/varset RunSlot ${Me.Gem[${RunSong}]}
	/if (!${RunSlot}) {
		/echo ${RunSong} is not memorized.
		/varset SwitchBack 1
		/goto :Switch
}
	/squelch /twist ${RunSlot}
	/delay ${Int[${Math.Calc[(${Spell[${RunSong}].CastTime}*10)+15]}]}
||||||||Wait till the spell lands.
	:Land
	/if (!${Me.Buff[${RunSong}].ID}) /goto :Land
||||||||Twist off, and set SongDur to the duration of the song -10 seconds.
	/squelch /twist off
	/varcalc SongDur (${Spell[${RunSong}].Duration}*60)-100
||||||||Switch items back
	/varset SwitchBack 1
   	/goto :Switch
/return

Sub Event_Pause
	/if (!${Defined[Paused]}) /declare Paused int outer 0
	/varset Paused 0
	/echo Paused.
	:Paused
	/delay 1s
	/doevents Unpause
	/if (${Paused}==0) /goto :Paused
/return

Sub Event_Unpause
	/if (!${Defined[Paused]}) /declare Paused int outer 1
	/varset Paused 1
	/echo Unaused.
/return


Spoon
a lesser mummy
a lesser mummy
Posts: 72
Joined: Thu Jan 29, 2004 1:18 am

Post by Spoon » Thu Dec 22, 2005 12:26 pm

Ok, you have me confused. If you have MQ2Twist, why don't you just use BardSwap? No macro needed...

BardsAreTooEasy
a lesser mummy
a lesser mummy
Posts: 39
Joined: Sun Feb 27, 2005 3:01 pm

Post by BardsAreTooEasy » Sat Dec 24, 2005 5:47 pm

I liked the way the first wheel was invented, but I wanted mine to be blue. Seriously though, I use an old version of mq2twist(10-5-04), and I don't know if there is a newer version that's been fixed, but my version uses /exchange, and as far as I know /exchange is broken. I dont have VIP so don't know if the new MQ2Twist has a fix.


SwiftyMUSE
Developer
Developer
Posts: 1205
Joined: Tue Sep 23, 2003 10:52 pm

Post by SwiftyMUSE » Sat Dec 24, 2005 6:12 pm

exchange is not broken. if yours is not working go pick up a current copy in the vip section.

BardsAreTooEasy
a lesser mummy
a lesser mummy
Posts: 39
Joined: Sun Feb 27, 2005 3:01 pm

Post by BardsAreTooEasy » Sat Dec 24, 2005 7:39 pm

I don't need exchange, I have this!! =p


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

Re: Bard-Change item to pri/sec slot, twist a song, change back

Post by xyilla » Sun Jun 29, 2025 11:32 am


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

Re: Bard-Change item to pri/sec slot, twist a song, change back

Post by xyilla » Sun Jun 29, 2025 11:33 am


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

Re: Bard-Change item to pri/sec slot, twist a song, change back

Post by xyilla » Sun Jun 29, 2025 11:35 am


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

Re: Bard-Change item to pri/sec slot, twist a song, change back

Post by xyilla » Sun Jun 29, 2025 11:36 am


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

Re: Bard-Change item to pri/sec slot, twist a song, change back

Post by xyilla » Sun Jun 29, 2025 12:13 pm


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

Re: Bard-Change item to pri/sec slot, twist a song, change back

Post by xyilla » Sun Jun 29, 2025 12:14 pm


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

Re: Bard-Change item to pri/sec slot, twist a song, change back

Post by xyilla » Sun Jun 29, 2025 12:15 pm


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

Re: Bard-Change item to pri/sec slot, twist a song, change back

Post by xyilla » Sun Jun 29, 2025 12:16 pm


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

Re: Bard-Change item to pri/sec slot, twist a song, change back

Post by xyilla » Sun Jun 29, 2025 12:53 pm


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

Re: Bard-Change item to pri/sec slot, twist a song, change back

Post by xyilla » Sun Jun 29, 2025 12:54 pm