{"id":19454023,"url":"https://github.com/vurv78/vextensions","last_synced_at":"2025-04-25T04:31:03.638Z","repository":{"id":54858104,"uuid":"262161172","full_name":"Vurv78/VExtensions","owner":"Vurv78","description":"A compilation of addons for Expression2 and StarfallEx development https://github.com/Vurv78/VExtensions/wiki","archived":false,"fork":false,"pushed_at":"2022-09-18T00:02:08.000Z","size":275,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-03T16:39:54.846Z","etag":null,"topics":["expression2","garrysmod","glua","lua","starfallex","wiremod"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Vurv78.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-07T21:21:21.000Z","updated_at":"2024-12-18T20:23:58.000Z","dependencies_parsed_at":"2023-01-18T13:31:08.260Z","dependency_job_id":null,"html_url":"https://github.com/Vurv78/VExtensions","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vurv78%2FVExtensions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vurv78%2FVExtensions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vurv78%2FVExtensions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vurv78%2FVExtensions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Vurv78","download_url":"https://codeload.github.com/Vurv78/VExtensions/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250754657,"owners_count":21481850,"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":["expression2","garrysmod","glua","lua","starfallex","wiremod"],"created_at":"2024-11-10T17:07:11.342Z","updated_at":"2025-04-25T04:31:01.709Z","avatar_url":"https://github.com/Vurv78.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# VExtensions [![Release Shield](https://img.shields.io/github/v/release/Vurv78/VExtensions)](https://github.com/Vurv78/VExtensions/releases/latest) [![Size Shield](https://img.shields.io/github/repo-size/Vurv78/VExtensions?color=red)](https://github.com/Vurv78/VExtensions/tree/master/lua) [![Contributors](https://img.shields.io/github/contributors/Vurv78/VExtensions)](https://github.com/Vurv78/VExtensions/contributors) [![Featured Server](https://img.shields.io/badge/Featured%20Server-E2%20Beyond%20Infinity-yellow)](steam://connect/69.140.244.127:27015) [![Wiki](https://img.shields.io/badge/Wiki-here-orange.svg)](https://github.com/Vurv78/VExtensions/wiki) [![github/Vurv78](https://img.shields.io/discord/824727565948157963?color=7289DA\u0026label=chat\u0026logo=discord)](https://discord.gg/epJFC6cNsw)\n\n##  Notice: This is being rewritten in Typescript and therefore won't be receiving updates for a while. See the https://github.com/Vurv78/VExtensions/tree/typescript branch.\n\nA compilation of mini-addons for [Expression2](https://github.com/wiremod/wire) and [StarfallEx](https://github.com/thegrb93/StarfallEx) development as well as a library to assist developers make more of them.\n\nNote that this will be unstable outside of releases.  \nThis is comparable to addons like [AntCore](https://github.com/tockno/E2-AntCore) or E2Power except, unlike E2Power, not filled with bugs and backdoors.\n\n\nSee and share some more examples here: https://github.com/Vurv78/VExtensions/discussions/categories/show-and-tell\n\n## Modules\n\n### [PrintGlobal - Expression2](https://github.com/Vurv78/VExtensions/wiki/PrintGlobal)\nAllows you to print to other players chats with Expression 2, behaves like chat.AddText  \nThis is similar to the ChatPrint E2 extension, except it is more lenient, supports trailing strings and colors, and is much safer for the server with net size restriction.\n\u003cdetails\u003e\u003csummary\u003ePrintGlobal Example Code\u003c/summary\u003e\n\n```ruby\n@name Chat Colorer\n@persist Owner:entity\n\n# This chip hides your chat and prints instead,\n# Turning your name blue and text gray.\n\nif(first()){\n    runOnChat(1)\n    Owner = owner()\n}elseif(chatClk(Owner)){\n    hideChat(1)\n    local Text = lastSaid()\n    printGlobal(vec(50,50,200), Owner:name(), vec(255), \": \", vec(220), Text)\n}\n```\n\u003c/details\u003e\u003cbr\u003e\n\n### [CoroutineCore - Expression2](https://github.com/Vurv78/VExtensions/wiki/CoroutineCore)\nAllows you to make use of lua's coroutines in expression2, by turning udfs into coroutines, you can use functions like ``coroutineWait(number seconds)`` and ``coroutineYield()``, and retrieve results from ``coroutine:resume()``.\n\u003cdetails\u003e\u003csummary\u003eCoroutine Example Code\u003c/summary\u003e\n\n```ruby\n@name CoroutineCore Example\n@persist Co:coroutine\nif(first()){\n    function thread(){\n        while(1){\n            coroutineWait(5)\n            print(\"5 seconds have passed\")\n        }\n    }\n    Co = coroutine(\"thread\")\n    runOnTick(1)\n}elseif(tickClk()){\n    if(Co:status()!=\"dead\"){\n        Co:resume()\n    }\n}\n\n```\n\u003c/details\u003e\u003cbr\u003e\n\n\n### [WebMaterials - Expression2](https://github.com/Vurv78/VExtensions/wiki/WebMaterials)\nAllows you to interact with images pulled off of the web that can be applied as a material to props and egp image boxes.  \nWhitelisted by default, see the whitelist @ https://github.com/Vurv78/VExtensions/blob/master/lua/entities/gmod_wire_expression2/core/custom/sv_webmaterials.lua#L25\n\nConVars:\n```\nvex_webmaterials_whitelist_sv\nvex_webmaterials_max_sv\nvex_webmaterials_enabled_cl 1\n```\n\n\u003cdetails\u003e\u003csummary\u003eWebmaterials Example Code\u003c/summary\u003e\n\n```ruby\n@name Webmaterials Prop Example\n@persist P:entity M:webmaterial\n# Spawns box with some beautiful rust evangelism on it\nif(first()){\n    P = propSpawn(\"models/hunter/blocks/cube075x075x075.mdl\",entity():pos(),ang(),0)\n    M = webMaterial(\"https://i.imgur.com/lfBBhiE.png\")\n    interval(100)\n}else{\n    P:setMaterial( M )\n}\n```\n\u003c/details\u003e\u003cbr\u003e\n\n### [Tool Core - Expression2](https://github.com/Vurv78/VExtensions/wiki/Tool-Core)\nAllows you to make use of a custom tool in the wiremod tab, the 'E2 Controller'\nBy right clicking a chip with the tool, you can take control of it and handle things inside of it with runOn* events when the tool clicks, that receive ranger data of the click.. etc\n\u003cdetails\u003e\u003csummary\u003eTool Core Example Code\u003c/summary\u003e\n\n```ruby\n@name Hologram Placer Example\n@persist HoloInd ColorInd Colors:array SelectedColor:vector\n# Example of how to use the E2 Controller from VExtensions.\n\nif(first()){\n    runOnE2CLeftClick(1)\n    runOnE2CReload(1)\n    runOnE2CRightClick(1)\n\n    # These are the colors that will be cycled through when we right click.\n    Colors = array(\n        vec(255,0,0), # Red\n        vec(255,69,0), # Orange\n        vec(255,255,0), # Yellow\n        vec(0,255,0), # Green\n        vec(0,255,200), # Aqua\n        vec(0,0,255), # Blue\n        vec(180,0,255), # Purple\n        vec(255,0,255) # Pink\n    )\n    ColorInd = 1\n    SelectedColor = Colors[1,vector]\n}elseif(e2CLeftMouseClk()){\n    local RData = lastE2CRangerInfo()\n    local Pos = RData:pos()\n    local Normal = RData:hitNormal()\n    holoCreate(HoloInd,Pos,vec(1,5,5),Normal:toAngle(),SelectedColor)\n    HoloInd = (HoloInd+1)%holoMaxAmount()\n}elseif(e2CReloadClk()){\n    print(\"Deleted all holos!\")\n    HoloInd = 0\n    holoDeleteAll(1)\n}elseif(e2CRightMouseClk()){\n    ColorInd = (ColorInd+1)%Colors:count()\n    SelectedColor = Colors[ColorInd+1,vector]\n    printColor(SelectedColor,\"Changed Color!\")\n}\n\n```\n\u003c/details\u003e\u003cbr\u003e\n\n### [VRMod Functions - Expression2](https://github.com/Vurv78/VExtensions/wiki/VRMod)\n\nAllows you to use VRMod's SHARED functions and hooks if vrmod is installed on your server  \nStarfallEx already has these builtin now, so they have been removed from VExtensions. See https://github.com/thegrb93/StarfallEx/commit/111d81e8c97f01d3b290909c333b675f901bfa77\n\nThis includes functions to get the vr player's headset position, hand position, whether they just dropped a prop and more\n\n\n### [Selfaware Extended - Expression2](https://github.com/Vurv78/VExtensions/wiki/SelfAware-Extended)\n\nAdds more functions that are more 'selfaware' just like e2's general selfaware.lua core  \nExamples are ``defined(string funcname)`` and ``getFunctionPath(string funcname)`` to use the useful #ifdef\n\u003cdetails\u003e\u003csummary\u003eSelfaware Extended Example\u003c/summary\u003e\n\n```ruby\n@name SelfAware Extended Example\n# Say a function name in chat, and the chip will print the OPS cost of the function.\n\nif(first()){\n    runOnChat(1)\n}elseif(chatClk()){\n    local YELLOW = vec(255,255,50)\n    local WHITE = vec(255)\n    local RED = vec(200,70,70)\n\n    local FuncName = lastSaid():explode(\" \")[1,string]\n    local FuncData = getBuiltinFuncInfo(FuncName)\n    if(FuncData){\n        local OPSCost = FuncData[3,number]\n        printGlobal(RED, \"Function\", WHITE, \": \", YELLOW, FuncName, RED, \"\\nCosts\", WHITE, \": \", YELLOW, OPSCost, \" ops\")\n    }else{\n        printGlobal(RED, \"No function data found for: \", YELLOW, FuncName)\n    }\n}\n\n```\n\u003c/details\u003e\u003cbr\u003e\n\n### [RunE2 - Expression2](https://github.com/Vurv78/VExtensions/wiki/RunE2)\n\nAdds functions that allow you to run E2 code, either through udfs and pcall with ``try(s)`` and ``try(st)``, or  \nwith runString(s) to run actual code inside of a chip.\n\u003cdetails\u003e\u003csummary\u003eRunE2 Example Code\u003c/summary\u003e\n\n```ruby\n@name RunE2 Example\nprint( runString(\"error(\\\"test\\\")\", 1) ) #--\u003e \"test\"\n```\n\u003c/details\u003e\u003cbr\u003e\n\n### Other General Functions can be found here:\nhttps://github.com/Vurv78/VExtensions/wiki\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvurv78%2Fvextensions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvurv78%2Fvextensions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvurv78%2Fvextensions/lists"}