{"id":20350579,"url":"https://github.com/seniru/timers4tfm","last_synced_at":"2025-04-12T01:36:22.567Z","repository":{"id":111874449,"uuid":"212810050","full_name":"Seniru/Timers4TFM","owner":"Seniru","description":"A library which provides easy and advanced timers for module developers","archived":false,"fork":false,"pushed_at":"2020-04-27T07:01:05.000Z","size":85,"stargazers_count":5,"open_issues_count":9,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T21:21:29.283Z","etag":null,"topics":["library","timers","transformice","transformice-lua-api"],"latest_commit_sha":null,"homepage":"https://seniru.github.io/Timers4TFM/","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Seniru.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2019-10-04T12:28:28.000Z","updated_at":"2024-01-26T03:40:48.000Z","dependencies_parsed_at":"2023-07-15T23:46:17.405Z","dependency_job_id":null,"html_url":"https://github.com/Seniru/Timers4TFM","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Seniru%2FTimers4TFM","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Seniru%2FTimers4TFM/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Seniru%2FTimers4TFM/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Seniru%2FTimers4TFM/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Seniru","download_url":"https://codeload.github.com/Seniru/Timers4TFM/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248504843,"owners_count":21115210,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["library","timers","transformice","transformice-lua-api"],"created_at":"2024-11-14T22:32:19.686Z","updated_at":"2025-04-12T01:36:22.534Z","avatar_url":"https://github.com/Seniru.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align='center'\u003e\n\n  \u003cimg src='https://user-images.githubusercontent.com/34127015/68472955-b7ee4200-0247-11ea-91b6-6f81b570b31d.png' alt='Timers4TFM'\u003e\n  \u003ch1\u003eTimers4TFM\u003c/h1\u003e\n\n\u003c/p\u003e\n\n[![All Contributors](https://img.shields.io/badge/all_contributors-4-orange.svg?style=flat-square)](#contributors)\n![GitHub file size in bytes](https://img.shields.io/github/size/Seniru/Timers4TFM/src/timer.min.lua?label=Code%20size%20%28minified%29\u0026style=flat-square)\n![GitHub Workflow Status](https://img.shields.io/github/workflow/status/Seniru/Timers4TFM/Build?logo=github\u0026style=flat-square)\n![CodeFactor Grade](https://img.shields.io/codefactor/grade/github/Seniru/Timers4TFM?logo=codefactor\u0026style=flat-square)\n![GitHub](https://img.shields.io/github/license/Seniru/Timers4TFM?style=flat-square)\n![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/Seniru/Timers4TFM?include_prereleases\u0026style=flat-square)\n\n\u003e A library which provides easy and advanced timers for module developers\n\n\u003e :warning: This library is still in beta phase. Use at your own risk!\n\u003e Contributions are always welcome\n\n## What is this?\n\n**A library which provides easy and advanced timers for module developers.**\n\nThis project is inspired by\n[mk's timer library](https://atelier801.com/topic?f=6\u0026t=875052), make sure to\nsupport that project too :heart:\n\n**_Background_**\n\nAs normal players - who aren't in module team - aren't allowed to use the Module\nAPI's timers (`system.newTimer` and `system.removeTimer`), I decided to create a\nbrand new, advanced timer system for the benefit of all!\n\n**_There are many capabilities for these timers_**\n\n- Create timers\n- Reset timers\n- Kill timers\n- Loop timers\n- Execute functions after/before mature\n- And more!\n\n## How to use?\n\nTo use this library you need to insert this libraries code in top of your code.\n\n[Use the full code _(Recommended for studying)_](https://raw.githubusercontent.com/Seniru/Timers4TFM/master/src/timer.lua)\n|\n[Use the minified version _(Recommended for production use)_](https://raw.githubusercontent.com/Seniru/Timers4TFM/master/src/timer.min.lua)\n\n\u003chr\u003e\n\n## Examples\n\n#### Creating new timer\n\n```lua\n--insert the library code here\n\nlocal timer1 = Timer(\"timer1\", function() end, 5000, false) -- Creating a very basic timer with a timeout value of 5000\n\nfunction eventLoop()\n  Timer.process() -- You need to call this method inside eventLoop to start and process timers\nend\n\n\n```\n\n[Documentation](https://seniru.github.io/Timers4TFM/docs/src/1.html)\n\n### Creating timers with callbacks\n\n```lua\n\n--a function to greet a user\nfunction greet(name, nice)\n    print(\"Hello\" .. name .. \"It seems you are \" .. (nice and \"nice\" or \"not nice\"))\nend\n\n-- storing the timer in a variable is optional. Storing will be useful if you need to access information about the timer\n\nTimer(\"callback\", greet, 2000, false, \"Seniru\", true) --setting the callback to our greet function and pass \"Seniru\" and true as arguments\n\nfunction eventLoop()\n    Timer.process()\nend\n\n--Run this code to see the results!\n\n```\n\n[Documentation](https://seniru.github.io/Timers4TFM/docs/src/1.html)\n\n### Looping timers\n\n```lua\n\nTimer(\"looping\", function() print(\"prints\") end, 3000, true)\n-- This would print `prints` every 3 seconds. Note that you need to specify the time in milliseconds\n\n```\n\n[Documentation](https://seniru.github.io/Timers4TFM/docs/src/1.html)\n\n# Contributing\n\nDo you want to contribute this project? Great! There are many way that you can\ninvolve!\n\n\u003cdetails\u003e\n    \u003csummary\u003eCreating issues\u003c/summary\u003e\n    You can create issues for,\n    \u003cul\u003e\n        \u003cli\u003eSomething is not working (bug)\u003c/li\u003e\n        \u003cli\u003eSuggestion / Feature request\u003c/li\u003e\n        \u003cli\u003eGeneral questions\u003c/li\u003e\n    \u003c/ul\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n    \u003csummary\u003eCreating PRs\u003c/summary\u003e\n    You can submit a PR for,\n    \u003cul\u003e\n        \u003cli\u003eBug fixes\u003c/li\u003e\n        \u003cli\u003eImprovements\u003c/li\u003e\n        \u003cli\u003eAdditions of new features\u003c/li\u003e\n        \u003cli\u003eMinor fixes (such as fixing a typo)\u003c/li\u003e\n    \u003c/ul\u003e\n\u003c/details\u003e\n\nPlease, make sure that you have searched well before creating a new issue or a\npull request. I'm actively responding to all kind of contributions :smile:\n\n## Contributors ✨\n\nThanks goes to these wonderful people\n([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore --\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/Seniru\"\u003e\u003cimg src=\"https://avatars2.githubusercontent.com/u/34127015?v=4\" width=\"100px;\" alt=\"Seniru Pasan Indira\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eSeniru Pasan Indira\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/Seniru/Timers4TFM/commits?author=Seniru\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://allcontributors.org\"\u003e\u003cimg src=\"https://avatars1.githubusercontent.com/u/46410174?v=4\" width=\"100px;\" alt=\"All Contributors\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eAll Contributors\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#infra-all-contributors\" title=\"Infrastructure (Hosting, Build-Tools, etc)\"\u003e🚇\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"http://bit.ly/laut-id\"\u003e\u003cimg src=\"https://avatars2.githubusercontent.com/u/26045253?v=4\" width=\"100px;\" alt=\"Lautenschlager\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eLautenschlager\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/Seniru/Timers4TFM/commits?author=Lautenschlager-id\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/Seniru/Timers4TFM/issues?q=author%3ALautenschlager-id\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/Tocutoeltuco\"\u003e\u003cimg src=\"https://avatars2.githubusercontent.com/u/24902450?v=4\" width=\"100px;\" alt=\"Iván\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eIván\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/Seniru/Timers4TFM/issues?q=author%3ATocutoeltuco\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the\n[all-contributors](https://github.com/all-contributors/all-contributors)\nspecification. Contributions of any kind welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseniru%2Ftimers4tfm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseniru%2Ftimers4tfm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseniru%2Ftimers4tfm/lists"}