You like to Send a Chat Message with the text of your Editbox when you press your Button? this is easy stuff,
1. you have to get the Text of the Editbox
2. you have to pass it to SendChatMessage function
3. ???
4. profit
you have called your Editbox plr, an Editbox Widget have many methods to deal with it - you can read about them on wowwiki.com
when you come back you know you can use :GetText() to get the text of your Editbox
SendChatMessage (a Wow-Api function) use the first argument for the sending message
so it will looks like this
SendChatMessage(plr:GetText())
easy hu? But it will do nothing, you have to enable your button to be clickable
you use a Widgethandler, to specificate this: "OnClick"
to set a handler to your Object use :SetScript(Handler, function)
it will look like this
YourButton:SetScript("OnClick", function()
SendChatMessage(plr:GetText())
end)
thats it.
to append or preend the Message you use string concatenation ..
modify the secondline to this
SendChatMessage("Hey, "..plr:GetText()..".")
"Hey, ".. is a substring concatenate to plr:GetText() concatenate to .. "."
|