1.0.5.0 Release - LUA Scripting!

This is for questions regarding the software.
If you are already have a subscription, use the "General" or "Support" forum.
Forum rules
This is not a support forum. Use the General or Support forum instead. This is only for non subscribed users.
Locked
User avatar
uid0
Site Admin
Posts: 60
Joined: Tue Feb 16, 2021 12:54 pm

Awards (¬‿¬ )

1.0.5.0 Release - LUA Scripting!

Post by uid0 »

1.0.5.0 - LUA Scripting
Moonrock
  • - Removed JSON based triggers
  • + LUA Interpreter: Moonrock now has a full scripting system using Lua. The scripts can run on triggers (like the old system) or you can start a main script that totally disables the normal procedures.
  • + Added more checks on Undock/Belt swapping
  • + Fixed a loop that could cause bot to get stuck in station after getting recalled by GCS
  • + Added two example LUA scripts (not on by default) for autostacking and toggling MWD on asteroid approach.
LUA API Functions

ImagePresent: Check if image is present on screen.
String: image path
Float: tolerance
String: common name (can be empty)
Returns boolean

Code: Select all

ImagePresent(string, float, string) --> bool


FindImage: Find image on screen and returns coordinates.
If the image is not found the return output will be -1, -1
String: image path
Float: tolerance
String: common name (can be empty)
Returns coordinate table. X is [1], Y is [2].

Code: Select all

FindImage(string, float, string) --> List<int>
FindMulti: Find images on screen and returns coordinates.
If the image is not found the return output will be -1, -1
String: image path
Float: tolerance
Bool: convert to grayscale image
String: common name (can be empty)
Returns coordinate table. X is [n][1], Y is [n][2].

Code: Select all

FindMulti(string, float, bool, string) --> List<List<int>>
SendTap: Taps at given coordinates.
Int: X coordinate
Int: Y coordinate
Returns integer (always 1)

Code: Select all

SendTap(int, int) --> int 
SendSwipe: Swipes at given coordinates.
Int: Start X coordinate
Int: Start Y coordinate
Int: End X coordinate
Int: End Y coordinate
Returns integer (always 1)

Code: Select all

SendSwipe(int, int, int, int) --> int 
LogEvent: Sends a log message to console.
String: The message
Returns integer (always 1)

Code: Select all

LogEvent(string) -> int
Sleep: sleep the execution for the provided milliseconds.
Int: milliseconds to sleep (1000 = 1 second)
Returns integer (always 1)

Code: Select all

Sleep(int) --> int
CheckInSpace: checks if player is in space.
Returns boolean

Code: Select all

CheckInSpace() --> Bool
OreHoldFull: checks ore hold is full.
Returns boolean

Code: Select all

OreHoldFull() --> Bool
WarpAndDock: autopilot to station.
Returns boolean on completed operation.

Code: Select all

WarpAndDock() --> Bool
SendWebhookMessage: send a message via Telegram or Discord webhook.
String: The message
Returns boolean on completed operation.

Code: Select all

SendWebhookMessage(string) --> Bool

UploadScreengrab: capture and upload to Imgur a screengrab.
Returns the image link or the string "error" on a falied operation.

Code: Select all

UploadScreengrab() --> string
      . _, 
. .* _||.| 
(_||(_]|_|          
Need my help? Send me a private message or write at ccuid0 @ protonmail.ch
Locked