Page 1 of 1
Where can I find a scripting example?
Posted: 02 Jun 2019 23:30
by MusikMan74
I have looked around on the website and have not found anything.
Some simple examples to get us started would be great
Re: Where can I find a scripting example?
Posted: 03 Jun 2019 11:35
by kjetil
Hi,
Large parts of radium itself is scripted, so you can look in the bin/scheme directory for examples. In bin/menus.conf and bin/keybindings.conf you can search for functions that are executed through "evalScheme".
In the manual, you'll find instructions how to bind scripts to keys:
http://users.notam02.no/~kjetism/radium ... ramed.html
List of available functions:
https://raw.githubusercontent.com/kmath ... rotos.conf
Re: Where can I find a scripting example?
Posted: 03 Jun 2019 11:38
by kjetil
There's also a few discussion about scripting in the github issue tracker:
https://github.com/kmatheussen/radium/i ... evalScheme
Re: Where can I find a scripting example?
Posted: 04 Jun 2019 00:25
by MusikMan74
Thank you.
Re: Where can I find a scripting example?
Posted: 07 Jun 2019 15:42
by MusikMan74
I am finally getting around to reviewing the links from your previous replies.
My initial thoughts about Radium "scripting" would be the ability to control Radium externally, which does not seem to be the case (please correct me if I'm wrong.)
Is it correct to say that the only way to control Radium externally is to issue the supported keybindings, from some other program like AutoHotKey/AutoIt, OR is there another way to call the ra.functions from a script/command line external from the program itself?
Thanks again for your time.
Re: Where can I find a scripting example?
Posted: 07 Jun 2019 16:22
by kjetil
Radium opens a public port you can send scheme code to (first instance uses 5080, if 5080 was not open, use 5081, and so forth). See Help -> About -> Control Port.
You can start a browser-based repl by opening bin/s7webserver/s7webserver_repl.html in a browser.
You can start repl in a terminal by running the bin/scheme/reply.py script.
To start playing from the command line, run this command:
Code: Select all
curl -i -X POST -H "Content-Type: text/plain" -d '(ra:play-song-from-start)' http://localhost:5080
Re: Where can I find a scripting example?
Posted: 07 Jun 2019 16:53
by MusikMan74
WOW.
Very cool powerful remote functionality baked-in!
FYI, sInce I am on Windows:
1. I needed CURL- Windows binaries can be downloaded from:
https://curl.haxx.se/windows/
2. The command-line example supplied needed a syntax modification to work from the Windows cmd prompt- the radium function call requires double-quotes (not single quotes), i.e.:
curl -i -X POST -H "Content-Type: text/plain" -d "(ra:play-song-from-start)"
http://localhost:5080
Again, thanks for your time.
Lots more to learn and try out.