30 Nov 11, 04:14PM
(This post was last modified: 30 Nov 11, 04:17PM by Felix-The-Ghost.)
I'm having some serious trouble with this syntax.
This script I made used to work to an extent, going one-way and echoing the value but not toggling it. Now I don't know what's wrong.
I'm trying to emulate a Boolean variable and act on it.
I'm trying to do this:
[cubescript]
alias slow 0 //0 = normal speed 1 = slo_mo
alias toggle_slo_mo
[
if ( = $slow 0 ) //if slow is off
[
push slow 1; //turn slow on
gamespeed 10 //slow-mo
]
//else...
[
pop slow; //turn slow off
gamespeed 100 //normal-speed
]
echo $slow //debug
]
bind LALT toggle_slo_mo //no minimap for you
[/cubescript]
But it doesn't even echo the value, neither via LALT nor via manual typing the /toggle_slo_mo
Is a line-break a delimiter for commands as well as the semicolon?
I had tried removing it before and it ended up trying to combine the commands.
What methods are there for just assigning values to previously created aliases?
alias ali
ali = value? ali value? alias ali value?
This script I made used to work to an extent, going one-way and echoing the value but not toggling it. Now I don't know what's wrong.
I'm trying to emulate a Boolean variable and act on it.
I'm trying to do this:
[SELECT ALL] Code:
bool slow = false;
void toggle_slo_mo
{
slow = !slow;
if (slow)
gamespeed = 10;
else
gamespeed = 100;
}
[cubescript]
alias slow 0 //0 = normal speed 1 = slo_mo
alias toggle_slo_mo
[
if ( = $slow 0 ) //if slow is off
[
push slow 1; //turn slow on
gamespeed 10 //slow-mo
]
//else...
[
pop slow; //turn slow off
gamespeed 100 //normal-speed
]
echo $slow //debug
]
bind LALT toggle_slo_mo //no minimap for you
[/cubescript]
But it doesn't even echo the value, neither via LALT nor via manual typing the /toggle_slo_mo
Is a line-break a delimiter for commands as well as the semicolon?
I had tried removing it before and it ended up trying to combine the commands.
What methods are there for just assigning values to previously created aliases?
alias ali
ali = value? ali value? alias ali value?