This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
IsaacTBeast's profile picture

Why I can't press the button [cmd]

Started by IsaacTBeast, 13 March 2014 - 05:35 AM
IsaacTBeast #1
Posted 13 March 2014 - 06:35 AM
Please help me!! I am currently working for my own os but I can't press the [CMD] Program please help.

Here's the code.


function main()
  term.setBackgroundColor(colors.white)
  term.clear()
  term.setCursorPos(1,1)
  os.sleep(0.1)
  while true do
    term.setBackgroundColor(colors.lightBlue)
    term.clear()
    paintutils.drawLine(1, 1, screenX, 1, colors.white)
    term.setTextColor(colors.black)
    term.setCursorPos(1,1)
    print("System Applications")
    term.setCursorPos(30,1)
    term.setTextColor(colors.black)
    print("[X]")
    term.setTextColor(colors.black)
    term.setCursorPos(1,4)
    print("[CMD]")
    local event, button, X, Y = os.pullEventRaw("mouse_click")
	 if X >= 1 and X <= 10 and Y == 4 and button == 1 then
	    shell.run("/isaacos/Programs/cmd.lua")
	  elseif X >= 30 and X <= 33 and Y == 1 and button == 1 then
	    shell.run("/isaacos/system/x16/os.lua")
	
	  end


  end
end

main()

screenX, screenY = term.getSize()

If you have a great answer I would glad to hear it.
oeed #2
Posted 13 March 2014 - 10:43 AM
Does it give an error message or is it just not running?

If you've already fixed it report it and ask it to be locked.
IsaacTBeast #3
Posted 13 March 2014 - 12:02 PM
I fix it but thanks oeed.. Can you lock this topic? please.
Lyqyd #4
Posted 13 March 2014 - 02:29 PM
We don't generally lock Ask a Pro topics, since they usually fall off the page quickly enough on their own and occasionally more valuable information or a further question from the original poster will show up.
IsaacTBeast #5
Posted 13 March 2014 - 02:50 PM
Oh..