yeah the thing is with param_equal, it can do strings or actions, so while param_bigger doesn't need `` [but still can use] because it can't deal with strings and it uses '' or "" to encapsulate actions that include a space like
param_bigger 'get_var a' 'get_var b'
because param_equal can do strings, then it needs the action to be specified as an action, by wrapping in `` and strings wrapped in "" or ''
It's a little messy as a rule set but to clean it up would remove capabilities.
...script, it's a language, and languages have these weird nuances that a first are confusing but there's usually a reason as to why.
param_bigger 'get_var a' 'get_var b'
because param_equal can do strings, then it needs the action to be specified as an action, by wrapping in `` and strings wrapped in "" or ''
It's a little messy as a rule set but to clean it up would remove capabilities.
...script, it's a language, and languages have these weird nuances that a first are confusing but there's usually a reason as to why.
Posted Thu 10 Nov 22 @ 1:01 pm
Hi. Can a script count the number of letters in a string?
How many letters are there in the variable 'a'?
set_var 'a' "text"
How many letters are there in the variable 'a'?
Posted Sat 12 Nov 22 @ 1:45 am
setting another var to your first var with param_cast 'text' X, [X being the number of chars to cast] then comparing for equality.
truth be told you don't even need a 2nd var, same sort of idea but with param_equal
set_var 'a' "text" & set b `get_var a & param_cast 'text' 1` &
var_equal "a" "b" ? SIZE OF 1 :
set b `get_var a & param_cast 'text' 2` &
var_equal "a" "b" ? SIZE OF 2 :
set b `get_var a & param_cast 'text' 3` &
var_equal "a" "b" ? SIZE OF 3 :
set b `get_var a & param_cast 'text' 4` &
var_equal "a" "b" ? SIZE OF 4 :
truth be told you don't even need a 2nd var, same sort of idea but with param_equal
param_equal `get_var a` `get_var a & param_cast 'text' 1` ? SIZE OF 1 :
param_equal `get_var a` `get_var a & param_cast 'text' 2` ? SIZE OF 2 :
param_equal `get_var a` `get_var a & param_cast 'text' 3` ? SIZE OF 3 :
param_equal `get_var a` `get_var a & param_cast 'text' 4` ? SIZE OF 4 :
Posted Sat 12 Nov 22 @ 3:49 am
Perfect!!!
Posted Thu 17 Nov 22 @ 12:40 pm
locodog wrote :
param_equal `get_var a` `get_var a & param_cast 'text' 1` ? SIZE OF 1 :
param_equal `get_var a` `get_var a & param_cast 'text' 2` ? SIZE OF 2 :
param_equal `get_var a` `get_var a & param_cast 'text' 3` ? SIZE OF 3 :
param_equal `get_var a` `get_var a & param_cast 'text' 4` ? SIZE OF 4 :
Thank you !
Posted Thu 17 Nov 22 @ 1:18 pm
Someone asked for a midnight countdown video effect, but I was thinking that it would maybe be simpler to add it to a video skin
But that will need some scripting
I assume the value could then be taken from comparing 23:59:59 to get_clock cast to maybe an integer, then param_multiply -1 and param_add to get the difference, maybe adding the missing second, and then showing the value?
But I can only figure out how to do the first few steps...
But that will need some scripting
I assume the value could then be taken from comparing 23:59:59 to get_clock cast to maybe an integer, then param_multiply -1 and param_add to get the difference, maybe adding the missing second, and then showing the value?
But I can only figure out how to do the first few steps...
Posted Sun 04 Dec 22 @ 6:10 am
I've done it, I just need to remember how I did it.
*edit, I found it and I remember the problem now. It needs to be started at a known time.
[it monitors saved clock state v current clock and if different, -1 from the countdown, some maths, and resave new clock state]
Problem root is, get_clock, it returns a string so it will only cast the hour value as an int [the : breaks it]. And we've got nothing for casting substrings.
get_clock 'hour'
get_clock 'min'
get_clock 'sec'
would be one fix, for this specific problem, but that isn't real script currently.
param_cast 'text' SIZE INDEX
would be another more round about fix, it would have other uses too, but again doesn't exist.
I suppose it could be brute forced to get the time in a usable form but that would be pretty ugly.
[I'll see how it looks]
Or windows I could make a plugin
Posted Sun 04 Dec 22 @ 6:24 am
I'll add a countdown script to make this easier
Posted Sun 04 Dec 22 @ 7:17 am
thanks that would be good, I've just done the script way anyway.
not easy I suppose I'll post it here in the off chance I need it in the future,
plus to remind myself how to do stuff
get hour,min,sec as vars
timer to midnight
send to text plugin
I played with it a little bit just see second by second changes, this uses text presets for size font & position, so it will only work if you have them saved ["time","number","message" in my case]
this bit replaces the end bit
not easy I suppose I'll post it here in the off chance I need it in the future,
plus to remind myself how to do stuff
get hour,min,sec as vars
timer to midnight
send to text plugin
deck master repeat_start runClock ?
var $showCount 1 ?
on & set $showCount 0 & deck master effect_string 'text' 2 "GENERIC MESSAGE" : off & set $showCount 1 & deck master effect_active text on :
set $showCount 1 & deck master effect_active text on & deck master effect_string 'text' 2 "COUNTDOWN" &
set $minString `get_clock 24 & param_cast 'text' 5` &
set $secString `get_clock 24` &
set $hours `get_clock 24 & param_cast 'integer'` &
set $min 0 &
set $sec 0 &
set $time `get_var $hours & param_cast '00' & param_cast 'text'` &
set_var $char ":" &
set $time `param_add 'get_var $char' 'get_var $time' & param_cast 'text'` &
set $time1 $time &
( param_smaller 10 `get_var $min` ? set $min `param_add 'get_var $min' 'get_text "0"'` : ) &
set $time1 `param_add 'get_var $min & param_cast 00' 'get_var $time'" & param_cast 'text'` &
repeat_start_instant minRun 25ms 60 &
var_equal "$minString" "$time1" !?
set $min `param_add 'get_var $min & param_cast "integer"' 1` &
( param_smaller 10 `get_var $min & param_cast 'integer'` ? set $min `param_add 'get_var $min & param_cast "text"' 'get_text "0"'` : ) &
set $time1 `param_add 'get_var $min & param_cast "text"' 'get_var $time' & param_cast 'text'` :
repeat_stop minRun &
set $time `param_add 'get_var $char' 'get_var $time1'` &
set $time1 $time &
( param_smaller 10 `get_var $sec` ? set $sec `param_add 'get_var $sec' 'get_text "0"'` : ) &
set $time1 `param_add 'get_var $sec & param_cast 00' 'get_var $time'"` &
repeat_start_instant secRun 25ms 60 &
var_equal "$secString" "$time1" !?
set $sec `param_add 'get_var $sec & param_cast "integer"' 1` &
( param_smaller 10 `get_var $sec & param_cast 'integer'` ? set $sec `param_add 'get_var $sec & param_cast "text"' 'get_text "0"'` : ) &
set $time1 `param_add 'get_var $sec & param_cast "text"' 'get_var $time' & param_cast 'text'` :
repeat_stop secRun &
repeat_start_instant correction 25ms 6 &
var_equal "$time1" `get_clock 24` !?
set $hours `get_var $hours & param_cast 'integer'` &
set $min `get_var $min & param_cast 'integer'` &
set $sec `get_var $sec & param_cast 'integer'` &
( cycle $sec 60 & var $sec 0 !? : cycle $min 60 & var $min 0 !? : cycle $hours 24 ) &
set $time3 `get_var $hours & param_cast '00' & param_cast 'text'` &
set $time3 `param_add 'get_var $char' 'get_var $time3' & param_cast 'text'` &
set $time3 `param_add 'get_var $min & param_cast "00"' 'get_var $time3' & param_cast 'text'` &
set $time3 `param_add 'get_var $char' 'get_var $time3' & param_cast 'text'` &
set $time3 `param_add 'get_var $sec & param_cast "00"' 'get_var $time3' & param_cast 'text'` &
set $time1 $time3 :
repeat_stop correction &
set $hours `get_var $hours & param_cast 'integer'` &
set $min `get_var $min & param_cast 'integer'` &
set $sec `get_var $sec & param_cast 'integer'` &
set $countdown `param_add "param_multiply 'get_var $hours' 3600" "param_multiply 'get_var $min' 60"` &
set $countdown `param_add "get_var $sec" "get_var $countdown"` &
set $day 86400 &
set $countdown `param_multiply "get_var $countdown" -1 & param_add 86400` &
set $time `get_clock 24` &
repeat_start_instant runClock 25ms &
var_equal $time `get_clock 24` !?
( cycle $sec 60 & var $sec 0 !? : cycle $min 60 & var $min 0 !? : cycle $hours 24 ) &
set $countdown -1 &
set $time `get_clock 24` &
set $cdHour `param_multiply 'get_var $countdown' 'get_constant 3600 & param_1_x' & param_cast 'int_trunc'` &
set $cdMin 0 &
set $cdSec `param_mod 60 'get_var $countdown'` &
set $cdMin `param_add 'param_multiply "get_var $cdSec" -1' 'param_multiply "get_var $cdHour" -3600' ` &
set $cdMin `param_multiply "param_add 'get_var $countdown' 'get_var $cdMin'" "get_constant 60 & param_1_x"`&
set $time3 `param_add "get_var $char" "get_var $cdHour & param_cast '00'" & param_cast 'text'` &
set $time3 `param_add "get_var $cdMin & param_cast '00'" "get_var $time3"` &
set $time3 `param_add "get_var $char" "get_var $time3"` &
set $time3 `param_add "get_var $cdSec & param_cast '00'" "get_var $time3"` &
( var $showCount 1 ?
get_var $time3 & param_cast & deck master effect_string 'text' 2 : var $showCount 2 ? deck master effect_string 'text' 2 "Happy New Year!" : ) &
param_equal `get_var $time3` "00:00:00" ? set $showCount 2 & wait 1000ms & repeat_stop runClock & wait 29000ms & deck master effect_active text off & set $showCount 0 & deck master effect_string 'text' 2 "GENERIC MESSAGE" : :
I played with it a little bit just see second by second changes, this uses text presets for size font & position, so it will only work if you have them saved ["time","number","message" in my case]
this bit replaces the end bit
( var $showCount 1 ? effect_string text 3 "time" &
get_var $time3 & param_cast & deck master effect_string 'text' 2 : ) &
param_equal `get_var $time3` "00:00:10" ? set $showCount 0 & effect_string text 3 "number" & effect_string text 2 "10" :
param_equal `get_var $time3` "00:00:09" ? set $showCount 0 & effect_string text 2 "9" :
param_equal `get_var $time3` "00:00:08" ? set $showCount 0 & effect_string text 2 "8" :
param_equal `get_var $time3` "00:00:07" ? set $showCount 0 & effect_string text 2 "7" :
param_equal `get_var $time3` "00:00:06" ? set $showCount 0 & effect_string text 2 "6" :
param_equal `get_var $time3` "00:00:05" ? set $showCount 0 & effect_string text 2 "5" :
param_equal `get_var $time3` "00:00:04" ? set $showCount 0 & effect_string text 2 "4" :
param_equal `get_var $time3` "00:00:03" ? set $showCount 0 & effect_string text 2 "3" :
param_equal `get_var $time3` "00:00:02" ? set $showCount 0 & effect_string text 2 "2" :
param_equal `get_var $time3` "00:00:01" ? set $showCount 0 & effect_string text 2 "1" :
param_equal `get_var $time3` "00:00:00" ? set $showCount 2 & effect_string text 3 "message" & deck master effect_string 'text' 2 "Happy New Year!" &
wait 1000ms & repeat_stop runClock & wait 29000ms & deck master effect_active text off & set $showCount 0 & deck master effect_string 'text' 2 "GENERIC MESSAGE" : :
Posted Sun 04 Dec 22 @ 10:49 am
don't mind me I was just making an edit.
Posted Mon 05 Dec 22 @ 10:01 am
locodog wrote :
thanks that would be good, I've just done the script way anyway.
not easy I suppose I'll post it here in the off chance I need it in the future,
plus to remind myself how to do stuff
get hour,min,sec as vars
timer to midnight
send to text plugin
not easy I suppose I'll post it here in the off chance I need it in the future,
plus to remind myself how to do stuff
get hour,min,sec as vars
timer to midnight
send to text plugin
Crazy stuff!
Here is my video on it:
And... we may also need a script that turns it off again, so that the text fx returns to normal :)
Posted Mon 05 Dec 22 @ 10:29 am