viewing paste topic/8882- queue_bug | Athena

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
prontera,152,185,5  script  add 1_F_MARIA,{
    if ( !queueadd( $@q, getcharid(3) ) )
        dispbottom "success";
    else
        dispbottom "already join";
    end;
}
prontera,158,185,5  script  remove  1_F_MARIA,{
    if ( !queueremove( $@q, getcharid(3) ) )
        dispbottom "success";
    else
        dispbottom "not yet join";
    end;
}
prontera,155,185,5  script  check   1_F_MARIA,{
    if ( queuesize($@q) ) {
        .@it = queueiterator($@q);
        dispbottom "iterator ID ["+ .@it +"] has "+ queuesize($@q) +" players on it.";
        .@i = 1;
        dispbottom .@i +". "+ qiget(.@it);
        while ( qicheck(.@it) ) {
            .@i++;
            dispbottom .@i +". "+ qiget(.@it);
        }
        qiclear .@it;
    }
    else {
        dispbottom "no entry";
    }       
    end;
OnInit:
    $@q = queue();
    end;
}
Viewed 1204 times, submitted by AnnieRuru.