{"id":27291383,"url":"https://github.com/sovdeeth/oopsk","last_synced_at":"2026-05-13T15:39:08.389Z","repository":{"id":287133354,"uuid":"960770879","full_name":"sovdeeth/oopsk","owner":"sovdeeth","description":"a Skript addon that aims to add limited object-oriented programming tools to Skript in a non-invasive manner.","archived":false,"fork":false,"pushed_at":"2026-01-19T19:22:27.000Z","size":188,"stargazers_count":7,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-20T01:11:24.255Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","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/sovdeeth.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,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-04-05T03:13:46.000Z","updated_at":"2026-01-19T19:22:32.000Z","dependencies_parsed_at":"2025-06-28T18:23:38.268Z","dependency_job_id":null,"html_url":"https://github.com/sovdeeth/oopsk","commit_stats":null,"previous_names":["sovdeeth/oopsk"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/sovdeeth/oopsk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sovdeeth%2Foopsk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sovdeeth%2Foopsk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sovdeeth%2Foopsk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sovdeeth%2Foopsk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sovdeeth","download_url":"https://codeload.github.com/sovdeeth/oopsk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sovdeeth%2Foopsk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32989720,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"ssl_error","status_checked_at":"2026-05-13T13:14:51.610Z","response_time":115,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2025-04-11T21:57:03.687Z","updated_at":"2026-05-13T15:39:08.384Z","avatar_url":"https://github.com/sovdeeth.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# oopsk\n\noopsk is a Skript addon that aims to add limited object-oriented programming tools to Skript in a non-invasive manner. \n\n## Basics\nThe current feature set revolves around `structs`, simple objects that group together a set of typed fields. Structs are defined by struct templates, top-level structures that define their name and the fields they contain:\n```\nstruct Message:\n  contents: string\n  sender: offline player\n  const timestamp: date = now\n  converts to:\n    string via this-\u003econtents\n```\nA template's name and field names are case-insensitive. The template name follows the same rules as a function name, while field names can only consist of letters, underscores, and spaces. \nEach field has a name and a type, as well as an optional default value. This default value may be an expression, as it is evaluated when a struct is created, not when the template is registered.\nAdding `const` or `constant` to the start will prevent the field from being changed after creation.\n\nStructs also support conversion expressions, which allow you to define how a struct can be converted to other types. The syntax is \n`\u003ctype\u003e via \u003cexpression\u003e`, where `\u003ctype\u003e` is the type to convert to and `\u003cexpression\u003e` is an expression that evaluates to that type. \nThe expression may use `this` to refer to the struct being converted. Multiple conversions can be defined by adding more lines under the `converts to:` section.\n\nCreating a struct involves a simple expression:\n```\nset {_a} to a message struct instance\n```\n`{_a}` is now a new instance of the Message template, with contents and sender unset and timestamp set to the date the struct was created. Fields can be accessed and modified with the field access expression:\n```\nset field contents of {_a} to \"hello world\"\nbroadcast {_a}'s sender field\nreset {_a}-\u003etimestamp\n```\nStructs can also be created with initial values:\n```\nset {_a} to a message struct instance:\n  sender: player\n  contents: \"hello world\"\n```\n\n### Custom Types\n\nStruct templates automatically create a new Skript type using the template's name + `struct`. \nIn the above example, `message struct` is now a valid Skript type that can be used in function parameters and other struct fields.\n**You should be very careful when reloading templates, as any existing code that used the type may break if the template was modified or removed.**\nALWAYS reload all scripts after modifying templates to ensure all code is properly re-parsed.\n\n### Type Safety\noopsk attempts to ensure type safety at parse time via checking all fields with the given name. This means having unique field names across structs allows oopsk to give you more accurate parse errors, while sharing field names can result in invalid code not causing any errors during parsing. \nAny type violations not caught during parsing should be caught at runtime via runtime errors that cannot be suppressed. Note that code parsed in one script prior to updates to a struct in another script will not show parse errors until it is reloaded again, though it should properly emit runtime errors.\n\n### Modifying the Template of Existing Structs\nAny modifications to a template will be reflected in all structs that have been previously created from that template. This can result in data loss if a field is renamed, removed, or changes type, as existing structs will have their modified fields either removed or re-evaluated as appropriate. \nNote that this means default values need to be re-evaluated and therefore will not have been evaluated when the struct was created. oopsk will print a warning in console if any existing structs were modified as a result of template changes. Adding fields to a template or changing default values will not modify existing structs.\n\nRemoving a template will 'orphan' existing structs, who will function as if the template still existed, though it may be impossible to access their information as the field access expression may not recognize the field names. If a new template is added with the same name, these existing structs will be updated to match the new template.\nIf you remove a template, you should take care to remove structs that depended on it.\n\n**I recommend putting your templates in a separate script file, so you can limit the chances of them being accidentally modified or disabled.**\n\n## Roadmap\nBeta:\n- Reflective expressions for structs and field (get fields, get types, get whether a field is constant...)\n- Expression to dynamically access a field from a string (unsafe)\n- Serialization of structs (unsure on feasibility)\n\nPossibilities:\n- Methods?\n- Allowing fields to accept structs from specific templates, rather than any struct.\n\n## Docs\n\nDocs are available on [skUnity](https://docs.skunity.com/syntax/search/addon:oopsk) or on [SkriptHub](http://skripthub.net/docs/?addon=oopsk).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsovdeeth%2Foopsk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsovdeeth%2Foopsk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsovdeeth%2Foopsk/lists"}