WoWInterface

WoWInterface (http://www.wowinterface.com/forums/index.php)
-   Macro Help (http://www.wowinterface.com/forums/forumdisplay.php?f=140)
-   -   Need help with this script! (http://www.wowinterface.com/forums/showthread.php?t=38522)

Mimfoe 01-21-11 11:39 PM

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.

Xrystal 01-22-11 12:04 AM

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.

Mimfoe 01-22-11 08:01 AM

Quote:

Originally Posted by Xrystal (Post 227381)
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.

Ailae 01-22-11 08:07 AM

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.

Mimfoe 01-22-11 08:16 AM

You're my hero


All times are GMT -6. The time now is 06:00 PM.

vBulletin © 2014, Jelsoft Enterprises Ltd
©2012 ZAM Network LLC