Miscellaneous

This page will cover miscellaneous APIs or APIs that do not have thorough documentation.

Notifications

These enable you to easily push notifications to the end-user.

MachoMenuNotification([string] title, [string] description) -> void

Create a macho-style notification to be queued and displayed in the top right of the screen, this is visible regardless of whether the menu is open or closed, and slides away after a few seconds.

Logger Control

These APIs are designed to aid menu developers trying to protect their triggers from users. They can be used to quickly disable the logger whilst you run a trigger, keep in mind you may need to wait a second if you're using something asynchronous (eg. resource injection).

MachoGetLoggerState() -> integer

Gets the loggers current state.

MachoSetLoggerState([integer] state) -> void

Sets the loggers current state. These APIs can be used to quickly disable the logger whilst you run a trigger, keep in mind you may need to wait a second if you're using something asynchronous (eg. resource injection).

MachoLockLogger([integer] state) -> void

This will completely lock the event loggers until the cheat is reloaded (closed, and reopened).

Authentication

Authentication support for private lua menus.

MachoAuthenticationKey() -> string

Returns the users authentication key.

MachoWebRequest([string] url) -> string

Sends a HTTP GET request to the URL specified and returns the response body.

local KeysBin = MachoWebRequest("website_url_with_keys")
local CurrentKey = MachoAuthenticationKey()

local KeyPresent = string.find(KeysBin, CurrentKey)
if KeyPresent ~= nil then
    print("Key is authenticated [" .. CurrentKey .. "]")
else
    print("Key is not in the list [" .. CurrentKey .. "]")
end

MachoMenuGetSelectedPlayer() -> integer

Returns the selected player's server id on the macho player picker.

MachoMenuGetSelectedVehicle() -> integer

Returns the selected vehicle's handle on the macho vehicle picker.

MachoOnKeyUp([function] callback) -> void
MachoOnKeyDown([function] callback) -> void

Calls the callback when a key is pressed down or released, this is using Microsoft's Virtual-Key codes. The callback is passed a single argument containing the integer value of the virtual-key code.