I may release it if there is enough interest.
Osyris had this sublime build script that compiled all scripts in directory into a Lua script that could be executed through ‘Execute Script’ in Studio. It would set the source of scripts in the game to what they were in your file system. I wanted to switch over to using an external text editor because I can navigate around it with my keyboard a lot quicker and it has a lot of extra features, but the process that Osyris had to go seemed too tedious.
I took Osyris’ packaging script and wrote some code that looks for changes in source files in file system, and then sends a response to a waiting COMET (HTTP long-polling) request. The response body itself is the script generated by Osyris’ packaging script.
If you don’t know how a long-held HTTP request works, basically a request is sent to a server, and the server doesn’t send anything back until it has something it wants to send. In this case, I let the request hang there until there is a change in one of my files. When this happens, the plugin executes the script that was sent back through response body. As soon as a request is completed, the plugin companion sends another request to the server and waits until next file save. If it times out, it just sends another.
The reason I’m not releasing it right now is because it would probably require an extensive tutorial. It requires Node (if running locally, need to port forward so ROBLOX can connect), and a few sublime build scripts.
Can you httprequest localhost using any method a plugin has access to?
In that case, if you write it in Java, C-ish or anything like that, you could make it run its own
webserver and do all the stuff. As far as I know, that would just be double-click-to-run, no Node install.
Perhaps I’m confused, but are you sending HTTP requests from Studio to listen for these responses? I thought you could only do that in a test server environment.
[quote] Can you httprequest localhost using any method a plugin has access to?
In that case, if you write it in Java, C-ish or anything like that, you could make it run its own
webserver and do all the stuff. As far as I know, that would just be double-click-to-run, no Node install. [/quote]
Since ROBLOX doesn’t run locally, it can’t ping localhost. Localhost for ROBLOX is their own servers. But if you port forward you could run it locally and it would work, yea! It would definitely be an easier setup if I wrote an all-in-one application. I would also be able to avoid javascript (and the crazy frameworks people use in their Node modules), but that’s an argument for somewhere else. I might do this! I would like to hear what Anaminus is working on (probably something in Go) before I do this, though.
You’re absolutely right, HTTP requests are from Studio. ROBLOX actually just recently made an update where you don’t need to use a test server environment! It has been a wonderful update.
[quote]
You’re absolutely right, HTTP requests are from Studio. ROBLOX actually just recently made an update where you don’t need to use a test server environment! It has been a wonderful update. [/quote]