What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

PB Question

vuwrr

Member
Joined
Jan 15, 2010
Messages
287
Reaction score
1
Is it possible to send a whisper/say/gchat message into the game through PB scripting? If so could anyone point me in the right direction?

Any help would be appriciated.

Best regards,
vuwrr.
 
Yes you can do that - read the Guide.rtf that comes with PB, there are some instructions on how to do it.
 
If you need to insert variables into the text in the chat you're gonna need to use String.concat
If you get trouble lemme know and post examples - then I'll try to help.
 
Is it possible to send a whisper/say/gchat message into the game through PB scripting? If so could anyone point me in the right direction?

Any help would be appriciated.

Best regards,
vuwrr.

Code:
Lua.DoString("SendChatMessage(\"Hello \",\" SAY\", \"COMMON\"));
you can do something like that. however, that's not going to work the way i put it, so its going to need some work.
you can find the api for SendChatMesage here. API SendChatMessage - WoWWiki - Your guide to the World of Warcraft


or now that i think about it
Code:
Lua.DoString("RunMacroText(\"/say Nuddy Fudge'Kins\")")
that should work too, but it's a little ass backwords and you still need to escape the lua properly for it to work.
heres the api link for RunMacroText, but its pretty dead simple to use.
http://www.wowwiki.com/API_RunMacroText
 
Last edited:
That is, indeed another way to do it and probably more right way to do it than the approach I've used in the guide.
Code:
Lua.DoString(string.Format("RunMacroText(\"{0}\")", "/s hello"), 0);
Although with this way you don't really need to look much into any api - it's just /g whatever you want
just like you would do ingame.
 
Lua.DoString(string.Format("SendChatMessage(\"test\", 'WHISPER', nil, 'Randomchar')"));

This works, however, as the newbie I am I have no idea how to f.x. put var1 (set to anything really numbers / text) into the field and send it. For example I wanted to check what Me.FreeNormalBagSlots reported back and have it send it in a whisper. Would that be doable?
 
Yea that's what I was talking about with String.concat.
Example (if var1 is a number (int), and var2 is a string)
Code:
Lua.DoString(string.Format("SendChatMessage(\"I've sent \" + var1.ToString() + \" Whiptail to \" + var2 + \". Cheers mate\", 'WHISPER', nil, 'Randomchar')"));
As you can see, you concatenate with the +.
You turn the number into a string by adding .ToString()
I suppose this should work, I haven't tried it - I just looked up how to do it in C#.
 
Last edited:
Back
Top