Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- c = peripheral.wrap("bottom")
- f = "Friday"
- x = 0.1
- t = {}
- e = "Ekxx"
- u = "stone" -- back output
- r = "dirt" -- right output
- ff = "cobble" -- front output
- l = "wood" -- left output
- s8 = "Sending 8 "
- s16 = "Sending 16 "
- s32 = "Sending 32 "
- s64 = "Sending 64 "
- se = "That is not a valid number. You can select 8, 16, 32 or 64. Please try again."
- function rsc(item,side)
- delay = item/20
- sleep(x)
- redstone.setOutput(side,true)
- sleep(delay)
- redstone.setOutput(side,false)
- sleep(x)
- t = {}
- end
- -- Code --
- while true do
- event, name, msg = os.pullEvent("chat")
- print(msg)
- t[#t+1]= msg
- for key, value in ipairs(t) do
- print(key..' '..value)
- -- Up --
- if name == e and t[#t] == u then
- sleep(x)
- c.say("How much "..u.." would you like?",-1,true,f)
- sleep(x)
- t[#t+1] = 1
- elseif name == e and t[#t-2] == u and t[#t] == "8" then
- sleep(x)
- c.say(s8..u,-1,true,f)
- rsc(8,"back")
- elseif name == e and t[#t-2] == u and t[#t] == "16" then
- sleep(x)
- c.say(s16..u,-1,true,f)
- rsc(16,"back")
- elseif name == e and t[#t-2] == u and t[#t] == "32" then
- sleep(x)
- c.say(s32..u,-1,true,f)
- rsc(32,"back")
- elseif name == e and t[#t-2] == u and t[#t] == "64" then
- sleep(x)
- c.say(s64..u,-1,true,f)
- rsc(64,"back")
- elseif
- t[#t-2] == u and name == e then
- sleep(x)
- c.say(se,-1,true,f)
- t = {}
- -- Right --
- elseif name == e and t[#t] == r then
- sleep(x)
- c.say("How much "..r.." would you like?",-1,true,f)
- sleep(x)
- t[#t+1] = 1
- elseif name == e and t[#t-2] == r and t[#t] == "8" then
- sleep(x)
- c.say(s8..r,-1,true,f)
- rsc(8,"right")
- elseif name == e and t[#t-2] == r and t[#t] == "16" then
- sleep(x)
- c.say(s16..r,-1,true,f)
- rsc(16,"right")
- elseif name == e and t[#t-2] == r and t[#t] == "32" then
- sleep(x)
- c.say(s32..r,-1,true,f)
- rsc(32,"right")
- elseif name == e and t[#t-2] == r and t[#t] == "64" then
- sleep(x)
- c.say(s64..r,-1,true,f)
- rsc(64,"right")
- elseif
- t[#t-2] == r and name == e then
- sleep(x)
- c.say(se,-1,true,f)
- t = {}
- -- Down --
- elseif name == e and t[#t] == ff then
- sleep(x)
- c.say("How much "..ff.." would you like?",-1,true,f)
- sleep(x)
- t[#t+1] = 1
- elseif name == e and t[#t-2] == ff and t[#t] == "8" then
- sleep(x)
- c.say(s8..ff,-1,true,f)
- rsc(8,"front")
- elseif name == e and t[#t-2] == ff and t[#t] == "16" then
- sleep(x)
- c.say(s16..ff,-1,true,f)
- rsc(16,"front")
- elseif name == e and t[#t-2] == ff and t[#t] == "32" then
- sleep(x)
- c.say(s32..ff,-1,true,f)
- rsc(32,"front")
- elseif name == e and t[#t-2] == ff and t[#t] == "64" then
- sleep(x)
- c.say(s64..ff,-1,true,f)
- rsc(64,"front")
- elseif
- t[#t-2] == ff and name == e then
- sleep(x)
- c.say(se,-1,true,f)
- t = {}
- -- Left --
- elseif name == e and t[#t] == l then
- sleep(x)
- c.say("How much "..l.." would you like?",-1,true,f)
- sleep(x)
- t[#t+1] = 1
- elseif name == e and t[#t-2] == l and t[#t] == "8" then
- sleep(x)
- c.say(s8..l,-1,true,f)
- rsc(8,"left")
- elseif name == e and t[#t-2] == l and t[#t] == "16" then
- sleep(x)
- c.say(s16..l,-1,true,f)
- rsc(16,"left")
- elseif name == e and t[#t-2] == l and t[#t] == "32" then
- sleep(x)
- c.say(s32..l,-1,true,f)
- rsc(32,"left")
- elseif name == e and t[#t-2] == l and t[#t] == "64" then
- sleep(x)
- c.say(s64..l,-1,true,f)
- rsc(64,"left")
- elseif
- t[#t-2] == l and name == e then
- sleep(x)
- c.say(se,-1,true,f)
- t = {}
- elseif name == e and t[#t] == "clear" then
- sleep(x)
- c.say("Clearing cache",-1,true,f)
- sleep(x)
- t = {}
- else
- sleep(x)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement