Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mon = peripheral.wrap("monitor_1")
- snsr = peripheral.wrap("right")
- local shoppers = {}
- local shopperCount = 0
- local myNames
- mon.setTextScale(.5)
- local function checkShoppers (newName)
- local oldShopper = false
- for k,v in ipairs(shoppers) do
- if v == newName then
- oldShopper = true
- end
- end
- return oldShopper
- end
- local function considerShopper (shopper)
- if shopperCount == 0 then
- shoppers[1] = shopper
- shopperCount = 1
- else
- if not checkShoppers(shopper) then
- shopperCount = shopperCount + 1
- shoppers[shopperCount] = shopper
- end
- end
- end
- local function displayShoppers ()
- mon.clear()
- mon.setCursorPos(1,1)
- mon.setTextColor(colors.yellow)
- mon.write("Recent Patrons:")
- for a,b in ipairs(shoppers) do
- mon.setTextColor(colors.yellow)
- mon.setCursorPos(1,a+1)
- mon.write("-")
- if b == "Speedynutty68" or b == "ringgeest11" or b == "Flaskee" or b == "nixeagle" or b == "rivrippa" then
- mon.setTextColor(colors.purple)
- elseif b == "slightlynamed" then
- mon.setTextColor(colors.green)
- elseif b == "Professor29" or b=="Sovereignty89" then
- mon.setTextColor(colors.lightBlue)
- elseif b == "zenkmander" then
- mon.setTextColor(colors.gray)
- elseif b == "protobender" then
- mon.setTextColor(colors.orange)
- elseif b == "jaxory" then
- mon.setTextColor(colors.cyan)
- else
- mon.setTextColor(colors.white)
- end
- mon.write(b)
- end
- end
- while true do
- myNames = snsr.getPlayerNames()
- for a,b in pairs(myNames) do
- considerShopper(b)
- end
- displayShoppers()
- os.sleep(.5)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement