# Some basic commands modified so that you no longer need to type the # hash (#) in the channel name. # Source: Written by Wizzu , based on the join/leave # from the Death script # Date: 25th Nov 1995, modified 12th May 1996 # Commands: join, leave, rejoin, invite, mode, op, dop, kick, names, list alias ne xecho -level crap ### alias err xecho -level crap ### # Channelize, add # to front if needed for channel names. # Based on the join / leave alias from the Death script. alias channelize { if ((![$0])||([&]==[$[1]0])||([#]==[$[1]0])||([$0]==[0])||([-]==[$[1]0])) { @function_return = [$0-] } { @function_return = [#$0-] } } # Join / leave (no # required) alias join { if ([$[2]0]!=[-i]) {${K}${K}join $channelize($0) $1-} {${K}${K}join $0-} } alias leave { if ((![$0])||([$0]==[*])) { if (![$C]==[0]) { partcmt $C $1- } } { ^assign chan $channelize($0) if ([$onchannel($N $chan)]) { partcmt $chan $1- } { if (match(#* $0)) { err $0: no such channel. } { if ([$C]) { partcmt $C $0- } { err You're not on any channel. } } } ^assign -chan } } alias partcmt if ([$1]) { quote part $0 :$1- } { quote part $0 } # Rejoin alias rejoin { if ([$0]) { if ([$0]!=[*]) { ^assign chan $channelize($0) } { ^assign chan $C } if ([$onchannel($N $chan)]) { leave $chan $1- eval timer 2 join $chan timer 3 ^assign -chan } { err $chan: Not on that channel. ^assign -chan } } { if ([$C]!=[0]) { eval timer 2 join $C leave $C } { err No channel to rejoin. } } } # Invite, assumes current channel if none specified, and hash ('#') may # be omitted from channel name. alias invite { if ([$0]!=[]) { if (![$1]) { if ([$C]!=[0]) { ${K}${K}invite $0 $C } { err No channel specified for invite. } } { ${K}${K}invite $0 $channelize($1) } } { err No nick specified for invite. } } # Mode, assumes current channel if no target (channel or nick) specified, # the hash ('#') from channel name may be omitted. # Based one the mode from Data alias mode if ((rmatch($0 #*))||([$0]==[$N])) { ${K}${K}mode $0- } { if ([$0]==[*]) { ${K}${K}mode $C $1- } { if (([$[1]0]==[+])||([$[1]0]==[-])) { ${K}${K}mode $C $0- } { ${K}${K}mode $channelize($0-) } } } alias op { if ([$1]) { if (([$[1]0]==[#])||(onchannel($N $channelize($0)))) { ${K}${K}MODE $channelize($0) +ooooo $1-5 if ([$6]) { op $C $6- } } { ${K}${K}MODE $C +ooooo $0-4 if ([$5]) { op $C $5- } } } { if ([$C]) { if ([$0]) {${K}${K}MODE $C +o $0} {err No argument. Use OP to give ops on current channel.} } {err You must be on a channel to use OP.} } } alias dop { if ([$1]) { if (([$[1]0]==[#])||(onchannel($N $channelize($0)))) { ${K}${K}MODE $channelize($0) -ooooo $1-5 if ([$6]) { dop $C $6- } } { ${K}${K}MODE $C -ooooo $0-4 if ([$5]) { dop $C $5- } } } { if ([$C]) { if ([$0]) {${K}${K}MODE $C +o $0} {err No argument. Use DOP to take ops on current channel.} } {err You must be on a channel to use DOP.} } } alias kick { if ([$0]) { ^assign -chan if ([$0]!=[*]) { if ([$onchannel($N $channelize($0))]) { if ([$1]) { @ chan = [$channelize($0)] @ nick = [$1] @ msg = [$2-] } { err No nickname specified. } } { @ chan = [$C] @ nick = [$0] @ msg = [$1-] } } { if (![$C]==[0]) { if ([$1]) { @ chan = [$C] @ nick = [$1] @ msg = [$2-] } { err No nickname specified. } } { err You're not on a channel. } } if ([$chan]) { if ([$onchannel($nick $chan)]) { ${K}${K}kick $chan $nick $msg } { err $nick is not on channel ${chan}. } ^assign -chan ^assign -nick ^assign -msg } } { err You must at least specify the nick to kick. } } alias names if ([$0]) { ${K}${K}names $channelize($0-) } { if ([$C]) { ${K}${K}names $C } { ne You really shouldn't do that. } } alias list { ${K}${K}list $channelize($0-) }