Posted 28 April 2012 - 09:29 PM
I just wanted to share this little program I wrote for someone else on a tekkit server.
I didn't have much time and I didn't really care about making it clean and good to read. :)/>/>
Functions:
The original didn't have a channel system.
One last warning, I didn't know term.scroll() when I wrote this, so exspect it to be crappy and buggy.
Please post feedback and suggestions on how to make it better.
License:
I didn't have much time and I didn't really care about making it clean and good to read. :)/>/>
Functions:
- Multi-user support
- Uses computer ID; so you can't disguise as someone else
- 100% client side program, no servers required
- Lightweight and easy to use
- Filters incoming messages to prevent chat spam by other programs
The original didn't have a channel system.
One last warning, I didn't know term.scroll() when I wrote this, so exspect it to be crappy and buggy.
term.clear()
term.setCursorPos(1,1)
while true do
write("Please enter the site of your computer the modem is attached on: ")
uModemSide = read()
term.clear()
term.setCursorPos(1,1)
if uModemSide == "left" or uModemSide == "back" or uModemSide == "right" or uModemSide == "top" then
break
else
end
end
rednet.open(uModemSide)
parallel.waitForAll(
function()
while true do
term.setCursorPos(1,18)
term.clearLine()
write("You: ")
term.setCursorPos(6,18)
uMessage = read()
rednet.broadcast("#IM"..uMessage)
end
end
,
function()
while true do
id, message = rednet.receive()
if string.find(message, "#IM") then
message = string.sub(message, 4)
term.setCursorPos(1,18)
print("You should not see this!")
term.clearLine()
write("You: ")
term.setCursorPos(1,17)
term.clearLine()
print(id..": "..message)
else
end
end
end
)
I'll probably rewrite big parts of the code, because hate my temporary solution with the "You should not see this!".Please post feedback and suggestions on how to make it better.
License:
Edited on 14 May 2012 - 07:21 PM