Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function playback(tf)
- f=fs.open("playback","w")
- f.write(tf)
- f.close()
- end
- function check(uuid)
- box=peripheral.wrap("right")
- list=box.sense()
- for i=1,#list do
- if list[i].id==uuid then
- if list[i].x>-1.5 and list[i].x<0.5 or list[i].y>2.5 and list[i].y<6 and list[i].z>1 and list[i].z<-0.5 then
- return true
- else return false
- end
- elseif i==#list then
- return false
- end
- end
- end
- mon=peripheral.find("monitor")
- box=peripheral.wrap("right")
- mon.clear()
- mon.setTextScale(1)
- afker=false
- while afker==false do
- _,player,message,uuid=os.pullEvent("chat_message")
- if message=="test" then
- if check(uuid) then
- afker=true
- playback("t")
- shell.openTab("ducktales")
- while check(uuid) do
- pfr=fs.open("employees/"..uuid,"r")
- if pfr then
- playername=pfr.readLine()
- pbalance=pfr.readLine()
- totalafktime=pfr.readLine()
- pfr.close()
- else
- pbalance=0
- totalafktime=0
- end
- sleep(3.6)
- pbalance=tonumber(pbalance)+0.01
- totalafktime=tonumber(totalafktime)+3.6
- pfw=fs.open("employees/"..uuid,"w")
- pfw.writeLine(player)
- pfw.writeLine(pbalance)
- pfw.writeLine(totalafktime)
- pfw.close()
- mon.clear()
- mon.setCursorPos(1,1)
- mon.write("Logged in as")
- mon.setCursorPos(1,2)
- mon.write(player..".")
- mon.setCursorPos(1,4)
- mon.write("Your balance:")
- mon.setCursorPos(1,5)
- mon.write(string.format("%.2f",pbalance).." kst")
- end
- playback("f")
- for i=0,15 do
- mon.clear()
- mon.setCursorPos(1,1)
- mon.write(player)
- mon.setCursorPos(1,2)
- mon.write("left the area,")
- mon.setCursorPos(1,3)
- mon.write("AFK session over.")
- mon.setCursorPos(1,4)
- mon.write(player.."'s")
- mon.setCursorPos(1,5)
- mon.write("balance is:")
- mon.setCursorPos(1,6)
- mon.write(pbalance.." kst")
- mon.setCursorPos(1,8)
- mon.write("Payout in:")
- mon.setCursorPos(3,10)
- mon.write("Gold Krist")
- mon.setCursorPos(1,12)
- mon.write("Closing in "..15-i)
- sleep(1)
- end
- end
- end
- end
- os.reboot()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement