Edited by CCJJSax, 11 June 2016 - 02:36 AM.
[solved] Program to alter craftOS
Started by CCJJSax, Jun 11 2016 01:38 AM
2 replies to this topic
#1
Posted 11 June 2016 - 01:38 AM
I use sublime to code and I like the colors. The colors are automatically there when you use a .lua file. If I had a file named blah.lua, I want to be able to go to a computer and run "blah" and have it search for "blah" then try "blah.lua". The 2 ways I can think of to do this are to edit craftOS in the computercraft files which I don't want to do, or run a separate program with it as an argument. ie. "run blah", which defeats the purpose.
#2
Posted 11 June 2016 - 01:54 AM
At a glance, it looks like you may be able to do this by overriding shell.resolveProgram():
... though I haven't tested this.
local oldShellResolve = shell.resolveProgram shell.resolveProgram = function(program) return oldShellResolve(program) or oldShellResolve(program .. ".lua") end
... though I haven't tested this.
#3
Posted 11 June 2016 - 02:35 AM
Bomb Bloke, on 11 June 2016 - 01:54 AM, said:
At a glance, it looks like you may be able to do this by overriding shell.resolveProgram():
... though I haven't tested this.
local oldShellResolve = shell.resolveProgram shell.resolveProgram = function(program) return oldShellResolve(program) or oldShellResolve(program .. ".lua") end
... though I haven't tested this.
You sir, are a genius! Works wonders
2 user(s) are reading this topic
0 members, 2 guests, 0 anonymous users











