Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Areana AI
- --Siren
- --By Flashing
- --Declare variables
- chatb = peripheral.wrap("top")
- gotkit = false
- introdone = false
- stoploop = true --true means loop, false means stop
- range = 10
- player = "noplayer"
- t = {}
- function initF()
- print("start")
- chatb.say("Init player 1")
- e,p,m = os.pullEvent("chat")
- if p == "flaashing" then
- print(player)
- if string.find(m,"!player1") then
- for k,v in string.gmatch(m, "[^%s]+") do
- table.insert(t,k)
- end
- print("blob")
- print(t[2])
- player = t[2]
- print(player)
- initdone = true
- end
- end
- end
- --Declare functions
- function intro()
- chatb.say("Siren: Welcome to Game Central Station. You are contestant #1",range)
- sleep(2)
- chatb.say("Siren: I'm Siren. I am here to help you",range)
- sleep(3)
- chatb.say("Siren: To win the match, survive and be the last man standing",range)
- sleep(3)
- chatb.say("Siren: You can select 4 classes. Choose carefully",range)
- sleep(3)
- chatb.say("Siren: Kit 1 is the Warrior. Equipped with an iron sword and iron armor.",range)
- sleep(3)
- chatb.say("Siren: Kit 2 is the Ranger. Equipped with a bow and leather armor",range)
- sleep(3)
- chatb.say("Siren: Kit 3 is the Mage. Equipped with a magic wand a leather bits.",range)
- sleep(3)
- chatb.say("Siren: Kit 4 is the Rogue. Equipped with a magic dagger and invisibilty.",range)
- sleep(3)
- chatb.say("Siren: To choose a kit type !siren kit [number]",range)
- introdone = true
- print("intro done")
- end
- function getkit(msg)
- while not gotkit do
- event, player, msg = os.pullEvent("chat")
- print("get msg start")
- if msg == "!siren kit 1" then
- rs.setBundledOutput("bottom", colors.white)
- sleep(0.4)
- rs.setBundledOutput("bottom", 0)
- afterkit("1")
- elseif msg == "!siren kit 2" then
- rs.setBundledOutput("bottom", colors.black)
- sleep(0.4)
- rs.setBundledOutput("bottom", 0)
- afterkit("1")
- elseif msg == "!siren kit 3" then
- rs.setBundledOutput("bottom", colors.yellow)
- sleep(0.4)
- rs.setBundledOutput("bottom", 0)
- afterkit("1")
- elseif msg == "!siren kit 4" then
- rs.setBundledOutput("bottom", colors.green)
- sleep(0.4)
- rs.setBundledOutput("bottom", 0)
- afterkit("1")
- else
- print("no kit")
- end
- end
- end
- function afterkit(num)
- print("Got kit" .. num)
- gotkit = true
- end
- function funcRestart()
- if rs.getInput("left",true) then print("Restarting") sleep(2) os.reboot() end
- end
- --Run script
- while stoploop do
- if initdone then
- --if booth is triggered then
- if rs.getInput("right", true) then
- --roll the into
- if not introdone then
- intro()
- end
- end
- if introdone and not gotkit then
- getkit()
- elseif gotkit then
- event, player, msg = os.pullEvent("chat")
- if string.match(msg, "!siren kit") then
- chatb.say("Siren: You already got your kit!", range)
- end
- end
- --check for reset
- funcRestart()
- else
- print("main loop")
- initF()
- end
- sleep(2)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement