Giter Club home page Giter Club logo

run-in-roblox's Introduction

run-in-roblox

run-in-roblox is a tool to run a place, a model, or an individual script inside Roblox Studio.

run-in-roblox pipes output from inside Roblox Studio back to stdout/stderr, which enables traditional automation tools to work alongside Roblox.

Installation

From GitHub Releases

You can download pre-built binaries from run-in-roblox's GitHub Releases page.

With Foreman

run-in-roblox can be installed with Foreman, a toolchain manager for Roblox projects.

[tools]
run-in-roblox = { source = "rojo-rbx/run-in-roblox", version = "0.3.0" }

From crates.io

You'll need Rust 1.37.0 or newer.

cargo install run-in-roblox

Usage

The recommended way to use run-in-roblox is with a place file and a script to run:

run-in-roblox --place MyPlace.rbxlx --script starter-script.lua

This will open MyPlace.rbxlx in Roblox Studio, run starter-script.lua until it completes, and then exit.

--place is optional, but --script is required.

License

run-in-roblox is available under the terms of the MIT License. See LICENSE.txt or https://opensource.org/licenses/MIT for details.

run-in-roblox's People

Contributors

jeparlefrancais avatar lpghatguy avatar noahwillcrow avatar orbitalowen avatar zotethemighty avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

run-in-roblox's Issues

Adjustable timeout

I've set the timeout while waiting for Roblox Studio to 60 seconds. It might be useful to configure this on slower or flakier machines.

Ability to run in specific place

It would be good to have the ability to run the script in a specific place as it may also include assets that the plugin may want.

Get another way to talk the the local server

One problem I discovered when we rely on the LogService.MessageOut to send data from Studio to the server is that the string passed to MessageOut is sometimes filtered (for example some urls gets truncated).

One thing we could do is change the main template for something like

return function(sender)
    ...
end

And then, sender could be a function that will json encode the content and send it directly through the server.

Table prints go unlogged

The new studio output window features that print({ value = 1 }) is visualised, instead of being outputted as table: hex ID. However, run-in-roblox does not detect this at all, acting as if nothing was printed.
This also applies to print(Instance.new("TextLabel"))

Use LogService and local server for communication

So I have an idea about how we could communicate the output from studio to the command line where run-in-roblox was called.

The idea would be that run-in-roblox would add a "master" script to the given roblox place. This script could connect to the MessageOut event or use GetLogHistory to retrieve the output, send it to the server and print it back in the terminal.

Use `ScriptContext.Error` to filter out unrelated error messages

Currently, run-in-roblox uses LogService.MessageOut and will set the exit code to 1 if the messageType == Enum.MessageType.MessageError. However, occasionally Studio will report internal Roblox errors like "Studio beta features failed to fetch". This will cause run-in-roblox to exit with a status code of 1 even if none of the user code had an error.

Instead, maybe run-in-roblox should use ScriptContext.Error to determine the status code and continue to use LogService.MessageOut for logging. ScriptContext.Error provides a reference to the script that errored.

We can probably safely ignore any script errors from outside common services like:

  • Workspace
  • ServerScriptService
  • ReplicatedStorage
  • StarterPlayer.StarterPlayerScripts?

Default port does not work

I was having issues with the following error whenever I attempted to run run-in-roblox:

PS S:\Projects\ProjectVampire\main> F:\justi\run-in-roblox-0.3.0-win64\run-in-roblox.exe --place ./test.rbxl --script ./ci.lua > ./test-out.txt
thread '<unnamed>' panicked at 'error binding to 127.0.0.1:50312: error creating server listener: An attempt was made to access a socket in a way forbidden by its access permissions. (os error 10013)', C:\Users\runneradmin.cargo\registry\src\github.com-1ecc6299db9ec823\hyper-0.12.35\src\server\mod.rs:116:17
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
thread '<unnamed>' panicked at 'called Result::unwrap() on an Err value: Timeout reached while waiting for Roblox Studio to come online', src/main.rs:75:9
[ERROR run_in_roblox] receiving on a closed channel

Someone in the open-source discord server suggested I recompile with a different port and then it started running. Their reasoning was that the port may conflict with a Windows 11 port. So I thought I would open a issue here about it for anyone else having this problem :).

Add functionality to run model inside place

Some projects like rbx-dom need to send a more complicated script to run inside the place. Instead of generating the place with all of that code, it would be useful to generate a model whose top-level instance is a ModuleScript and have run-in-roblox execute that script.

Alternatively, we could have the run-in-roblox runtime search the model for all Script instances and run them?

Error: "Timeout reached while waiting for Roblox Studio to come online"

When using run-in-roblox in a windows-latest GitHub Action I get the error Timeout reached while waiting for Roblox Studio to come online. This happens 100% of the time in the action but I am not able to reproduce it locally.

I am running run-in-roblox with a .rbxl file that is 17MB in size. The following is the relevent part of my workflow YML:

- name: Install Roblox Studio
  uses: OrbitalOwen/[email protected]
  with:
      cookie: ${{ secrets.ROBLOSECURITY }}
      token: ${{ secrets.GITHUB_TOKEN }}
  timeout-minutes: 2

- name: Run unit tests with run-in-roblox
  run: npm test

The npm test command is run-in-roblox --place game.rbxl --script ci-scripts/unit-testing.lua.

Fail with clean exit

Run-in-Roblox failed while apparently giving a clean exit code during CI setup when running the command run-in-roblox --place build.rbxlx --script Tests/Run.server.lua.

firefox_C5Ch0uOS8c

Unfortunately I cannot reproduce this. Rerunning the job resulted in expected behavior. If I encounter it again I'll leave more details.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.