Moderator: MacroQuest Developers
Code: Select all
/alias /shrink /mac swap orbCode: Select all
/shrinkCode: Select all
/if (${String[${equipslot}].Find[null]}) { Code: Select all
/if (!${equipslot}) { 




Code: Select all
Sub Main(p0,p1)
/call SwapCast "${p0}" "${p1}"
/endmacro
Sub SwapCast(item,equipslot)
/declare inventoryslot int local
/declare pack local
/declare packslot int local
/declare leaveopen int local 1
/declare packnumber int local 0
/declare leavetwisting int local 0
/if (!${Defined[item]}) /goto :end
/if (${Twist}) {
/twist stop
/varset leavetwisting 1
}
:stopsingingdelay
/if (${Me.Casting.ID}>0) {
/stopsong
/goto :stopsingingdelay
}
/varset inventoryslot ${FindItem[${item}].InvSlot}
/if (!${inventoryslot}) /goto :notfound
:packcountloop
/if (${inventoryslot}>250 && ${inventoryslot}<331) {
/varset packnumber ${Math.Calc[${packnumber}+1]}
/varset inventoryslot ${Math.Calc[${inventoryslot}-10]}
/goto :packcountloop
}
/if (${packnumber} > 0) {
/varset pack pack${packnumber}
/varset packslot ${Math.Calc[${inventoryslot}-240]}
/goto :foundit
}
:notinpack
/call CastItem ${inventoryslot}
/goto :end
:foundit
/if (!${Window[${pack}].Open}) {
/nomod /itemnotify ${pack} rightmouseup
/varset leaveopen 0
}
/call WaitCursor ${packslot} ${pack}
/if (${equipslot.Find[null]}) {
/if (${Cursor.WornSlots}>0) {
/varset equipslot ${Cursor.WornSlot[1]}
} else {
/varset equipslot pack1
}
}
/call WaitCursor ${equipslot}
/call CastItem ${equipslot}
/call WaitCursor ${equipslot}
/call WaitCursor ${packslot} ${pack}
/if (${leaveopen} == 0) /nomod /itemnotify ${pack} rightmouseup
/goto :end
:notfound
/echo ${item} not found in inventory.
:end
/if (${leavetwisting} == 1) /twist start
/return
Sub CastItem(slot)
/nomod /itemnotify ${slot} rightmouseup
/echo Swapcast::Casting the effect on your ${InvSlot[${slot}].Item.Name}
:castloop
|| special case composer greaves don't ever stop casting
/if (${InvSlot[${slot}].Item.Name.Find["Composers Greaves"]}) {
/delay 12
/stopsong
}
|| special cases for epics and other items that don't seem to cast proper with default cast times
/if (${InvSlot[${slot}].Item.Name.Find["Blade of Vesagran"]}) {
/delay 10
/stopsong
}
/if (${InvSlot[${slot}].Item.Name.Find["Prismatic Dragon Blade"]}) {
/delay 10
/stopsong
}
/if (${Me.Casting.ID}>0) /goto :castloop
/return
Sub WaitCursor(slot, pack)
/declare item local
/declare timeout timer 30
/varset item ${Cursor.ID}
/if (${Defined[pack]}) /goto :waitloop2
:waitloop1
/nomod /itemnotify ${slot} leftmouseup
/if ((${item} == ${Cursor.ID}) && (${timeout} > 0)) /goto :waitloop1
/goto :donewaiting
:waitloop2
/nomod /itemnotify in ${pack} ${slot} leftmouseup
/if ((${item} == ${Cursor.ID}) && (${timeout} > 0)) /goto :waitloop2
:donewaiting
/returnCode: Select all
:castloop
/delay 5s ${Me.Casting}

Code: Select all
Sub Main(p0,p1)
/call SwapCast "${p0}" "${p1}"
/endmacro
Sub SwapCast(item,equipslot)
/declare inventoryslot int local
/declare pack local
/declare packslot int local
/declare leaveopen int local 1
/declare packnumber int local 0
/declare leavetwisting int local 0
/if (!${Defined[item]}) /goto :end
/if (${Twist}) {
/twist stop
/varset leavetwisting 1
}
:stopsingingdelay
/if (${Me.Casting.ID}>0) {
/stopsong
/goto :stopsingingdelay
}
/varset inventoryslot ${FindItem[${item}].InvSlot}
/if (!${inventoryslot}) /goto :notfound
:packcountloop
/if (${inventoryslot}>250 && ${inventoryslot}<331) {
/varset packnumber ${Math.Calc[${packnumber}+1]}
/varset inventoryslot ${Math.Calc[${inventoryslot}-10]}
/goto :packcountloop
}
/if (${packnumber} > 0) {
/varset pack pack${packnumber}
/varset packslot ${Math.Calc[${inventoryslot}-240]}
/goto :foundit
}
:notinpack
/call CastItem ${inventoryslot}
/goto :end
:foundit
/if (!${Window[${pack}].Open}) {
/nomod /itemnotify ${pack} rightmouseup
/varset leaveopen 0
}
/call WaitCursor ${packslot} ${pack}
/if (${equipslot.Find[null]}) {
/if (${Cursor.WornSlots}>0) {
/varset equipslot ${Cursor.WornSlot[1]}
} else {
/varset equipslot pack1
}
}
/call WaitCursor ${equipslot}
/call CastItem ${equipslot}
/call WaitCursor ${equipslot}
/call WaitCursor ${packslot} ${pack}
/if (${leaveopen} == 0) /nomod /itemnotify ${pack} rightmouseup
/goto :end
:notfound
/echo ${item} not found in inventory.
:end
/if (${leavetwisting} == 1) /twist start
/return
Sub CastItem(slot)
/nomod /itemnotify ${slot} rightmouseup
[color=red] /echo Waiting 3seconds for server or untill I start to cast
/delay 3s ${Me.Casting.ID}[/color]
/echo Swapcast::Casting the effect on your ${InvSlot[${slot}].Item.Name}
:castloop
|| special case composer greaves don't ever stop casting
/if (${InvSlot[${slot}].Item.Name.Find["Composers Greaves"]}) {
/delay 12
/stopsong
}
|| special cases for epics and other items that don't seem to cast proper with default cast times
/if (${InvSlot[${slot}].Item.Name.Find["Blade of Vesagran"]}) {
/delay 10
/stopsong
}
/if (${InvSlot[${slot}].Item.Name.Find["Prismatic Dragon Blade"]}) {
/delay 10
/stopsong
}
[color=red]/if (${Me.Casting.ID})[/color] /goto :castloop
/return
Sub WaitCursor(slot, pack)
/declare item local
/declare timeout timer 30
/varset item ${Cursor.ID}
/if (${Defined[pack]}) /goto :waitloop2
:waitloop1
/nomod /itemnotify ${slot} leftmouseup
/if ((${item} == ${Cursor.ID}) && (${timeout} > 0)) /goto :waitloop1
/goto :donewaiting
:waitloop2
/nomod /itemnotify in ${pack} ${slot} leftmouseup
/if ((${item} == ${Cursor.ID}) && (${timeout} > 0)) /goto :waitloop2
:donewaiting
/return