Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if fs.exists("touchpoint") then
- print("yes")
- else
- print("Downloading touchpoint")
- local h = http.get( "http://pastebin.com/raw.php?i=pFHeia96" ) --#get the raw paste
- if h then
- local f = fs.open( "touchpoint", "w" ) --#open the 'touchpoint' file in write mode
- f.write( h.readAll() ) --#write the contents of the raw paste to the file
- f.close() --#close the file handle
- h.close() --#close the web handle
- end
- end
- os.loadAPI("touchpoint")
- t = touchpoint.new("right")
- function numberPad(xMin,yMin,xMax,yMax,colorActive,colorInactive)
- local column1 = {xMin,((xMax-xMin)/5)+xMin}
- local column2 = {(((xMax-xMin)/5)*2)+xMin,(((xMax-xMin)/5)*3)+xMin}
- local column3 = {(((xMax-xMin)/5)*4)+xMin,xMax}
- local row1 = {yMin, ((yMax-yMin)/7)+yMin}
- local row2 = {(((yMax-yMin)/7)*2)+yMin,(((yMax-yMin)/7)*3)+yMin}
- local row3 = {(((yMax-yMin)/7)*4)+yMin,(((yMax-yMin)/7)*5)+yMin}
- local row4 = {(((yMax-yMin)/7)*6)+yMin,yMax}
- -- --[[
- print(column1[1].." - "..column1[2])
- print(column2[1].." - "..column2[2])
- print(column3[1].." - "..column3[2])
- print(row1[1].." - "..row1[2])
- print(row2[1].." - "..row2[2])
- print(row3[1].." - "..row3[2])
- print(row4[1].." - "..row4[2])
- -- ]]--
- if colorActive == rainbow then
- print("RAINBOW!!!")
- colors = {
- colors.red,
- colors.orange,
- colors.green,
- colors.blue,
- colors.purple,
- }
- else
- colors = {
- colorActive,
- colorActive,
- colorActive,
- colorActive,
- colorActive,
- }
- end
- t:add("7", Seven,column1[1],row1[1],column1[2],row1[2],colors[1],colorInactive)
- t:add("8", Eight,column2[1],row1[1],column2[2],row1[2],colors[2],colorInactive)
- t:add("9", Nine,column3[1],row1[1],column3[2],row1[2],colors[3],colorInactive)
- t:add("4", Four,column1[1],row2[1],column1[2],row2[2],colors[2],colorInactive)
- t:add("5", Five,column2[1],row2[1],column2[2],row2[2],colors[3],colorInactive)
- t:add("6", Six,column3[1],row2[1],column3[2],row2[2],colors[4],colorInactive)
- t:add("1", One,column1[1],row3[1],column1[2],row3[2],colors[3],colorInactive)
- t:add("2", Two,column2[1],row3[1],column2[2],row3[2],colors[4],colorInactive)
- t:add("3", Three,column3[1],row3[1],column3[2],row3[2],colors[5],colorInactive)
- t:add("0", Zero,column2[1],row4[1],column2[2],row4[2],colors[5],colorInactive)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement