162 posts
Posted 19 October 2013 - 09: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?
92 posts
Posted 19 October 2013 - 11:47 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?
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
7508 posts
Location
Australia
Posted 20 October 2013 - 01:43 AM
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.
162 posts
Posted 20 October 2013 - 02:26 AM
Thanks for the advice guys!
162 posts
Posted 20 October 2013 - 08: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 :(/>
162 posts
Posted 21 October 2013 - 08: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
115 posts
Posted 22 October 2013 - 06: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