Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- speaker = peripheral.wrap("left")
- monitor1 = peripheral.wrap("top")
- rednet.open("right")
- client = 1
- --face-------------------------------------
- function face()
- monitor1.clear()
- --lefteye
- monitor1.setCursorPos(5,2)
- monitor1.write("##")
- monitor1.setCursorPos(5,3)
- monitor1.write("##")
- --lefteye
- --righteye
- monitor1.setCursorPos(13,2)
- monitor1.write("##")
- monitor1.setCursorPos(13,3)
- monitor1.write("##")
- --righteye
- --mouth
- monitor1.setCursorPos(6,6)
- monitor1.write("########")
- monitor1.setCursorPos(6,7)
- monitor1.write("########")
- --mouth
- --textbox
- monitor1.setCursorPos(1,9)
- monitor1.write("------------------")
- monitor1.setCursorPos(1,12)
- monitor1.write("------------------")
- end
- --textbox
- --begin text at 1,10
- --face------------------------------------
- --faceblink-------------------------------
- function faceblink()
- monitor1.clear()
- --lefteye
- monitor1.setCursorPos(5,3)
- monitor1.write("##")
- --lefteye
- --righteye
- monitor1.setCursorPos(13,3)
- monitor1.write("##")
- --righteye
- --mouth
- monitor1.setCursorPos(6,6)
- monitor1.write("########")
- monitor1.setCursorPos(6,7)
- monitor1.write("########")
- --mouth
- --textbox
- monitor1.setCursorPos(1,9)
- monitor1.write("------------------")
- monitor1.setCursorPos(1,12)
- monitor1.write("------------------")
- end
- --textbox
- --begin text at 1,10
- --faceblink-------------------------------
- --facelookleft----------------------------
- function facelookleft()
- monitor1.clear()
- --lefteye
- monitor1.setCursorPos(4,2)
- monitor1.write("##")
- monitor1.setCursorPos(4,3)
- monitor1.write("##")
- --lefteye
- --righteye
- monitor1.setCursorPos(12,2)
- monitor1.write("##")
- monitor1.setCursorPos(12,3)
- monitor1.write("##")
- --righteye
- --mouth
- monitor1.setCursorPos(6,6)
- monitor1.write("########")
- monitor1.setCursorPos(6,7)
- monitor1.write("########")
- --mouth
- --textbox
- monitor1.setCursorPos(1,9)
- monitor1.write("------------------")
- monitor1.setCursorPos(1,12)
- monitor1.write("------------------")
- end
- --textbox
- --begin text at 1,10
- --facelookleft---------------------------
- --facelookright--------------------------
- function facelookright()
- monitor1.clear()
- --lefteye
- monitor1.setCursorPos(6,2)
- monitor1.write("##")
- monitor1.setCursorPos(6,3)
- monitor1.write("##")
- --lefteye
- --righteye
- monitor1.setCursorPos(14,2)
- monitor1.write("##")
- monitor1.setCursorPos(14,3)
- monitor1.write("##")
- --righteye
- --mouth
- monitor1.setCursorPos(6,6)
- monitor1.write("########")
- monitor1.setCursorPos(6,7)
- monitor1.write("########")
- --mouth
- --textbox
- monitor1.setCursorPos(1,9)
- monitor1.write("------------------")
- monitor1.setCursorPos(1,12)
- monitor1.write("------------------")
- end
- --textbox
- --begin text at 1,10
- --facelookright-------------------------
- ---------------------------------------------------------face^^^^^^^^
- --xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
- --functions
- function facemotion()
- local blinktime = math.random(8,11)
- local looker = math.random(2,9)
- face()
- sleep(blinktime)
- if looker == 3 then
- facelookright()
- sleep(2)
- elseif looker == 6 then
- facelookleft()
- sleep(2)
- else
- faceblink()
- sleep(.1)
- end
- end
- function receive()
- while true do
- id, msg = rednet.receive()
- if id == client then
- speaker.synthesize(msg, 5)
- end
- end
- end
- --function
- --main loop
- while true do
- parallel.waitForAny(receive, facemotion)
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement