Difference between revisions of "Talk:Os.queueEvent"

From ComputerCraft Wiki
Jump to: navigation, search
 
(One intermediate revision by the same user not shown)
Line 2: Line 2:
 
--[[User:Banane9|Banane9]] 15:21, 12 July 2012 (UTC)
 
--[[User:Banane9|Banane9]] 15:21, 12 July 2012 (UTC)
 
:It is supposed to output "Hello" when a redstone current from the left side comes or when the player hits Enter - which works for me --[[User:Pinkishu|Pinkishu]] 14:35, 13 July 2012 (CEST)
 
:It is supposed to output "Hello" when a redstone current from the left side comes or when the player hits Enter - which works for me --[[User:Pinkishu|Pinkishu]] 14:35, 13 July 2012 (CEST)
 +
:: if event == "redstone" then
 +
      if rs.getInput("left") then
 +
        os.queueEvent("key",28)
 +
      end
 +
    elseif event == "key" then
 +
      if param1 == 28 then
 +
        print("Hello")
 +
      end
 +
    end
 +
::but the code says elseif, so i wonder why that would be executed when the event is redstone.
 +
:::Oh ok the while true loop and qeue event -.-
 +
--[[User:Banane9|Banane9]] 14:33, 13 July 2012 (UTC)

Latest revision as of 14:33, 13 July 2012

Is the Code supposed to not output hello when a redstone current comes? --Banane9 15:21, 12 July 2012 (UTC)

It is supposed to output "Hello" when a redstone current from the left side comes or when the player hits Enter - which works for me --Pinkishu 14:35, 13 July 2012 (CEST)
if event == "redstone" then
     if rs.getInput("left") then
       os.queueEvent("key",28)
     end
   elseif event == "key" then
     if param1 == 28 then
       print("Hello")
     end
   end
but the code says elseif, so i wonder why that would be executed when the event is redstone.
Oh ok the while true loop and qeue event -.-

--Banane9 14:33, 13 July 2012 (UTC)