Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tableId= {}
- tableName= {}
- tableFix= {}
- tableFix[0]= 0
- tableFix[1]= " "
- tableFix[2]= " "
- tableFix[3]= " "
- function getButtonInfo()
- term.clear()
- term.setCursorPos(1,1)
- print("How Many Buttons?")
- butNum = read()
- term.clear()
- for i=1, butNum do
- term.setCursorPos(1,1)
- print(string.format("Name of Button %d", i))
- tableName[i] = read()
- term.clear()
- end
- for i=1, butNum do
- term.setCursorPos(1,1)
- print(string.format("ID of computer %d", i))
- tableId[i] = read()
- term.clear()
- end
- end
- function FixNameNum()
- for i=1, butNum do
- NameFixNum = 6 - string.len(tableName[i])
- if NameFixNum == 0 then
- tableName[i] = (tableName[i].." Door")
- else
- tableName[i] = (tableName[i]..tableFix[NameFixNum].." Door")
- print(myTable[i])
- end
- end
- end
- function BasicDraw()
- term.clear()
- if tonumber(butNum) == 1 then
- for i=1, butNum do
- term.setCursorPos(1, i)
- term.setBackgroundColor(colors.blue)
- term.write(tableName[i])
- term.setBackgroundColor(colors.black)
- term.setCursorPos(12,i)
- term.write(" Open ")
- term.setCursorPos(18,i)
- term.write("Close ")
- end
- elseif tonumber(butNum) == 2 then
- for i=1, butNum do
- term.setCursorPos(1, i)
- term.setBackgroundColor(colors.blue)
- term.write(tableName[i])
- term.setBackgroundColor(colors.black)
- term.setCursorPos(12,i)
- term.write(" Open ")
- term.setCursorPos(18,i)
- term.write("Close ")
- end
- elseif tonumber(butNum) == 3 then
- for i=1, butNum do
- term.setCursorPos(1, i)
- term.setBackgroundColor(colors.blue)
- term.write(tableName[i])
- term.setBackgroundColor(colors.black)
- term.setCursorPos(12,i)
- term.write(" Open ")
- term.setCursorPos(18,i)
- term.write("Close")
- end
- end
- end
- getButtonInfo()
- FixNameNum()
- BasicDraw()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement