695 posts
Location
In my basement.
Posted 17 June 2013 - 05:02 AM
Seen the chatbox peripheral from miscperipherals?
Want to use it but don't know how to?
Well.. You've come to the right topic.
I'm going to explain how to use it.
First, we need to tell the computer that the periperal is there like so;
p = peripheral.wrap("side") -- side is the side you got the peripheral on
Then get the messages like so:
while true do
event, player, message = os.pullEvent("chat") -- Now you got the event, which player, and which message.
if message == "hi" then
p.say("Hi there!") -- if the message from chat is hi , the chatbox will say "Hi there!"
end
end
Now you know some basics about the chatbox peripheral.
// Mackan90096
892 posts
Location
Where you'd least expect it.
Posted 17 June 2013 - 06:02 PM
You forgot the then in if message == "hi".
695 posts
Location
In my basement.
Posted 18 June 2013 - 07:21 AM
You forgot the then in if message == "hi".
Oh, lol.
Fixed it :)/>
770 posts
Location
In My Lonely Little Computer Corner
Posted 18 June 2013 - 12:07 PM
Thanks! This helped a lot!
1029 posts
Location
Missouri, United States, America, Earth, Solar System, Milky Way, Universe 42B, Life Street, Multiverse, 4th Dimension
Posted 18 June 2013 - 02:49 PM
/offtopic Now if you made a tutorial for the Speaker(miscPeripherals) you could have it speak instead of chat! :o/>
/ontopic Thanks, I didn't know the ChatBox could get messages people are saying. Now I can make a chatbot! :3
2 posts
Posted 20 June 2013 - 12:42 PM
is their anyway to add to this to pull like a chat from the player doing a command for example : if player did /bal and computer was set up like so event,player,message=os.pullEvent("chat") would that pull it up and if so would i be able to check the message with like if message =="Balance: $<500") would that check if the balance is below 500 ???
8 posts
Location
United Kingdom
Posted 20 June 2013 - 12:59 PM
is their anyway to add to this to pull like a chat from the player doing a command for example : if player did /bal and computer was set up like so event,player,message=os.pullEvent("chat") would that pull it up and if so would i be able to check the message with like if message =="Balance: $<500") would that check if the balance is below 500 ???
It doesn't pick up player commands, only text / messages that I am aware of.
Someone can correct me if I'm incorrect.
1243 posts
Location
Indiana, United States
Posted 20 June 2013 - 07:45 PM
This is handy because far too many people ask about this.
Edit: Of course, maybe more than a paragraph would be nice.
26 posts
Location
In the turtle.....
Posted 23 October 2013 - 04:42 AM
Hey guys, for some reason my code isn't working, could someone please correct it (btw I think its the last line that's not working)
local chat = peripheral.wrap("back")
term.clear()
term.setCursorPos(1, 1)
term.write("who?")
Who = read()
term.write("what?")
What = read()
term.write(Who)
term.setCursorPos(1, 4)
term.write(What)
chat.tell((Who), (What))
331 posts
Posted 23 October 2013 - 11:28 PM
Hey guys, for some reason my code isn't working, could someone please correct it (btw I think its the last line that's not working)
local chat = peripheral.wrap("back")
term.clear()
term.setCursorPos(1, 1)
term.write("who?")
Who = read()
term.write("what?")
What = read()
term.write(Who)
term.setCursorPos(1, 4)
term.write(What)
chat.tell((Who), (What))
:/ no report button
this belongs in ask a pro
also this is a really old thread and is *DEAD* please read the rules: if digging up an old thread add useful content to it
26 posts
Location
In the turtle.....
Posted 28 October 2013 - 02:28 AM
sorry :/ ill put it in ask a pro later
2 posts
Posted 30 October 2013 - 11:03 AM
i probibly she be on ask a pro but is there any way to save a program like the paint using a chatbox without opening the computer
2 posts
Posted 30 October 2013 - 11:06 AM
becuase i want to make a shop at spawn running paint so they can edit the paint picture then they could say save then it would tell a huge monitor to put up the same thing on the original computer had becuase i dont want them to change what the computer does basically save the changes then be able to send it