configfile menu

# "Description: popup menu config file"

# "command NAME COMMAND adds a normal menu entry"
# "menu NAME starts a submenu"
# "end ends the most recent submenu"
# "more help on this later, if you cant figure it out ask me"

channel {
    command Ping "/ping $channel"
    command Banlist... {
        /echo $channel \[ channel \] Retrieving banlist...
        /mode $channel b
    }
    command Rejoin {
        /part $channel
        /join $channel
    }
    command Part "/part $channel"
    command Modes... "/mode $channel"
}

query {
    menu Ctcp
    command Ping "/ping $nick"
    command Version "/ctcp $nick version"
    command Clientinfo "/ctcp $nick clientinfo"
    command Userinfo "/ctcp $nick userinfo"
    command Finger "/ctcp $nick finger"
    command Time "/ctcp $nick time"
    end
    menu Dcc
    command Chat "/dcc chat $nick"
    command Send... "/dcc send $nick"
    end
    command Whois "/whois $nick $nick"
    command Who "/who $nick"
}

dcc {
    command Send... "/dcc send $nick"
    command Close "/dcc close chat $nick"
    command Whois "/whois $nick"
    command Query... "/query $nick"
}

user {
    menu Ctcp
    command Ping {/ping [join $nicks ,]}
    command Version {/ctcp [join $nicks ,] version}
    command Clientinfo {/ctcp [join $nicks ,] clientinfo}
    command Userinfo {/ctcp [join $nicks ,] userinfo}
    command Finger {/ctcp [join $nicks ,] finger}
    command Time {/ctcp [join $nicks ,] time}
    end
    command Whois {
        if {[llength $nicks] == "1"} {
            /whois $nick $nick
        } else {
            /whois [join $nicks ,]
        }
    }
    command Who {
        set after 0
        foreach x $nicks {
            after $after [list /who $x]
            incr after 1000
        }
    }
    command Query... "/query $nick"
    menu Dcc
    command Chat "/dcc chat $nick"
    command Send... "/dcc send $nick"
    end
    menu Control
    command Op {
        set mode ""
        set blah ""
        foreach x $nicks {
            if [IsOp $channel $x] {
                append mode -o
            } else {
                append mode +o
            }
            lappend blah $x
            if {[llength $blah] == "4"} {
                /mode $channel $mode [join $blah]
                set blah ""
                set mode ""
            }
        }
        if {$blah != ""} {
            /mode $channel $mode [join $blah]
        }
    }
    command Voice {
        set mode ""
        set blah ""
        foreach x $nicks {
            if [IsVoice $channel $x] {
                append mode -v
            } else {
                append mode +v
            }
            lappend blah $x
            if {[llength $blah] == "4"} {
                /mode $channel $mode [join $blah]
                set blah ""
                set mode ""
            }
        }
        if {$blah != ""} {
            /mode $channel $mode [join $blah]
        }
    }
    command QKick {
        global prefs
        /kick $channel [join $nicks ,] [lindex $prefs(kick) 0]
    }
    command "Q B/K" {
        /qbk $channel [join $nicks]
        foreach x $nicks {
            /ignore $x
        }
    }
    command Kick/Ban... "/bk $channel $nick"
}

personal {
    menu "Mark Away"
    foreach away $x "/away $x"
    end
    command "Unmark Away" /away
    menu "Join Channel"
    foreach chan $x "/join $x"
    end
    menu "Set Nick"
    foreach nick $x "/nick $x"
}

server {
    command Ping /sping
    command Links... /links
    command List... /list
    command Lusers /lusers
    command Motd /motd
    menu "Connect to"
    builtin servers
}

REMOVE!misc {
    command Example {Send "i suck"}
    menu test
    command Blah test
    menu test2
    separator
    command blah2 test
    end
    command blah3 test
    end
    command blah4 test
}
