Ok so im writing a simple script to use a guild recruitment macro for my guild. My guild is spread across like 8 realms with each guild at a various different level.
so basically what i was thinking is declaring a variable for GetGuildLevel and then writing a simple print command. However im not sure if i should use the print command or SendChatMessage command and if I use the SendChatMessage command, can i insert a variable into the parameters and if i use the print command, how do I output to the default chat channel, for example, trade in cities, general everywhere else?
Thanks for the help.
ok so basically
SLASH_DISCORD1, SLASH_DISCORD2 = '/discord', '/dc';
function SlashCmdList.DISCORD(msg, editbox)
gl = GetGuildLevel()
SendChatMessage("<Discord>("gl") is recruiting all levels. We are a social leveling guild with 7 bank tabs, website, vent & years of exp. So if you want help leveling, raiding, or just want to socialize, pst. We have a guild repair fund. Pst for invite.", "channel",nil,1)
Whats wrong here.
and is it possible to use GetChannel Name and an if/then statement to output to trade in city and general not in city?
Please use [code] tags around your code so it's actually readable. I'm not sure how you're formatting your actual Lua file, but once proper formatting is applied to the code you posted, there are several glaringly obvious problems:
2) You're missing string concatenation operators around the "gl" variable you're trying to insert into the middle of your string.
Both of those problems are triggering Lua errors; enabling Lua error display -- or better yet, installing a dedicated error display addon like BugSack -- is the first thing you should do when trying to write or even just edit an addon. Without an error display, you are working blind.
Also, you don't actually need a variable, since you can just concatenate the result directly -- "<Discord>(" .. GetGuildLevel() .. ") is recruiting..." -- but if you want to use one anyway, it should absolutely not be a global variable, and absolutely should be a local one.
I'd also suggest picking one style of string delimiter -- single quotes or double quotes -- and use it consistently. Double quotes are more popular, since apostrophes are more likely to be in the middle of a string, either one is fine.
Finally, I'm not 100% sure, but the channel name (eg. "CHANNEL") passed to SendChatMessage may need to be capitalized; even if it's not required, you should do it anyway to maintain consistency with the official API usage in Blizzard's code and the API documentation on places like Wowpedia (which follows Blizzard's usage).
Here is your code revised to address the above issues and preferrentially send to the Trade channel when possible.
Finally, your message seems a little wordy; I'd suggest trying to shorten it as much as possible. The less people have to read, the more likely they are to read at all.
Thanks so much for the help, some of these errors are obvious ones. Ive been up since 4 this morning and everything was starting blend together.
|All times are GMT -6. The time now is 10:51 PM.|
vBulletin © 2018, Jelsoft Enterprises Ltd
© 2004 - 2017 MMOUI