SummonItem.mac v2.0

HardOne

Rawk On!
Joined
Sep 27, 2008
Messages
344
Reaction score
1
Points
0
Someone had asked a little while back about a macro to repeatedly click an item, which gave me the idea to make a macro for summoning things from an item.

This macro makes it easy!

To use it:
Code:
/mac SummonItem "[COLOR=Magenta]In-Game Item Link[/COLOR]" Quantity

The "Item Link" must be wrapped in quotes.


This may not work with the Packed Picnic Basket as that item can summon more than one thing, and I do not have one to test it on.

I've tested it with the Warm Milk Dispenser, and Mysterious Belt of Daggers.

Thanks to PeteSampras for the help with the Item Spell information.


Give it a try and let me know what everyone thinks.

Code:
|#################################################################################################|
|#################################################################################################|
|## SummonItem.mac	v2.1																		##|
|##    By HardOne																				##|
|## Useage:	/mac SummonItem "In-Game Item Link" Quantity												##|
|##																								##|
|##			ItemLink:	This is the "In-Game Item Link" for the item you wish to click and summon from.	##|
|##						This needs to be wrapped in quotes.										##|
|##																								##|
|##			Quantity:	This is the quantity you wish to summon.								##|
|#################################################################################################|
|#################################################################################################|

#turbo 80

Sub Main
/if (!${Param0.Length} || !${Param1.Length}) {
	/echo You must start the macro including the "Item Link" and the Quantity to summon
	/echo i.e.:
	/echo /mac SummonItem "In-Game Item Link" 20
	/echo The "In-Game Item Link" must have quotes.
/end
}

/declare ItemToClick	string	outer	${Param0}
/varset ItemToClick ${ItemToClick.Right[-57]}
/varset ItemToClick ${ItemToClick.Left[-1]}

/declare NumberToSummon	int		outer	${Param1}

/if (${FindItemCount[${Spell[${FindItem[${ItemToClick}].Spell.ID}].Base[1]}]} >= ${NumberToSummon}) {
	/echo You have a total of ${FindItemCount[${Spell[${FindItem[${ItemToClick}].Spell.ID}].Base[1]}]} ${FindItem[${Spell[${FindItem[${ItemToClick}].Spell.ID}].Base[1]}].Name}'s on you already!
	/echo Select a higher Quantity to summon more.
	/end
}

/echo SummonItem.mac is running
|${FindItem[${Spell[${FindItem[${ItemToClick}].Spell.ID}].Base[1]}].Name}'s
/echo Summoning ${NumberToSummon} items, using the ${ItemToClick}

:loop
/if (${FindItemCount[${ItemToClick}]} && !${FindItem[${ItemToClick}].Timer}) {
	/itemnotify ${FindItem[${ItemToClick}].InvSlot} rightmouseup
	/delay ${Math.Calc[${FindItem[${ItemToClick}].CastTime}+1]}s
}
/if (${Cursor.ID}) /autoinv
/if (${FindItemCount[${Spell[${FindItem[${ItemToClick}].Spell.ID}].Base[1]}]} >= ${NumberToSummon}) {
	/echo ${FindItem[${Spell[${FindItem[${ItemToClick}].Spell.ID}].Base[1]}].Name} Summoning Complete!
	/echo We have a total of ${FindItemCount[${Spell[${FindItem[${ItemToClick}].Spell.ID}].Base[1]}]} ${FindItem[${Spell[${FindItem[${ItemToClick}].Spell.ID}].Base[1]}].Name}'s
	/end
}
/goto :loop
/return
 
Last edited:
Great idea for a macro, thanks for posting up, if I ever get one of those belts for my ranger I'll give it a shot!
 
There is only one issue I know of right now.

When the macro starts it tells you that it's summoning X number of Y from Z. For some reason if you do not already have at least one Y on you, it says NULL instead. This is just a function of the way the code determines what the item it your summoning. I don't know how to fix it yet....

Glad to see someone might get some use out of it.
 
You could make this into an include and add an alias. i may have to steal your idea at a later date! Use an ini (or downshit if you dont want to have a macro running) to keep a set number of items on your based on item/spell. i had been thinking of the best ways to do this and as a single mac, this seems to be perfect for summoning items. nicely done.
 
Good evening, im trying to get this macro to run. I start it using

/mac summonitem "Warm Milk Dispenser" 20

Nothing happens. I get two the below 2 lines but nothing else

Summonitem.mac is running
summoning 20 NULL's, using the
 
Item links changed from -51 to -56. See highlighted area to fix.

