streqicity

shopthing

Mar 16th, 2014
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.05 KB | None | 0 0
  1. os.loadAPI("button")
  2. shell.run("pastebin","get","HRbMF1Eg","button")
  3. fs.makeDir("folder")
  4. sug="id:"
  5. red=1
  6. m=peripheral.wrap("top")
  7. function fillTable()
  8. button.setTable("1",one,2,4,8,10)
  9. button.setTable("2",two,5,7,8,10)
  10. button.setTable("3",three,8,10,8,10)
  11. button.setTable("4",four,2,4,5,7)
  12. button.setTable("5",five,5,7,5,7)
  13. button.setTable("6",six,8,10,5,7)
  14. button.setTable("7",seven,2,4,2,4)
  15. button.setTable("8",eight,5,7,2,4)
  16. button.setTable("9",nine,8,10,2,4)
  17. button.setTable(":",colon,2,5,11,13)
  18. button.setTable("0",zero,6,10,11,13)
  19. button.setTable("Enter",enter,2,10,14,16)
  20. button.setTable("Clear",clear,2,10,17,19)
  21. button.screen()
  22.  
  23. end
  24. function getClick()
  25. event,side,x,y=os.pullEvent("monitor_touch")
  26. button.checkxy(x,y)
  27. end
  28. function one()
  29. button.flash("1")
  30. sug=(sug.."1")
  31. end
  32. function two()
  33. button.flash("2")
  34. sug=(sug.."2")
  35. end
  36. function three()
  37. button.flash("3")
  38. sug=(sug.."3")
  39. end
  40. function four()
  41. button.flash("4")
  42. sug=(sug.."4")
  43. end
  44. function five()
  45. button.flash("5")
  46. sug=(sug.."5")
  47. end
  48. function six()
  49. button.flash("6")
  50. sug=(sug.."6")
  51. end
  52. function seven()
  53. button.flash("7")
  54. sug=(sug.."7")
  55. end
  56. function eight()
  57. button.flash("8")
  58. sug=(sug.."8")
  59. end
  60. function nine()
  61. button.flash("9")
  62. sug=(sug.."9")
  63. end
  64. function zero()
  65. button.flash("0")
  66. sug=(sug.."0")
  67. end
  68. function colon()
  69. button.flash(":")
  70. sug=(sug..":")
  71. end
  72. function enter()
  73. button.flash("Enter")
  74. god=fs.open(("folder".."/"..red),"w")
  75. god.write(sug)
  76. god.close()
  77. red=red+1
  78. sug="id:"
  79. m.setCursorPos(15,13)
  80. m.clearLine()
  81. m.setCursorBlink(false)
  82. m.write(sug)
  83. end
  84. function clear()
  85. sug="id:"
  86. button.flash("Clear")
  87. m.setCursorPos(15,13)
  88. m.clearLine()
  89. m.setCursorBlink(false)
  90. m.write(sug)
  91. end
  92.  
  93.  
  94. fillTable()
  95. button.heading("Want an item? enter its id here if we dont have it")
  96. getClick()
  97. m.setCursorPos(15,13)
  98. m.clearLine()
  99. m.setCursorBlink(false)
  100. m.write(sug)
  101. while true do
  102. getClick()
  103. fillTable()
  104. m.setCursorPos(15,13)
  105. m.clearLine()
  106. m.setCursorBlink(false)
  107. m.write(sug)
  108. end
Advertisement
Add Comment
Please, Sign In to add comment