Basic Bard Instrument/Weapon swapping macro.

A forum for you to dump all the macros you create, allowing users to use, modify, and comment on your work.

Moderator: MacroQuest Developers

User avatar
a_troll_01
a lesser mummy
a lesser mummy
Posts: 46
Joined: Sat Dec 06, 2003 6:06 am
Location: Memphis, TN
Contact:

Basic Bard Instrument/Weapon swapping macro.

Post by a_troll_01 » Sat Dec 06, 2003 6:14 am

This is my first submission. It's a very simple, very basic, easily customizable script to swap out Weapons/Instruments for bards. Feel free to tear it apart and post your own revisions or ideas.

Code: Select all


| Swap v1.0
| Basic Bard Weapon/Instrument Swapping Macro.
| Hacked apart from aGuy's Weapon/Instrument swapping script.
| By a_troll_01

| Simply adjust the Inventory numbers to match your preference,
| and you're good to go. Mind the '/delays' if you don't want to get
| others around you suspicious of your lighting-fast weapon-swaps.



Sub Main 
   /if $invpanel==FALSE /press i 
   /click right inv 7
   
   /if $equip(Primary)!=TRUE /call EquipWeapons 
   /if $equip(Primary)==TRUE /call EquipInstrument

   /doevents
/endmacro

Sub EquipWeapons
   /click left Secondary
   /click left pack 7 6
   /click left pack 7 9
   /delay 2s
   /click left Secondary
   /click left pack 7 8
   /delay 2s
   /click left Primary
   /cleanup
   /doevents
/return

Sub EquipInstrument
   /click left Primary
   /click left pack 7 8
   /click left pack 7 4
   /delay 2s
   /click left Secondary
   /click left pack 7 9
   /cleanup
   /doevents
/return

-- a_troll_01

User avatar
Dniper
a lesser mummy
a lesser mummy
Posts: 71
Joined: Tue Nov 25, 2003 2:54 pm

Post by Dniper » Thu Dec 11, 2003 11:54 pm

Hey, nice idea and good work, but too bad though you can't use two macros at the same time. Because of that you can't have a twist macro running without having to close it down to run this.

DekeFentle
a lesser mummy
a lesser mummy
Posts: 48
Joined: Wed Oct 22, 2003 1:41 pm

Post by DekeFentle » Fri Dec 12, 2003 1:08 pm

But you could "include" this one and tack the call to an F key.
Last edited by DekeFentle on Fri Dec 12, 2003 1:18 pm, edited 1 time in total.
Revelation 6:8

Mckorr
Developer
Developer
Posts: 2326
Joined: Fri Oct 18, 2002 1:16 pm
Location: Texas

Post by Mckorr » Fri Dec 12, 2003 1:13 pm

Actually I did something similar to this for a bard "healing" macro. I'd use it in between fights to de-equip weapons and equip a stringed instrumet, then use a healing song. When I reached 100% health it would switch back. Mine was kinda buggy though, since I threw it together in about 5 minutes.

You can combine something like this with twisting, used to be a macro here that did that. It would swap weapons and instruments during the delay between songs, so you'd constantly switch around to use the best instrument for whatever song you were twisting next.

User avatar
Dniper
a lesser mummy
a lesser mummy
Posts: 71
Joined: Tue Nov 25, 2003 2:54 pm

Post by Dniper » Fri Dec 12, 2003 1:22 pm

Would there be a way to define what instrument to swap for what songs and have it do that automatically? Like using an ini file to save all the songs you have for the instrument?

Also, "But you could "include" this one and tack the call to an F key". How would you do this? I've searched the forums and seen a couple people ask this but with no one responding.

Mutter
a ghoul
a ghoul
Posts: 105
Joined: Sat Nov 16, 2002 1:09 pm

hmm

Post by Mutter » Tue Feb 10, 2004 1:54 pm

is there any way to telll through MQ2, what type of song something is? IE I am gonna cast a DOT, it is a brass song, so i switch to my brass instr. If anyone know please let me know, I've love to write it.

El
a ghoul
a ghoul
Posts: 108
Joined: Mon Dec 29, 2003 12:34 pm

Post by El » Tue Feb 10, 2004 6:25 pm

You know what song you're playing, doesn't seem that hard to make an ini file to associate an instrument type with each song. Songs don't change all that often.

funkeymonk
decaying skeleton
decaying skeleton
Posts: 6
Joined: Tue Jan 27, 2004 11:51 pm

Finding out spell type and getting the instruments in Inv

Post by funkeymonk » Tue Feb 10, 2004 8:17 pm

