{"id":13744890,"url":"https://github.com/MattesGroeger/as3-cheats","last_synced_at":"2025-05-09T04:31:14.093Z","repository":{"id":1552454,"uuid":"1936772","full_name":"MattesGroeger/as3-cheats","owner":"MattesGroeger","description":"Provides an easy way to use cheat codes with ActionScript 3.0.","archived":false,"fork":false,"pushed_at":"2012-11-22T22:33:34.000Z","size":1188,"stargazers_count":22,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-08-04T05:05:18.973Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"ActionScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MattesGroeger.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-06-22T18:55:27.000Z","updated_at":"2016-02-12T22:37:46.000Z","dependencies_parsed_at":"2022-08-28T12:51:40.417Z","dependency_job_id":null,"html_url":"https://github.com/MattesGroeger/as3-cheats","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MattesGroeger%2Fas3-cheats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MattesGroeger%2Fas3-cheats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MattesGroeger%2Fas3-cheats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MattesGroeger%2Fas3-cheats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MattesGroeger","download_url":"https://codeload.github.com/MattesGroeger/as3-cheats/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224811305,"owners_count":17373940,"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":[],"created_at":"2024-08-03T05:01:17.952Z","updated_at":"2024-11-15T16:32:10.286Z","avatar_url":"https://github.com/MattesGroeger.png","language":"ActionScript","funding_links":[],"categories":["Unsorted"],"sub_categories":["Other API"],"readme":"AS3 Cheats\n==================\n\nThis library provides an easy way to handle cheats within flash. Register a key combination or phrase to a cheat and it gets then triggered by the library.\n\n**Use cases for this library:**\n\n- Enable functionalities in live environments which should be normally deactivated (e.g. logging)\n- Use cheats within games\n- Trigger easter eggs\n\n**What does it do?**\n\nIt observes all keyboard inputs and compares them against the keycode combinations registered for your cheats. Whenever a keyboard input matches, the appropriate cheat gets toggled and you can trigger a custom action.\n\nBeside this basic functionality it provides an easy way to define master cheats. They prevent your users from accidentally triggering easy to type cheats. Furthermore cheat states can be  stored in the local shared object. This way you don't have to re-enter the cheats the next time you start your application.\n\nSee the examples below for more details.\n\n**Dependencies**\n\nThis library is compiled against *as3-signals-v0.7*. The SWC is included in the download file.\nMore information regarding as3-signals can be [found here](https://github.com/robertpenner/as3-signals).\n\n**Known issues**\n\nThe CheatLib only supports the english keyboard layout. There is no support for other keyboard layouts planned so far.\n\nUsage\n-----\n\n**Download**\n\nDownload the latest version from [the downloads page](https://github.com/MattesGroeger/as3-cheats/downloads). The zip file contains all necessary SWC files and the asdocs. Put the SWC files in your projects libs folder and/or add them to the classpath of your project.\n\n**Creation**\n\nFirst of all you have to initialize the `CheatLib` with the `stage` and a custom identifier (id):\n\n\tvar lib:ICheatLib = CheatLib.create(stage, \"demo\");\n\nYou can then either use the returned instance or always retrieve it via the `CheatLib.get(id)`. \n\n**Basic usage**\n\nThe basic use-case is to enter a string and then trigger a functionality. \n\n\tCheatLib.get(\"demo\")\n\t\t.createCheat(\"test\")\n\t\t\t.toggledSignal\n\t\t\t.add(handleTestCheatToggle);\n\n\tfunction handleTestCheatToggle(cheat:ICheat):void\n\t{\n\t\ttrace(\"Test cheat toggled, now \" + cheat.activated);\n\t}\n\nYou can always get the created cheat again via the `getCheat()` method:\n\n\tCheatLib.get(\"demo\")\n\t\t.getCheat(\"test\");\n\n**Master cheats**\n\nWith master cheats you block certain cheats until the master is activated. This would be the easiest way to just use one master cheat:\n\n\tCheatLib.get(\"demo\")\n\t\t.createMasterCheat(\"master\");\n\t\nA more complex example, on how to use multiple master cheats will follow later.\n\n**Persistency**\n\nIf you don't want to re-enter you cheats after each restart you can use the optional `persistent` flag. It stores the cheat state in the LocalSharedObject and re-initializes it on the next start. This flag needs to be set for each cheat individually.\n\n\tCheatLib.get(\"demo\")\n\t\t.createMasterCheat(\"master\", true);\n\n**Output**\n\nTo display cheat toggles this library provides several default implementations. If you want to see a visual output you can assign an instance of `NotificationOutput` to your `CheatLib`:\n\n\tCheatLib.get(\"demo\")\n\t\t.output = new NotificationOutput(stage);\n\nAnd this is how it looks like for a master cheat toggle:\n\n![Notification output example](https://github.com/MattesGroeger/as3-cheats/blob/master/assets/example.png?raw=true \"Notification output example\")\n\nBeside this visual output the library comes with a `TraceOutput` which just traces all cheat toggles. By default the `CheatLib` uses the `NoOutput` which doesn't do anything.\n\n**Complex cheat codes**\n\nFor more advanced cheat codes – including special keys – you can use the following syntax:\n\n\tCheatLib.get(\"demo\")\n\t\t.addCheat(CheatBuilder.create(\"fps\", \n\t\t\t\t\tCheatCodeBuilder.create()\n\t\t\t\t\t\t.appendKeyCode(Keyboard.ENTER)\n\t\t\t\t\t\t.appendString(\"fps\")\n\t\t\t\t\t\t.appendKeyCode(Keyboard.ENTER)\n\t\t\t\t\t\t.build())\n\t\t\t\t\t.build());\n\nIn this case the cheat code consists of \"Enter\" + \"fps\" + \"Enter\".\n\nFor more insight please check out the [example implementation](https://github.com/MattesGroeger/as3-cheats/blob/master/example/src/de/mattesgroeger/cheats/example/Demo.as).\n\nChange log\n----------\n\n**0.0.3** (2011/07/29)\n\n* **[Added]** Added `CheatLib.has(id)` method to determine if a lib exists for a certain key\n* **[Added]** Added `applyMaster` parameter to `addCheat()` in case you want to ignore the master cheat\n* **[Added]** Added method `addMasterCheat` to CheatLib\n\n**0.0.2** (2011/07/13)\n\n* **[Added]** Added output functionality for `CheatLib` (shows state changes). You can use one of the default implementations (NotificationOutput, TraceOutput) or assign your own ones.\n* **[Changed]** Default timeout is now 2 seconds instead of 3\n\n**0.0.1** (2011/07/07)\n\n* **[Added]** Cheat functionality for any combination of strings and special keys\n* **[Added]** Cheats can be toggled (on/off)\n* **[Added]** Per cheat and global toggled Signal\n* **[Added]** Master Cheat support\n* **[Added]** Cheats can be optionally persisted (Local Shared Object)\n* **[Added]** Static access for easy access (`CheatLib.get(id)`)\n\nRoadmap\n-------\n\n- Anything missing? [Please let me know](https://github.com/MattesGroeger).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMattesGroeger%2Fas3-cheats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMattesGroeger%2Fas3-cheats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMattesGroeger%2Fas3-cheats/lists"}