Skip to content

Commands

Lady-Binary edited this page Jun 12, 2021 · 13 revisions

Commands

The following commands are available in your EasyLOU LUA scripts.
Commands are not in alphabetic order. Rather, they are (somewhat) grouped by functionality.

FindItem

Parameters:

  • Item: either a number or a string.
  • ContainerID: a number, optional.

Useful for pretty much any item in game. If Item is a number, FindItem will search for a dynamic object having the given ObjectID. If Item is a string, FindItem will search for all the dynamic objects whose Name contains the given string.

If ContainerID is given, FindItem will only search within the container having the given ObjectId.

Examples

FindItem("hatchet") -- finds all hatchets and stores the result in FINDITEM
FindItem("hatchet",BACKPACKID) -- finds all hatchet in your backpack and stores the result in FINDITEM

FindPermanent

Parameters:

  • Permanent: either a number or a string.
  • Distance: maximum search distance. If not specified, it defaults to 30.

Useful for trees, rocks, etc. If Permanent is a number, FindPermanent will search for a permanent object having the given PermanentID. If Permanent is a string, FindPermanent will search for all the permanent objects whose Name contains the given string.

Examples

FindPermanent("tree") -- finds all trees and stores the result in FINDITEM

Key

Unused.

Move

Parameters:

  • x: x coordinate.
  • y: y coordinate.
  • z: z coordinate.

or alternatively

  • id: ObjectID.

Character will attempt to move at the given location x, y, and z, or if an ObjectID was provided, will attempt to move at the location of the given ObjectID.
Please note that pathfinding will be used, but if there are obstacles such as doors the action will probably fail and character will stay at the original position.
Likewise, if the location is too far from the current position than just a couple of screens, the action will probably fail and character will stay at the original position.
A sleep() command may be desired after the call to Move() to allow the character time to walk to the location.

Examples

Move(500,30,1000) -- moves to word coordinates 500,30,1000

Stop

Parameters:
None.

If the character is moving, it will stop.

ScanJournal

Parameters:

  • timestamp: timestamp in seconds.

The journal will be scanned, and it will return the first entry that immediately follows the given timestamp.
If the timestamp provided is equal to 0, it will return the very first message of the journal.

Examples

ScanJournal(TIME) -- reads the latest entry of the journal

Macro

Parameters:

  • macro: a number.

It will execute the given macro.
Macros dropped on the left bar are usually from 0-27.
Primary action (usually bound to Q) is usually 27.
Secondary action (usually bound to E) is usually 28.

Examples

Macro(0) -- presses first hotbar button
Macro(10) -- presses first hotbar button on second bar

Say

Parameters:

  • text: a string.

Will say the given text. This can also be used to trigger scripts commands, i.e. commands that starts with "/" such as "/wave".

SayCustom

Parameters:

  • text: a string.

Useful for context-menu commands such as "Stack Contents", "Release", etc. See 04-finditem-drag-split example file.

ToggleWarPeace

Parameters: None.

Toggles between War and Peace.

TargetDynamic

Parameters:

  • id: the ObjectID to target.

Targets a dynamic object (i.e. an item, or a mobile).

Examples

FindItem("bear") 
TargetDynamic(FINDITEM[1].ID)

TargetPermanent

Parameters:

  • id: the PermanentID to target.

Targets a permanent object (i.e. a rock, or a tree).

Examples

FindPermanent("tree") 
TargetPermanent(FINDITEM[1].ID)

TargetLoc

Parameters:

  • x (number): x coordinate to target.
  • y (number): y coordinate to target.
  • z (number): z coordinate to target.
  • objectId (number): not sure, may not be needed. it looks like an object with a given objectId can be targeted at the given coords.

Targets the given location.

LastTarget

Parameters: None.

Execute the LastTarget macro.

TargetSelf

Parameters: None.

Execute the TargetSelf macro.

WaitForTarget

Parameters:

  • timeout in milliseconds, optional, default is 5000 (i.e. 5 seconds.).

Wait for the cursor to change into a target, or for the timeout to elapse, whichever occurs first.

AttackSelected

Parameters:

  • id: the ObjectID to attack.

Attack the given ObjectID.

UseSelected

Parameters:

  • id: the ObjectID to use.

Use the given ObjectID. It is the equivalent of Double Clicking the object.

Examples

FindItem("cotton")
UseSelected(FINDITEM[1].ID)

ContextMenu

Parameters:

  • id: the ObjectID to trigger the command on.
  • command: the Context Menu command to trigger.

Triggers the given Context Menu command on the given object.

Examples

ContextMenu(CHARID, "Dismount")
ContextMenu(CHARID, "Power Hour")
ContextMenu(FINDITEM[1].ID, "Split Stack")
ContextMenu(FINDITEM[1].CNTID, "Stack Contents")

Drag

Parameters:

  • id: the ObjectID to drag.

Drag the given ObjectID.

Dropc

Parameters:

  • id: the ContainerID where the dragged item should be dropped.

To be used in conjunction with Drag.
Drops the currently dragged item into the given ContainerID.

Example

Drag(itemId)
Dropc(BACKPACKID)

Dropg

Parameters:

  • x (number): x coordinate.
  • y (number): y coordinate.
  • z (number): z coordinate.

To be used in conjunction with Drag.
Drops the currently dragged item at the given location.

FindMobile

Parameters:

  • Mobile: can be a number or a string.
  • Distance: maximum search distance. If not specified, it defaults to 30.

Useful for searching mobs, npcs, etc.
If Mobile is a number, FindMobile will search for a mobile object having the given id.
If Mobile is a string, FindMobile will search for all the mobile objects whose Name contains the given string.

Examples

