Categories > Coding > Lua >

[REQ] Need functions for DLL

heckerdude

heckerdude

Posts: 129

Threads: 16

Joined: Aug, 2022

Reputation: 6

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.

  • 0

Added

NOTE: If you have HttpGet and Loadstring that FULLY works in lua im willing to pay 10$

  • 0

hecker dude ngl i hecked 5 ips in 1 second also luaU_loadbiglongjuicythingy(rL);

Haruka

STD Testing Center

Posts: 58

Threads: 3

Joined: Feb, 2023

Reputation: 5

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()

 

  • 0

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()

 

  • 0

https://media.discordapp.net/attachments/979069297374671018/1078367228593971362/VelvetSiggy.png

 

 

marcus__

S.K.I.D

vip

Posts: 444

Threads: 23

Joined: Nov, 2022

Reputation: 29

Replied

@Haruka

im convinced you are an ai gpt-3 thing

  • 1

!!!!!marcus__!!!!!#8611

https://cdn.discordapp.com/attachments/1066053366758780978/1078052772567597127/image.png

Haruka

STD Testing Center

Posts: 58

Threads: 3

Joined: Feb, 2023

Reputation: 5

Replied

@marcus__, why lol?

 

  • 0

https://media.discordapp.net/attachments/979069297374671018/1078367228593971362/VelvetSiggy.png

 

 

heckerdude

heckerdude

Posts: 129

Threads: 16

Joined: Aug, 2022

Reputation: 6

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.

  • 0

Added

@Haruka, OOF. The problem is I am trying to also write require in roblox lua not C++.

  • 0

hecker dude ngl i hecked 5 ips in 1 second also luaU_loadbiglongjuicythingy(rL);

Posts: 112

Threads: 0

Joined: Feb, 2022

Reputation: 34

Replied

become a weirdo and use RequestInternal in the HttpService

  • 0

https://media.discordapp.net/attachments/706429709734510622/1138184558462902424/BEST_CLIP_EVER.gif?width=660&height=371

Haruka

STD Testing Center

Posts: 58

Threads: 3

Joined: Feb, 2023

Reputation: 5

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

 

  • 0

https://media.discordapp.net/attachments/979069297374671018/1078367228593971362/VelvetSiggy.png

 

 

heckerdude

heckerdude

Posts: 129

Threads: 16

Joined: Aug, 2022

Reputation: 6

Replied

@Haruka, Also, last request. Anyway to do getgenv in lua?

  • 0

hecker dude ngl i hecked 5 ips in 1 second also luaU_loadbiglongjuicythingy(rL);

Haruka

STD Testing Center

Posts: 58

Threads: 3

Joined: Feb, 2023

Reputation: 5

Replied

@heckerdude, you can use the _G table to access the global environment

 

  • 0

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

 

  • 0

https://media.discordapp.net/attachments/979069297374671018/1078367228593971362/VelvetSiggy.png

 

 

Posts: 112

Threads: 0

Joined: Feb, 2022

Reputation: 34

Replied

@heckerdude,

 

getgenv = function() 
return getfenv(0)
end

  • 0

Added

@Haruka is ChatGPT your best friend

  • 0

https://media.discordapp.net/attachments/706429709734510622/1138184558462902424/BEST_CLIP_EVER.gif?width=660&height=371

Next >>>

Users viewing this thread:

( Members: 0, Guests: 1, Total: 1 )