{"id":"iibhf-devteam/sequencer","name":"sequencer","scope":"iibhf-devteam","platform":"roblox","description":"A library for running events in a sequence.","version":"0.1.2","latest":"0.1.2","versions":["0.1.0","0.1.1","0.1.2"],"license":"MIT","licenseRating":"safe","licenseCaveats":[],"licenseVerified":true,"dependencies":{},"integrity":"eca4dcdbbbee08bd5e5f8a57c46d4042cc1d897685dd1433fdf97600b9b4ca0f","likes":0,"downloads":0,"install":"forest install iibhf-devteam/sequencer","url":"https://forest.dev/p/roblox/iibhf-devteam/sequencer","files":"https://api.forest.dev/ai/package/roblox/iibhf-devteam/sequencer/files","readme":"# Sequencer\nA library for running events in a sequence.\n# Setup\n## Project\nThis project uses [Rojo](https://github.com/rojo-rbx/rojo), some Rojo project files are included, 3 to be exact\n* ``default.project.json`` is the project file that you should probably be using, this one packs it to be compatible with Wally\n* ``test.project.json`` is used to demo the tester(and to test it)\n\n- This project has no dependencies, LocalAudio is used to test it, so if you want to test it, run ``wally install``\n\nIn order to build the desired copy, run\n```bash\nrojo build {project file you want to use} --output Sequencer.rbxm\n```\n## Example\nThis is an example of a sequence\n\n### A sequence\n```\nreturn {\n    Length = 20,\n    {\n        Time = 1,\n        PlayLocalAudio = {\"Test.Keycard\"},\n        Warning = {\"Hiiii\"},\n        EventCode = function() print(\" Starting new Sequence\") end\n    },\n    {\n        EventName = \"MakePart\",\n        Time = 4,\n        EventCode = function()\n            local newInst = Instance.new(\"Part\")\n            newInst.Name = \"SequencerThingy!\"\n            newInst.Position = Vector3.new(10, 5, 10)\n            newInst.Parent = workspace\n        end\n    },\n    {\n        PreEvent = \"MakePart\",\n        AddTime = 10,\n        Warning = {\"This is a warning from sequencer occuring at 14 seconds!\"},\n        EventCode = function() warn(\"Running Thingy\") end\n    }\n}\n```\nFirst, this thing calls LocalAudio to play an audio called ``Test.Keycard``, it also prints the phrase \"Starting New Sequence\", and then also prints a warning in the console saying \"Hiiii\", Then it waits about 3 seconds, it then makes a new part, and you get the gist.\n\n### Macros\n```\nlocal Seq = require(game:GetService(\"ReplicatedStorage\").Sequencer)\nreturn {\n    Seq.NewMacro(\"PlayLocalAudio\", function(args)\n        local LocalAudio = require(game:GetService(\"ReplicatedStorage\").LocalAudio)\n        LocalAudio:PlayAudio(args[1], args[2])\n        print(\"Running Macro!\")\n    end),\n    Seq.NewMacro(\"Warning\", function(args)\n        warn(args[1]) \n    end)\n}\n```\n\nThis makes 2 macros, one for printing warnings to the console, and one for playing audio with LocalAudio, each macro has a name, you can make a macro execute by adding an entry to the event that you want to play a macro, then adding the parameters as the value\n\nMacros will have their arguments put into a list when added to the event and when running the macro, keep this in mind!\n\nIf you don't pass in a macro module script into ``RunSequence`` it will use ``ReplicatedStorage.Data.Macros`` as a fallback\n\n## API\n``Sequencer.NewMacro(name: string, code: ({any}) -> ()): Macro``\nCreates a new macro, ``name`` will be the name of the macro defined in the event, ``code`` will be what code is ran, the function must take in an array!\n\n``Sequencer.RunSequence(sequence: Instance, MacroScript: Instance & nil)`` Runs a sequence, ``sequence`` is the sequence that you want to run, and ``MacroScript`` is the MacroScript you want to run, defaulting to ``ReplicatedStorage.Data.Macros``\n\n# License\nThis project is avaliable under the MIT License. See [LICENSE](https://github.com/IIBHF-DevTeam/Sequencer/blob/f573cca82b7f2ad9e25f95971f256fdf5d828997/LICENSE) for details","readmeTruncated":false}