lua
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
lua [2016/03/11 22:49] – [Methods] tomato | lua [2024/10/20 20:29] (current) – Added volume controls frutejuise | ||
---|---|---|---|
Line 141: | Line 141: | ||
You are recommended to keep Tap Action scripts shorter e.g. by running functions in the main script file, as Tap Action scripts are stored in the XML file and not the separate script file. | You are recommended to keep Tap Action scripts shorter e.g. by running functions in the main script file, as Tap Action scripts are stored in the XML file and not the separate script file. | ||
- | ===== Run Lua Function Every Second or Millisecond ===== | + | ===== Run Lua Function Every Hour, Minute, |
+ | |||
+ | function on_hour(h) | ||
+ | function on_minute(h, | ||
+ | function on_second(h, | ||
+ | function on_millisecond(dt) | ||
If you have some custom variables that update every millisecond, | If you have some custom variables that update every millisecond, | ||
Line 202: | Line 207: | ||
===== WatchMaker Lua API ===== | ===== WatchMaker Lua API ===== | ||
- | WatchMaker extends the Lua commandset. Just use the wm_action() or other functions anywhere in your script or tap actions : | + | WatchMaker extends the Lua commandset. Just use the wm_action() or other functions anywhere in your script or tap actions: |
- | + | ||
- | wm_action(' | + | |
- | wm_action(' | + | |
- | wm_action(' | + | |
- | wm_action(' | + | |
+ | wm_action(' | ||
+ | wm_action(' | ||
+ | wm_action(' | ||
+ | wm_action(' | ||
+ | wm_action(' | ||
+ | wm_action(' | ||
+ | wm_action(' | ||
+ | wm_action(' | ||
+ | wm_action(' | ||
+ | wm_action(' | ||
+ | wm_action(' | ||
+ | wm_action(' | ||
+ | wm_action(' | ||
+ | wm_action(' | ||
+ | wm_action(' | ||
+ | wm_action(' | ||
+ | wm_action(' | ||
+ | wm_action(' | ||
+ | wm_action(' | ||
+ | wm_action(' | ||
+ | | ||
wm_schedule(' | wm_schedule(' | ||
wm_unschedule_all() | wm_unschedule_all() | ||
wm_vibrate(d, | wm_vibrate(d, | ||
+ | wm_sfx(' | ||
wm_transition(' | wm_transition(' | ||
+ | wm_anim_set(' | ||
+ | wm_anim_set(' | ||
+ | wm_anim_start(' | ||
wm_tag(' | wm_tag(' | ||
return a value of a WatchMaker tag, e.g. wm_tag(" | return a value of a WatchMaker tag, e.g. wm_tag(" | ||
is_bright | is_bright | ||
+ | |||
+ | *About wm_action w_app | ||
+ | |||
+ | The delimiter for the app link is a backtick '' | ||
+ | |||
+ | * App name (may be empty) | ||
+ | * Package name | ||
+ | * Activity name (optional) | ||
+ | |||
+ | The app name is optional. If it is empty, the app main activity is launched. Example: '' | ||
+ | |||
+ | The easiest way to find the package name (example '' | ||
+ | |||
+ | Available activities of apps can be obtained by downloading the APK file and uploading it to https:// | ||
===== Tweening Functions ===== | ===== Tweening Functions ===== |
lua.1457736540.txt.gz · Last modified: 2016/03/11 22:49 by tomato