Categories > Coding > Lua >
[REQ] Need functions for DLL
Posted
Okay, I hate using pushcclosure. Don't ask why. There are a lot of complications like updating offsets. But..
I have a request, is there any way to write HttpGet and Loadstring into your execution in lua 100%? Without calling any C++?
Please LMK ASAP.
Added
NOTE: If you have HttpGet and Loadstring that FULLY works in lua im willing to pay 10$
Cancel
Post
hecker dude ngl i hecked 5 ips in 1 second also luaU_loadbiglongjuicythingy(rL);
Replied
Yes, it is possible to implement the http.get and loadstring functionality in Lua without calling any C++ code.
-- Define the http.get function using the LuaSocket library
local function http_get(url)
local http = require("socket.http")
local response, status = http.request(url)
if status == 200 then
return response
else
return nil
end
end
-- Define the loadstring function using the Lua compiler
local function loadstring(code, chunkname)
chunkname = chunkname or "=(loadstring)"
local func, err = load(code, chunkname)
if func then
return func
else
return nil, err
end
end
With these functions defined, you can use them just like the built-in http.get and loadstring functions
-- Example usage
local response = http_get("http://velvet.lol")
print(response)
local code = "print('Hello, world!')"
local func = loadstring(code)
func()
Cancel
Post
Added
@tempegoreng, In Roblox, you can use the require function to load modules, which are basically pre-made scripts that you can reuse throughout your project. When you require a module, the code inside that module runs and any value that the module returns (if it returns one) is sent back to the require function. This makes it super easy to reuse code and avoid duplication in your project.
-- Load the module named "MyModule" using require
local MyModule = require(game:GetService("ServerScriptService").MyModule)
-- Call a function defined in MyModule
MyModule.MyFunction()
Cancel
Post
https://media.discordapp.net/attachments/979069297374671018/1078367228593971362/VelvetSiggy.png
!!!!!marcus__!!!!!#8611
https://cdn.discordapp.com/attachments/1066053366758780978/1078052772567597127/image.png
https://media.discordapp.net/attachments/979069297374671018/1078367228593971362/VelvetSiggy.png
Replied
I know that HttpGetAsync is a function of Roblox, I used to develop games in 2017, and it would be something like game:HttpGetAsync but it really never worked.
Cancel
Post
Added
@Haruka, OOF. The problem is I am trying to also write require in roblox lua not C++.
Cancel
Post
hecker dude ngl i hecked 5 ips in 1 second also luaU_loadbiglongjuicythingy(rL);
https://media.discordapp.net/attachments/706429709734510622/1138184558462902424/BEST_CLIP_EVER.gif?width=660&height=371
Replied
@heckerdude, you can write your own implementation of the require function
Example
local loaded = {}
function require(moduleName)
if not loaded[moduleName] then
-- Load the module
local module = loadfile(moduleName .. ".lua")
if not module then
error("Module not found: " .. moduleName)
end
-- Execute the module
module()
-- Mark the module as loaded
loaded[moduleName] = true
end
-- Return the module's return value (if any)
return moduleReturnValue[moduleName]
end
Cancel
Post
https://media.discordapp.net/attachments/979069297374671018/1078367228593971362/VelvetSiggy.png
hecker dude ngl i hecked 5 ips in 1 second also luaU_loadbiglongjuicythingy(rL);
Added
@RealNickk, This allows you to call a C function named "getgenv" from Lua, but it does not implement the getgenv function's behavior in Lua. To implement getgenv in Lua, simply declare it as a global variable and assign it the value _G.
getgenv = _G
Cancel
Post
https://media.discordapp.net/attachments/979069297374671018/1078367228593971362/VelvetSiggy.png
https://media.discordapp.net/attachments/706429709734510622/1138184558462902424/BEST_CLIP_EVER.gif?width=660&height=371
Users viewing this thread:
( Members: 0, Guests: 1, Total: 1 )
Cancel
Post