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

rednet client/server chat help?

Started by Ninja_swag, 29 November 2013 - 01:57 AM
Ninja_swag #1
Posted 29 November 2013 - 02:58 AM
so far i dont have any code for it :(/> but heres what i want it to look like



on the server computer i want it to look this
|==============================|
| request from (idhere) | Online: |
| allow | ID |
| [pending] | ID |
| deny | ID |
|==================| ID |
| Pending | ID |
|>> ID ^ | ID |
|ID v | |
|==============================|
| use names or ID's |
| >>ID's<< |
| Names |
|==============================|



and the client computer like this
|====================|
| Send request? |
|====================|
| [yes] |
| no |
|====================|
| request sent! |
|====================|

if its accepted then client computer looks like this
+——————————————————–+
| name: |
+——————————————————–+


then after a name is entered it looks like this

|=====================================|
|_______Online_____| (name): message ^|
|(ID)name< ^| (name): message |
| >PM (ID) | (name): message |
|(ID)name | (name): message |
|(ID)name |___________________v|
|(ID)name v| (message here) |
|=====================================|


using the up and down arrows to navigate though who your PM-ing like this

|=====================================|
|_______Online_____| (name): message ^|
|(ID)name< ^| (name): message |
|(ID)name | (name): message |
|(ID)name | (name): message |
|(ID)name |___________________v|
|(ID)name v| (message here) |
|=====================================|
hitting enter while looking at someone should make it show the admin menu if your premoted to admin like this



|==============================|
| request from (idhere) | Online: |
| allow | ID< |
| [pending] | Edit rank< |
| deny | ID |
|================== | ID |
| Pending | ID |
|>> ID ^ | ID |
|ID v | |
|==============================|
| use names or ID's |
| >>ID's<< |
| Names |
|==============================|
*enter*
|==================|
| current rank: user |
|==================|
| [promote to admin] |
| ban |
| exit |
|=================|
if you are admin you should have 3 options when you click on there name/id
1. msg
2. ban
3. mute


sorry if this is hard to understand or hard to help with im kind of nooby with Lua/cc coding and i dont know if this is possible

sorry spacing didnt work
Yevano #2
Posted 29 November 2013 - 12:04 PM
For networking, you can use the rednet API or the modem API to send and receive messages to and from the server. With your system, you could probably get away with just sending, the client's name, the type of message, and the recipient if it's a pm. Then, you would just have the server decode the message and send it back out for some other computers to catch.

You'll need to know how to catch the events from the rednet API. Take a look here.

For the GUI, it seems simple enough to just use the barebones term API.

Also, don't forget that there is a tutorial section if you can't figure something out. If you're still stuck and you have written some of your own code, just ask again here.
Edited on 29 November 2013 - 11:04 AM