Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function run(pgrm)
- shell.run(pgrm)
- end
- function pos(x, y)
- term.setCursorPos(x, y)
- end
- function pixel(a, b, color)
- paintutils.drawPixel(a, b, color)
- end
- function background(color)
- term.setBackgroundColor(color)
- end
- function clear(x, y)
- term.clear()
- pos(x, y)
- end
- function horLine(x, length, y)
- for i=x, x+length-1, 1 do
- pos(i, y)
- print('-')
- end
- end
- function vertLine(y, length, x)
- for i=y, y+length-1, 1 do
- pos(x, i)
- print('|')
- end
- end
- function findPeripheral( kind )
- for _, v in pairs( rs.getSides() ) do
- if peripheral.isPresent( v ) and peripheral.getType( v ) == kind then
- return v
- end
- end
- return nil
- end
- run('cd /.aOS')
- clear(1, 1)
- --List Of Stuff to do
- pixel(51, 19, colors.red)
- background(colors.black)
- pos(1, 1)
- print(' Shell | Shutdown')
- pixel(1, 1, colors.lime)
- pixel(28, 1, colors.red)
- pos(1, 2)
- background(colors.black)
- print(' rReceive | Reboot')
- pixel(1, 2, colors.lime)
- pixel(28, 2, colors.red)
- pos(1, 3)
- background(colors.black)
- print(' rSend | rLookupHost')
- pixel(1, 3, colors.lime)
- pixel(28, 3, colors.lime)
- pos(1, 4)
- background(colors.black)
- print(' Lua | rLookupProtocol')
- pixel(1, 4, colors.lime)
- pixel(28, 4, colors.lime)
- pos(1, 5)
- background(colors.black)
- print(' Edit | FTPSend')
- pixel(1, 5, colors.lime)
- pixel(28, 5, colors.lime)
- pos(1, 6)
- background(colors.black)
- print(' FTPReceive |')
- pixel(1, 6, colors.lime)
- pos(1, 7)
- background(colors.black)
- --Detect Click
- local event, button, x, y = os.pullEvent('mouse_click')
- --Do Stuff with Click
- if x == 1 and y == 1 then
- run('shell')
- elseif x == 28 and y == 1 then
- os.shutdown()
- elseif x == 1 and y == 2 then
- run('rReceive')
- elseif x == 28 and y == 2 then
- os.reboot()
- elseif x == 1 and y == 3 then
- run('rSend')
- elseif x == 28 and y == 3 then
- run('rLookupHost')
- elseif x == 1 and y == 4 then
- run('runLua')
- elseif x == 28 and y == 4 then
- run('rLookupProtocol')
- elseif x == 1 and y == 5 then
- run('runEdit')
- elseif x == 1 and y == 6 then
- run('FTPReceive')
- elseif x == 28 and y == 5 then
- run('FTPSend')
- elseif x == 51 and y == 19 then
- clear(1, 1)
- error()
- else
- run('menu')
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement