Thread Tools Display Modes
01-21-11, 11:39 PM   #1
Mimfoe
A Defias Bandit
Join Date: Jan 2011
Posts: 3
Need help with this script!

I need it to announce the 4x random numbers to guildchat instead of to DEFAULT_CHAT_FRAME, but i simply can't figure out how, managed to easily set it to just /s, but doing "SendChatMessage" instead of the other one, but i can't figure out how to announce to Guild.

/script local a,msg={},"Weekly Lotto Numbers are:" for b = 1,4 do local c = math.random(10) while a[c] do c = math.random(10) end a[c]=1 msg=msg.." "..c end DEFAULT_CHAT_FRAME:AddMessage(msg)


This is for a personal Guild Lotter, Yes it is LEGAL i've got pic from a GM here


Thanks in advance!


Mimfoe.
  Reply With Quote
01-22-11, 12:04 AM   #2
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,919
Looking up SendChatMessage on wowpedia showed this link : http://www.wowpedia.org/API_SendChatMessage

Code:
/script SendChatMessage("Hello Bob!", "WHISPER", "Common", "Bob");
Simply changing WHISPER to GUILD should work fine.
__________________
  Reply With Quote
01-22-11, 08:01 AM   #3
Mimfoe
A Defias Bandit
Join Date: Jan 2011
Posts: 3
Originally Posted by Xrystal View Post
Looking up SendChatMessage on wowpedia showed this link : http://www.wowpedia.org/API_SendChatMessage

Code:
/script SendChatMessage("Hello Bob!", "WHISPER", "Common", "Bob");
Simply changing WHISPER to GUILD should work fine.
Yea i looked it up aswell, but i can't seem to work that into my script :/, like it will just link the whole script into the guild chat, instead of actually making the numbers into guild chat.
  Reply With Quote
01-22-11, 08:07 AM   #4
Ailae
A Rage Talon Dragon Guard
 
Ailae's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2007
Posts: 318
Code:
/script local a,msg={},"Weekly Lotto Numbers are:" for b = 1,4 do local c = math.random(10) while a[c] do c = math.random(10) end a[c]=1 msg=msg.." "..c end SendChatMessage(msg, "GUILD")
Prints the expected output, "Weekly Lotto Numbers are: n n n n", to guild-chat.
__________________
Oh, the simulated horror!
  Reply With Quote
01-22-11, 08:16 AM   #5
Mimfoe
A Defias Bandit
Join Date: Jan 2011
Posts: 3
You're my hero
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » Macro Help » Need help with this script!

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off