I do a check if the object owner is in away state, and poll the if statement its in every 0.5 seconds. yet, when I hit the /afk and my char flops into away mode, the script does nothing at all. I inserted a debug line with llOwnerSay, but it just doesnt set off!
Ive checked, double-checked and triple-checked my checks, also compared to a similar script which seems to be working. but i cant figure it out for the life of me. so either the AGENT_AWAY condition is broken/bugged, or there a really stupid error with my script.
Id be grateful if anyone could look at it and toss me any mistakes I mightve made - many thanks in advance.
CODE
//Blinking Script by Psistorm Ikura
//Global variables
integer listenchannel = 42; //listen channel - dur :P
float bmax = 15.0; //max wait between blinking
float bmin = 10.0; //min wait between blinking
//"no twiddle!" variables
integer idleness = 1;
integer blink = 0;
float blinkTresh = 20.0;
//Functions
doBlink() {
llSetTextureAnim(FALSE, 0, 2, 2, 0, 0, 10.0);
llSetTextureAnim(ANIM_ON|PING_PONG,ALL_SIDES, 2, 2, 1, 4, 10.0);
blinkTresh = 2.0 * llFrand((bmax - bmin) + bmin);
}
setAfk() {
if (idleness == 1) {
idleness = 0;
llSetTextureAnim(ANIM_ON,ALL_SIDES, 2, 2, 1, 0.0, 10.0);
}
}
//Script
default
{
on_rez(integer start_param)
{
llResetScript();
}
state_entry()
{
llListen(listenchannel, "", llGetOwner(),"");
llSetTimerEvent(0.5);
}
listen (integer channel, string name, key id, string message)
{
message = llToLower(message);
if (message == "close") {
setAfk();
}
else if (message == "open") {
idleness = 1;
doBlink();
}
}
timer() {
if (idleness == 1 & llGetAgentInfo(llGetOwner()) & AGENT_AWAY) { //here be FAIL D:
setAfk();
}
else if (idleness == 0 & llGetAgentInfo(llGetOwner()) & !AGENT_AWAY) { //basically the reverse check of above, checks if agent has returned from away
doBlink();
idleness ==1;
}
if (idleness == 1) {
if (blink >= blinkTresh) {
doBlink();
blink = 0;
}
else {
blink++;
}
}
}
}
Ive narrowed it down on the first line after calling the timer() handler - any simple operations executed after this line is true fail, thus the line never does become true.
any help is hugely appreciated, since I really want this script working

