This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#9174 - Lua Scripting Language for Rockbox
Attached to Project:
Rockbox
Opened by Dan Everton (safetydan) - Wednesday, 09 July 2008, 12:14 GMT+1
Last edited by Steve Bavin (pondlife) - Thursday, 17 July 2008, 12:15 GMT+1
Opened by Dan Everton (safetydan) - Wednesday, 09 July 2008, 12:14 GMT+1
Last edited by Steve Bavin (pondlife) - Thursday, 17 July 2008, 12:15 GMT+1
|
DetailsHere is an (very, very) early proof of concept Lua viewer plugin.
Currently only a few functions are exported from the plugin API and it also lacks a setjmp/longjmp implementation for actual targets so error handling will go wrong very quickly. However it does work so far for simple scripts like the following: function sayhello(seconds) message = string.format("Hello from LUA for %d seconds", 5) rb.splash(seconds, message) end -- Drawn an X on the screen rb.clear() rb.drawline(0, 0, rb.LCD_WIDTH, rb.LCD_HEIGHT) rb.drawline(rb.LCD_WIDTH, 0, 0, rb.LCD_HEIGHT) rb.update() seconds = 5 rb.sleep(5 * rb.HZ) sayhello(seconds) |
I've added some extra functions to the rb lib (see attached diff)