Jump to content




Where is the problem ?


  • You cannot reply to this topic
4 replies to this topic

#1 Asbetha

  • Members
  • 3 posts

Posted 06 February 2014 - 01:25 PM

Well, I'm programing a desktop (it shall looks like a bit of Windows XP).
My problem is now, if I want to start the program "Desktop" the PC immediately is closeing himself
Can someone see my mistake in the codes?
(Sorry for my bad English grammar knowledge)

os.pullEvent = os.PullEventRaw
term.clear()
term.setBackgroundColor(512)
print(" ")
print(" ")
print(" ")
print(" ")
print(" ")
print(" ")
print(" ")
print(" ")
print(" ")
print(" ")
print(" ")
print(" ")
print(" ")
print(" ")
print(" ")
print(" ")
print(" ")
term.setBackgroundColor(colors.blue)
term.setTextColor(colors.white)
print(" ")

term.setCursorPos(1,18)
term.setBackgroundColor(008800)
term.setTextColor(colors.white)
write(" START ")

term.setCursorPos(1,1)

while true do local event, button, X, Y = os.pullEvent("mouse_click")
XY = X..","..Y
if XY == "1,18" and button == 1 then
term.clear()
shell.run("programs")
end
if XY == "2,18" and button == 1 then
term.clear()
shell.run("programs")
end
if XY == "3,18" and button == 1 then
term.clear()
shell.run("programs")
end
if XY == "4,18" and button == 1 then
term.clear()
shell.run("programs")
end
if XY == "5,18" and button == 1 then
term.clear()
shell.run("programs")
end
if XY == "6,18" and button == 1 then
term.clear()
shell.run("programs")
end
if XY == "7,18" and button == 1 then
term.clear()
shell.run("programs")
end
end

(http://pastebin.com/W3d4gt2r)

Edited by Asbetha, 06 February 2014 - 01:53 PM.


#2 Kingdaro

    The Doctor

  • Members
  • 1,636 posts
  • Location'MURICA

Posted 06 February 2014 - 02:07 PM

The first line should say "os.pullEvent = os.pullEventRaw" and not "os.pullEvent = os.PullEventRaw".

Edited by Kingdaro, 06 February 2014 - 02:07 PM.


#3 Asbetha

  • Members
  • 3 posts

Posted 06 February 2014 - 03:25 PM

The first line should say "os.pullEvent = os.pullEventRaw" and not "os.pullEvent = os.PullEventRaw".
well that sounds equal...

#4 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 06 February 2014 - 04:07 PM

No, they are different. Look carefully at the capitalization. Lua is case-sensitive, so it makes a difference.

#5 Asbetha

  • Members
  • 3 posts

Posted 06 February 2014 - 04:58 PM

ah I can see it ... thanks^^"





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users