QUOTE(what_is_name @ Jan 15 2023, 06:10)

I think I have debugged a lot in this script, why don't you try yourself and see if "It does what you want"? none of your code actually work in this script.
My bad. You are right.
I was finding a differet way to do eval() thing.
[cmd1,cmd2] actions[n]();
This in event it does what you say .
Event function not just add a frame function() {} .
Works differently.
normal call
try it in w3schools
[
www.w3schools.com]
https://www.w3schools.com/jsref/tryit.asp?f...e=tryjsref_max2CODE
<script>
var a = Math.max(5, 10);
var b = Math.max(0, 150, 30, 20, 38);
function C1() {
a = 666;}
function C2(xx) {
alert(xx);
b = 777;}
function C3(ee) {}
C3([C1,C2]);
document.getElementById("demo").innerHTML =
a + "<br>" + b + "<br>";
</script>
Triggers nothing.
Try call function in array ee index 0.
CODE
<script>
var a = Math.max(5, 10);
var b = Math.max(0, 150, 30, 20, 38);
function C1() {
a = 666;}
function C2(xx) {
alert(xx);
b = 777;}
function C3(ee) {ee[0]();}
C3([C1,C2]);
document.getElementById("demo").innerHTML =
a + "<br>" + b + "<br>";
</script>
Triggers C1 , that is fine.
Try give C2 a argument ,see what happen.
CODE
<script>
var a = Math.max(5, 10);
var b = Math.max(0, 150, 30, 20, 38);
function C1() {
a = 666;}
function C2(xx) {
alert(xx);
b = 777;}
function C3(ee) {ee[0]();}
C3([C1,C2('qq')]);
document.getElementById("demo").innerHTML =
a + "<br>" + b + "<br>";
</script>
Triggers C1 fine, C2 triggers too, but I did not call it in C3.
Try call array ee index 1 , call a function with argument.
CODE
<script>
var a = Math.max(5, 10);
var b = Math.max(0, 150, 30, 20, 38);
function C1() {
a = 666;}
function C2(xx) {
alert(xx);
b = 777;}
function C3(ee) {ee[1]();}
C3([C1,C2('qq')]);
document.getElementById("demo").innerHTML =
a + "<br>" + b + "<br>";
</script>
Triggers C2 twice, first time argument line , second time C3 array ee[1](); but second time raise error.
Then in Monsterbation .
Bind backspace key this action.
CODE
Bind(8, Strongest([CursorTarget,Cast1('Ragnarok'), Cast2('Disintegrate'), Cast('Corruption')]));
Add test functions
CODE
function Cast1(name) {
return function() {
debugger;
alert('check me1');};}
function Cast2(name) {
return function() {
debugger;
alert('check me2');};}
Modify Strongest()
CODE
function Strongest(actions) { return function() { var n = actions.length; while ( n-- > 0 ) {actions[n]();alert('check me3');debugger;} };}
Ttrigger order:
me3 me2 me3 me1 me3 me3
while ( n-- > 0 ) loop
Cast('Corruption') triggered me3
Cast2('Disintegrate') triggered me2 me3
Cast1('Ragnarok') triggered me1 me3
CursorTarget me3
In event call , argument line does not trigger call , use array to call a function with argument
would not raise error .