Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Designed for PvE fights, not PvP
- -- Change this to whatever the sensor peripheral is connected as
- sensor = peripheral.wrap("openperipheral_sensor_0")
- -- Change this to whatever the monitor is connected as
- mon = peripheral.wrap("monitor_75")
- -- rednet side
- rSide = "right"
- -- Fight Status
- fight = false
- -- Timer Data
- tData = 0
- -- Name of the boss
- mobName = " "
- -- Fight Results
- fRes = " "
- -- Player attempts
- attempts = 1
- iLoop = 1
- iLoop2 = 1
- while iLoop == 1 do
- term.clear()
- term.setCursorPos(1,1)
- term.setTextColor(colors.orange)
- print("Program Setup")
- print("Please enter the player's name:")
- iLoop2 = 1
- pData = read()
- while iLoop2 == 1 do
- term.clear()
- term.setCursorPos(1,1)
- term.setTextColor(colors.orange)
- print("Program Setup")
- print(pData .. " - Is this correct? y/n")
- input = read()
- if input == "y" or input == "Y" or input == "yes" or input == "YES" or input == "yes" then
- print("Name Set! Beginning Program")
- sleep(1)
- iLoop2 = 0
- iLoop = 0
- elseif input == "N" or input == "n" or input == "NO" or input == "no" or input == "No" then
- iLoop2 = 0
- else
- term.setTextColor(colors.red)
- print("Invalid Selection")
- sleep(1)
- end
- end
- end
- while rs.testBundledInput(rSide, colors.orange) == false do
- sleep(0.1)
- term.clear()
- term.setCursorPos(1,1)
- print("Waiting for boss spawn")
- end
- sleep(4)
- iLoop = 1
- loop3 = true
- while loop3 == true do
- mData = textutils.serialize(sensor.getMobIds())
- term.clear()
- term.setCursorPos(1,1)
- print("Arena Stat Management System V1 \n ")
- print("Players: ")
- print(pData)
- print("Mob Data: ")
- print(mData)
- term.redirect(mon)
- term.clear()
- term.setCursorPos(1,1)
- term.setTextColor(colors.lime)
- print("Boss Fight in Progress! Keep clear of the arena! \n ")
- term.setTextColor(colors.orange)
- print("Player Present: " .. pData)
- print(pData .."'s attempts: " .. attempts)
- print (" ")
- print("Current Boss: " .. mobName .. " \n ")
- print("Timer: " .. tData .. " seconds elapsed")
- sleep(1)
- tData = tData + 1
- term.restore()
- if rs.testBundledInput(rSide, colors.white) == true then
- iLoop = 1
- term.redirect(mon)
- term.clear()
- term.setCursorPos(1,1)
- term.setTextColor(colors.yellow)
- print("Boss Fight Paused by Arena Operator - Awaiting input \n ")
- term.setTextColor(colors.orange)
- print("Player Present: " .. pData)
- print(pData .."'s attempts: " .. attempts)
- print (" ")
- print("Current Boss: " .. mobName .. " \n ")
- term.setTextColor(colors.yellow)
- print("Timer: " .. tData .. " seconds elapsed")
- term.restore()
- while iLoop == 1 do
- term.clear()
- term.setCursorPos(1,1)
- term.setTextColor(colors.orange)
- print("Arena Stat Management System V1 \n ")
- print("Fight has been paused!")
- print("Please Input Your Selection: ")
- print("End Fight (Player Loss) - \"Loss\"")
- print("End Fight (Player Won) - \"Won\"")
- print("Resume Fight - \"Resume\"")
- input = read()
- if input == "resume" or input == "Resume" then
- iLoop = 0
- elseif input == "Loss" or input == "loss" then
- attempts = attempts + 1
- if attempts >= 4 then
- fRes = "Lost"
- attempts = 3
- loop3 = false
- else
- print("Resuming Match")
- sleep(1)
- end
- iLoop = 0
- elseif input == "Won" or input == "won" then
- fRes = "Won"
- loop3 = false
- iLoop = 0
- else
- term.setTextColor(colors.red)
- print("Invalid Selection")
- sleep(1)
- end
- end
- end
- end
- print("Fight Ended - Updating Stat Board")
- term.redirect(mon)
- term.clear()
- term.setCursorPos(1,1)
- term.setTextColor(colors.red)
- if fRes == "Won" then
- term.setTextColor(colors.lime)
- print("Boss Fight Ended by Arena Operator - Results Below! \n ")
- else
- term.setTextColor(colors.red)
- print("Boss Fight Ended by Automated System - Results Below! \n ")
- end
- term.setTextColor(colors.orange)
- print("Player Present: " .. pData)
- if fRes == "Won" then
- term.setTextColor(colors.yellow)
- print(pData .."'s attempts: " .. attempts)
- else
- term.setTextColor(colors.red)
- print(pData .." used up their 3 attempts. Game over")
- end
- print (" ")
- print("Current Boss: " .. mobName .. " \n ")
- if fRes == "Won" then
- term.setTextColor(colors.yellow)
- else
- term.setTextColor(colors.red)
- end
- print("Timer: " .. tData .. " seconds elapsed")
- if fRes == "Won" then
- term.setTextColor(colors.lime)
- print(pData .. " has won the fight! Payouts will begin shortly.")
- else
- term.setTextColor(colors.red)
- print(pData .. " has lost the fight. Bets have been forfeited.")
- end
- term.restore()
- -- Change this to the name of the stat program
- shell.run("startup")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement