Page 1 of 2

Handin.mac

Posted: Fri Jun 11, 2004 3:42 pm
by kagonis
Here is the converted handin.mac, thanks to various people on helping converting it :)

Code: Select all

| handin.mac
|
| Author(s):
| - Kagonis
| - Corrections and suggestions by various people..
|   SukMage
|   DKAA
|   Wassup
|   WaBBiT
|
| Description:
| - Used to make handins to NPCs, nifty for those who
|    doesn't feel like getting carpal tunnel syndrome to
|    complete a quest that requires a lot of hand ins.
|
| Usage:
| - /macro handin.mac <pp|gp|sp|cp|"Item Name"> <amount> ["destroy"]
|    The you must type "destroy" for the macro to destroy items returned.
|
| Example:
| - /macro handin.mac "Batwing" 4 "destroy"
|    Will hand in 4 Batwing's and destroy the item(s) returned from the NPC.


Sub Main(string TheItem, int TheAmount, string DoDestroy)

    /declare Loopcount int local
    /declare Timeout timer local

    :GiveItem
        /if (!${Defined[TheItem]} || !${Defined[TheAmount]}) /call Syntax
        /for Loopcount 1 to ${TheAmount}
            /if (${TheItem.Equal[pp]}) {
                /ctrl /notify InventoryWindow IW_Money0 leftmouseup
            } else /if (${TheItem.Equal[gp]}) {
                /ctrl /notify InventoryWindow IW_Money1 leftmouseup
            } else /if (${TheItem.Equal[sp]}) {
                /ctrl /notify InventoryWindow IW_Money2 leftmouseup
            } else /if (${TheItem.Equal[cp]}) {
                /ctrl /notify InventoryWindow IW_Money3 leftmouseup
            } else {
                /ctrl /itemnotify ${FindItem[${TheItem}].InvSlot} leftmouseup
            }

            :WaitForItem
            /varset Timeout 5s
            /if (!${Cursor.ID}) {
                /if (!${Timeout.Value}) /goto :Done
                /delay 0
                /goto :WaitForItem
            }
            /click left target

            :Wait
            /varset Timeout 10s
            /if (${Cursor.ID}) {
                /if (!${Timeout.Value}) /goto :Done
                /delay 0
                /goto :Wait
            }
        /next Loopcount
        /notify GiveWnd GVW_Give_Button leftmouseup
        /delay 5

        :ClearCursor
        /if (${Cursor.ID}) {
            /if (${Defined[DoDestroy]} && ${DoDestroy.Equal[destroy]}) {
                /destroy
            } else {
                /autoinv
            }
            /delay 0
            /goto :ClearCursor
        }
    /goto :GiveItem
    :Done
        /endmacro
/return

Sub Syntax
    /echo Syntax: /macro handin <pp|gp|sp|cp|"Item Name"> <#> [destroy]
    /echo ..
    /echo Example: /macro handin gp 2 destroy
    /echo Will hand in 2 pieces of gold to the targeted NPC and then click give, and will destroy anything you get back on your cursor.
    /echo ..
    /echo Example: /macro handin "Batwing" 4
    /echo Will hand in 4 batwings to the targeted NPC and then click give, and will keep anything you get back on your cursor.
    /endmacro
/return
Edit: Fixed an error with hitting the "Give button", thanks to WaBBiT.

Posted: Mon Jun 14, 2004 7:20 am
by WaBBiT
An error occurs here and it keeps handing more stackable stuff to the NPC without pressing Give button

Code: Select all

/click left npctrade give 
needs to be

Code: Select all

/notify GiveWnd GVW_Give_Button leftmouseup
Happy Turnins :D

Posted: Mon Jun 14, 2004 9:08 am
by wolf5
Any beneficial hand ins i should know of?

:D :D :D :D

-Wolf5

Posted: Mon Jun 14, 2004 11:59 am
by CuddleBunny
Casino Tokens , Cabilis BoneChips hand in for faction, whatever. :roll:

Posted: Mon Jun 14, 2004 2:40 pm
by Semper-Fi
a good hand in is bandages in misty thicket to the halfling who burned his hands, honeybugger the male on the round dome building. With 20 stacks of bandages you go from ready to attack to indifferently in rivervale!

Happy hunting evildoers!

Posted: Mon Jun 14, 2004 7:35 pm
by TheWarden
Lol, i quit EQ for the night, but now I'm gonna go hand in some bandages...

[edit] The macro just gives 4 of the stacked items into his first slot over and over for me. Also, doesn't destroy items for me...

/mac handin.mac "Bone Chips" 4 destroy
and
/mac handin.mac "Bone Chips" 4 "destroy"

Am i doing it wrong? Lol, i ended up just doing:
/mac handin.mac "Bone Chips" 1

the problem

Posted: Wed Jun 16, 2004 12:52 am
by macrolover
this mac isn't coded to put the items in any slot but the first. it would have to use.

Code: Select all

/notify GiveWnd GVW_MyItemSlot1 leftmouseup
/notify GiveWnd GVW_MyItemSlot2 leftmouseup
/notify GiveWnd GVW_MyItemSlot3 leftmouseup
/notify GiveWnd GVW_MyItemSlot4 leftmouseup
to put anything in the other slots

the problem

Posted: Wed Jun 16, 2004 12:52 am
by macrolover
this mac isn't coded to put the items in any slot but the first. it would have to use.

Code: Select all

