The Wiki for Tale 5 is in read-only mode and is available for archival and reference purposes only. Please visit the current Tale 11 Wiki in the meantime.

If you have any issues with this Wiki, please post in #wiki-editing on Discord or contact Brad in-game.

VeggieTales Scripting Reference

From ATITD5
Jump to navigationJump to search

General Philosophy

Most of the existing macros and the macroing interface are all built around a few primary goals:

  • No keyboard interaction. While a macro is running, the user should be able to freely chat with their friends, navigate between guild tabs, etc.
  • Image recognition over offsets. Where possible, read and scrape the screen to find the exact image we want to click on instead of hardcoding pixel offsets that might change based on resolution or other factors. The downside of this is that it is more susceptible to minor changes in ATITD causing the macros to work.
  • Status and prompts. Friendly prompts about what values are desired are easy to add, and much better than telling someone to edit the script to handle the values they desire.

API

The functions prefixed with "ls" (short for "LUA script", which makes more sense in the C++ code, as opposed to the actual macros where *everything* is lua script...) generally operate on the VeggieTales window, so lsGetWindowSize() gets the width and height of the VeggieTales window.

The functions prefixed with "sr" (short for Screen Reader) generally operate on the ATITD window, so srGetWindowSize() gets the width and height of the ATITD window.

Specific Reference

This is a work in progress, feel free to fill in details to help everyone.

int lsScreenX
int lsScreenY
void lsSetCaptureWindow()
void lsSleep(int ms)
Vec2 lsGetWindowSize()
Vec2 srGetWindowSize()
Vec2 lsMouseClick(int x, int y, int w, int h, int button)
void lsPrintln(const char *s)
Vec2 srImageSize(const char *fn)
void srMakeImage(const char *name, int x, int y, int w, int h)
Vec2 srFindImage(const char *fn, int tol)
void srShowImageDebug(const char *fn, float x, float y, float z, float scale)
Vec2 srFindImageInRange(const char *fn, int x0, int y0, int w, int h, int tol)
void srReadScreen()
void srClickMouse(int x, int y, bool bRightClick)
void srClickMouseNoMove(int x, int y, bool bRightClick)
void srDrag(int x0, int y0, int x1, int y1, bool rightClick)
void srSetMousePos(int x, int y)
int srReadPixel(int x, int y)
int srReadPixelFromBuffer(int x, int y)
void srMouseDown(int x, int y, bool rightClick)
void srMouseUp(int x, int y, bool rightClick)
void srSaveLastReadScreen(const char *fn)
Vec2 srMousePos()
bool lsShiftHeld()
bool lsAltHeld()
bool lsControlHeld()
void lsPlaySound(const char *sound)
int lsPrint(int x, int y, int z, float xsc, float ysc, const char *color, const char *str)
void lsFontShadow(int on)
int lsMessageBox(const char *title, const char *msg, int buttons)
int lsPrintWrapped(int x, int y, int z, int w, float xsc, float ysc, const char *color, const char *str)
void lsDisplaySystemSprite(int tile, int x, int y, int z, float w, float h, const char *color)
bool lsButtonText(int x, int y, int z, int w, const char *color, const char *txt)
bool lsCheckBox(int x, int y, int z, const char *color, const char *txt, bool value)
int lsDropdown(const char *key, int x, int y, int z, int w, int val)
void lsScrollAreaBegin(const char *key, int x, int y, int z, int w, int h)
void lsScrollAreaEnd(int h)
void lsSetCamera(float x0, float y0, float x1, float y1)
void lsDoFrame()
void lsTopmost(int value)
{bool done, selection} lsEditBox(const char *key, int x, int y, int z, int w, int h, float xsc, float ysc, const char *color, const char *def)
int lsGetTimer()
void lsShowScreengrab(const char *_color)
Vec2[] lsAnalyzePapyrus(int minsize, int maxsize, int debug, int relevant_radius)
Vec2[] lsAnalyzeSilt(int minsize, int maxsize, int debug, int relevant_radius)