Posted 27 September 2015 - 02:29 PM
Literally started ComputerCraft 6 hours ago and have yet to finish my first program, I've just started recieving a multiple points error everytime I try to access gui by typing gui. Here is the code, hopefully it's not too difficult to find. Thanks for any help I recieve, I have very very little idea what I'm actually doing so far. And sorry, it's probably a bit longer than it needed to be, newb clutter.
–Variables
version = 1.0.0
running = true
–Colors
colTaskBar = colors.black
colBackground = colors.black
–Images
_dt = paintutils.loadImage("/os/.backgrounds/dt")
–Booleans
_ms = 0
_rcm = 0
–Functions
clear = function()
term.setBackgroundColor(colors.black)
term.clear()
term.setCursorPos(1, 1)
end
drawMenu1 = function()
term.setCursorPos(1, 2)
term.setBackgroundColor( colors.red )
term.setTextColor( colors.black )
print( "[POWER]" )
end
rightClickMenu = function(x, y)
term.setBackgroundColor( colors.white )
term.setTextColor( colors.black )
term.setCursorPos(x, y)
term.write(" [LUA] ")
term.setCursorPos(x, y+1)
term.write(" [IDE] ")
local event, button, xPos, yPos = os.pullEvent("mouse_click")
while true do
if button == 1 and yPos == y and xPos <= (x+7) and xPos >= x then
running = false
clear()
term.setTextColor( colors.red )
print("Gone into Command Prompt..")
print("OS will shutdown after exitting of LUA PROMPT")
print("Any function of the OS is in the LUA functions now.")
shell.run("lua")
break
elseif button == 1 and yPos == (y+1) and xPos <= (x+7) and xPos >= x then
shell.run("edit", "/gui")
init()
break
else
redraw()
break
end
end
_rcm = 0
end
redraw = function()
drawDeskTop()
drawTaskBar()
end
drawTaskBar = function()
term.setCursorPos(1, 1)
term.setBackgroundColor( colors.colTaskBar )
term.clearLine()
term.setCursorPos(1, 1)
term.setBackgroundColor( colors.black )
term.setTextColor( colors.white )
term.write( "[MENU]" )
end
drawDeskTop = function()
term.setBackgroundColor(colors.colBackground)
term.clear()
term.setCursorPos(1, 1)
paintutils.drawImage(_dt, 1, 1)
end
loadConfig = function()
local
end
stop = function()
clear()
running = false
term.setTextColor( colors.green )
print("Log Off Confirmed.")
exit()
end
runTime = function()
while running do
event, button, x, y = os.pullEvent("mouse_click")
if _ms == 0 and button == 1 and x < 7 and y == 1 then
drawMenu1()
_ms = 1
elseif _ms == 1 and button == 1 and y == 2 and x < 7 then
stop()
elseif _ms == 1 and button == 1 and x < 7 and y == 1 then
init()
elseif _ms == 0 and _rcm == 0 and button == 2 then
_rcm = 1
rightClickMenu(x, y)
end
end
end
init = function()
_ms = 0
drawDeskTop()
drawTaskBar()
runTime()
end
–Main Stuff
init()
–Variables
version = 1.0.0
running = true
–Colors
colTaskBar = colors.black
colBackground = colors.black
–Images
_dt = paintutils.loadImage("/os/.backgrounds/dt")
–Booleans
_ms = 0
_rcm = 0
–Functions
clear = function()
term.setBackgroundColor(colors.black)
term.clear()
term.setCursorPos(1, 1)
end
drawMenu1 = function()
term.setCursorPos(1, 2)
term.setBackgroundColor( colors.red )
term.setTextColor( colors.black )
print( "[POWER]" )
end
rightClickMenu = function(x, y)
term.setBackgroundColor( colors.white )
term.setTextColor( colors.black )
term.setCursorPos(x, y)
term.write(" [LUA] ")
term.setCursorPos(x, y+1)
term.write(" [IDE] ")
local event, button, xPos, yPos = os.pullEvent("mouse_click")
while true do
if button == 1 and yPos == y and xPos <= (x+7) and xPos >= x then
running = false
clear()
term.setTextColor( colors.red )
print("Gone into Command Prompt..")
print("OS will shutdown after exitting of LUA PROMPT")
print("Any function of the OS is in the LUA functions now.")
shell.run("lua")
break
elseif button == 1 and yPos == (y+1) and xPos <= (x+7) and xPos >= x then
shell.run("edit", "/gui")
init()
break
else
redraw()
break
end
end
_rcm = 0
end
redraw = function()
drawDeskTop()
drawTaskBar()
end
drawTaskBar = function()
term.setCursorPos(1, 1)
term.setBackgroundColor( colors.colTaskBar )
term.clearLine()
term.setCursorPos(1, 1)
term.setBackgroundColor( colors.black )
term.setTextColor( colors.white )
term.write( "[MENU]" )
end
drawDeskTop = function()
term.setBackgroundColor(colors.colBackground)
term.clear()
term.setCursorPos(1, 1)
paintutils.drawImage(_dt, 1, 1)
end
loadConfig = function()
local
end
stop = function()
clear()
running = false
term.setTextColor( colors.green )
print("Log Off Confirmed.")
exit()
end
runTime = function()
while running do
event, button, x, y = os.pullEvent("mouse_click")
if _ms == 0 and button == 1 and x < 7 and y == 1 then
drawMenu1()
_ms = 1
elseif _ms == 1 and button == 1 and y == 2 and x < 7 then
stop()
elseif _ms == 1 and button == 1 and x < 7 and y == 1 then
init()
elseif _ms == 0 and _rcm == 0 and button == 2 then
_rcm = 1
rightClickMenu(x, y)
end
end
end
init = function()
_ms = 0
drawDeskTop()
drawTaskBar()
runTime()
end
–Main Stuff
init()