Giter VIP home page Giter VIP logo

lua-hotkey's Introduction

Commands:

runfile [absolute path]
runfile [relative path]
run [code]

You can run file by dragging it onto LuaEngine.exe

Functions:

console.print(string: text)
console.rawline(string: text)
console.clear()

mouse.setPosition(int: x, int: y)
mouse.getPosition()
mouse.smoothMove(int: x, int: y, int: time, int: interpolations)
mouse.setState(int: button, bool: state)
mouse.click(int: x, int: y, int: button, int:time)

keyboard.getKeyState(int: key)
keyboard.getAsyncKeyState(int: key)
keyboard.setKeyState(int: key, bool: state)
keyboard.execute(string: text)

screen.getDimensions()
screen.getPixelColor(int: x, int: y)
screen.findPixelByColor(int: x, int: y, int: w, int: h, int: r, int: g, int: b, int: variation)

engine.wait(int: time)
engine.messageBox(string: title, string: info, int: type)

Examples:

local sx, sy = screen.getDimensions()
mouse.smoothMove(sx/2, sy/2, 1000)
local input = ""

function updateConsole()
    console.clear()
    print("\x1B[31mInput text:")
    console.rawline("\x1B[32m" .. input)
end

while true do
    for k,v in pairs(_G) do
        if k:sub(1, 3) == "VK_" and #k == 4 then
            if keyboard.getAsyncKeyState(v) then
                input = input .. k:sub(4, 4):lower()
                updateConsole()
            end
        end
    end
    if keyboard.getAsyncKeyState(VK_BACK) then
        input = input:sub(1, #input-1)
        updateConsole()
    end
    if keyboard.getAsyncKeyState(VK_RETURN) then
        console.clear()
        print("\x1B[33mResult: " .. input)
        input = ""
    end
end

lua-hotkey's People

Contributors

borsuczyna avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.