Posted 27 October 2013 - 01:36 PM
:(/> so i need help. i am making an alternative shell for computercraft. due to the stupid nature of shell.run() i need to split my command inputted to a 2 part array. For example, say i inputted this:
I would have an array like this:
My code:
Any idead on how? :ph34r:/>
ls rom
I would have an array like this:
{'ls', 'rom'}
My code:
while true do
if os.computerLabel() then
lbl = os.computerLabel()
else
lbl = os.computerID()
end
write("root@"..lbl.." $ "..dir)
local command = read()
if command == "exit" then
break
else
local exists, path = findFile(command)
if exists then
shell.run(path)
else
print("Unknown command: "..command)
end
end
end
Any idead on how? :ph34r:/>