Jump to content




Chatbox Pulling From A /msg


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

#1 campicus

  • Members
  • 164 posts

Posted 19 October 2013 - 08:54 PM

Hey everyone! I am using the chatbox peripheral, which is awesome. What I have is this:

chat = peripheral.wrap("front")

while true do
  e, player, msg = os.pullEvent("chat")
  if player == "campicus" and msg == "/o" then
    for x = 1,2 do
      rs.setOutput("back", true)
      sleep(0.5)
      rs.setOutput("back", false)
      sleep(0.5)
    end
  end
end

The chatbox doesnt pick this up, is there any way I can get it to pull something like this?

#2 CreeperGoBoom

  • Members
  • 91 posts

Posted 19 October 2013 - 10:47 PM

View Postcampicus, on 19 October 2013 - 08:54 PM, said:

Hey everyone! I am using the chatbox peripheral, which is awesome. What I have is this:

[code="lua"]
chat = peripheral.wrap("front")

while true do
e, player, msg = os.pullEvent("chat")
if player == "campicus" and msg == "/o" then
for x = 1,2 do
rs.setOutput("back", true)
sleep(0.5)
rs.setOutput("back", false)
sleep(0.5)
end
end
end
[/code]

The chatbox doesnt pick this up, is there any way I can get it to pull something like this?

there is a little bit of confusion where it comes to OpenPeripherals, "chatbox_command" has nothing to do with the actual chatbox

instead i would use, chat_command where the command is fired by a $$ not a /

here:
chat = peripheral.wrap("front")

while true do
  e, msg = os.pullEvent()
  if e=="chat_command" and msg=="c" then -- where chat_command event is fired by $$ in chat, the beauty of this is, noone sees your commands :)/>
	for x = 1,2 do
	  rs.setOutput("back", true)
	  sleep(0.5)
	  rs.setOutput("back", false)
	  sleep(0.5)
	end
  end
end


#3 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 20 October 2013 - 12:43 AM

View PostCreeperGoBoom, on 19 October 2013 - 10:47 PM, said:

there is a little bit of confusion where it comes to OpenPeripherals, "chatbox_command" has nothing to do with the actual chatbox

instead i would use, chat_command where the command is fired by a $$ not a /
No. If you're going to help, have a little more knowledge in peripherals. The OP could be using MiscPeripherals which adds a chat box, which fires the event "chat" as the OP is using, also OpenPeripheral doesn't have a command "chatbox_command" it is "chat_command".


@OP no, the chat box doesn't intercept commands, only player chat and death messages, so if you prefix with '/' the message will go to the server and the chatbox will not pick it up. If you wish to send messages to your computer without anyone seeing (except IRC) use OpenPeripheral terminal glasses, as CreeperGoBoom stated they use $$ in the front, and they do not display in the chat.

#4 campicus

  • Members
  • 164 posts

Posted 20 October 2013 - 01:26 AM

Thanks for the advice guys!

#5 campicus

  • Members
  • 164 posts

Posted 20 October 2013 - 07:47 PM

Apparently (and I have not tested this) you can just put "/" in front of whatever you write and the chatbox (but not the ingame chat) will pick it up?
This does not work :(

#6 campicus

  • Members
  • 164 posts

Posted 21 October 2013 - 07:14 PM

I am playing on mindcrack, so no peripheral glasses? :( I can't find a way to do what I want and I look like a douche saying "open" and "close" in chat all the time haha

#7 Inumel

  • Members
  • 120 posts

Posted 22 October 2013 - 05:33 PM

You could always switch to a player detector, Granted its not voice activated and you have to have the block showing but.. It stops the aforementioned douchieness





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users