viewing paste @Main | 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
-   script  at_main -1,{
 
    OnInit:
        bindatcmd "main", strnpcinfo(3) +"::OnCommand", 0, 2;
        end;
        
        
    OnCommand:
        if (.@atcmd_parameters$[0] == "on") {
            if (!@main) {
                atcommand "@join #main";
                message strcharinfo(0), "You are now in #main chat.";
                @main = 1;
            } else {
                message strcharinfo(0), "You are already in #main chat.";
            }
        } else if (.@atcmd_parameters$[0] == "off") {
            if (@main) {
                atcommand "@channel leave #main";
                message strcharinfo(0), "You are no longer in #main chat.";
                @main = 0;
            } else {
                message strcharinfo(0), "You are not in #main chat.";
            }
        } else {
            message strcharinfo(0), "Invalid parameters.";
            message strcharinfo(0), .@atcmd_command$ +" failed.";
        }
        
        end;
 
}
 
Viewed 1233 times, submitted by Dastgir.