Posted 20 November 2015 - 08:50 PM
local keys = {}
Keys["keys.1"] = "1"
Keys["keys.2"] = "2"
Keys["keys.3"] = "3"
Keys["keys.4"] = "4"
Keys["keys.5"] = "5"
Keys["keys.6"] = "6"
Keys["keys.7"] = "7"
Keys["keys.8"] = "8"
Keys["keys.9"] = "9"
function draw()
paintutils.drawFilledBox(0,0,100,100,colors.blue)
term.setCursorPos(3,3)
print("Turtle Controller V1")
term.setCursorPos(3,5)
print("Add ID : "..ID)
end
ID = ""
draw()
term.setCursorPos(10,5)
while true do
local event, key = os.pullEvent("key")
end
this is my current code and i want to test when you press a number key and add it to the var id, i thought of tables but couldn't remember how to implement that, could someone help me? is there a better way?
Keys["keys.1"] = "1"
Keys["keys.2"] = "2"
Keys["keys.3"] = "3"
Keys["keys.4"] = "4"
Keys["keys.5"] = "5"
Keys["keys.6"] = "6"
Keys["keys.7"] = "7"
Keys["keys.8"] = "8"
Keys["keys.9"] = "9"
function draw()
paintutils.drawFilledBox(0,0,100,100,colors.blue)
term.setCursorPos(3,3)
print("Turtle Controller V1")
term.setCursorPos(3,5)
print("Add ID : "..ID)
end
ID = ""
draw()
term.setCursorPos(10,5)
while true do
local event, key = os.pullEvent("key")
end
this is my current code and i want to test when you press a number key and add it to the var id, i thought of tables but couldn't remember how to implement that, could someone help me? is there a better way?