Change from weapons to instrument and vice verso----help

Help section from before the user variable changes that broke all macros

Moderator: MacroQuest Developers

aGuy
orc pawn
orc pawn
Posts: 18
Joined: Tue Nov 05, 2002 3:22 pm

Change from weapons to instrument and vice verso----help

Post by aGuy » Fri Nov 08, 2002 7:02 pm

This script will only run the false statment. I can go from instrument in secondary slot to duel wielding but when I go from duel weilding I do not equip instrument and have one weapon left on mouse pointer. This happens because it only runs the false statment.

This macro should allow me to swap out my two weapons for an instrument in inv 3 and remove weapons and replace instrument when needed.

Code: Select all

Sub Main
|check to see if inv is open, if not open it.
/if $invpanel==false /press g

| Check to see if primary and secondary weapons  are equip.  If they are remove them, if not go to else statment
/if n $equip(Primary,value)!=true {

| removing primary weapon
/click left equip Primary

| Primary weapon will be placed here
/click left inv 7

| Grabbing Instrument in this slot
/click left inv 3

| Placing a delay here so it does not look humanily imposible to switch out so fast.
/delay 3

| Place instrument in secondary slot and removing secondar weapon.
/click left equip secondary

| Place secondary weapon in this slot
/click left inv 3

| Check to see if Instrument is equip, if it is remove it and equip weapons
} else /if n $equip(primary,value)!=false {

| Removing instrument
/click left equip secondary

| Grabbing secondary weapon and dropping Instrument in this slot 
/click left inv 3 | secondary 

| Equiping secondary weapon
/click left equip secondary

| Placing a delay here so it does not look humanily imposible to switch out so fast.
/delay 3

| Grabbing primary weapon from this slot
/click left inv 7

| Equiping Primary weapon
/click left equip primary
}

| If inv is open close it
/if $invpanel==true /press g
/return
Last edited by aGuy on Fri Nov 08, 2002 7:52 pm, edited 3 times in total.

User avatar
Fippy
a snow griffon
a snow griffon
Posts: 499
Joined: Tue Jul 16, 2002 10:42 am

Post by Fippy » Fri Nov 08, 2002 7:12 pm

Cant follow the logic there aGuy, can ya post what you are trying to do in psuedo code or something.

Never played a bard myself.
Fippy

This is my girl. But Rizwank had her first :-)
[img]http://www.btinternet.com/~artanor/images/fairy_bounce09.gif[/img]

aGuy
orc pawn
orc pawn
Posts: 18
Joined: Tue Nov 05, 2002 3:22 pm

Updated info

Post by aGuy » Sat Nov 09, 2002 8:40 am

I added comments to my script to make it more clear what I am trying to do. Any help would be appreciated.

aGuy

Lurker_005
a lesser mummy
a lesser mummy
Posts: 51
Joined: Thu Oct 17, 2002 12:08 pm

Post by Lurker_005 » Sat Nov 09, 2002 12:16 pm

Change

