Remove Advertisements

Sending item links in a macro

All things /script related

Moderators: Fridmarr, Worldie, Aergis, _Chloe

Sending item links in a macro

Postby Arnock » Sat May 30, 2009 9:25 pm

So I'm completely unfamiliar with lua, and I'm trying to figure out how to make a macro to say that I'm buying or selling something

So far, I've worked out how to send a message in /say

Code: Select all
/script SendChatMessage("Buying all \124cff1eff00\124Hitem:35624:0:0:0:0:0:0:0:0\124h[Eternal Earth]\124h\124r 5 gold each, please CoD ");


but reading through http://www.wowwiki.com/API_SendChatMessage I can't seem to figure out how to send the message in trade

can someone help me out with this?
Image
Courage not of this earth in your eyes
Faith from far beyond lies deep inside
User avatar
Arnock
 
Posts: 3666
Joined: Tue Apr 08, 2008 6:36 pm
Location: Everywhere and nowhere

Re: Sending item links in a macro

Postby _Chloe » Sun May 31, 2009 12:54 am

Easy:


Code: Select all
SendChatMessage("Buying all \124cff1eff00\124Hitem:35624:0:0:0:0:0:0:0:0\124h[Eternal Earth]\124h\124r 5 gold each, please CoD ", nil, nil, 2);


Basically replace the 2 with whatever channel number trade is.
User avatar
_Chloe
Moderator
 
Posts: 971
Joined: Fri Dec 07, 2007 6:36 pm
Location: Santa Monica, CA

Re: Sending item links in a macro

Postby majiben » Sun May 31, 2009 3:56 am

Is it possible to insert text into open chat boxes? Like if I wanted to PM someone who I hadn't previously spoken to.
Amirya wrote:some bizarre lovechild of Hawking, Einstein, and Theck
User avatar
majiben
Moderator
 
Posts: 6999
Joined: Fri Aug 22, 2008 4:37 pm
Location: Retired

Re: Sending item links in a macro

Postby majiben » Sun May 31, 2009 4:14 am

Actually I can't get any of this to work,and even copy and pastes of their "hello world" examples.

EDIT:
seems /run was needed and was found through some google though the wowwiki link neglected to mention this >.<

Still the one you linked chole doesn't say the message in trade chat, just in /s
Amirya wrote:some bizarre lovechild of Hawking, Einstein, and Theck
User avatar
majiben
Moderator
 
Posts: 6999
Joined: Fri Aug 22, 2008 4:37 pm
Location: Retired

Re: Sending item links in a macro

Postby majiben » Sun May 31, 2009 5:30 am

After some more poking and copying/splicing this macro worked for me
Code: Select all
/script SendChatMessage("Buying all \124cff1eff00\124Hitem:35624:0:0:0:0:0:0:0:0\124h[Eternal Earth]\124h\124r 5 gold each, please CoD ", "CHANNEL", nil, 2);
Amirya wrote:some bizarre lovechild of Hawking, Einstein, and Theck
User avatar
majiben
Moderator
 
Posts: 6999
Joined: Fri Aug 22, 2008 4:37 pm
Location: Retired

Re: Sending item links in a macro

Postby majiben » Sun May 31, 2009 6:15 am

The code for linking items is quite long, can it be shorted to fit more than 2 in a macro? or am I out of luck? Also I was having trouble finding a data base for finding item codes. So far thottbot has worked but I need to add an additional :0 and change some of the letters at the beginning to copy the format used in message arnock posted.
Amirya wrote:some bizarre lovechild of Hawking, Einstein, and Theck
User avatar
majiben
Moderator
 
Posts: 6999
Joined: Fri Aug 22, 2008 4:37 pm
Location: Retired

Re: Sending item links in a macro

Postby Panzerdin » Sun May 31, 2009 6:27 am

I believe you're stuck with it.
User avatar
Panzerdin
 
Posts: 5504
Joined: Sat May 24, 2008 2:51 pm
Location: On a picket line, protesting against the changes to Maintankadin

Re: Sending item links in a macro

Postby Arnock » Sun May 31, 2009 10:09 am

Thanks, I didn't realize I had to put in "nil" where the chat type and language modifiers were

zomg 1k posts
Last edited by Arnock on Sun May 31, 2009 10:17 am, edited 1 time in total.
Image
Courage not of this earth in your eyes
Faith from far beyond lies deep inside
User avatar
Arnock
 
Posts: 3666
Joined: Tue Apr 08, 2008 6:36 pm
Location: Everywhere and nowhere

Re: Sending item links in a macro

Postby Arnock » Sun May 31, 2009 10:10 am

Majiben wrote:The code for linking items is quite long, can it be shorted to fit more than 2 in a macro? or am I out of luck? Also I was having trouble finding a data base for finding item codes. So far thottbot has worked but I need to add an additional :0 and change some of the letters at the beginning to copy the format used in message arnock posted.


I used the wowhead "link" tool, just copied the item code rather than the whole script

I.e.

/script DEFAULT_CHAT_FRAME:AddMessage("Shift-click this to place a link into a chat message: \124cffa335ee\124Hitem:45251:0:0:0:0:0:0:0:0\124h[Shoulderplates of the Deconstructor]\124h\124r");
Image
Courage not of this earth in your eyes
Faith from far beyond lies deep inside
User avatar
Arnock
 
Posts: 3666
Joined: Tue Apr 08, 2008 6:36 pm
Location: Everywhere and nowhere

Re: Sending item links in a macro

Postby fafhrd » Sun May 31, 2009 9:32 pm

You don't need to screw around with making the links yourself with the item IDs, you can make the game fill them in for you:

http://wiki.bwerp.net/World_of_Warcraft_macros

Basically, type out in your chat window (ie NOT in a macro):

Code: Select all
/script CreateMacro("macro name", 6, "/2 Selling 5xBLAH 4g!", 1, 0)


And instead of BLAH above, shift click your item link in before hitting enter. The CreateMacro funciton will create a macro with the appropriate code to have an item link.

You can then go to your macros list and do whatever you want with the macro (change name/icon/text). Length restrictions still apply though, and item links take up a lot more characters than they display, so you only get to link about 3 items before a macro fills up.

Change that last 1 to "nil" if you want the macro to be per-account instead of per character.
ImageImage
1/1 Lore pre-nerf.
User avatar
fafhrd
 
Posts: 5432
Joined: Fri Aug 31, 2007 2:31 pm

Re: Sending item links in a macro

Postby moduspwnens » Tue Jun 02, 2009 7:46 am

I use Fizzwidget Linkerator. It auto-inserts links to items or spells as you type, or as you copy/paste. It also has a neat feature for linking items to yourself.

/link Thunder

would return me Thunderfury, Deep Thunder, and probably the Shaman spell "Thunder".

/shrug, if you're only making one macro it's probably not worth it, but if you link items occasionally, it's nice.
I rule.
moduspwnens
Moderator
 
Posts: 6211
Joined: Tue Nov 06, 2007 12:28 pm
Location: Shattered Hand


Return to Add-ons, UI, and Macros

Who is online

Users browsing this forum: No registered users and 1 guest


Remove Advertisements

Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest (based on users active over the past 5 minutes)
Most users ever online was 380 on Tue Oct 14, 2008 6:28 pm

Users browsing this forum: No registered users and 1 guest
?php } else { ?