/notify GiveWnd GVW_MyItemSlot1 leftmouseup
/notify GiveWnd GVW_MyItemSlot2 leftmouseup
/notify GiveWnd GVW_MyItemSlot3 leftmouseup
/notify GiveWnd GVW_MyItemSlot4 leftmouseup
to put anything in the other slots

Posted: Wed Jun 16, 2004 8:49 am
by TheWarden
Aha, thank you :oops: hehe

<-------Newb :P

Posted: Wed Jun 16, 2004 4:29 pm
by SukMage
Can that just be pasted in? or does it need an /if statement? Will it not work if there is only 1 bandage going in to the window?

Posted: Fri Jun 18, 2004 2:32 am
by kagonis
Should be possible to change the macro in such a way that it will actually put the items in the slots/coinfields automatically dependant on coin or item..

This code is not tested, feel free to test and give feedback :)

Code: Select all

| handin.mac
|
| Author(s):
| - Kagonis
| - Corrections and suggestions by various people..
|   SukMage
|   DKAA
|   Wassup
|   WaBBiT
|
| Description:
| - Used to make handins to NPCs, nifty for those who
|    doesn't feel like getting carpal tunnel syndrome to
|    complete a quest that requires a lot of hand ins.
|
| Usage:
| - /macro handin.mac <pp|gp|sp|cp|"Item Name"> <amount> ["destroy"]
|    The you must type "destroy" for the macro to destroy items returned.
|
| Example:
| - /macro handin.mac "Batwing" 4 "destroy"
|    Will hand in 4 Batwing's and destroy the item(s) returned from the NPC.


Sub Main(string TheItem, int TheAmount, string DoDestroy)

    /declare Loopcount int local
    /declare Timeout timer local
    /declare Itemtype string local

    :GiveItem
        /if (!${Defined[TheItem]} || !${Defined[TheAmount]}) /call Syntax
        /for Loopcount 1 to ${TheAmount}
            /if (${TheItem.Equal[pp]}) {
                /ctrl /notify InventoryWindow IW_Money0 leftmouseup
                /varset Itemtype "coin"
            } else /if (${TheItem.Equal[gp]}) {
                /ctrl /notify InventoryWindow IW_Money1 leftmouseup
                /varset Itemtype "coin"
            } else /if (${TheItem.Equal[sp]}) {
                /ctrl /notify InventoryWindow IW_Money2 leftmouseup
                /varset Itemtype "coin"
            } else /if (${TheItem.Equal[cp]}) {
                /ctrl /notify InventoryWindow IW_Money3 leftmouseup
                /varset Itemtype "coin"
            } else {
                /ctrl /itemnotify ${FindItem[${TheItem}].InvSlot} leftmouseup
                /varset Itemtype "item"
            }

            :WaitForItem
            /varset Timeout 5s
            /if (!${Cursor.ID}) {
                /if (!${Timeout.Value}) /goto :Done
                /delay 0
                /goto :WaitForItem
            }

            /if (${Loopcount.Value} == 1 || ${Itemtype.Equal[coin]}) {
                /click left target
            } else {
                /if (${Itemtype.Equal[item]}) {
                    /notify GiveWnd GVW_MyItemSlot${Loopcount.Value} leftmouseup
                }
            }

            :Wait
            /varset Timeout 10s
            /if (${Cursor.ID}) {
                /if (!${Timeout.Value}) /goto :Done
                /delay 0
                /goto :Wait
            }
        /next Loopcount
        /notify GiveWnd GVW_Give_Button leftmouseup
        /delay 5

        :ClearCursor
        /if (${Cursor.ID}) {
            /if (${Defined[DoDestroy]} && ${DoDestroy.Equal[destroy]}) {
                /destroy
            } else {
                /autoinv
            }
            /delay 0
            /goto :ClearCursor
        }
    /goto :GiveItem
    :Done
        /endmacro
/return

Sub Syntax
    /echo Syntax: /macro handin <pp|gp|sp|cp|"Item Name"> <#> [destroy]
    /echo ..
    /echo Example: /macro handin gp 2 destroy
    /echo Will hand in 2 pieces of gold to the targeted NPC and then click give, and will destroy anything you get back on your cursor.
    /echo ..
    /echo Example: /macro handin "Batwing" 4
    /echo Will hand in 4 batwings to the targeted NPC and then click give, and will keep anything you get back on your cursor.
    /endmacro
/return

Posted: Fri Jun 25, 2004 1:38 pm
by leptoid
could this be used in qeynos to hand in 2gp at a time to an npc for faction? (yes, there's a specific npc for this) I'd rather not manually hand him 2000gp 2 gp at a time manually.

Posted: Fri Jun 25, 2004 6:21 pm
by TheWarden
Yes, target that stupid pally(I hate him so much, Lol, he shouts too much) and type:

/macro handin gp 2

Posted: Tue Jul 06, 2004 3:59 pm
by WhiteWolf
ok, ive been working on this, but ive hit a few snags.
first, Loopcount.Value does not work. Loopcount does, somewhat.

ok, been toying around some more, and /next Loopcount is working, but now its just picking the item up and holding it on the cursor. if i manually drop it, it picks another one up and holds it again. it continues as such until i drop the 4th, then it clicks give, and starts over, dropping the first one and holding the second.

still playing around with it, trying to figure this portion out.

Posted: Sun Jul 25, 2004 4:40 pm
by Epsilon
i have been using this macro for the casino and it happens very often that he hands in 2 tokens stacked..no wonder why i burned money so fast

how can i fix this?