Code: Select all

} else /if n $equip(primary,value)!=false { 
to

Code: Select all

} else /if n $equip(primary,value)=false { 
You want it to fire the second half if Primary is empty (correct?)

aGuy
orc pawn
orc pawn
Posts: 18
Joined: Tue Nov 05, 2002 3:22 pm

Post by aGuy » Sat Nov 09, 2002 12:17 pm

Ok I have change the script a little and this seems to work. However, I am having problems adding this code to another macro listed below.

Code: Select all


Sub Main

/if $invpanel==false /press g
/if n $equip(primary,value)==false /goto :equip_duelweapons
/if n $equip(Primary,value)==true /goto :equip_instrument

:equip_instrument
/click left equip Primary | removing primary weapon
/click left inv 7 | Primary weapon will be placed here
/click left inv 3 | Grabbing Instrument in this slot
/delay 3 | Placing a delay here so it does not look humanily imposible to switch out so fast.
/click left equip secondary | Place instrument in secondary slot and removing secondar weapon.
/click left inv 3 | Place secondary weapon in this slot
/if $invpanel==true /press g
/endm

:equip_duelweapons
/click left equip secondary | Removing instrument
/click left inv 3 | secondary | Grabbing secondary weapon and dropping Instrument in this slot
/click left equip secondary | Equiping secondary weapon
/delay 3 | Placing a delay here so it does not look humanily imposible to switch out so fast.
/click left inv 7 | Grabbing primary weapon from this slot
/click left equip primary | Equiping Primary weapon
/if $invpanel==true /press g
/endm

I would now like to add this to my the two macros that I use when I am group fighing and group healing. I have been able to get it to work with the fighing.mac but for some reason it will not work in the healmana.mac. For the most part these are the same scripts just using differant songs.

This one works and will switch out instrument for weapons.

Code: Select all

| - bardtwist.mac - Used for group fighting
| Twists the bard songs and watches for a missed note, if the note is 
| missed restarts that song. 
| By PussyFoot 



#event MissedNote "You miss a note, bringing your song to a close!" 
#event MobDead "You gain experience" 
#event Loading "LOADING" 
#event Stunned "You cannot cast while stunned" 
#event OutOfRange "Your target is out of range, get closer!" 

#event NoTarget "You must first select a target for this spell" 
#event EXP "You gain experience!!" 
#event LOADING "LOADING" 
#event stunoff "You are unstunned" 

#define SingStatus v59 
#define SONG_UNKOWN 1 
#define SING_RESTART 2 
#define OUT_OF_RANGE 3 
#define STUNED 4 
#define SONG_FINISHED 8 
#define SongTimer t7

Sub Main

/if n $equip(primary,value)==false /call change_to_weapons

:SingLoop
/Call Sing "Selo`s Consonant Chain" 
/stop 
/delay 0 
/call Sing "Jonthan's Provocation" 
/stop 
/delay 0 
/call Sing "Katta's Song of Sword Dancing" 
/stop 
/delay 0
|/call Sing "Shield of Songs" 
/stop
/delay 0
/goto :SingLoop 


Sub change_to_weapons

/if $invpanel==false /press g
/click left equip secondary | Removing instrument
/click left inv 3 | secondary | Grabbing secondary weapon and dropping Instrument in this slot
/click left equip secondary | Equiping secondary weapon
/delay 3 | Placing a delay here so it does not look humanily imposible to switch out so fast.
/click left inv 7 | Grabbing primary weapon from this slot
/click left equip primary | Equiping Primary weapon
/if $invpanel==true /press g
/return

Sub Sing 
|   /echo "Attempting to sing $p0" 
   :StartSong 
   /varset SingStatus 0 
   /stop 
   /delay 1 
   /cast "$p0" 
   /varset SongTimer 35 
   :WaitSing 
      /doevents 
      /doevents MissedNote 
         /if n $SingStatus==SING_RESTART /goto :StartSong 
           /if n $SingStatus>SING_RESTART /return $SingStatus 
        /if n $SongTimer>0 /goto :WaitSing 
        /varset SongTimer 0 
/return SONG_FINISHED 


Sub Event_MissedNote 
   /stop    
   /delay 4 
   /varset SingStatus SING_RESTART 
/return 

Sub Event_Stunned 
   /varset SingStatus STUNED 
/return 

Sub Event_OutOfRange 
   /stop 
   /delay 4 
   /varset SingStatus SING_RESTART 
/return 



Sub Event_NoTarget 
   /stop 
/endm 

Sub Event_EXP 
   /stop 
   /delay 5 
   /stop 
/endm 

Sub Event_stunoff 
   /stop 
   /goto :SingLoop 
/endm 

Sub Event_LOADING 
/endm 


This one will not switch out weapons for instrument but will twist the songs.

Code: Select all


| - bardtwist.mac - Used for group healing and mana regen.
| Twists the bard songs and watches for a missed note, if the note is 
| missed restarts that song. 
| By PussyFoot 
| Modified to Do Fufil's Chant, Tuyens chant of flame and Frost 


#event MissedNote "You miss a note, bringing your song to a close!"
| #event MobDead "You gain experience"
#event Loading "LOADING"
#event Stunned "You cannot cast while stunned"
| #event OutOfRange "Your target is out of range, get closer!"

| #event NoTarget "You must first select a target for this spell"
#event EXP "You gain experience!!"
#event LOADING "LOADING"
#event stunoff "You are unstunned"

#define SingStatus v59
#define SONG_UNKOWN 
#define SING_RESTART 2
#define OUT_OF_RANGE 3
#define STUNED 4
#define SONG_FINISHED 8
#define SongTimer t7

Sub Main

/if n $equip(primary,value)==true /call instrument

:SingLoop
/Call Sing "Cantata of Soothing"
/stop
/delay 0
/call Sing "Cassindra`s Chorus of Clarity"
/stop
|/delay 2
|/call Sing "Hymn of Restoration"
|/stop
/delay 2
/goto :SingLoop


Sub instrument

/if $invpanel==false /press g
/click left equip Primary | removing primary weapon
/click left inv 7 | Primary weapon will be placed here
/click left inv 3 | Grabbing Instrument in this slot
/delay 3 | Placing a delay here so it does not look humanily imposible to switch out so fast.
/click left equip secondary | Place instrument in secondary slot and removing secondar weapon.
/click left inv 3 | Place secondary weapon in this slot
/if $invpanel==true /press g
/return

Sub Sing 
|   /echo "Attempting to sing $p0" 
   :StartSong 
   /varset SingStatus 0 
   /stop 
   /delay 1 
   /cast "$p0" 
   /varset SongTimer 35 
   :WaitSing 
      /doevents 
      /doevents MissedNote 
         /if n $SingStatus==SING_RESTART /goto :StartSong 
           /if n $SingStatus>SING_RESTART /return $SingStatus 
        /if n $SongTimer>0 /goto :WaitSing 
        /varset SongTimer 0 
/return SONG_FINISHED 


Sub Event_MissedNote 
   /stop    
   /delay 4 
   /varset SingStatus SING_RESTART 
/return 

Sub Event_Stunned 
   /varset SingStatus STUNED 
/return 

Sub Event_OutOfRange 
   /stop 
   /delay 4 
   /varset SingStatus SING_RESTART 
/return 



|Sub Event_NoTarget 
|   /stop 
|/endm 

|Sub Event_EXP 
|   /stop 
|   /delay 5 
|   /stop
|/endm 

Sub Event_stunoff 
   /stop 
   /goto :SingLoop 
/endm 

Sub Event_LOADING 
/endm 

Any help would be appreciated.