Posted 18 October 2014 - 06:40 PM
Hi guys. Where is a problem please ?local function pmenu () local f=fs.open("//.core/nastaveni.cfg","r") local cnt=f.readAll() f.close() local nastaveni=textutils.unserialize(cnt) term.setBackgroundColor(colors.white) term.setTextColor(colors.black) term.clear () term.setBackgroundColor(nastaveni.barva) term.setCursorPos(1,1) print " " term.setBackgroundColor(colors.lightBlue) term.setCursorPos(5,4) print "- Run " term.setCursorPos(5,6) print "- Get " term.setCursorPos(5,6) print "- Put " term.setCursorPos(5,7) print "- End " term.setBackgroundColor(colors.white) while true do local event, button, x, y = os.pullEventRaw() if event == "mouse_click" then if x <= 5 and x >= 10 and y == 4 and button == 1 then spustit () elseif x <= 5 and x >= 10 and y == 6 and button == 1 then ulozit () end end end end function spustit () print "vlozte kod" kod1 = io.read () shell.run ("pastebin run",kod1) end function ulozit () print "vlozte kod" kod1 = io.read () print "vlozte umisteni" kod2 = io.read () shell.run ("pastebin get",kod1,kod2) prohlizec () end function nahrat () print "vlozte umisteni" kod1 = io.read () shell.run ("pastebin put",kod1) pokr = io.read () if pokr == "" then pmenu () else plocha () end end pmenu ()
Hi guys. Where is a problem please ?
local function pmenu ()
local f=fs.open("//.core/nastaveni.cfg","r")
local cnt=f.readAll()
f.close()
local nastaveni=textutils.unserialize(cnt)
term.setBackgroundColor(colors.white)
term.setTextColor(colors.black)
term.clear ()
term.setBackgroundColor(nastaveni.barva)
term.setCursorPos(1,1)
print " "
term.setBackgroundColor(colors.lightBlue)
term.setCursorPos(5,4)
print "- Run "
term.setCursorPos(5,6)
print "- Get "
term.setCursorPos(5,6)
print "- Put "
term.setCursorPos(5,7)
print "- End "
term.setBackgroundColor(colors.white)
while true do
local event, button, x, y = os.pullEventRaw()
if event == "mouse_click" then
if x <= 5 and x >= 10 and y == 4 and button == 1 then
spustit ()
elseif x <= 5 and x >= 10 and y == 6 and button == 1 then
ulozit ()
end
end
end
end
function spustit ()
print "vlozte kod"
kod1 = io.read ()
shell.run ("pastebin run",kod1)
end
function ulozit ()
print "vlozte kod"
kod1 = io.read ()
print "vlozte umisteni"
kod2 = io.read ()
shell.run ("pastebin get",kod1,kod2)
prohlizec ()
end
function nahrat ()
print "vlozte umisteni"
kod1 = io.read ()
shell.run ("pastebin put",kod1)
pokr = io.read ()
if pokr == "" then
pmenu ()
else
plocha ()
end
end
pmenu ()
Edited on 18 October 2014 - 06:07 PM