ComputerCraft Archive

cshell

computer operating-system kepler155c github

Description

ComputerCraft OS

Installation

Copy one of these commands into your ComputerCraft terminal:

wget:wget https://raw.githubusercontent.com/kepler155c/opus/develop-1.8/sys/apps/cshell.lua cshell
Archive:wget https://cc.shobie.xyz/cc/get/gh-kepler155c-opus-sys-apps-cshell cshell
Quick Install: wget https://cc.shobie.xyz/cc/get/gh-kepler155c-opus-sys-apps-cshell cshell

Usage

Run: cshell

Tags

none

Source

View Original Source

Code Preview

local Config     = require('opus.config')

local read  = _G.read
local shell = _ENV.shell

if not _G.http.websocket then
	error('Requires CC: Tweaked')
end

if not _G.cloud_catcher then
	local key = Config.load('cloud').key

	if not key then
		print('Visit https://cloud-catcher.squiddev.cc')
		print('Paste key: ')
		key = read()
		if #key == 0 then
			return
		end
	end
	print('Connecting...')
	shell.run('cloud ' .. key)
end