FindMobile("dragon")
if FINDMOBILE then
    Say("OMG A DRAGON!")
end

FindGameObject

Parameters:

  • Name: a string.

FindGameObject will search for all the Unity GameObjects whose Name contains the given string.

SetUsername

Parameters:

  • Username: a string.

Sets the Username textbox. This can be used at login.

SetPassword

Parameters:

  • Password: a string.

Sets the Password textbox. This can be used at login.

Login

No parameters.

Triggers the login button. This can be used at login.

SelectServer

Parameters:

  • URL: a string.

Connects to the custom server with the given URL. This can be used at the server selection page.

CharacterSelect

Parameters:

  • Character: a number.

Selects the given character (0-3). This can be used at the character selection page.

FindPanel

Parameters:

  • Name: a string.

FindPanel will search for all the panels whose Name contains the given string.

Example(s)

FindPanel() -- all panels will be listed in variable FINDPANEL
FindPanel("Tracking") -- all panels containing the word Tracking will be listed in variable FINDPANEL

FindButton

Parameters:

  • Panel: a string.
  • Name: a string. or
  • Panel: a string.
  • x: a GUI x coordinate.
  • y: a GUI y coordinate.

If Name is provided, FindButton will search within the provided Panel all the buttons whose Name/Tooltip/Command contains the given Name string.
If X and Y are provided, FindButton will search within the provided Panel all the buttons that are clickable at the given GUI coordinates X and Y.

Example

FindButton("CraftingWindow", "favorites")
ClickButton("CraftingWindow", FINDBUTTON[1].NAME)

ClickButton

Parameters:

  • PanelName: a string.
  • ButtonName: a string.

Trigger a click event on the button having the name specified and contained in the specified panel. Mouse over the button needed, and the ButtonName will be stored in the MOUSEOVERUINAME variable

Example

FindPanel("Tracking")
ClickButton(FINDPANEL[1].ID, "0")

GetTooltip

Parameters:

  • id: the ObjectID to examine

Gets the tooltip data of an object. Each line of the tooltip is split with a '|' character and stored in the TOOLTIPTEXT variable.

Example

FindItem("Chest")
GetTooltip(FINDITEM[1].ID)

SetInput

Parameters:

  • ContainerName: a string.
  • InputName: a string.
  • NewValue: a string.

Sets the value of the input having the name specified and contained in the specified panel.

SetTargetFrameRate

Parameters:

  • FrameRate: a number.

Set the given target frame rate.

SetVSyncCount

Parameters:

  • VSyncCount: a number.

Set the given target VSync count.

SetMainCameraMask

Parameters:

  • CameraMask: a number.

Set the given camera mask. If 0, will competely disable the rendering (CPU and GPU reduced usage).
If -1, will re-enable the rendering (CPU and GPU high usage).
Handy for multiboxing.

ResetVars

Parameters:

  • None.

Reset EasyLOU state variables such as FIND variables, etc.

RegisterHotKey

Parameters:

  • Key: string, taken from the following list:

"backspace", "delete", "tab", "clear", "return", "pause", "escape", "space", "[0]", "[1]", "[2]", "[3]", "[4]", "[5]", "[6]", "[7]", "[8]", "[9]", "[.]", "[/]", "[*]", "[-]", "[+]", "equals", "enter", "up", "down", "right", "left", "insert", "home", "end", "pageup", "pagedown", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "-", "=", "!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "_", "+", "[", "]", "`", "{", "}", "~", ";", "'", "\\", ":", "\", ""|", "", ".", "/", "<", ">", "?", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "numlock", "capslock", "scrolllock", "rightshift", "leftshift", "rightctrl", "leftctrl", "rightalt", "leftalt", "rightcmd", "leftcmd", "rightsuper", "leftsuper", "altgr", "compose", "help", "printscreen", "sysreq", "break", "menu", "power", "euro", "undo"

Register a hotkey that should be listened to.

OnHotKey

Parameters:

  • Key: string, see RegisterHotKey.

Returns true if the hotkey has been pressed. NOTE: this will fire only once per keypress.

Examples

RegisterHotKey("f1")
RegisterHotKey("f2")
RegisterHotKey("f3")

while true do
	if OnHotKey("f1") then
		Say("Hi")
	end
	if OnHotKey("f2") then
		Say("Hey")
	end
	if OnHotKey("f3") then
		Say("Hello")
	end
end
RegisterHotKey("f1")
RegisterHotKey("f2")
RegisterHotKey("f3")

while true do
	if OnHotKey("f1") then
		CastHealSelf()
	end
	if OnHotKey("f2") then
		CastCureSelf()
	end
	if OnHotKey("f3") then
		CastArchCureSelf()
	end
end

IsHotKeyDown

Parameters:

  • Key: string, see RegisterHotKey.

Returns true if the hotkey is currently being pressed. NOTE: this will keep firing until the key is down.

Examples

RegisterHotKey("f1")
RegisterHotKey("f2")
RegisterHotKey("f3")

while true do
	if IsHotKeyDown("f1") then
		Say("Fire F1!!!")
	end
	if OnHotKey("f2") then
		Say("Fire F2!!!")
	end
	if OnHotKey("f3") then
		Say("Fire F3!!!")
	end
end

PlayScript

Parameters:

  • ScriptName: string, the name of a script.

Start the script.

PlayAllScripts

Parameters: None.

Start all the scripts.

PauseScript

Parameters:

  • ScriptName: string, the name of a script.

Pause the script.

StopScript

Parameters:

  • ScriptName: string, the name of a script.

Stop the script.

StopAllScripts

Parameters: None.

Stop all the scripts.

StopAllScriptsButThis

Parameters: None.

Stop all the scripts except the current one.