From 7bd89704344f9812ccb70b5312c3a2616c3f0f92 Mon Sep 17 00:00:00 2001 From: KubaPro010 Date: Sat, 3 Jan 2026 12:19:29 +0100 Subject: [PATCH] large pi and better readme --- README.md | 21 ++++++++++++++------- examples/large_pi.lua | 20 ++++++++++++++++++++ plugin.lua | 2 +- 3 files changed, 35 insertions(+), 8 deletions(-) create mode 100644 examples/large_pi.lua diff --git a/README.md b/README.md index f6188fd..782e873 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,26 @@ # Lua host This is an WIP lua host for rds spy, a plugin -Compile this under MINGW32, not 64, RDS Spy lives in the past where men who couldn't count to 4294967295 still walked the planet +Compile this under MINGW32, not 64, RDS Spy lives in the past where men who couldn't count to 4294967296 in a CPU word still walked the planet -Project stared 1st of January, 2026 (or 7 haha) +Project started 1st of January, 2026 -Aside from all that, this it loads and executes the script at "%LOCALAPPDATA%\RDS Spy\script.lua", with the api in the `plugin.lua` meta-file +Aside from all that, this loads and executes the script at "%LOCALAPPDATA%\RDS Spy\script.lua", with the api in the `plugin.lua` meta-file ## Why? -Ask Jan Kolar why his funny little rds decoder doesn't have Enchanced RT (excluding the 0x6552 to ERT mapping of course) +Ask Jan Kolar why his funny little rds decoder doesn't have Enchanced RT (excluding the 0x6552 to ERT mapping of course). Yes, no eRT decoding is really why is this, because why decode RDS in C (or even delphi ughhh) when you can just do it in lua! + +Also RDS Surveyor doesn't take line-in MPX input # Scripts -Inside of the examples folder you have `basic.lua` which mostly replaced the `basic.dll` plugin in RDS Spy -Note that you can double click on the buttons, if you try it +Inside of the examples folder you have `basic.lua` which mostly replaces the `basic.dll` plugin in RDS Spy -Another note is that on menu 0 you have the PI and PS in a large font, why? democracy? or something like that ([forum post](https://pira.cz/forum/index.php?topic=1124.0)) \ No newline at end of file +I have also included `large_pi.lua`, while `basic.lua` already shows the PS and PI on a large font, this does only the large PI and PS but in a even larger font. event 1 toggles stickyness + +# Console + +You have a console window generated by this plugin which has as of now 8 buttons where the first if you double-click the "Reload" button, I don't know what it does but maybe it reloads the script? + +The other 7 send events to the Lua script, you can use this with the console mode:true to display diffrent "menus" on the console, double clicking also sends a unique event \ No newline at end of file diff --git a/examples/large_pi.lua b/examples/large_pi.lua new file mode 100644 index 0000000..ea6157d --- /dev/null +++ b/examples/large_pi.lua @@ -0,0 +1,20 @@ +set_console_mode(true) +set_font_size(148) + +local last_pi = "----" +local last_ps = "--------" +function group(...) + local pi = db.read_value("PI") or "----" + local ps = db.read_value("PS") or "--------" + if last_pi ~= pi or last_ps ~= ps then + set_console(string.format("%s\r\n%s", pi, ps)) + last_pi = pi + last_ps = ps + end +end + +function event(event) + if event == 1 then + set_window_stick(not get_window_stick()) + end +end \ No newline at end of file diff --git a/plugin.lua b/plugin.lua index 88358d2..f4a29c5 100644 --- a/plugin.lua +++ b/plugin.lua @@ -71,7 +71,7 @@ function db.read_record(index) end ---@param value string function db.add_value(key, value) end -function db.reset_values(key, value) end +function db.reset_values() end ---@return integer function db.count_records(key, value) end