|--------------------------------------------------------------------
|omm.inc
| Code to process and respond to OMM gazes to auto click
| Mirrod Mask
|
| Click code borrowed from
| Rogue Helper (RH) Macro
| - v6.0 by Jerle (10/26/04)
|
|Date: 05/23/2005 by Loonies
|--------------------------------------------------------------------
#Event GazeYou "#*#gaze of deadly power focusing on you#*#"
Sub Event_GazeYou
/varset lastevent Event_GazeYou
/declare gyspellname string local
/declare camefrom local
/declare clickyID int local
/declare wornat int local
/declare previousID local
|- skip all checks if not even in Anguish
/if (${Zone.ShortName.NotEqual[Anguish]}) /return
|- get spell buff name looking for
/varset gyspellname ${FindItem[Mirrored Mask].Spell}
|- spell name = NULL if person doesnt even have a Mask
/if (${gyspellname.Equal[NULL]}) {
/say Look at me, I'm a BOZO fighting OMM without a mask!
/return
}
|- repeat all following code waiting to see if spell lands after spell
|- attempt to click
:recast
/if (${Me.Casting.ID}) {
/delay 1
/goto :recast
}
|- do we have buff on, if so, can't reclick and we are done
/if (${gyspellname.Equal[${Me.Buff[${gyspellname}]}]}) /return
|- Is it in a Bag? i
/echo ** Attempting to use: Mirrored Mask from bag
/if (${FindItem[Mirrored Mask].InvSlot.Pack}) {
:OpenPack
/if (!${Window[${FindItem[Mirrored Mask].InvSlot.Pack.Name}].Open}) {
/itemnotify ${FindItem[Mirrored Mask].InvSlot.Pack.Name} rightmouseup
/delay 2
/goto :OpenPack
}
/varset camefrom ${FindItem[Mirrored Mask].InvSlot}
:GrabItem
/if (!${Cursor.ID}) {
/itemnotify ${InvSlot[${camefrom}]} leftmouseup
/delay 2
/goto :GrabItem
}
/varset clickyID ${Cursor.ID}
/varset wornat ${Cursor.WornSlot[1]}
:SwapFirst
/if (${Cursor.ID}==${clickyID}) {
/itemnotify ${InvSlot[${wornat}]} leftmouseup
/delay 2
/goto :SwapFirst
}
|- Click it
/delay 2
/echo ** Clicking: Mirrored Mask
/varset previousID ${Cursor.ID}
/itemnotify ${InvSlot[${wornat}]} rightmouseup
:SwapAgain
/if (${Cursor.ID}==${previousID}) {
/itemnotify ${InvSlot[${wornat}]} leftmouseup
/delay 2
/goto :SwapAgain
}
|- Put it back
:PutItBack
/if (${Cursor.ID}==${clickyID}) {
/itemnotify ${InvSlot[${camefrom}]} leftmouseup
/delay 2
/goto :PutItBack
}
:SummonedCheck
/if (${Cursor.ID}) {
|- Something was summoned
/autoinv
/delay 2
/goto :SummonedCheck
}
:ClosePack
/if (${Window[${InvSlot[${camefrom}].Pack.Name}].Open}) {
/itemnotify ${InvSlot[${camefrom}].Pack.Name} rightmouseup
/delay 2
/goto :ClosePack
}
} else {
|- Just click it
/if (${FindItem[Mirrored Mask].InvSlot}) {
/echo ** Clicking: Mirrored Mask already worn
/itemnotify ${FindItem[Mirrored Mask].InvSlot} rightmouseup
/delay 2
} else {
|- shouldn't ever get here
/return
}
}
|- now wait for item to be cast and see if buff landed, in case
|- of interrupts, or such, this buff must cast until land even if
|- your tanking OMM, these checks are all at top of sub
/goto :recast
/return