Code:
|#################################################################################################|
|#################################################################################################|
|## SummonItem.mac    v2.0                                                                        ##|
|##    By HardOne                                                                                ##|
|## Useage:    /mac SummonItem "Item Link" Quantity                                                ##|
|##                                                                                                ##|
|##            ItemLink:    This is the "Item Link" for the item you wish to click and summon from.    ##|
|##                        This needs to be wrapped in quotes.                                        ##|
|##                                                                                                ##|
|##            Quantity:    This is the quantity you wish to summon.                                ##|
|#################################################################################################|
|#################################################################################################|

#turbo 80

Sub Main
/if (!${Param0.Length} || !${Param1.Length}) {
    /echo You must start the macro including the "Item Link" and the Quantity to summon
    /echo i.e.:
    /echo /mac SummonItem "Item Link" 20
    /echo The "Item Link" must have quotes.
/end
}

/declare ItemToClick    string    outer    ${Param0}
/varset ItemToClick ${ItemToClick.Right[[COLOR=Yellow]-56[/COLOR]]}
/varset ItemToClick ${ItemToClick.Left[-1]}

/declare NumberToSummon    int        outer    ${Param1}

/if (${FindItemCount[${Spell[${FindItem[${ItemToClick}].Spell.ID}].Base[1]}]} >= ${NumberToSummon}) {
    /echo You have a total of ${FindItemCount[${Spell[${FindItem[${ItemToClick}].Spell.ID}].Base[1]}]} ${FindItem[${Spell[${FindItem[${ItemToClick}].Spell.ID}].Base[1]}].Name}'s on you already!
    /echo Select a higher Quantity to summon more.
    /end
}

/echo SummonItem.mac is running
/echo Summoning ${NumberToSummon} ${FindItem[${Spell[${FindItem[${ItemToClick}].Spell.ID}].Base[1]}].Name}'s, using the ${ItemToClick}

:loop
/if (${FindItemCount[${ItemToClick}]} && !${FindItem[${ItemToClick}].Timer}) {
    /itemnotify ${FindItem[${ItemToClick}].InvSlot} rightmouseup
    /delay ${Math.Calc[${FindItem[${ItemToClick}].CastTime}+1]}s
}
/if (${Cursor.ID}) /autoinv
/if (${FindItemCount[${Spell[${FindItem[${ItemToClick}].Spell.ID}].Base[1]}]} >= ${NumberToSummon}) {
    /echo ${FindItem[${Spell[${FindItem[${ItemToClick}].Spell.ID}].Base[1]}].Name} Summoning Complete!
    /echo We have a total of ${FindItemCount[${Spell[${FindItem[${ItemToClick}].Spell.ID}].Base[1]}]} ${FindItem[${Spell[${FindItem[${ItemToClick}].Spell.ID}].Base[1]}].Name}'s
    /end
}
/goto :loop
/return
Thanks for reminding me about this mac. stealing it now for bot.mac.
 
I copied and used the changed code, but I end up with the same results. It doesnt summon anything. I've tried a couple of things and no luck. While it doesnt summon anything, if i manually summon it will auto inventory it.
 
Last edited:
I updated the first post to include the -56 (I just plain forgot to update the one here, my personal copy was already fixed.)

This should work, be sure you are using the item link, and that the item link is in quotations: /mac SummonItem "Item Link" Quantity
 
I have the milk dispenser in an open inventory slot, I then run the command

/mac summonitem "Warm Milk Dispenser" 20

and nothing happens
 
/mac summonitem "Warm Milk Dispenser" 20

The actual in game link of the item. PEBKAC
 
lolz. it does happen from time to time! in fairness, he never technically said that it was the in game actual pink link. just that it was the item link. somewhat vague if you havent seen people referencing it that way.
 
HardOne,
I turned this idea into an include scenario with an alias, though i added it directly to my bot mac instead of as an include. I havent had feedback on it working yet, but once i do I will edit this to be that finalized version.

In your include you would have to:

#Define MyIni name_of_ini.ini

And somewhere in the mac:
/call Summon

Code:
#event SummonItem "#*#SummonItem #0#"

