Posted: Sat Sep 23, 2006 9:33 pm
same results JJ. casts then just leaves things where they are with out putting them back.
Need to talk about MacroQuest to other MacroQuest users?
https://mq64.org/phpBB3/
Code: Select all
[color=red]Unparsable in Calculation: 'B'[/color]
swapcast.mac@67 (CastItem(Slot)): /delay 3s ${Me.Casting}
swapcast.mac@53 (SwapCast(item,equipslot)): /call CastItem ${equipslot}
swapcast.mac@2 (Main(p0,p1)): /call SwapCast "${p0}" "{p1}"
The current macro has ended.
[color=red]Failed to parse /delay condition 'Bramblecoat'. non-numeric encountered[/color]Code: Select all
/delay 3s ${Me.Casting.ID}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 Waiting 3seconds for server or untill I start to cast
/delay 1s ${Me.Casting.ID}
/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}) /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
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}>261 && ${inventoryslot}<342) {
/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}-251]}
/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 Waiting 3seconds for server or untill I start to cast
/delay 1s ${Me.Casting.ID}
/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}) /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
Code: Select all
Sub Main(p0,p1)
/call SwapCast "${p0}" "${p1}"
/endmacro
Sub SwapCast(loot,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[loot]}) /goto :end
/if (${Twist}) {
/twist stop
/varset leavetwisting 1
}
:stopsingingdelay
/if (${Me.Casting.ID}>0) {
/stopsong
/goto :stopsingingdelay
}
/varset inventoryslot ${FindItem[${loot}].InvSlot}
/if (!${inventoryslot}) /goto :notfound
:packcountloop
/if (${inventoryslot}>261 && ${inventoryslot}<342) {
/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}-251]}
/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 ${loot} not found in inventory.
:end
/if (${leavetwisting} == 1) /twist start
/return
Sub CastItem(slot)
/nomod /itemnotify ${slot} rightmouseup
/echo Waiting 3seconds for server or untill I start to cast
/delay 1s ${Me.Casting.ID}
/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}) /goto :castloop
/return
Sub WaitCursor(slot, pack)
/declare loot local
/declare timeout timer 30
/varset loot ${Cursor.ID}
/if (${Defined[pack]}) /goto :waitloop2
:waitloop1
/nomod /itemnotify ${slot} leftmouseup
/if ((${loot} == ${Cursor.ID}) && (${timeout} > 0)) /goto :waitloop1
/goto :donewaiting
:waitloop2
/nomod /itemnotify in ${pack} ${slot} leftmouseup
/if ((${loot} == ${Cursor.ID}) && (${timeout} > 0)) /goto :waitloop2
:donewaiting
/return
I recommend you try "spell_routines.inc", it's current and works well for both spells and clickies. You'll probably want to also get bagwindow etc.Mangilagat wrote:Anyone have an updated macro for this? It doesn't work atm -- doesn't swap items, just tries to cast them from inventory.