Updated the venerable muffin turnin macro for Pandos. It ends on faction max or when you are out of muffins.
Rich (BB code):
#turbo 120
#Event NullSlot "#*#Invalid item slot 'null#*#"
#Event Finished "#1#could not possibly get any better."
Sub Main
/declare ItemToHandIn string outer Muffin
/declare TurnInTarget string outer Pandos
/declare NullExit int outer 0
/declare ItemID int outer 13014
:MainLoop
:ZoneLoop
/doevents
/call SafeTarget ${TurnInTarget}
/call TurnIn
/call ClearCursor
/if (${FindItemCount[${ItemToHandIn}]}>0) {
/goto :ZoneLoop
} else {
/end
}
/return
/goto :MainLoop
/return
Sub ClearCursor
:redetroy
/if (${Cursor.ID} && ${Cursor.NoDrop}==FALSE) {
/destroy
/delay 1
/goto :redetroy
}
/return
Sub SafeTarget(string targ)
/declare targid int local 0
:retarget
/if (${Target.ID} && ${Target.ID}==${Spawn[${targ}].ID}) /return
/if (${Spawn[${targ}].ID}) {
/varset targid ${Spawn[${targ}].ID}
/if (${Spawn[${targ}].Distance}<100) {
/echo Targeting ${Spawn[${targ}]}
/target id ${targid}
/delay 30 ${Target.ID}==${targid}
}
}
/if (!${Target.ID}) {
/echo [SafeTarget] couldnt find a target, retrying
/delay 1s
/goto :retarget
}
/return
Sub TurnIn
/declare muffintimer timer local 0
/declare i int local
/for i 0 to 3
/if (${FindItemCount[${ItemToHandIn}]}>0) {
:GetMuffin
/varset muffintimer 3s
/itemnotify "${ItemToHandIn}" leftmouseup
:waitformuffin
/if (${Cursor.ID}!=${ItemID}) {
/if (${muffintimer}==0) {
/goto :GetMuffin
}
/goto :waitformuffin
}
:retrytrade
/varset muffintimer 3s
/click left target
:waitfortrade
/if (${Window[GiveWnd].Child[GVW_MyItemSlot${i}].Tooltip.NotEqual[${ItemToHandIn}]}) {
/goto :waitfortrade
}
/if (${Cursor.ID} && ${Cursor.ID}==${ItemID}) {
/if (${muffintimer}==0) {
/goto :retrytrade
}
/goto :waitfortrade
}
}
/next i
:NullFix
/if (${Window[GiveWnd].Open}) /notify GiveWnd GVW_Give_Button leftmouseup
/delay 200 !${Window[GiveWnd].Open}
/return
Sub CursorCheck(int CursorLoop)
/declare i int local
/for i 1 to ${CursorLoop}
/if (${Cursor.ID} && ${Cursor.ID}!=${ItemID}) {
/echo Destroy ${i}. ${Cursor.Name}
/destroy
}
/next i
/return
Sub Event_NullSlot
/varset NullExit 1
/echo Opening all bags to correct null slot
/keypress OPEN_INV_BAGS
/timed 100 /keypress CLOSE_INV_BAGS
/return
Sub Event_Finished
/endmacro
/return