Sub Event_SummonItem(string SummonItems)
/if (!${Defined[SummonLoaded]}) /call SummonLoad
/declare x string local
/if (${Cursor.ID}) /autoinv

            /varset x ${SummonItems.Arg[1,|]}
            /varset x ${x.Right[-56]}
            /varset x ${x.Left[-1]}
            /varcalc SummonTotal ${SummonTotal}+1
            /ini "MyIni" "Summon" "SummonSpellName${SummonTotal}" "${x}"
            /ini "MyIni" "Summon" "SummonSpellGem${SummonTotal}" "item"
            /ini "MyIni" "Summon" "SummonItemName${SummonTotal}" "${FindItem[${Spell[${FindItem[${x}].Spell.ID}].Base[1]}].Name}"
            /ini "MyIni" "Summon" "SummonItemCount${SummonTotal}" "${SummonItems.Arg[2,|]}"
            /ini "MyIni" "Summon" "SummonTotal" "${SummonTotal}"

            /declare SummonSpellName${SummonTotal} string outer ${Ini[MyIni,Summon,SummonSpellName${SummonTotal}]}
            /declare SummonSpellGem${SummonTotal} string outer ${Ini[MyIni,Summon,SummonSpellGem${SummonTotal}]}
            /declare SummonItemName${SummonTotal} string outer ${Ini[MyIni,Summon,SummonItemName${SummonTotal}]}
            /declare SummonItemCount${SummonTotal} int outer ${Ini[MyIni,Summon,SummonItemCount${SummonTotal}]}

            /echo ${SummonItemCount${SummonTotal}} x ${SummonItemName${SummonTotal}} will now be created using ${SummonSpellName${SummonTotal}} if total onhand drops to 0

/return


Sub SummonLoad
/if (!${Defined[SummonLoaded]}) /declare SummonLoaded int outer 1
/alias /summon /echo SummonItem
/declare SummonTotal int outer ${Ini[MyIni,Summon,SummonTotal]}
/if (!${SummonTotal}) /ini "MyIni" "Summon" "SummonTotal" "0"
/if (${SummonTotal}) {
    /declare i int local
        /for i 1 to ${SummonTotal} {
            /declare SummonSpellName${i} string outer ${Ini[MyIni,Summon,SummonSpellName${i}]}
            /declare SummonSpellGem${i} string outer ${Ini[MyIni,Summon,SummonSpellGem${i}]}
            /if (${Me.Book[${SummonSpellName${i}} Rk. III]}) /varset SummonSpellName${i} ${SummonSpellName${i}} Rk. III
            /if (${Me.Book[${SummonSpellName${i}} Rk. II]}) /varset SummonSpellName${i} ${SummonSpellName${i}} Rk. II
            /declare SummonItemName${i} string outer ${Ini[MyIni,Summon,SummonItemName${i}]}
            /declare SummonItemCount${i} int outer ${Ini[MyIni,Summon,SummonItemCount${i}]}
        }
        /next i
}
/return

Sub SummonItem
/declare i int local
    /for i 1 to ${SummonTotal} {
        /if (!${FindItemCount[${SummonItemName${i}}]}) {
            /if (${FindItemCount[${SummonSpellName${i}}]} && !${FindItem[${SummonSpellName${i}}].Timer}||${SummonSpellGem${i}.Find[gem]} && ${Me.Book[${SummonSpellName${i}}]}||${Me.AltAbilityReady[${SummonSpellName${i}}]} && ${SummonSpellGem${i}.Find[alt]}) {
                :summonloop                    
                /if (${FindItemCount[${SummonItemName${i}}]}<${SummonItemCount${i}}) {
                    /if (${Cursor.ID}) /autoinv
                    /call Cast "${SummonSpellName${i}}" ${SummonSpellGem${i}}
                    /echo Summoning: ${SummonItemCount${i}} x ${SummonItemName${i}} using ${SummonSpellName${i}} - ${SummonSpellGem${i}}
                        /if (${Verbose} && ${MyChannel.NotEqual[NULL]}) /docommand /${MyChannel} Summoning: ${SummonItemCount${i}} x ${SummonItemName${i}}
                    /goto :summonloop
                }
        }
    }
    /next i
/if (${Cursor.ID}) /autoinv

/return
Then for items, you could add in game, or directly to ini. If you were using a spell/AA to summon, you would have to write directly to ini instead.

/summon Huntsman's Ethereal Quiver|100

Same INI entry:
Code:
[Summon]
SummonTotal=2

SummonSpellName1=Awesome Spell of Win
SummonSpellGem1=gem12
SummonItemName1=Dagger of Win
SummonItemCount1=20


SummonSpellName2=Huntsman's Ethereal Quiver
SummonSpellGem2=item
SummonItemName2=Ethereal Arrow
SummonItemCount2=100
Maybe it is useful, maybe not. Either way, if someone wants an INI driven include vice a standalone mac, this could be useful.
 
Is this mac still working for anyone. I keep getting an error

"summoning 10 NULLS, using the BWarm Milk Dispenser"
 
Is this mac still working for anyone. I keep getting an error

"summoning 10 NULLS, using the BWarm Milk Dispenser"

In game item links changed (-57).

First post was edited, uploading a new file soon.