Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("phpInterface")
- local IOUrl = "softberrykai.com/cc/objc.php"
- local function send(url,args)
- phpInterface.setUrl(url)
- local v = phpInterface.sendPostPodyWithArguments(args)
- return v
- end
- --http.post("http://softberrykai.com/cc/objc.php","label=cs,data=print('Starting COpSys...')")
- --http.post("http://softberrykai.com/cc/objc.php","label=luas,data=eventstartup")
- local function pullClick()
- local event, button, x, y = os.pullEvent("mouse_click")
- local string = "b"..tostring(button).."x"..tostring(x).."y"..tostring(y).."|eventclick"
- local args = {["label"] = "luas", ["data"] = string}
- --phpInterface.setUrl(IOUrl)
- --phpInterface.sendPostPodyWithArguments(args)
- http.post("http://softberrykai.com/cc/objc.php","label=luas&data="..string)
- end
- local function pullKey()
- local event, code = os.pullEvent("key")
- local string = "k"..tostring(code).."|eventkey"
- local args = {["label"] = "luas", ["data"] = string}
- http.post("http://softberrykai.com/cc/objc.php","label=luas&data="..string)
- end
- local function pullScroll()
- local event, direction, x, y = os.pullEvent("mouse_scroll")
- local string = "d"..tostring(direction).."x"..tostring(x).."y"..tostring(y).."|eventscroll"
- local args = {["label"] = "luas", ["data"] = string}
- http.post("http://softberrykai.com/cc/objc.php","label=luas&data="..string)
- end
- local function pullDrag()
- local event,button,x,y = os.pullEvent("mouse_drag")
- local string = "b"..tostring(button).."x"..tostring(x).."y"..tostring(y).."|eventdrag"
- local args = {["label"] = "luas", ["data"] = string}
- http.post("http://softberrykai.com/cc/objc.php","label=luas&data="..string)
- end
- local function pullInsert()
- local event,side = os.pullEvent("disk")
- local string = "s"..side.."|eventdiskinsert"
- local args = {["label"] = "luas", ["data"] = string}
- http.post("http://softberrykai.com/cc/objc.php","label=luas&data="..string)
- end
- local function pullEject()
- local event,side = os.pullEvent("disk_eject")
- local string = "s"..side.."|eventdiskeject"
- local args = {["label"] = "luas", ["data"] = string}
- http.post("http://softberrykai.com/cc/objc.php","label=luas&data="..string)
- end
- local function pullResponse()
- local response = ""
- while response == "" or response == "Data Has Been Read" do
- response = http.post("http://softberrykai.com/cc/objc.php","label=luar&data= ").readAll()
- end
- --print(response)
- loadstring(response)()
- end
- local x,y = term.getSize()
- http.post("http://softberrykai.com/cc/objc.php","label=luar&data= ")
- http.post("http://softberrykai.com/cc/objc.php","label=luas&data=x"..tostring(x).."y"..tostring(y).."|eventstartup")
- while true do
- pullResponse()
- parallel.waitForAny(pullClick,pullKey,pullScroll,pullDrag,pullInsert,pullEject)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement