I want to make a plugin to remotely control an instance of MC on another pc (see what they see, etc), and I need TCP, UDP is just too... stateless. I think the best way to do this is lua, since other languages will freeze MC, not respond to events, etc. I am totally lost though, I don't know where to begin. Can I make a script in lua to open/transmit through a TCP socket, or do I have to write an external DLL and link it to MC?
Remote control plugin.
Posted by Poromenos on Fri 10 Dec 2004 09:21 AM — 8 posts, 29,166 views.
Why not use the chat protocol?
Its real easy to do. Well... once you get into triggers and stuff, it's a bit like putting a ship in a bottle. But it is indeed easy, once you get the hang of it.
You already have everything you need. Snooping, Commands. Just no notes. (You rewrite all your world.note's as chat messages)
Its real easy to do. Well... once you get into triggers and stuff, it's a bit like putting a ship in a bottle. But it is indeed easy, once you get the hang of it.
You already have everything you need. Snooping, Commands. Just no notes. (You rewrite all your world.note's as chat messages)
Because chat pops up the box to allow snooping and stuff, and I need to be able to control it when noone is at the other PC :/
You can get past that. There is an option "automatically allow snoop" that gets rid of the need for that box. That and 'automaticlly accept files' get rid of all need of anyone at the remote computer (I was thinking about this specifically when lobbying for those auto options).
Quote:
Can I make a script in lua to open/transmit through a TCP socket ...
Can I make a script in lua to open/transmit through a TCP socket ...
The luasocket library, that I think I described recently, will do that. I think it lets you have non-blocking connections which is what you want.
However Flannel may be right about the chat system being an easier way of doing it.
Flannel's way is great, but I *think* I tried that and it still popped up the box. I'll try again and see. Luasock also sounds nice for other general-purpose stuff.
Something isn't getting set properly if you still get the box. Since it does indeed work, well, if everything works correctly.
Ah, great, I will do it that way then.