Jump to content

Some Suggestions


JamesMerth
 Share

Recommended Posts

Apparently nobody seems to use the lua api in this gta mod menu, since I'm the first post here.
However I've got a few suggestions:

  • Switch to Luajit since it's considerable faster and it provides ffi which let's you call c functions through lua
  • Implement some sort of pattern scanning through lua
  • More advanced web functions
    • header, body, parameters, timeout for requests
    • async web requests by passing a callback function like 
      • -- web.get(url, header, body, complete)
        web.get("www.google.com", nil, nil, function(data)
            if data.status ~= 200 then
            	error(string.format("Error request failed, status: %d", data.status)  
            end
              
            print(data.body)
        end)
    • put, delete (and maybe other less important functions like head, options, patch as well)
    • websocket support
  • More rendering function
    • loading custom fonts and drawing text with said font
    • scissorrect
    • drawing blurred rectangles e.g draw_rect_blur(hash, draw, x, y, w, h, blur_strength, rounding = 0, rounding_flags = 0)
    • support for utf8 characters fore draw_text (not sure if that's already the case)
Link to comment
Share on other sites

  • Administrators
2 hours ago, JamesMerth said:

Apparently nobody seems to use the lua api in this gta mod menu, since I'm the first post here.
However I've got a few suggestions:

  • Switch to Luajit since it's considerable faster and it provides ffi which let's you call c functions through lua
  • Implement some sort of pattern scanning through lua
  • More advanced web functions
    • header, body, parameters, timeout for requests
    • async web requests by passing a callback function like 
      • -- web.get(url, header, body, complete)
        web.get("www.google.com", nil, nil, function(data)
            if data.status ~= 200 then
            	error(string.format("Error request failed, status: %d", data.status)  
            end
              
            print(data.body)
        end)
    • put, delete (and maybe other less important functions like head, options, patch as well)
    • websocket support
  • More rendering function
    • loading custom fonts and drawing text with said font
    • scissorrect
    • drawing blurred rectangles e.g draw_rect_blur(hash, draw, x, y, w, h, blur_strength, rounding = 0, rounding_flags = 0)
    • support for utf8 characters fore draw_text (not sure if that's already the case)

Lua is more actively discussed on discord and on the test server. Thanks for your suggestions, I'll definitely consider them. I can’t say that we will be able to switch on LuaJit soon, because too much time has already been devoted to Lua to the detriment of other sections and functionality, but we will definitely return to this issue very soon. Regarding web requests, I will pass all this on to the person who is responsible for the network part 😉

UPD: I just looked again at the documentation, our lua lib supports LuaJIT, so we will add support for it soon.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...