Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Script by Savage_Me55iah of CraftAU.com.au--
- --Other Savage_Me55iah scripts @ http://pastebin.com/u/Savage_Me55iah
- --INSTRUCTIONS ON USE--
- --Instruction video on http://youtube.com/savagemessiah5
- --Contact Savage_Me55iah @ CraftAU.com.au or http://www.computercraft.info/forums2/ with suggestions/fixes/bugs
- local scriptName = "eventmanip"
- fileDetail = fileDetail or {}
- fileDetail[scriptName] = {["version"] = 0.1, ["pastebin"] = "AijGThy5"}
- local tArgs = {...}
- if tArgs[1] == "update" then
- print("UPDATING") shell.run("pastebin get "..fileDetail[scriptName].pastebin.." "..scriptName.."_update")
- if fs.exists(scriptName.."_update") then fs.remove(shell.getRunningProgram()) fs.copy(scriptName.."_update", shell.getRunningProgram()) fs.remove(scriptName.."_update") print("UPDATE SUCCESS") else print("UPDATE FAILED") end
- end
- -----------------------------------------------------------------------------------------------------------
- -- Variables --
- -----------------------------------------------------------------------------------------------------------
- eventFunction = {}
- -----------------------------------------------------------------------------------------------------------
- -- API Functions --
- -----------------------------------------------------------------------------------------------------------
- -- event = eventmanip.filter(functionNum, {string, string, etc}) -- [1] returns function ran correctly [2] returns result
- -- will shift an numerical table, up > down
- function filter(param_functionNum, param_events)
- local result, functionNum, list, event = {false, false}, param_functionNum.."/002", {}, {false}
- if booleanmanip.variableCheck(functionNum, {"table"}, {param_events})[2] then
- for a,b in pairs(param_events) do list[b] = true end
- while not booleanmanip.check(functionNum, list[event[1]])[1] do
- event = {os.pullEvent()}
- end
- logger.logger(functionNum, {"EventFilter Triggered:", event}, 0, " ")
- else
- logger.logger(functionNum, {"Function Error, Expected: event = eventmanip.filter(functionNum, {string, string, etc})"}, 2, " ")
- end
- return event
- end
- -----------------------------------------------------------------------------------------------------------
- -- Old Functions --
- -----------------------------------------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment