Crummy Server REPL

Discussion in 'Mod Discussions' started by wondible, October 11, 2014.

  1. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    Code:
    var stdin
    var repl = function() {
      file.load('/server-script/stdin.js', function(contents) {
        if (contents != stdin) {
          stdin = contents
          console.log(eval(stdin))
        }
      })
    }
    setInterval(repl, 1000)
    
    Edit the listed file (stdin.js), and hit save instead of return.

    Note that you only get access to symbols for the file it's in - so in main.js you won't be able to see the global `armies` in playing.js
    proeleert and cola_colin like this.

Share This Page