Hotkeys

Hotkey is spammable as long as u hold the keyboard key, singlehotkey occurs once even if the keyboard key is held.

hotkey

Prototypes
hotkey(keys, callback)
hotkey(keys, name, callback)
hotkey(keys, name, callback, parent)
Parameters
    • keys: keys as string.
    • name: name on bot interface.
    • callback: function being called on hotkey.
    • parent: tab interface hotkey belongs to. default tab is main
Examples
hotkey(keys, callback)

hotkey with no interface button.

hotkey("f5", function()
    info("Wow, you clicked f5 hotkey")
  end)
-- simple dash
hotkey("u", function() g_game.walk(0) delay(50) end) -- north
hotkey("k", function() g_game.walk(1) delay(50) end) -- east
hotkey("j", function() g_game.walk(2) delay(50) end) -- south
hotkey("h", function() g_game.walk(3) delay(50) end) -- west
hotkey(keys, name, callback)

hotkey with button interface on Main tab

hotkey.png

hotkey("f5", "hello world", function()
    info("Hello World!")
  end)
hotkey(keys, name, callback, parent)

hotkey with button interface on a tab

hotkeywithbutton.png

local toolsTab = addTab("Tools")
hotkey("f5", "hello from tools", function()
    info("Hello World!")
  end, toolsTab)

 

singlehotkey

 

Prototypes
singlehotkey(keys, callback)
singlehotkey(keys, name, callback)
singlehotkey(keys, name, callback, parent)

Examples
singlehotkey(keys, callback)

single occurs hotkey with no interface button. happens once once keypress even it was held

singlehotkey("ctrl+f6", function()
    info("Wow, you clicked ctrl+f6 singlehotkey")
  end)

singlehotkey(keys, name, callback)

example with button interface button on main tab.

singlehotkeyonmain.png

singlehotkey("ctrl+f7", "singlehotkey", function()
    info("Wow, you clicked ctrl+f7 singlehotkey")
  end)
singlehotkey(keys, name, callback, parent)

example with button interface button on a tab

singlehotkeyontab.png

singlehotkey("ctrl+f7", "singlehotkey on tools", function()
    info("hello once from tools")
  end)