alias phelp if ([$0]) {
    if (match($0 $_htopics)) {
        hook pdhelp $0
    }{
        pecho phelp: Invalid topic
    }
}{
    pecho Usage: /phelp <index|topic>
}

on ^hook "pdhelp %" {
    echo $p.vers Help on Topic: $(hwht)$1$(cl)
    switch ($tolower($1)) {
	(index) {
	    fe ($sort($toupper($_htopics))) h1 h2 h3 h4 h5 h6 {
		xecho    $[11]h1 $[11]h2 $[11]h3 $[11]h4 $[11]h5 $[11]h6
	    }
	}
	(addchan) {
	    xecho $(cyn)Usage$(cl): /addchan <channel>
	    xecho    - Adds a channel to your jchans channel list
	    xecho > See also: $(cyn)CHANLIST JCHANS PSET REMCHAN$(cl)
	}
	(addpass) {
	    xecho $(cyn)Usage$(cl): /addpass <password>
	    xecho    - Adds a password to your encode password list
	    xecho > See also: $(cyn)ENCODE PASSLIST PSET REMPASS$(cl)
	}
	(allop) {
	    xecho $(cyn)Usage$(cl): /allop <nick>
	    xecho    - Gives ops to <nick> in every channel you share with them
	}
	(cdccstats) {
	    xecho $(cyn)Usage$(cl): /cdccstats | /cs
	    xecho    - Displays current CDCC and DCC statistics
	}
	(chanlist) {
	    xecho $(cyn)Usage$(cl): /chanlist
	    xecho    - Displays your current jchans channel list
	    xecho > See also: $(cyn)ADDCHAN JCHANS PSET REMCHAN$(cl)
	}
	(channels) {
	    xecho $(cyn)Usage$(cl): /channels
	    xecho    - Displays all your current channels
	}
	(country) {
	    xecho $(cyn)Usage$(cl): /country <hostname|domain|extension>
	    xecho    - Gives you the country of a domain extension
	}
	(encode) {
	    xecho $(cyn)Usage$(cl): /encode [-p <password>] [-m <nick|channel>] <text>
	    xecho    - Sends encrypted text to either a channel or nick with a password
	    xecho      so that only prevail and playdough users can read the text
	    xecho    - If no password is given then a default password will be used
	    xecho    - A default password can be set in /pset
	    xecho    - If no default password is present then a default hardcoded
	    xecho      password will be used
	    xecho    - Encrypted queries and messages are also supported
	    xecho    - Simply add a ":" before the nick in the query or message
	    xecho > See also: $(cyn)ADDPASS PASSLIST REMPASS$(cl)
	}
	(fset) {
	    xecho $(cyn)Usage$(cl): /fset [variable] [text]
	    xecho    - Works just like /set to change playdough's cosmetic formats
	    xecho > See also: $(cyn)PSAVE PSET$(cl)
	}
	(getnick) {
	    xecho $(cyn)Usage$(cl): /getnick <nick> | /getnick -
	    xecho    - Attemts to regain <nick> using various methods
	    xecho    - This is basically a much improved /orignick
	    xecho    - Giving the command "/getnick -" will disable getnick
	    xecho    - Monitors: signoffs, nick changes, notify list, and has a timer
	    xecho > See also: $(cyn)KEEPNICK$(cl)
	}
	(jchans) {
	    xecho $(cyn)Usage$(cl): /jchans
	    xecho    - Automatically joins all channels listed under /chanlist
	    xecho > See also: $(cyn)ADDCHAN CHANLIST REMCHAN$(cl)
	}
	(keepnick) {
	    xecho $(cyn)Usage$(cl): /pset keepnick <ON|OFF> | /pset keepnick_nick <nick>
	    xecho    - This is a feature designed to work along with Getnick.
	    xecho      If Keepnick detects you're not on the right nick, it will
	    xecho      automatically run Getnick to regain your nick.
	    xecho > See also: $(cyn)GETNICK$(cl)
	} 
	(key) {
	    xecho $(cyn)Usage$(cl): /key <key>
	    xecho    - Places a key on the current channel
	    xecho > See also: $(cyn)UNKEY$(cl)
	}
	(passlist) {
	    xecho $(cyn)Usage$(cl): /passlist
	    xecho    - Displays your current encode password list
	    xecho > See also: $(cyn)ADDPASS ENCODE PSET REMPASS$(cl)
	}
	(psave) {
	    xecho $(cyn)Usage$(cl): /psave
	    xecho    - Saves all your current playdough settings
	    xecho > See also: $(cyn)PSET$(cl)
	}
	(pset) {
	    xecho $(cyn)Usage$(cl): /pset [variable] [1|0|ON|OFF|text]
	    xecho    - Works exactly like /set to change your playdough settings
	    xecho > See also: $(cyn)PSAVE$(cl)
	}
	(remchan) {
	    xecho $(cyn)Usage$(cl): /remchan <channel>
	    xecho    - Removes a channel from your current jchans channel list
	    xecho > See also: $(cyn)ADDCHAN CHANLIST JCHANS PSET$(cl)
	}
	(rempass) {
	    xecho $(cyn)Usage$(cl): /rempass <password>
	    xecho    - Removes a password from your encode password list
	    xecho > See also: $(cyn)ADDPASS ENCODE PASSLIST PSET$(cl)
	}
	(reop) {
	    xecho $(cyn)Usage$(cl): /reop
	    xecho    - Re-ops all the current channel ops
	}
	(unkey) {
	    xecho $(cyn)Usage$(cl): /unkey
	    xecho    - Removes the key (if any) from the current channel
	    xecho > See also: $(cyn)KEY$(cl)
	}
	(*) {
	    pecho Usage: /phelp <index|topic>
	}
    }
}