I've been playing with an auto swap macro that twists songs and swaps for the needed instrument. I have gotten it to work but the swapping part is BAD....needs a lot of work. I can give you what i have on finding song type and how i got the list of instruments in inventory. I tweaked the code from Twist2.mac :

"Flexible bard song twister using timers by BrainDozer.
| Updated by Drax.
| Assist feature added by wilso132.
| Interrupt Song, Instrument swap feature added by ztilleto "

This is some of my older code...should work....I am at work right now on my laptop...will post my updated code tonight when i get home..Hope this helps

Code: Select all

|| this determines the type of instrument needed for spell being cast

/varset strSongType "$spell($char(castingspellid),skill)"

|| next bit logs the location of your instruments

Sub find_instruments
   /varset iItemIndex 0 

||  checks all your inventory slots for packs and sees if the are empty or have stuff in em.
      /for PackLoc 0 to 7     
         /if $pack(@PackLoc,empty)==FALSE { 
            /for PackSlot 0 to 10 $pack(@PackLoc,slots) 
               /if "$right(10,"($item(@PackLoc,@PackSlot,type))")"=="Instrument" { 

|| Stores the name and type of instrument found
                  /varset aInstrumentArray(@iItemIndex,0) "$item(@PackLoc,@PackSlot,name)" 
                  /varset aInstrumentArray(@iItemIndex,1) "$item(@PackLoc,@PackSlot,type)" 
    
|| Stores the location where you have the instruments.                 
                 
		  /varset aInstrumentLocation(@iItemIndex,0)  @PackLoc     
                  /varset aInstrumentLocation(@iItemIndex,1)  @PackSlot
                   
                  /varadd iItemIndex 1                
               }          
            /next PackSlot 

||  If you get a NULL result when checking for a pack means you have an item in that slot
||  So now we check to see if that Item is an instrument.
         
	  } else /if $pack(@PackLoc,empty)==NULL { 
            /if "$right(10,"($item(inv,@PackLoc,type))")"=="instrument" { 
               /varset aItem(@iItemIndex,0) "$item(inv,@PackLoc,name)" 
               /varset aItem(@iItemIndex,1) "$item(inv,@PackLoc,type)" 
    
               ||| To store the location where you have the instruments located.                 
               /varset aLocation(@iItemIndex,0)  @PackLoc      
               /varset aLocation(@iItemIndex,1)   @PackSlot 

               /varadd iItemIndex 1                
            } 
         } 
      /next PackLoc

/varadd @iItemIndex+1 

|Prints out in echo form how many instruments you have and their name
      /echo Number of instruments - @iItemIndex 
   /for z0 0 to $calc(@iItemIndex-2) 
         /echo @z0 - Current instrument : "@aInstrumentArray(@z0,0)" - "@aInstrumentArray(@z0,1)"
   /next z0 
/return 

I put the FUNK in MoNK

Funkey Monk

ztilleto
decaying skeleton
decaying skeleton
Posts: 5
Joined: Wed Jan 21, 2004 10:33 am
Location: Denmark
Contact:

Post by ztilleto » Thu Feb 12, 2004 7:43 am

Yeah as Funkeymonk says, the swapping part is a bid BAD, and i toke the macro and redid som of the swaping the day after i postet it on the forums, so it now handles switching between instruments as well, instead of having to swap to weapons first again...

Problem with making it autoswaping for every songchange, is that you will have your mouse move around every time you cast a song that has a diff instrumenttype.. (Can be a bit of a challenge cause you can't use your mouse to much either, cause then it wouldn't hit the right location.. )

The problem with the alteration you (Funkeymonk) did to instrumenttype check, will give some "wrong misses" when locating instruments in your inventory.
That was why i made a $item(<loc>,InstrumentType) call, cause some items will be caught as being armor, when they infact are instruments as well.
Look at my post for info on it..
http://macroquest2.com/phpBB2/viewtopic.php?t=5079


But as i said i rewrote it the day after, and have now had time to play with the macro. And it seems to work fine.. Problem is still the old way we use mouse click handling, and i'm looking into the new mouse code to see what we might gain from it ... :)

Ill upload the code when i get back home, as i forgot to add it to my cvs.

-----------------------------------------------------------------------------------
EDIT:
Reposted it in the linked forum thread, so there aint double posts of the code to maintain. Plus there is already explained how to use the InstrumentType function i added from the start, that Funkey apparently thought not to include in my code above. http://macroquest2.com/phpBB2/viewtopic.php?t=5079
"[i]Heart of a Lion, and the Wings of a Bat.... Because it's midnite.[/i]" - Limozeen