This is a fairly useful macro that I wrote for use inside of my Guild Hall. This macro allows you to have a bot distribute player crafted healing/buff potions to those who ask for them. This way, you don't have to clutter up your guild's bank and your bot can hold up to 80 stacks of potions.
The bot is written to work kind of like any other NPC you might find out and about. It'll give a bit of a sales pitch periodically and it will also respond to hails. Upon request, it'll also tell you how many of each type of potion are in stock. Also, the bot will explain how to get potions from it if the user asks.
The bot is also set up to automatically accept trades, so your friends can give you plat/item donations if they so desire. My guildies funnel all their Nodding Blue Lillies to me, so this makes it convenient for them to hook me up while I'm AFK.
In order to set the bot up, stand them somewhere (preferably in a corner, facing outwards) and start the macro. Position the mouse on the center of your screen. You have to be in first person view for this to work properly. I also recommend that if you are a tall race that you look down a bit so you'll be able to click on shorter races in order to initiate trades.
Right now the user can only request one stack of potions at a time. Eventually I'll incorporate asking for multiple stacks, but I like controlling how much someone can ask for at once.
I hope you all enjoy this.
Thanks again to z166204 for the help!
The bot is written to work kind of like any other NPC you might find out and about. It'll give a bit of a sales pitch periodically and it will also respond to hails. Upon request, it'll also tell you how many of each type of potion are in stock. Also, the bot will explain how to get potions from it if the user asks.
The bot is also set up to automatically accept trades, so your friends can give you plat/item donations if they so desire. My guildies funnel all their Nodding Blue Lillies to me, so this makes it convenient for them to hook me up while I'm AFK.
In order to set the bot up, stand them somewhere (preferably in a corner, facing outwards) and start the macro. Position the mouse on the center of your screen. You have to be in first person view for this to work properly. I also recommend that if you are a tall race that you look down a bit so you'll be able to click on shorter races in order to initiate trades.
Right now the user can only request one stack of potions at a time. Eventually I'll incorporate asking for multiple stacks, but I like controlling how much someone can ask for at once.
I hope you all enjoy this.
Rich (BB code):
| PotionBot.mac
| Written by Moonspell for RedGuides.com
| Additional code provided by: z166204
| Don't steal it or I'll sick a killer Redbot on you!
| Operating Instructions
| This bot is designed to hand out various player made healing/buff potions
| when asked. It can be queried to see what it currently has in stock
| and behaves similarly to an NPC that you would find in any given zone.
| In order to set it up, run the macro and leave your mouse positioned on the center of
| the screen. I've found it helpful to angle the camera downwards a bit to make sure you'll
| be able to click on short PCs (or upwards if you are a short race). You are required to
| stay in first person view when using this macro, else it won't work.
| The bot will automatically accept any trades that it is offered so the people who
| are using your bot can make donations to you.
#turbo
#event WhatPotions "#*#What potions#*#"
#event WhatInventory "#*#What inventory#*#"
#event IGotHailed "#*#Hail, #*#"
#event BuyHoT "#0# tells you#*#Buy HoT Potion#*#"
#event BuyClarity "#0# tells you#*#Buy Clarity Potion#*#"
#event BuyHaste "#0# tells you#*#Buy Haste Potion#*#"
#event BuyDirect "#0# tells you#*#Buy Direct Heal Potion#*#"
#event LetsTrade "#*#has offered you a#*#"
Sub Main
:SalesPitch
/echo <<< Entering Merchant Mode >>>
/say Hey, wanna buy some "performance enhancing and mind altering drugs"? I have some high quality [potions] in stock. Feel free to check my [inventory]!
:wait4customers
/doevents
/if (${Window[TradeWnd]}) /notify TradeWnd TRDW_Trade_Button LeftMouseUp
/doevents
/goto :wait4customers
/return
|---------------------------------------------------------|
|-----------What has it gots in its pocketses?------------|
|---------------------------------------------------------|
Sub event_WhatInventory
/say So you wanna see the goods, eh? Well I have ${FindItemCount[Elixir of Healing X]} HoT Potions, ${FindItemCount[Elixir of Clarity X]} Clarity Potions, ${FindItemCount[Elixir of Speed X]} Haste Potions, and ${FindItemCount[Healing Potion X]} Direct Heal Potions.
/delay 1s
/doevents
/delay 1s
/doevents
/delay 1s
/doevents
/delay 1s
/doevents
/delay 1s
/doevents
/delay 1s
/doevents
/delay 1s
/doevents
/delay 1s
/doevents
/delay 1s
/doevents
/delay 1s
/doevents
/doevents
/call Main
|---------------------------------------------------------|
|-----------How's it work and what do I get?--------------|
|---------------------------------------------------------|
Sub event_WhatPotions
/say I sell HoT, Clarity, Haste, and Direct Healing potions. I also accept donations! Check my [inventory] to see what is in stock.
/doevents
/say To buy something from me, stand directly in front of me and tell me what you want to buy. Your choices are HoT, Clarity, Haste, or Direct Heal.
/doevents
/delay 2s
/say For example, to buy a stack of HoT potions, /tell me "buy HoT potions"
/doevents
/delay 1s
/doevents
/delay 1s
/doevents
/delay 1s
/doevents
/delay 1s
/doevents
/delay 1s
/doevents
/delay 1s
/doevents
/delay 1s
/doevents
/delay 1s
/doevents
/delay 1s
/doevents
/delay 1s
/doevents
/doevents
/call Main
|---------------------------------------------------------|
|---------------Someone said hello to me!-----------------|
|---------------------------------------------------------|
Sub event_IGotHailed
/say Hello, friend. Wanna see my [inventory]? Perhaps you just want to get down to business and score some [potions]?
/delay 2s
/doevents
/delay 2s
/doevents
/delay 2s
/doevents
/delay 2s
/doevents
/call Main
|---------------------------------------------------------|
|------------------Let's make a deal!---------------------|
|---------------------------------------------------------|
Sub event_LetsTrade
/delay 3s
/notify TradeWnd TRDW_Trade_Button LeftMouseUp
/delay 10s
/say Thanks for the goods, mang!
/return
|---------------------------------------------------------|
|------------------Sell the HoT Potions-------------------|
|---------------------------------------------------------|
Sub event_BuyHoT(string targetstring)
|If person requesting pots not in zone return to mainloop.
/if (!${Spawn[pc ${targetstring}].ID}) /return
|If person is out of range return to mainloop.
/if (${Spawn[pc ${targetstring}].Distance3D}>10) {
/t ${targetstring} Your too far away. Get closer so i can reach you.
/return
}
|If out of potions return to loop with notify.
/if (!${FindItemCount[Elixir of Healing X]}) {
/t ${targetstring} Oh dammit! I ran out of Haste potions. You're going to have to wait til the next shipment from Columbia comes in, sorry.
/return
}
/t ${targetstring} Okay, let me get your goods ready for you. This can take a minute or two. Make sure you're standing right in front of me and are close.
/delay 1s
/call openbags
/delay 5
|picks up 1 stack of potions in one line.
/shift /itemnotify ${FindItem[Elixir of Healing X].InvSlot} LeftMouseUp
/delay 5
|force target type as pc so no pet targeting issues
/target pc ${targetstring}
/delay 1s
/click left target
/delay 2s
/notify TradeWnd TRDW_Trade_Button LeftMouseUp
|loop to wait for accept of trade.
:claritytradeclose
/delay 1
/if (${Window[TradeWnd]}) /goto :claritytradeclose
/delay 1s
/call closebags
/say Nice doing business with you!
/return
|---------------------------------------------------------|
|-----------We've got a crackhead on our hands------------|
|---------------------------------------------------------|
Sub event_BuyClarity(string targetstring)
|If person requesting pots not in zone return to mainloop.
/if (!${Spawn[pc ${targetstring}].ID}) /return
|If person is out of range return to mainloop.
/if (${Spawn[pc ${targetstring}].Distance3D}>10) {
/t ${targetstring} Your too far away. Get closer so i can reach you.
/return
}
|If out of potions return to loop with notify.
/if (!${FindItemCount[Elixir of Clarity X]}) {
/t ${targetstring} Sorry I'm currently out of crack in a bottle. Cocaine is a hell of a drug!
/return
}
/t ${targetstring} Okay, let me get your goods ready for you. This can take a minute or two. Make sure you're standing right in front of me and are close.
/delay 1s
/call openbags
/delay 5
|picks up 1 stack of potions in one line.
/shift /itemnotify ${FindItem[Elixir of Clarity X].InvSlot} LeftMouseUp
/delay 5
|force target type as pc so no pet targeting issues
/target pc ${targetstring}
/delay 1s
/click left target
/delay 2s
/notify TradeWnd TRDW_Trade_Button LeftMouseUp
|loop to wait for accept of trade.
:claritytradeclose
/delay 1
/if (${Window[TradeWnd]}) /goto :claritytradeclose
/delay 1s
/call closebags
/say Nice doing business with you!
/return
|---------------------------------------------------------|
|-----------We have a speed freak on our hands------------|
|---------------------------------------------------------|
Sub event_BuyHaste(string targetstring)
|If person requesting pots not in zone return to mainloop.
/if (!${Spawn[pc ${targetstring}].ID}) /return
|If person is out of range return to mainloop.
/if (${Spawn[pc ${targetstring}].Distance3D}>10) {
/t ${targetstring} Your too far away. Get closer so i can reach you.
/return
}
|If out of potions return to loop with notify.
/if (!${FindItemCount[Elixir of Speed X]}) {
/t ${targetstring} Oh dammit! I ran out of Haste potions. You're going to have to wait til the next shipment from Columbia comes in, sorry.
/return
}
/t ${targetstring} Okay, let me get your goods ready for you. This can take a minute or two. Make sure you're standing right in front of me and are close.
/delay 1s
/call openbags
/delay 5
|picks up 1 stack of potions in one line.
/shift /itemnotify ${FindItem[Elixir of Speed X].InvSlot} LeftMouseUp
/delay 5
|force target type as pc so no pet targeting issues
/target pc ${targetstring}
/delay 1s
/click left target
/delay 2s
/notify TradeWnd TRDW_Trade_Button LeftMouseUp
|loop to wait for accept of trade.
:claritytradeclose
/delay 1
/if (${Window[TradeWnd]}) /goto :claritytradeclose
/delay 1s
/call closebags
/say Nice doing business with you!
/return
|---------------------------------------------------------|
|-----------Someone wants blast heal potions??------------|
|---------------------------------------------------------|
Sub event_BuyDirect(string targetstring)
|If person requesting pots not in zone return to mainloop.
/if (!${Spawn[pc ${targetstring}].ID}) /return
|If person is out of range return to mainloop.
/if (${Spawn[pc ${targetstring}].Distance3D}>10) {
/t ${targetstring} Your too far away. Get closer so i can reach you.
/return
}
|If out of potions return to loop with notify.
/if (!${FindItemCount[Healing Potion X]}) {
/t ${targetstring} Oh dammit! I ran out of Direct Healing potions. You're going to have to wait til the next shipment from Columbia comes in, sorry.
/return
}
/t ${targetstring} Okay, let me get your goods ready for you. This can take a minute or two. Make sure you're standing right in front of me and are close.
/delay 1s
/call openbags
/delay 5
|picks up 1 stack of potions in one line.
/shift /itemnotify ${FindItem[Healing Potion X].InvSlot} LeftMouseUp
/delay 5
|force target type as pc so no pet targeting issues
/target pc ${targetstring}
/delay 1s
/click left target
/delay 2s
/notify TradeWnd TRDW_Trade_Button LeftMouseUp
|loop to wait for accept of trade.
:claritytradeclose
/delay 1
/if (${Window[TradeWnd]}) /goto :claritytradeclose
/delay 1s
/call closebags
/say Nice doing business with you!
/return
|---------------------------------------------------------|
|---------Open up your bags and see what we got-----------|
|---------------------------------------------------------|
Sub openbags
/delay 2s
/cleanup
/keypress I
/delay 1s
/itemnotify 22 rightmouseup
/itemnotify 23 rightmouseup
/itemnotify 24 rightmouseup
/itemnotify 25 rightmouseup
/itemnotify 26 rightmouseup
/itemnotify 27 rightmouseup
/itemnotify 28 rightmouseup
/itemnotify 29 rightmouseup
/delay 1s
/return
|---------------------------------------------------------|
|-----------Clean up your room when you're done-----------|
|---------------------------------------------------------|
Sub closebags
/delay 2s
/cleanup
/delay 1s
/return
Thanks again to z166204 for the help!
Last edited:


(and give credit if I decide to distrubute my finished product)