As requested by  klipche
Let me know if any issues.
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
					
					
	
					
					
	
	
	
					
				Let me know if any issues.
			
				Rich (BB code):
			
		
		
		| turnin.mac - Sym 9.3.2017 exclusively for RedGuides.com
|
| Gives selected item on cursor to targeted npc
| Usage: /mac turnin [count]
|
| count is optional, default is 4
| 
| Start macro with item to give on cursor and npc targeted.
|
| This macro will give one of each item to npc until count items have been given, then it will click the give button.
|   It will loop until there are no more items to give.
|
Sub Main
    /declare GiveCount int outer 4
    
    /if (${Defined[Param0]}) /varset GiveCount ${Param0}
    
    /declare a int 0
    /declare ItemToGive ${Cursor.Name}
    
    /if (!${Target.ID}) {
        /echo \arStart macro with NPC targeted.
        /endm
    }
    /if (!${Cursor.ID}) {
        /echo \arStart macro with turn in item on cursor.
        /endm
    }
    
    /if (${GiveCount} > 4) /varset GiveCount 4
    /autoinv
    /delay 1s !${Cursor.ID}
    /while (${FindItemCount[=${ItemToGive}]}) {
        /for a 1 to ${GiveCount}
            /nomodkey /ctrlkey /itemnotify ${FindItem[=${ItemToGive}].InvSlot} leftmouseup
            /delay 1s ${Cursor.ID}
            /if (${Cursor.ID}) {
                /click left target
                /delay 1s !${Cursor.ID}
            }
        /next a
        
        /notify GiveWnd GVW_Give_Button leftmouseup
        /delay 10s !${Window[GiveWnd].Open}
    }    
    /if (${Window[GiveWnd].Open}) {
        /notify GiveWnd GVW_Give_Button leftmouseup
    }
    
/return
	
				
