This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Mackan90096's profile picture

[Mack's Tutorials] Using the chatbox peripheral from MiscPeripherals

Started by Mackan90096, 17 June 2013 - 03:02 AM
Mackan90096 #1
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
MudkipTheEpic #2
Posted 17 June 2013 - 06:02 PM
You forgot the then in if message == "hi".
Mackan90096 #3
Posted 18 June 2013 - 07:21 AM
You forgot the then in if message == "hi".

Oh, lol.

Fixed it :)/>
nutcase84 #4
Posted 18 June 2013 - 12:07 PM
Thanks! This helped a lot!
Geforce Fan #5
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
Darkey #6
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 ???
Upgrade_Windows #7
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.
Tiin57 #8
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.
Darth_Ben17 #9
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))
jay5476 #10
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
Darth_Ben17 #11
Posted 28 October 2013 - 02:28 AM
sorry :/ ill put it in ask a pro later
Aidan9883 #12
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
Aidan9883 #13
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