Emistry icon

[RO] Auto Left Channel System

Emistry | PRO | 11/22/18 02:29:04 PM UTC | 0 ⭐ | 1956 👁️ | Never ⏰ | []
C |

1.01 KB

|

None

|

0 👍

/

0 👎

// https://rathena.org/board/topic/117458-channel-controller/#comment-353969
 
prontera,155,181,5  script  Sample  4_F_KAFRA1,{
    doevent "channel_setting_main::OnTalk";
}
 
-   script  channel_setting_main    -1,{
    
    OnInit:
        setarray .channel_list_name$, "#main", "#support";
        setarray .channel_list$, "#main", "#support";
        
        .channel_size = getarraysize(.channel_list$);
        end;
    
    OnTalk:
        mes "Hello "+strcharinfo(0);
        mes "Select the Chat Channel you wish to be in.";
        for (.@i = 0; .@i < .channel_size; .@i++)
            .@menu$ = .@menu$ + .channel_list_name$[.@i] + (#CHANNEL_SETTINGS & (1 << .@i) ? "[On]":"[Off]")  + (1 >> .@i) + ":";
        .@i = select(.@menu$) - 1;
        if (#CHANNEL_SETTINGS & (1 << .@i)) 
            #CHANNEL_SETTINGS -= (1 << .@i);
        else 
            #CHANNEL_SETTINGS |= (1 << .@i);
        mes "Setting updated.";
        close;
    
    OnPCLoginEvent:
        // sleep2 1000;
        while (.@i < .channel_size) {
            if (#CHANNEL_SETTINGS & (1 >> .@i))
                atcommand "@channel leave "+.channel_list$[.@i];
            .@i++;
        }
        end;
 
}

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