Jump to content




Using HTTP and a web server as Rednet

api computer help

4 replies to this topic

#1 Vert3x

  • New Members
  • 2 posts

Posted 16 July 2017 - 04:02 PM

Hello, I was wondering... I have a simple web server set up on my Raspberry PI. I have port-forwarded it and would like to use it for sending commands to other computers (via a master computer or a website). How would I do this? This would remove the need of me having to waste E pearls on modems. Thanks!

#2 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 17 July 2017 - 05:40 AM

You can't, exactly, at least not directly. Instead, you'd need to have your ComputerCraft systems send command requests to your web server.

#3 Dave-ee Jones

  • Members
  • 456 posts
  • LocationVan Diemen's Land

Posted 17 July 2017 - 05:59 AM

View PostBomb Bloke, on 17 July 2017 - 05:40 AM, said:

You can't, exactly, at least not directly. Instead, you'd need to have your ComputerCraft systems send command requests to your web server.
Well, actually, you could have the computers listen in on a notepad file and when it changes it does something, like execute a command that was put there by the web server...

Oooo! Then you could have a CLI on a web page that controls multiple computers on a MC server! The possibilities for server admins...Deleting users, adding users, wiping a server, launching a disk..Manually controlling a PC that was hacked..

#4 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 17 July 2017 - 06:41 AM

Ah, true, if the web server has access to the Minecraft server's files, you could indeed have it write commands to a file on a ComputerCraft system's "drive" (located within the world save). That system would then simply need to read that file every few seconds to check for commands.


... although, if you have that level of control, then it's also possible to just generate multiple computers with the same ID number (if you can access your world save then you should also be able to use /give). These all share the same hard drive, allowing you to pull much the same communications trick without the need of any external software at all (we are just replacing rednet, right?) - HDeffo's pocket command computers provide a great example of this technique.

#5 Anavrins

  • Members
  • 775 posts

Posted 17 July 2017 - 02:19 PM

I remember an api doing just that, to receive a message it would make a request to a server, the server would not send anything but would keep the connection alive, only when a message was to be received that the server would respond and close the connection, the CC computer restarts the connection awaiting the next message.

I'll edit my post with the thread once I remember the name.
Edit: httpnet http://www.computerc...p?/topic/15226-

Edited by Anavrins, 17 July 2017 - 02:29 PM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users