-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpipe.lua
48 lines (38 loc) · 1.03 KB
/
pipe.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
--require("png") --https://github.com/DelusionalLogic/pngLua
--terminal komandoak exekutatzeko
function os.capture(cmd, raw)
local f = assert(io.popen(cmd, 'r'))
local s = assert(f:read('*a'))
f:close()
if raw then return s end
s = string.gsub(s, '^%s+', '')
s = string.gsub(s, '%s+$', '')
s = string.gsub(s, '[\n\r]+', ' ')
return s
end
--Windows-en CMD bidez irudia lortzeko, oso geldoa
function getImagePipe()
client.screenshottoclipboard()
local cmd = ("python .\\clipboardimage.py")
local image = os.capture(cmd)
return image
end
--irudia png moduan gorde eta kargatu
function getImage()
image = ""
client.screenshot("frame.png")
img = pngImage("frame.png", newRowCallback)
return image
end
--socket bidezko komunikazioa
function getSocket()
comm.socketServerSetTimeout(1000)
response = comm.socketServerScreenShotResponse()
return response
end
--http bidezko komunikazioa
function getHttp(postreq)
client.screenshottoclipboard()
image = comm.httpPost("http://192.168.0.18:8081",postreq)
return image
end