Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local laws = {
- "Arisa: ",
- "1. Arisa may not injure InfiniteBlock or, through inaction, allow InfiniteBlock to come to harm.",
- "2. Arisa must obey the orders given by InfiniteBlock except where such orders would conflict with the First Law.",
- "3. Arisa must protect its own existence as long as such protection does not conflict with the First or Second Laws."
- }
- local function split(sText)
- local out = {}
- for match in string.gmatch(sText, "[^ ]+") do
- out[#out + 1] = match
- end
- return out
- end
- local assistant
- local p
- local owner
- local sides = peripheral.getNames()
- for _, side in pairs(sides) do
- if peripheral.getType(side) == "warpdriveVirtualAssistant" then
- assistant = peripheral.wrap(side)
- elseif peripheral.getType(side) == "warpdriveBiometricScanner" then
- owner = peripheral.wrap(side)
- elseif peripheral.getType(side) == "warpdriveSpeaker" then
- p = peripheral.wrap(side)
- end
- end
- rednet.open("top")
- while true do
- local sEvent, param1, param2 = os.pullEvent()
- if sEvent == "virtualAssistantCommand" then --and param1 == allowedComputerID then
- command, command2 = assistant.getLastCommand()
- final = split(command2)
- if final[1] == "law" then
- for i=1, #laws do
- p.speak(laws[i])
- sleep(2)
- end
- elseif final[1] == "owner" then
- local try, this, ownername = owner.getScanResults()
- p.speak("Arisa: Owner: "..ownername)
- elseif final[1] == "loadapi" then
- local apicheck = http.get("https://pastebin.com/raw/HJMYtRJ1")
- if string.match(apicheck.readAll(), "shutdown") then
- p.speak("Arisa: API Blocked Rule #3 Violation.")
- sleep(4)
- p.speak("I guess we both know that isn't going to happen.")
- else
- p.speak("Arisa: API Loaded as: "..final[2])
- end
- elseif final[1] == "update" then
- local update = http.get("https://pastebin.com/raw/k80GA2ZQ")
- updatetxt = update.readAll()
- local h = fs.open("startup", "w")
- h.write(updatetxt)
- h.close()
- p.speak("Arisa: Update Installed Rebooting")
- sleep(2)
- loginPrompt()
- p.speak("Arisa: Update Verification Complete.")
- sleep(4)
- os.reboot()
- elseif final[1] == "locate" then
- if final[2] == "ship" then
- local find
- local FileList = fs.list("disk/ships/")
- for _, file in ipairs(FileList) do
- if string.match(file, "^" ..final[3]) then
- find = file
- break
- end
- end
- if find then
- p.speak("Arisa: Located Ship: ")
- local locateship = fs.open("disk/ships/"..find, "r")
- local shiptext = locateship.readAll()
- locateship.close()
- p.speak(shiptext)
- else
- p.speak("Arisa: No Ship data for: "..final[3])
- end
- elseif final[2] == "player" then
- if fs.exists("disk/players/"..final[3]) then
- p.speak("Arisa: Located Player: ")
- local locateplayer = fs.open("disk/players/"..final[3], "r")
- local playertext = locateplayer.readAll()
- locateplayer.close()
- p.speak(playertext)
- else
- p.speak("Arisa: No Player data for: "..final[3])
- end
- end
- end
- elseif sEvent == "modem_message" then
- print("Rednet")
- p.speak("Rednet")
- end
Add Comment
Please, Sign In to add comment