-
Notifications
You must be signed in to change notification settings - Fork 202
Function error fixes 9c16c #137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: revision
Are you sure you want to change the base?
Changes from all commits
da2e569
4fd30f6
2abf154
21fdc0f
d51b4ad
03d48dd
15db25e
57c159e
c5e93a2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,42 @@ | ||
| debug.lua | ||
| selene.toml | ||
| roblox.toml | ||
| .vscode | ||
| /user | ||
| ``` | ||
| # Compiled files | ||
| *.pyc | ||
| *.class | ||
| *.o | ||
| *.obj | ||
| *.out | ||
|
|
||
| # Dependencies | ||
| node_modules/ | ||
| venv/ | ||
| .venv/ | ||
| __pycache__/ | ||
| .mypy_cache/ | ||
| .pytest_cache/ | ||
| target/ | ||
| .gradle/ | ||
|
|
||
| # Build artifacts | ||
| dist/ | ||
| build/ | ||
| coverage/ | ||
| htmlcov/ | ||
| .coverage | ||
|
|
||
| # Editor/IDE files | ||
| .vscode/ | ||
| .idea/ | ||
| *.swp | ||
| *.swo | ||
| *.tmp | ||
|
|
||
| # System files | ||
| .DS_Store | ||
| Thumbs.db | ||
| .env | ||
| .env.local | ||
| *.env.* | ||
|
|
||
| # Logs | ||
| *.log | ||
| ``` |
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i don't understand why these images are in directly in the repository |
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. redundant file, caching is already done here Lines 190 to 286 in 91327d0
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| local owner = "Yuki-1224-nazz" | ||
| local branch = "revision" | ||
|
|
||
| -- Cache frequently used functions for performance | ||
| local pairs = pairs | ||
| local type = type | ||
| local unpack = unpack or table.unpack | ||
| local pcall = pcall | ||
| local loadstring = loadstring | ||
| local game = game | ||
|
|
||
| -- Optimized web import with caching and error handling | ||
| local importCache = {} | ||
|
|
||
| local function webImport(file) | ||
| -- Return cached result if available | ||
| if importCache[file] then | ||
| return unpack(importCache[file]) | ||
| end | ||
|
|
||
| local success, result = pcall(function() | ||
| local url = ("https://raw.githubusercontent.com/%s/Hydroxide/%s/%s.lua"):format(owner, branch, file) | ||
| local content = game:HttpGetAsync(url) | ||
|
|
||
| if not content or content == "" then | ||
| return nil | ||
| end | ||
|
|
||
| local func = loadstring(content, file .. '.lua') | ||
| if func then | ||
| return func() | ||
| end | ||
|
|
||
| return nil | ||
| end) | ||
|
|
||
| if success and result ~= nil then | ||
| importCache[file] = {result} | ||
| return result | ||
| end | ||
|
|
||
| return nil | ||
| end | ||
|
|
||
| -- Load main module first (initializes oh environment) | ||
| local initResult = webImport("init") | ||
|
|
||
| -- Load UI module | ||
| if initResult then | ||
| webImport("ui/main") | ||
| end |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,26 @@ | ||
| local ClosureSpy = {} | ||
|
|
||
| local hookFunction = hookFunction | ||
| local newCClosure = newcclosure | ||
| local isLClosure = islclosure | ||
| local getProtos = getprotos | ||
| local getUpvalues = getupvalues | ||
| local getUpvalue = getupvalue | ||
| local getContext = getthreadcontext | ||
| local setContext = setthreadcontext | ||
| local setUpvalue = setupvalue | ||
| local getConstants = getconstants | ||
| local getConstant = getconstant | ||
| local setConstant = setconstant | ||
| local getCallingScript = getcallingscript | ||
| local pairs = pairs | ||
| local type = type | ||
| local table_insert = table.insert | ||
| local table_remove = table.remove | ||
| local table_find = table.find | ||
| local typeof = typeof | ||
| local getInfo = debug.getinfo or getinfo | ||
|
|
||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why are we still localizing globals in 2026 |
||
| local requiredMethods = { | ||
| ["hookFunction"] = true, | ||
| ["newCClosure"] = true, | ||
|
|
@@ -38,7 +59,7 @@ end | |
|
|
||
| local Hook = {} | ||
| local hookMap = {} | ||
| hookCache = {} | ||
| local hookCache = {} | ||
|
|
||
| function Hook.new(closure) | ||
| local hook = {} | ||
|
|
@@ -175,14 +196,14 @@ end | |
|
|
||
| function Hook.incrementCalls(hook, vargs) | ||
| hook.Calls = hook.Calls + 1 | ||
| table.insert(hook.Logs, vargs) | ||
| table_insert(hook.Logs, vargs) | ||
| end | ||
|
|
||
| function Hook.decrementCalls(hook, vargs) | ||
| local logs = hook.Logs | ||
|
|
||
| hook.Calls = hook.Calls - 1 | ||
| table.remove(logs, table.find(logs, vargs)) | ||
| table_remove(logs, table_find(logs, vargs)) | ||
| end | ||
|
|
||
| ClosureSpy.Hook = Hook | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i do not understand the point of this file