Jump to content




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


  • You cannot reply to this topic
12 replies to this topic

#1 Mackan90096

  • Signature Abuser
  • 518 posts
  • LocationIn my basement.

Posted 17 June 2013 - 04: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

#2 MudkipTheEpic

  • Members
  • 639 posts
  • LocationWhere you'd least expect it.

Posted 17 June 2013 - 05:02 PM

You forgot the then in if message == "hi".

#3 Mackan90096

  • Signature Abuser
  • 518 posts
  • LocationIn my basement.

Posted 18 June 2013 - 06:21 AM

View PostMudkipTheEpic, on 17 June 2013 - 05:02 PM, said:

You forgot the then in if message == "hi".

Oh, lol.

Fixed it :)

#4 nutcase84

  • Members
  • 711 posts
  • LocationIn My Lonely Little Computer Corner

Posted 18 June 2013 - 11:07 AM

Thanks! This helped a lot!

#5 Geforce Fan

  • Members
  • 846 posts
  • LocationMissouri, United States, America, Earth, Solar System, Milky Way, Universe 42B, Life Street, Multiverse, 4th Dimension

Posted 18 June 2013 - 01: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

#6 Darkey

  • New Members
  • 2 posts

Posted 20 June 2013 - 11:42 AM

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 ???

#7 Upgrade_Windows

  • Members
  • 27 posts
  • LocationUnited Kingdom

Posted 20 June 2013 - 11:59 AM

View PostDarkey, on 20 June 2013 - 11:42 AM, said:

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.

#8 Tiin57

    Java Lunatic

  • Members
  • 1,412 posts
  • LocationIndiana, United States

Posted 20 June 2013 - 06:45 PM

This is handy because far too many people ask about this.
Edit: Of course, maybe more than a paragraph would be nice.

#9 Darth_Ben17

  • Members
  • 26 posts
  • LocationIn the turtle.....

Posted 23 October 2013 - 03: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))


#10 jay5476

  • Members
  • 289 posts

Posted 23 October 2013 - 10:28 PM

View PostDarth_Ben17, on 23 October 2013 - 03:42 AM, said:

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

#11 Darth_Ben17

  • Members
  • 26 posts
  • LocationIn the turtle.....

Posted 28 October 2013 - 02:28 AM

sorry :/ ill put it in ask a pro later

#12 Aidan9883

  • New Members
  • 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

#13 Aidan9883

  • New Members
  • 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






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users