Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while true do
- response = http.get("http://35.204.206.85/transmit.php?server=35.187.40.176&user=nosk&password=1234&query=Select+*+FROM+Traverskran.Traverskran")
- data = response.readAll()
- response.close()
- function getStatus(str)
- output = ""
- for i=0, (string.len(str)) do
- cc = string.sub(str, i, i)
- if((cc=='[') or (cc=='"') or (cc==',') or (cc == ']')) then
- i = i+1
- else
- output = output .. cc
- end
- end
- return output
- end
- status = getStatus(data)
- print(status)
- redstone.setOutput("top", (string.sub(status, 1, 1) == '1'))
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement