Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --defines----
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.red)
- -------------
- --functions--
- function test()
- sleep(0)
- end
- function clear()
- term.setBackgroundColor(colors.black)
- term.clear()
- term.setCursorPos(1,1)
- end
- function addButton(xmin,ymin,xmax,ymax,func,text)
- term.setBackgroundColor(colors.green)
- term.setCursorPos(xmin,ymin)
- term.write(text)
- event, button, x, y = os.pullEvent("mouse_click")
- if x >= xmin and x <= xmax and y >= ymin and y <= ymax then
- func()
- end
- end
- -------------
- while true do
- addButton(1,1,4,2,test,"hi")
- addButton(1,3,4,4,test,"fgt")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement