home *** CD-ROM | disk | FTP | other *** search
/ Hackers Toolkit v2.0 / Hackers_Toolkit_v2.0.iso / HTML / archive / IRC / phoenix.irc < prev    next >
Text File  |  1999-11-04  |  99KB  |  3,455 lines

  1. #
  2. #          - +  Welcome to PhoEniX Version 2.13 from Vassago  + -
  3. # - +  The ORIGINAL PHOENIX/GARGOYLE -*- Accept no Hacks or Substitutes + -
  4. #                      -* Release Date: 03/27/95 *-
  5. #
  6. #  This script works with all 2.2.9 and greater clients (at this point in
  7. #  time). It will not work on VMS or similar systems. 2.3.17 clients and
  8. #  variations thereof may cause irregular script behavior. AIX and similar
  9. #  systems may experience unusual results from the script /SVE function.
  10. #
  11. #  This script is NOT compatible with any other scripts, with the exception
  12. #  of the other files that are included with it and my extras, pkicks,
  13. #  annoy, VeveS, and Serpent scripts. I only guarantee PhoEniX to be
  14. #  backdoor free if you download it from my Public Domain FTP site:
  15. #
  16. #                       jcowan.reslife.okstate.edu
  17. #
  18. #  If you have problems, delete your .ircrc and/or make sure you are 
  19. #  untarring the tarfile (tar -xvf <filename>). If problems persist,
  20. #  get a fresh copy from my FTP site (jcowan.reslife.okstate.edu)
  21. #
  22. #  - Vassago (Ryan Addams)
  23. #
  24.  
  25. ^set NOVICE OFF
  26. ^set EXEC_PROTECTION OFF
  27.  
  28. echo   .-------------------------------------------------------------------------.
  29. EVAL echo   |     __________ /\\___    ________/\\_________/\\ .__  ___ ____  _____      |
  30. EVAL echo   |    /_______   \\_ |  \\::/   _____    ______ . \\|  \\|   |    |/    /      |
  31. EVAL echo   |   .::|   |/    /     \\/   /|   \\    ___|:/  \\ `   \\   |\\   |    /::.    |
  32. EVAL echo   | .::::|   _____/  |    \\   \\|    \\   |    \\   \\     \\  |/   _    \\::::.  |
  33. EVAL echo   |::::::|   |:\\_____|     \\________/____     \\___\\     \\_|____|     \\:::::.|
  34. EVAL echo   |::::::|   |:::::::|______/:::::::::::\\______/::|______/:::::|______\\:::::|
  35. echo   |      :   :                                  (<  MiSTRaL / PaRaLLaX >)   |
  36. echo   |    PhoEniX Version 2.13 by Vassago - Accept No Hacks or Substitutes!    |
  37. echo   |-------------------------------------------------------------------------|
  38. EVAL echo   | = Type /COMMANDS for a list of commands \(PHOENIX.HLP must be loaded\). = |
  39. echo   | To get the latest version of PhoEniX, ftp to jcowan.reslife.okstate.edu |
  40. echo   |   DO NOT use this script unless you get it directly from my FTP site!   |
  41. echo   `-------------------------------------------------------------------------'
  42.  
  43. ### Customizable Section
  44.  
  45. assign fingermsg VMS IRC Client 1.7.6
  46. assign pingmsg Pong!
  47. assign versionmesg VMS IRC Client 1.7.6
  48. assign default_server irc-2.texas.net 6667
  49. assign flood_msg Flood protection activated. You are now being ignored.
  50. assign ex [E/X]
  51. assign pk | PhoEniX |
  52. assign abkickmsg | Auto BKick |
  53. assign channel_floodmsg | Channel Flood |
  54. assign nick_floodmsg | Nick Flood |
  55. assign uban_kickmsg | User Ban |
  56. assign ignore_types MSGS CTCP NOTICES INVITES NOTES CRAP
  57. assign defumes Be back in a few...
  58. assign idlemes Automatically set away.
  59. assign signmsg I'm outta here!
  60. assign shell_pgm csh
  61. assign usermode +is
  62. assign false_files null zero yes true false lice*
  63. assign false_chars ** ** ** ** ** *;* ** ** *$$* */*
  64.  
  65. # Sensor Settings (Flood/Mass Protection)
  66.  
  67. @ msgsensor    =  6
  68. @ noticesensor =  10
  69. @ ctcpsensor   =  4
  70. @ nicksensor   =  3
  71. @ msensor      =  2
  72. @ ksensor      =  3
  73. @ dcclimit     =  8
  74. @ resetcount   =  16
  75. @ ignorecount  =  300
  76.  
  77. # Default Assigns (Can be changed while online)
  78.  
  79. assign extmes ON
  80. assign floodp ON
  81. assign chanprot ON
  82. assign idle_time 5
  83. assign prot ON
  84. assign nhp OFF
  85. assign rejoin ON
  86. assign autochannels ALL
  87. assign ctcpauto ON
  88. assign autorename ON
  89. assign autoop on
  90.  
  91. assign TOOPVIEW OFF
  92. assign AUTOGET ON
  93. assign AUTOSEND ON
  94. assign AUTOCLOSE OFF
  95. assign SECURITY OFF
  96. assign AUTOCLOSEWHENAWAY OFF
  97. assign NOISE ON
  98. assign OVERWRITE OFF
  99.  
  100. # PhoEniX Directories ($W designates current directory)
  101. # If you aren't on SunOS, you might want to change $HOME to ~ if you are
  102. # having problems with the script trying to write to a strange directory.
  103.  
  104. EVAL ^assign PhoEniXDir $HOME/.PhoEniX
  105. EVAL ^assign MainDir $W
  106. EVAL ^assign UPLOADDIR $W
  107. EVAL ^assign DOWNLOADDIR $W
  108.  
  109. ### End Customize Section
  110.  
  111. ### Initializers
  112.  
  113. assign SCRIPTLOADING YES
  114.  
  115. ^set status_format %T %*%@%N%#%S%H%B%Q%A%C%+%I%O%M%F %W%>%U 
  116. EVAL ^assign OLD_STATUS $STATUS_FORMAT
  117.  
  118. EVAL echo $ex PhoEniX Version 2.13 now loading, please wait...
  119.  
  120. @ mcount = 0
  121. @ kcount = 0
  122. @ msgcount = 0
  123. @ noticecount = 0
  124. @ ctcpcount = 0
  125. @ dccsent = 0
  126. @ nickcnt = 0
  127. @ away_messages = 0
  128. @ logged_entries = 0
  129. @ msgmax = 10
  130. @ MYSEND = [NO]
  131. @ FRIENDADD = 0
  132. @ PRIVADD = 0
  133. @ ENEMYADD = 0
  134. @ COMMENTADD = 0
  135. @ GETCOUNT = 0
  136. @ TOTPACK = 0
  137.  
  138. EVAL ^assign asve $PhoEniXDir/save.ex
  139. EVAL ^assign baksve $PhoEniXDir/exsave.ex
  140. EVAL ^assign awayfle $PhoEniXDir/away.ex
  141. EVAL ^assign offerfile $PhoEniXDir/offer.ex
  142. EVAL ^set logfile $MainDir/irclog.ex
  143.  
  144. EVAL ^assign flood_ok $help_service
  145.  
  146. assign defban h
  147. assign ban_name HOST
  148. assign change_stat ON
  149. assign showkill ON
  150. assign awaystat ON
  151. assign OPVIEWING OFF
  152. assign isaway NO
  153. assign logirc OFF
  154. assign bogus_patterns *fuck* *shit* *suck* *dick* *penis* *cunt* *haha* *fake* *split* *ass* *hehe* *bogus* *yawn* *leet*
  155.  
  156. ^set AUTO_UNMARK_AWAY OFF
  157. ^set AUTO_WHOWAS OFF
  158. ^set BEEP ON
  159. ^set BEEP_MAX 3
  160. ^set BEEP_ON_MSG NONE
  161. ^set BEEP_WHEN_AWAY OFF
  162. ^set BOLD_VIDEO ON
  163. ^set CHANNEL_NAME_WIDTH 12
  164. ^set CLOCK ON
  165. ^set CLOCK_24HOUR OFF
  166. ^set CLOCK_ALARM NULL
  167. ^set COMMAND_MODE OFF
  168. ^set CONTINUED_LINE  
  169. ^set DCC_BLOCK_SIZE 1024
  170. ^set DISPLAY ON
  171. ^set FLOOD_WARNING OFF
  172. ^set FULL_STATUS_LINE ON
  173. ^set HELP_WINDOW OFF
  174. ^set HIDE_PRIVATE_CHANNELS OFF
  175. ^set HIGHLIGHT_CHAR BOLD
  176. ^set HISTORY 25
  177. ^set HOLD_MODE OFF
  178. ^set INDENT ON
  179. ^set INPUT_PROMPT <P> 
  180. ^set INPUT_PROTECTION ON
  181. ^set INSERT_MODE ON
  182. ^set INVERSE_VIDEO ON
  183. ^set LASTLOG 40
  184. ^set LASTLOG_LEVEL ALL DCC
  185. ^set LOG OFF
  186. ^set MAIL 1
  187. ^set MAX_RECURSIONS 200
  188. ^set NO_CTCP_FLOOD ON
  189. ^set NOTIFY_ON_TERMINATION OFF
  190. ^set SCROLL ON
  191. ^set SEND_IGNORE_MSG OFF
  192. ^set SHOW_AWAY_ONCE ON
  193. ^set SHOW_CHANNEL_NAMES ON
  194. ^set SHOW_END_OF_MSGS OFF
  195. ^set SHOW_NUMERICS OFF
  196. ^set SHOW_STATUS_ALL OFF
  197. ^set SHOW_WHO_HOPCOUNT ON
  198. ^set STATUS_AWAY  (A)
  199. ^set STATUS_CHANNEL  %C
  200. ^set STATUS_CHANOP @
  201. ^set STATUS_CLOCK  %T
  202. ^set STATUS_HOLD  ** MORE **
  203. ^set STATUS_MODE  (+%+)
  204. ^set STATUS_MAIL  M:%M
  205. ^set STATUS_NOTIFY  A:%F
  206. ^set STATUS_OPER *
  207. ^set STATUS_OVERWRITE (ow) 
  208. ^set STATUS_QUERY  Q:%Q
  209. ^set STATUS_UMODE  (+%#)
  210. ^set STATUS_USER  E/X
  211. ^set STATUS_WINDOW ^
  212. ^set SUPPRESS_SERVER_MOTD ON
  213. ^set TAB ON
  214. ^set TAB_MAX 3
  215. ^set UNDERLINE_VIDEO ON
  216. ^set USE_OLD_MSG OFF
  217. ^set USER_WALLOPS OFF
  218. ^set VERBOSE_CTCP OFF
  219. ^set WARN_OF_IGNORES ON
  220.  
  221. bind meta1-[ meta2
  222. bind meta1-O meta2
  223. bind meta2-A backward_history
  224. bind meta2-B forward_history
  225. bind meta2-C forward_character
  226. bind meta2-D backward_character
  227. bind ^B self_insert
  228. bind ^_ self_insert
  229. bind ^V self_insert
  230. bind ^Z stop_irc
  231. bind ^X switch_channels
  232. bind ^O parse_command ig $,
  233. bind ^I parse_command ^getmsg 1 $msglist
  234. bind ^R parse_command ^getmsg -1 $msglist
  235. bind ^F parse_command FLUSH
  236.  
  237. # Creates the PhoEniX directory
  238.  
  239. EVAL ^cd $PhoEniXDir
  240. wait
  241. EVAL if ([$W]!=[$PhoEniXDir]) {
  242.    EVAL ^exec -name phoenix mkdir $PhoEniXDir
  243.    wait %phoenix
  244.    EVAL ^exec -name phoenix chmod 700 $PhoEniXDir
  245.    wait %phoenix
  246. }
  247. EVAL ^cd $MainDir
  248. wait
  249.  
  250. ### Basic Aliases
  251.  
  252. alias ww whowas
  253. alias scan names $C
  254. alias sc names $C
  255. alias n notice
  256. alias wi whois
  257. alias unignore noig
  258. alias chops w -chops
  259. alias re redirect
  260. alias c mode $C $0-
  261. alias dr //dcc rename
  262. alias dl //dcc list
  263. alias dc //dcc chat
  264. alias dcg //dcc close get
  265. alias ex exec
  266. alias wii whois $0 $0
  267. alias ls exec ls -al
  268. alias cat exec cat
  269. alias r msg , $0-
  270. alias m msg
  271. alias bklist listbk
  272. alias umode mode $N
  273. alias chat //dcc chat $decode($chatter)
  274. alias nochat //dcc close chat $decode($chatter)
  275. alias rmode ^set status_mode  (+%+)
  276. alias nokey quote MODE $C -k $decode($chankey)
  277. alias nnotice quote NOTICE $0 :$1-
  278. alias kkick quote KICK $0 $1 :$2-
  279. alias mmode quote MODE $0-
  280. alias unbanlop nunbanlop $C $0-
  281. alias mc quote MODE $C -lsnmpitk $decode($chankey)
  282. alias ml quote MODE $C +inst-lmpk $decode($chankey)
  283. alias mn quote MODE $C +nst-ilmpk $decode($chankey)
  284. alias _checkkey if (!rmatch($M *k*)) {^set status_mode  (+%+)}{^timer 15 _checkkey}
  285. alias sec_check if (rmatch($0 $SECLIST)) {@ FUNCTION_RETURN = [YES]}{@ FUNCTION_RETURN = [NO]}
  286. alias wl wholeft
  287. alias wh who -host
  288. alias ap autoping
  289. alias i inv $,
  290. alias bkick bk
  291. alias deop dop
  292. alias mop mass o
  293. alias mdop mass d
  294. alias mv mass v
  295. alias mdv mass s
  296. alias masskick mass k
  297. alias dop ndop $C $0-
  298. alias lk mass lk
  299. alias submode if (mcount>0) {@ mcount = mcount - 1}
  300. alias subkick if (kcount>0) {@ kcount = kcount - 1}
  301. alias chanpass if ((match($strip(# $0) $AutoChannels))||([$AutoChannels]==[ALL])) {^assign FUNCTION_RETURN YES}
  302. alias enickonly {^assign FUNCTION_RETURN $encode($left($index(! $0) $0))}
  303. alias userdomain @ function_return = LEFT($INDEX(@ $0) $0)##[@]##MID(${1+INDEX(. $0)} 99 $0)
  304. alias pecho {^xecho -level crap $ex $0-}
  305. alias pubact if (isop($N $1)) {/kkick $1 $0 $channel_floodmsg}
  306. alias pubecho if ([$1]==[$C]) {/echo <$0> $2-}{/echo <$0:$1> $2-}
  307. alias safe {^assign FUNCTION_RETURN $strip(\;#\(\)+*/\\=\{\}<>[]!$$%^~`,?|'\"  $0-)}
  308. alias safe2 {^assign FUNCTION_RETURN $strip(\;#\(\)+*/\\=\{\}<>[]$$%^~`,?|'\"  $0-)}
  309. alias hignore @ function_return = fixname($0) ## [@] ## fixdomain($1)
  310. alias join if ((![$0])||([&]==[$[1]0])||([#]==[$[1]0])||([$0]==[0])||([-]==[$[1]0])) { //join $0- } { //join #$0- }
  311. alias leave if (![$0]) { //leave $C } { if (([&]==[$[1]0])||([#]==[$[1]0])||([$0]==[*])) { //leave $0 } { //leave #$0 } }
  312. alias j join
  313. alias l leave
  314. alias autoping {
  315.    ^set STATUS_USER  Lag ? - E/X
  316.     quote PING $time() $S
  317. }
  318.  
  319. alias sb {
  320.    ^on ^367 "*" {
  321.      if ([$4]) {/echo *** $1 $2 \(By $3, $mid(4 15 $stime($4))\)}
  322.      {/echo *** $1-}
  323.    }
  324.    if ([$0]) {//mode $0 +b}
  325.    {//mode $C +b}
  326. }
  327.  
  328. alias w {
  329.    if ([$0]) {
  330.       if ([$0]==[-chops]) {//who $0 $C $1-} 
  331.       {//who $0-}
  332.    }
  333.    {//who *}
  334. }
  335.  
  336. alias t {
  337.   if ([$0]==[#*]) {//topic $0-}
  338.   {//topic $C $0-}
  339. }
  340.  
  341. alias inv {
  342.   if ([$0]) {
  343.     if ([$1]) {//invite $0-}
  344.     {//invite $0 $C}
  345.   }
  346.   {/pecho You need to specify a nick to invite.}
  347. }
  348.  
  349. alias serv { 
  350.   if ([$0]) {//server $0-}
  351.   {//server $default_server}
  352. }
  353.  
  354. alias pubcat {
  355.   if ([$0]) {^exec -name pubcat cat $0}
  356.   {/pecho Usage: /pubcat <filename>}
  357. }
  358.  
  359. alias fing {
  360.   if ([$0]) {/ctcp $0 FINGER}
  361.   {/ctcp $C FINGER}
  362. }
  363.  
  364. alias ver {
  365.   if ([$0]) {/ctcp $0 VERSION}
  366.   {/ctcp $C VERSION}
  367. }
  368.  
  369. alias p {
  370.   if ([$0]) {//ping $0}
  371.   {//ping $C}
  372. }
  373.  
  374. alias op {
  375.   mmode $C +ooo $0 $1 $2
  376.   if ([$3]) {/op $3-}
  377. }
  378.  
  379. alias ndop {
  380.     mmode $0 -oo $1 $2
  381.     if ([$3]) {/ndop $0 $3-}
  382. }
  383.  
  384. alias dcc {
  385.      //dcc $0-
  386.      if ([$0]==[SEND]) {
  387.      @ dccsent = dccsent + 1
  388.      ^timer 120 checksend $1 $2
  389.      }
  390. }
  391.  
  392. ### Error Message Editing/Commenting
  393.  
  394. on ^002 "*" #
  395. on ^305 "*" #
  396. on ^306 "*" #
  397. on ^443 "*" #
  398. on ^401 "% % No such nick (channel)" #
  399.  
  400. alias do301 {
  401.     ^on ^301 "*" { 
  402.       if ([$0]!=[$N]) {/echo *** $0 is away: $1-}
  403.     }
  404. }
  405.  
  406. on ^404 "*" check_synch $0-
  407. on ^482 "*" check_synch $0-
  408.  
  409. alias check_synch {
  410.    if ([$0]!=[$desynch]) {
  411.       if ([$0]!=[$S]) {
  412.      pecho $0 is desynched from the IRC Network.
  413.     ^assign desynch $0
  414.     ^timer -delete 821
  415.     ^timer -refnum 821 180 ^assign -desynch
  416.       }
  417.       {/echo *** $1-}
  418.    }
  419. }
  420.  
  421. ### MODE and KICK Protection (by Vassago)
  422.  
  423. alias mdact {
  424.    if ((isop($N $1))&&([$mdwait]==[])&&([$decode($0)]!=[$N])) {
  425.     mmode $1 -o $decode($0)
  426.     pecho MASS DEOP DETECTED. By: $decode($0) On: $1
  427.        ^assign mdwait YES
  428.        ^timer -delete 793
  429.        ^timer -refnum 793 8 ^assign -mdwait
  430.    }
  431.    @ mcount = 0
  432. }
  433.  
  434. alias kact {
  435.    if ((isop($N $1))&&([$kwait]==[])&&([$decode($0)]!=[$N])) {
  436.     mmode $1 -o $decode($0)
  437.     pecho MASS KICK DETECTED. By: $decode($0) On: $1
  438.        ^assign kwait YES
  439.        ^timer -delete 794
  440.        ^timer -refnum 794 8 ^assign -kwait
  441.    }
  442.    @ kcount = 0
  443. }
  444.  
  445. alias mdtest {
  446.     if ([$0]==[$lastmd]) {
  447.     @ mcount = mcount + $2
  448.     ^timer 12 submode
  449.     if (mcount>msensor) {/mdact $0 $1}
  450.     }
  451.     {
  452.        ^assign lastmd $0
  453.     @ mcount = $2
  454.        ^timer 12 submode
  455.     if (mcount>msensor) {/mdact $0 $1}
  456.     }
  457. }
  458.  
  459. alias ktest {
  460.     if (([$0]==[$lastmdk])&&([$0]!=[$encode($N)])) {
  461.        @ kcount = kcount + 1
  462.        ^timer 12 subkick
  463.        if (kcount>ksensor) {/kact $0 $1}
  464.     }
  465.     {^assign lastmdk $0}
  466. }
  467.  
  468. ### MODE & KICK Handlers (by Vassago & YaZoO)
  469.  
  470. on -raw_irc "% MODE *" {
  471.   @ mdcnt = 0
  472.   @ nixcnt = 0
  473.   ^assign mde +
  474.   ^assign mdech $3
  475.   ^assign nix $4-
  476.   ^assign mdchop $encode($left($index(! $0) $0))
  477.   if (([$prot]==[ON])&&(rmatch($3 -ooo* *-ooo*))) {/mdact $mdchop $2}
  478.   while (mid($mdcnt 1 $mdech)!=[]) {
  479.     ^assign mdecc $mid($mdcnt 1 $mdech)
  480.     if (([$mdecc]==[-])||([$mdecc]==[+])) {^assign mde $mdecc}
  481.     {
  482.      if (match($mde$mdecc +b -b +o -o +k -k +l -l +m -m)) {
  483.      if ([$mde$mdecc]==[+b]) {
  484.        if ((match($word($nixcnt $nix) $ownadd))&&(rmatch($0 *!*))) {/bansave $2 $mdchop $word($nixcnt $nix)}
  485.        if ((!rmatch($0 *!*))&&(isop($N $2))&&([$nhp]==[ON])&&([$SAVEBAN]==[])) {/mmode $2 -b $word($nixcnt $nix)}
  486.        ^assign -SAVEBAN
  487.      }
  488.      if ([$mde$mdecc]==[+o]) {
  489.     if ((!rmatch($0 *!*))&&(isop($N $2))&&([$nhp]==[ON])) {/mmode $2 -o $word($nixcnt $nix)}
  490.      }
  491.      if ([$mde$mdecc]==[-o]) {
  492.     if ([$prot]==[ON]) {/mdtest $mdchop $2 1}
  493.      }
  494.      if ([$mde$mdecc]==[+k]) {
  495.        if ((rmatch($word($nixcnt $nix) $false_chars))&&(rmatch($0 *!*))) {
  496.       ^set status_mode  DEFLECTED!
  497.       ^timer 15 _checkkey
  498.        if ((isop($N $2))&&([$chanprot]==[ON])) {/mmode $2 -k $word($nixcnt $nix)}
  499.        }
  500.        {/if ((!rmatch($0 *!*))&&(isop($N $2))&&([$NHP]==[ON])) {/mmode $2 -k $word($nixcnt $nix)}}
  501.        ^assign chankey $encode($word($nixcnt $nix))
  502.      }
  503.      @ nixcnt = nixcnt + 1
  504.      }
  505.     }
  506.     @ mdcnt = mdcnt + 1
  507.   }
  508. }
  509.  
  510. on ^mode "%.% *" pecho SERVER MODES DETECTED. In $1: \'$2-\'
  511.  
  512. alias bansave {
  513.     if (isop($N $0)) {
  514.     mmode $0 -ob $decode($1) $2
  515.     kkick $0 $decode($1) $uban_kickmsg
  516.     }
  517.    ^assign SAVEBAN YES
  518.     pecho BAN ON YOU DETECTED. By: $decode($1)
  519.     log You were banned from $0 by $decode($1)\.
  520. }
  521.  
  522. on -raw_irc "% KICK *" {
  523.   ^assign kickchan $strip(: $2)
  524.   ^assign kickperson $encode($left($index(! $0) $0))
  525.   if ([$prot]==[ON]) {/ktest $kickperson $kickchan}
  526.   if ([$3]==[$N]) {
  527.      if ([$REJOIN]==[ON]) {^timer 3 //join $kickchan}
  528.      log You were kicked from $kickchan by $decode($kickperson)\. Reason: $4-
  529.   }
  530. }
  531.  
  532. ### Multi-Channel Nickname Flood Protection (by Vassago)
  533.  
  534. on -channel_nick "*" {
  535.   if ( ([$chanprot]==[ON])&&([$2]!=[$N])) {
  536.     if ([$newnick1]==[$encode($1)]) {@ nickcnt = nickcnt + 1}
  537.        if (nickcnt==nicksensor) {
  538.       if (isop($N $0)) {
  539.          kkick $0 $2 $nick_floodmsg
  540.          pecho NICK FLOOD DETECTED. On $0 by: $2
  541.       }
  542.       @ nickcnt = 0
  543.        }
  544.       ^assign newnick1 $encode($2)
  545.       ^timer 30 ^assign -newnick1
  546.       ^timer 30 @ nickcnt = 0
  547.     }
  548. }
  549.  
  550. ### JOIN Functions (by Vassago)
  551.  
  552. alias autocheck {
  553.   if ([$ainuse]==[]) {
  554.    ^assign ainuse YES
  555.     foreach ENEMIES XX {
  556.        if ((rmatch($ENEMIES[$XX] $1))||(match($ENEMIES[$XX] $1))) {
  557.         if ([$bkmatch]==[]) {
  558.         if ([$COMMENTS[$XX]]!=[]) {
  559.             mmode $0 -o+b $decode($2) $ENEMIES[$XX]
  560.             kkick $0 $decode($2) $COMMENTS[$XX]
  561.         }
  562.         {
  563.             mmode $0 -o+b $decode($2) $ENEMIES[$XX]
  564.             kkick $0 $decode($2) $abkickmsg
  565.         }
  566.         ^assign bkmatch YES
  567.         }
  568.        }
  569.     }
  570.     ^assign -bkmatch
  571.   }
  572.   {^timer 1 autocheck $0-}
  573.   ^assign -ainuse
  574.   if (([$autoop]==[ON])&&([$chanpass($0)]==[YES])&&(rmatch($1 $OPLIST))) {/mmode $0 +o $decode($2)}
  575. }
  576.  
  577. on -raw_irc "% JOIN *" {
  578.    ^assign jchan $strip(: $2)
  579.     if (isop($N $jchan)) {/autocheck $jchan $safe2($0) $encode($left($index(! $0) $0))}
  580. }
  581.  
  582. on ^join "*" {^netjoined $encode($tolower($1)) $encode($0) $1 $0 $safe($Userhost())}
  583.  
  584. ### Netsplit Detection (by Daemon - Mods <mostly deletions> by Vassago)
  585.  
  586. alias netclean {
  587.   foreach splittime ii
  588.   {
  589.     foreach splittime.$ii jj
  590.     {
  591.       if ( time() - splittime[$ii][$jj] > 300 )
  592.       {
  593.     foreach signcross.$(ii).$jj xx
  594.     {
  595.       foreach signcross.$(ii).$(jj).$xx yy
  596.       {
  597.         ^assign -signcross[$ii][$jj][$xx][$yy]
  598.         ^assign -signoffs[$xx][$yy]
  599.       }
  600.     }
  601.     ^assign -xx
  602.     ^assign -yy
  603.     ^assign -isbroke[$ii][$jj]
  604.     ^assign -splitname[$ii][$jj]
  605.     ^assign -splittime[$ii][$jj]
  606.       }
  607.     }
  608.   }
  609.   ^assign -ii
  610.   ^assign -jj
  611. }
  612.  
  613. alias isbogus {
  614.      if ([$3]) { @ function_return = 1 }
  615.      if (rmatch(.$1. $bogus_patterns *..*)) { @ function_return = 1 }
  616.      if (rmatch(.$2. $bogus_patterns *..*)) { @ function_return = 1 }
  617. }
  618.  
  619. on ^channel_signoff "% % %.% %.*" {
  620.       if (isbogus($1-)) {/echo *** Signoff: $1 \($2-\)}
  621.       {^netbroke $encode($tolower($0)) $encode($1) $encode($2).$encode($3) $2-}
  622. }
  623.  
  624. alias netbroke {
  625.   ^assign signcross[$2][$0][$1] 1
  626.   ^assign signoffs[$0][$1] $2
  627.   ^assign splittime[$2] $time()
  628.    if (isbroke[$2]==[]) {
  629.       ^assign isbroke[$2] 1
  630.       ^assign splitname[$2] $3-
  631.       ^xecho -window OpView $ex Netsplit detected at $Z: \($3-\)
  632.       ^xecho -window OpView $ex Type /wholeft to see who split away.
  633.    }
  634. }
  635.  
  636. alias netjoined {
  637.   if (signoffs[$0][$1]) {
  638.     if (isbroke[$signoffs[$0][$1]]) {^xecho -window OpView $ex Netjoined at $Z \($splitname[$signoffs[$0][$1]]\)}
  639.     ^assign -isbroke[$signoffs[$0][$1]]
  640.     ^assign -signcross[$signoffs[$0][$1]][$0][$1]
  641.     ^assign -signoffs[$0][$1]
  642.   }
  643.   {
  644.      if ([$2]==[$C]) {/echo *** $3 \($4-\) has joined channel $C}
  645.      {/echo *** $3 \($4-\) has joined channel $2\}
  646.   }
  647. }
  648.  
  649. alias netpurge {
  650.    purge isbroke
  651.    purge splitname
  652.    purge splittime
  653.    purge signcross
  654.    purge signoffs
  655. }
  656.  
  657. alias purge {
  658.    foreach $0 ii {/purge $0.$ii}
  659.    ^assign -ii
  660.    ^assign -$0
  661. }
  662.  
  663. alias lformat {
  664.    @ IRCII.word = [$1-]
  665.    if (@IRCII.word < [$0]) {@ function_return = [$([$0]IRCII.word)]}
  666.    {@ function_return = [$IRCII.word]}
  667. }
  668.  
  669. alias wholeft {
  670.   foreach signoffs ii {
  671.      foreach signoffs.$ii jj {^xecho -window OpView $ex $lformat(15 
  672. $decode($ii)) $lformat(10 $decode($jj)) $splitname[$signoffs[$ii][$jj]]}
  673.   }
  674.   ^assign -ii
  675.   ^assign -jj
  676. }
  677.  
  678. ### Flood Handling Routines (by Vassago)
  679.  
  680. alias fcheck {
  681.  if (([$floodp]==[ON])&&(!match($0 $flood_ok))) {
  682.    if ((match(**** $3-))||(match(**** $3-))) {
  683.       ignore_flood $0 $1\-CHARACTERS $2
  684.       clearflood $1
  685.      ^assign FUNCTION_RETURN ON
  686.    }
  687.    if (([$lastmsger]==[$tempflood])||([$lastnoter]==[$tempflood])||([$lastctcper]==[$tempflood])) {
  688.     if ([$1]==[MSG]) {
  689.         @ msgcount = msgcount + 1
  690.         EVAL ^timer $resetcount subcheck MSG
  691.     }
  692.     if ([$1]==[NOTICE]) {
  693.         @ noticecount = noticecount + 1
  694.         EVAL ^timer $resetcount subcheck NOTICE
  695.     }
  696.     if ([$1]==[CTCP]) {
  697.         @ ctcpcount = ctcpcount + 1
  698.         EVAL ^timer $resetcount subcheck CTCP
  699.     }
  700.     if ((msgcount==msgsensor)||(noticecount==noticesensor)||(ctcpcount==ctcpsensor)) {
  701.         ignore_flood $0 $1\-FLOOD $2
  702.         clearflood $1
  703.        ^assign FUNCTION_RETURN ON
  704.     }
  705.    }
  706.    if ([$1]==[MSG]) {^assign lastmsger $tempflood}
  707.    {
  708.       if ([$1]==[NOTICE]) {^assign lastnoter $tempflood}
  709.       {
  710.      if ([$1]==[CTCP]) {^assign lastctcper $tempflood}
  711.       }
  712.    }
  713.    ^assign host_tmp $2
  714.    ^assign tempflood $right(${@host_tmp-index(@ $2)} $2)
  715.    }
  716. }
  717.          
  718. alias clearflood {
  719.    if ([$0]==[MSG]) {@ msgcount = 0;^assign -lastmsger}
  720.    {
  721.       if ([$0]==[NOTICE]) {@ noticecount = 0;^assign -lastnoter}
  722.       {
  723.      if ([$0]==[CTCP]) {@ ctcpcount = 0;^assign -lastctcper}
  724.       }
  725.    }
  726. }
  727.  
  728. alias subcheck {
  729.   if (([$0]==[MSG])&&(msgcount>0)) {@ msgcount = msgcount - 1}
  730.   {
  731.       if (([$0]==[NOTICE])&&(noticecount>0)) {@ noticecount = noticecount - 1}
  732.       {
  733.       if (([$0]==[CTCP])&&(ctcpcount>0)) {@ ctcpcount = ctcpcount - 1}
  734.       }
  735.   }
  736. }
  737.  
  738. alias ignore_flood {
  739.   ^assign ignore_tmp $2
  740.    EVAL ^assign toig $right(${@ignore_tmp-index(@ $2)} $2)
  741.    if ([$toig]!=[]) {
  742.      if ([$floodnotice]==[]) {
  743.          EVAL //^ignore *$toig $ignore_types
  744.         ^assign floodnotice ON
  745.          EVAL ^timer $ignorecount //^ignore *$toig NONE
  746.          @ tmpdivide = ignorecount / 60
  747.          pecho WARNING! $1 DETECTED. Ignoring $decode($0) for $tmpdivide minutes.
  748.          log FLOOD PROTECTION: $1 DETECTED. From $decode($0):$toig
  749.          if ([$flood_msg]!=[]) {/nnotice $decode($0) $flood_msg}
  750.         ^assign -tmpdivide
  751.         ^assign -toig
  752.      }
  753.     ^timer 6 ^assign -floodnotice
  754.    }
  755. }
  756.  
  757. ### FLOOD-OK List (by Vassago & Robey)
  758.  
  759. alias floodok {
  760.   if ([$0]) {
  761.       if (!match($0 $flood_ok)) {
  762.       @ flood_ok = flood_ok ## [ $0]
  763.       pecho Nick $0 now exempt from triggering flood protection.
  764.       }
  765.       {/pecho Nickname $0 is already on your flood_ok list.}
  766.   }
  767.   {
  768.       pecho Nicknames exempt from triggering flood protection:
  769.       pecho $flood_ok
  770.   }
  771. }
  772.    
  773. alias remflood {
  774.   if ([$0]) {
  775.     if (match($0 $flood_ok)) {
  776.       @ flood_ok = rem_w($0 $flood_ok)
  777.      /pecho Nickname $0 has been removed from your flood_ok list.
  778.     }
  779.     {/pecho $0 is not on your flood_ok list.}
  780.   }
  781.   {/pecho Usage: /REMFLOOD <nick> of person to remove from flood_ok.}
  782. }
  783.  
  784. ### PUBLIC flood Protection (by Vassago & CKeeper)
  785.  
  786. on ^public "% % ******" {
  787.    if ([$floodp]==[ON]) {/pubecho $0 $1 [Tsunami Detected]}
  788.    {/pubecho $0 $1 $2-}
  789.    if ([$chanprot]==[ON]) {/pubact $0 $1}
  790. }
  791.  
  792. on ^public "% % ********" {
  793.    if ([$floodp]==[ON]) {/pubecho $0 $1 [7+ Beeps Detected]}
  794.    {/pubecho $0 $1 $2-}
  795.    if ([$chanprot]==[ON]) {/pubact $0 $1}
  796. }
  797.  
  798. ### Raw IRC CTCP/NOTICE Protection/Notification (by Vassago)
  799.  
  800. on ^raw_irc "% NOTICE % :*ERR**" #
  801. on ^raw_irc "% PRIVMSG % :*%INFO*" #
  802. on ^raw_irc "% PRIVMSG % :*SED**" #
  803.  
  804. on -raw_irc "% PRIVMSG % :**" {
  805.    if (match(******* $3-)) {/word_detect $left($index(! $0) $0) CTCP-BOMB $2 flood}
  806.    {
  807.       ^assign _command $strip(\;#\(\)+:*/\\=\{\}<>[]!$$%^~`,?|'\"  $3)
  808.        if (rmatch($_command JUPE ORD CMD GROK LAME TVERS)) {/word_detect $left($index(! $0) $0) $_command $2 backdoor}
  809. #       if ((rmatch($_command A ACTION))&&([$4-]==[])) {/word_detect $left($index(! $0) $0) WSIRC-KILL $2 backdoor}
  810.    }
  811. }
  812.  
  813. alias word_detect {
  814.    if ([$spoken]!=[ON]) {
  815.      if (rmatch($2 #*)) {
  816.      if (isop($N $2)) {
  817.         ^assign _chan $2
  818.         ^assign _reason $1
  819.          Userhost $0 -CMD if ([$3]!=[<UNKNOWN>]) {
  820.         mmode $_chan -o+b $0 $hban($3 $4)
  821.         kkick $_chan $0 | $_reason Attempt |
  822.          }
  823.      }
  824.      pecho WARNING! $1 $3 attempt from $0 to $2\.
  825.      }
  826.      {/pecho WARNING! $1 $3 attempt from $0\.}
  827.      ^assign spoken ON
  828.      ^timer -delete 892
  829.       EVAL ^timer -refnum 892 $resetcount ^assign -spoken
  830.    }
  831. }
  832.  
  833. ### Version/Finger Flood Protection (by Vassago and CKeeper)
  834.  
  835. on ^raw_irc "% PRIVMSG % :VER**" {
  836.     if ([$LASTVER]!=right(10 $0)) {
  837.      if (rmatch($2 #*)) {/pecho $decode($enickonly($0)) requested version information for everyone in $2\.}
  838.      {/pecho $decode($enickonly($0)) requested version information for you.}
  839.      if ([$versionmesg]!=[]) {/nnotice $decode($enickonly($0)) VERSION $versionmesg\}
  840.      ^assign LASTVER $right(10 $0)
  841.      ^timer -delete 684
  842.      ^timer -refnum 684 30 ^assign -LASTVER
  843.     }
  844. }
  845.  
  846. on ^raw_irc "% PRIVMSG % :FINGER**" {
  847.     if ([$LASTFING]!=right(10 $0)) {       
  848.     if (rmatch($2 #*)) {/pecho $decode($enickonly($0)) requested finger information for everyone in $2\.}
  849.     {/pecho $decode($enickonly($0)) requested finger information for you.}
  850.     if ([$fingermsg]!=[]) {/nnotice $decode($enickonly($0)) FINGER $FINGERMSG\}
  851.     ^assign LASTFING $right(10 $0)
  852.     ^timer -delete 685
  853.     ^timer -refnum 685 30 ^assign -LASTFING
  854.     }
  855. }
  856.  
  857. ### CTCP Commands/Responses (by Vassago)
  858.  
  859. on -ctcp "*" {
  860.    if ([$1]==[$N]) {
  861.       if ([$inuse]==[]) {
  862.       ^assign inuse YES
  863.       ^assign ctcpadr $safe($Userhost())
  864.        if ([$fcheck($encode($0) CTCP $ctcpadr $2-)]!=[ON]) {
  865.            if (!match($2 ACTION TIME)) {
  866.            if (rmatch($0!$ctcpadr $FRIENDLIST)) {
  867.                if ([$3]) {^assign channel $3}
  868.                {^assign channel $C}
  869.                if ([$2]==[HELP]) {/ctcpcmd $0 HELP}
  870.                {
  871.               if ([$chanpass($channel)]==[YES]) {
  872.                   if (match($2 INVITE OP)) {
  873.                  if ([$2]==[OP]) {
  874.                     if (rmatch($0!$ctcpadr $OPLIST)) {
  875.                     ctcpcmd $0 $2
  876.                     ^assign TEMPYES ON
  877.                     }
  878.                  }
  879.                  if ([$2]==[INVITE]) {
  880.                     if (rmatch($0!$ctcpadr $INVITELIST)) {
  881.                     ctcpcmd $0 $2
  882.                     ^assign TEMPYES ON
  883.                     }
  884.                  }
  885.                  if ([$TEMPYES]==[]) {/nnotice $0 You do not have access to command $2\.}
  886.                  {^assign -TEMPYES}
  887.                   }
  888.                   {/nnotice $0 $2 is not a valid CTCP command.}
  889.               }
  890.               {/nnotice $0 CTCP functions are not enabled for channel $channel\.}
  891.                }
  892.            }
  893.            {   
  894.                if (match($2 INVITE OP UNBAN HELP)) {
  895.               if ([$said_not]==[]) {
  896.                  ^assign said_not ON
  897.                   nnotice $0 You are not registered.
  898.                  ^timer -delete 410
  899.                  ^timer -refnum 410 45 ^assign -said_not
  900.               }
  901.                }
  902.                pecho CTCP \($safe2($[35]2-)\) from unregistered person $0\.
  903.            }
  904.            }
  905.        }
  906.       ^assign -inuse
  907.       }
  908.    }
  909. }
  910.  
  911. # CTCP COMMAND Parser (by YaZoO & Vassago)
  912.  
  913. alias ctcpcmd {
  914.  if ([$ctcpauto]==[ON]) {
  915.   if ([$1]==[OP]) {
  916.     if (isop($N $channel)) {
  917.     mmode $channel +o $0
  918.     if ([$versionmesg]) {/nnotice $0 You have been opped via $versionmesg}
  919.     pecho $0 has been opped on $channel via a CTCP request.
  920.     }
  921.     {
  922.      nnotice $0 I am not an operator on channel $channel\.
  923.      pecho $0 requested a CTCP Op on $channel\.
  924.     }
  925.   }
  926.   if ([$1]==[INVITE]) {
  927.     if (isop($N $channel)) {
  928.      //^invite $0 $channel
  929.      if ([$versionmesg]) {/nnotice $0 You have been invited via $versionmesg}
  930.      pecho Inviting $0 under request from a CTCP.
  931.     }
  932.     {
  933.      nnotice $0 I am not a channel operator on $channel\.
  934.      pecho $0 requested a CTCP invite to $channel\.
  935.     }
  936.   }
  937.   if ([$1]==[HELP]) {
  938.       nnotice $0 These commands are available via CTCP request:
  939.       nnotice $0  /CTCP $N OP <#Channel>     :For ops on <#Channel>.
  940.       nnotice $0  /CTCP $N INVITE <#Channel> :For an invite to <#Channel>.
  941.       nnotice $0 I am currently on channel\(s\): $tolower($strip(# $mychannels()))
  942.       nnotice $0 Channel\(s\) on which these commands are active: $autochannels
  943.       pecho $0 has asked for help from my Friends list.
  944.   }
  945.   }
  946.   {
  947.       nnotice $0 Sorry, but my CTCP functions are disabled.
  948.       pecho $0 tried $1 for $channel via CTCP.
  949.       pecho CTCP functions are currently disabled.
  950.   }
  951. }
  952.  
  953. # Miscellaneous CTCP Handlers (by Vassago)
  954.  
  955. on -ctcp "% % PING *" {
  956.   ^assign pingadr $safe($Userhost())
  957.   if ([$fcheck($encode($0) CTCP $pingadr $2-)]!=[ON]) {
  958.     if (rmatch($1 #*)) {/pecho $0 has pinged everyone in $1\.}
  959.     {/pecho $0 pinged you.}
  960.     if ([$pingmsg]!=[]) {/nnotice $0 $PINGMSG}
  961.    }
  962. }
  963.  
  964. on ^ctcp "% % DCC CHAT *" {
  965.   if ([$1]==[$N]) {
  966.     ^assign dccadr $safe($Userhost())
  967.     if (([$fcheck($encode($0) CTCP $dccadr $2-)]!=[ON])&&([$lastchatter]!=[$right(10 $dccadr)])) {
  968.     ^assign chatter $encode($0)
  969.      pecho DCC CHAT request received from $0\.
  970.      pecho Type /CHAT to chat, /NOCHAT to ignore or when finished.
  971.     ^assign lastchatter $right(10 $dccadr)
  972.     ^timer -delete 601
  973.     ^timer -refnum 601 15 ^assign -lastchatter
  974.     }
  975.   }
  976. }
  977.  
  978. ### Lag Indicator/PONG Flood Protection 
  979. ### (by Robey & Vassago, based on some ideas and scripting from BeeF.)
  980.  
  981. on ^raw_irc "%.% PONG *" {
  982.   if ([$0]==[$S]) {
  983.      ^assign lagtime ${time()-mid(1 999 $3)}
  984.      if (lagtime==0) {^set status_user  E/X}
  985.      {^set status_user  Lag $lagtime - E/X}
  986.   }
  987. }
  988.  
  989. ### IsChanop Function (by CKeeper)
  990.  
  991. alias isop {
  992.   if (([$1] == [$C])&&([$0] == [$N])) {
  993.     if ([$P] == [@]) {@ FUNCTION_RETURN = 1}
  994.     {@ FUNCTION_RETURN = 0}
  995.   }
  996.   {/EVAL @ FUNCTION_RETURN = $ischanop($0 $1)}
  997. }
  998.  
  999. ### Invitation Handlers (by Vassago)
  1000.  
  1001. on ^invite "*" {
  1002.    if ([$fcheck($encode($0) CTCP $safe($Userhost()) $1-)]!=[ON]) {
  1003.       if (rmatch($1 $false_chars)) {/pecho $0 invites you to channel $[12]1\. \(Fake\)}
  1004.       {/echo *** $0 invites you to channel $1}
  1005.    }
  1006. }
  1007.  
  1008. ### Server Notice Handlers (by Vassago, WinterHawk, and YaZoO)
  1009.  
  1010.  
  1011. on ^server_notice "*" #
  1012.  
  1013. on ^server_notice "% % no% -- fake: *" {
  1014.     if (rmatch($7 $mychannels())) {/pecho [FAKE] $5 $7- from $0}
  1015. }
  1016.  
  1017. alias ov {
  1018.    if ([$OPVIEWING]==[OFF]) {
  1019.     ^assign OPVIEWING ON
  1020.     ^assign TOOPVIEW ON
  1021.     ^clear
  1022.     ^window new name OpView
  1023.     ^window scroll on
  1024.     ^window shrink 7
  1025.     ^window level wallop,opnote,snote
  1026.     ^set hold_mode off
  1027.     ^on ^server_notice "*" {/xecho -level snote [***] $4-}
  1028.     ^on ^server_notice "% % no% -- hack: *" Userhost $$5 -cmd showhack $$$$0 $$$$3 $$$$4 $$4 $$6-
  1029.     ^on ^server_notice "% % no% -- n%k c%n *" {^xecho -level snote [COLLISION] $6-}
  1030.     ^on ^server_notice "% % no% -- Rec%d KILL*" {
  1031.        if (rmatch($10 %.%)) {
  1032.      if ([$SHOWKILL]==[ON]) {^xecho -level snote [COLLISION] $10 killed $8 $13-}
  1033.        }
  1034.        {^xecho -level snote [OPER KILL] $7 $8 $9 $10 $13-}
  1035.     }
  1036.     ^on ^raw_irc "*.* WALLOPS :*" {/xecho -level wallop [WALLOPS] $strip(: $2-) \($0\)}
  1037.     ^on ^server_notice "% % no% -- mes% *" {^xecho -level snote [MESSAGE] $5-}
  1038.     ^on ^server_notice "% % no% -- rec%d unauth*" #
  1039.     ^on ^server_notice "% % no% -- inv%d %name: *" #
  1040.     ^on ^server_notice "% % no% -- bogus*" #
  1041.  
  1042.     //mode $N +isw
  1043.     ^window goto 2
  1044.     pecho OPView Windowing/Server noticing has been activated.
  1045.     if ([$showkill]==[ON]) {/pecho To disable server kill notices, type /SERVKILL OFF.}
  1046.     {/pecho To enable server kill notices, type /SERVKILL ON.}
  1047.     }
  1048.     { 
  1049.       if ([$OPVIEWING]==[ON]) {
  1050.       ^assign OPVIEWING OFF
  1051.       ^assign TOOPVIEW OFF
  1052.       ^clear
  1053.       ^window refnum OpView
  1054.        wait -CMD ^window kill
  1055.       ^mode $N +is-w
  1056.       ^on server_notice -
  1057.       ^on ^server_notice "*" #
  1058.       ^on ^server_notice "% % no% -- fake: *" {
  1059.      if (rmatch($7 $mychannels())) {/pecho [FAKE] $5 $7- from $0}
  1060.       }
  1061.       ^on raw_irc - "*.* WALLOPS :*"
  1062.        pecho OPView Windowing/Server noticing has been deactivated.
  1063.        pecho Please wait a moment for the OpView window to disappear.
  1064.     }
  1065.   }
  1066. }
  1067.  
  1068. alias showhack {
  1069.    if ([$1@$2]!=[<UNKNOWN>@<UNKNOWN>]) {/xecho -level snote [HACK] $3 <$0!$1@$2> $4-}
  1070.    {/xecho -level snote [HACK] $3 <$0> $4-]}
  1071. }
  1072.  
  1073. ### DCC Control Parsers (By Vassago, based on some stuff from YaZoO)
  1074.  
  1075. on ^msg "% XDCC *" {
  1076.    ^assign XDCCUSER $safe($userhost())
  1077.     if ([$fcheck($encode($0) CTCP $XDCCUSER $2-)]!=[ON]) {/xdccmsg $0 $XDCCUSER $2-}
  1078. }
  1079.  
  1080. on ^ctcp "% % XDCC *" {
  1081.    ^assign DCCUSER $safe($userhost())
  1082.     if ([$fcheck($encode($0) CTCP $DCCUSER $3-)]!=[ON]) {/xdccmsg $0 $DCCUSER $3-}
  1083. }
  1084.  
  1085. alias dccCHECK {
  1086.     if ([$strip(\;/\\\{\}~|\"~ $4-)]!=[$4-]) {
  1087.     ignore_flood $encode($0) DCC-SEND $dcc_ignore
  1088.     //^dcc close get $0 $4
  1089.     ^assign FUNCTION_RETURN FALSE
  1090.     log DCC SEND BOMB received from $0\.
  1091.     }
  1092.     if (rmatch($4 .*)) {
  1093.     ignore_flood $encode($0) HIDDEN-FILE $dcc_ignore
  1094.     //^dcc close get $0 $4
  1095.     ^assign FUNCTION_RETURN FALSE
  1096.     log DCC SEND HIDDEN FILE request received from $0\.
  1097.     }
  1098.     if ((rmatch($6 1024 6667))||(rmatch($4 $false_files))) {
  1099.     ignore_flood $encode($0) FAKE/NULL-DCC $dcc_ignore
  1100.     //^dcc close get $0 $4
  1101.     ^assign FUNCTION_RETURN FALSE
  1102.     log FAKE DCC SEND request received from $0\.
  1103.     }
  1104.     if (([$AUTOCLOSEWHENAWAY]==[ON])&&([$isaway]==[YES])) {
  1105.     pecho You are AWAY: DCC request rejected and closed.
  1106.     nnotice $0 I am AWAY and not accepting any DCC SENDS at this time.
  1107.     //^dcc close get $0 $4
  1108.     log You were AWAY: DCC SEND $4 from $0 request ignored and closed.
  1109.     }
  1110.     ^assign -dcc_ignore
  1111. }
  1112.  
  1113. on ^ctcp "% % DCC SEND* * *" {
  1114.    if ([$1]==[$N]) {
  1115.       ^assign dcc_ignore $safe($userhost())
  1116.       if ([$dccCHECK($0-)]!=[FALSE]) {
  1117.      ^assign dccfile $4
  1118.      if (([$AUTOGET]==[ON])&&([$AUTOCLOSE]!=[ON])) {
  1119.          //^dcc rename $0 $4 $DOWNLOADDIR/$4
  1120.          ^exec -name DCG$0/${DOWNLOADDIR}/$4 ls ${DOWNLOADDIR}/$4
  1121.      }
  1122.      {
  1123.          if ([$AUTOCLOSE]==[ON]) {
  1124.          xdccecho DCC SEND $4 from $0 request ignored and closed.
  1125.          //^dcc close get $0 $4
  1126.          }
  1127.          {
  1128.          if (([$AUTOGET]!=[ON])&&([$AUTOCLOSE]!=[ON])) {
  1129.              //^dcc rename $0 $4 $DOWNLOADDIR/$4
  1130.              xdccecho DCC SEND $4 from $0 added to XDCC request list.
  1131.              adddccrequest $DOWNLOADDIR/$4 $0
  1132.          }
  1133.          }
  1134.      }
  1135.       }
  1136.    }
  1137. }
  1138.  
  1139. on ^exec_error "DCG* *" {
  1140.     @ dcclen = [$0]
  1141.     @ getf = [$right(${@dcclen-3} $0)]
  1142.     @ idx = [$index(/ $getf)]
  1143.     @ filenme = [$right(${@getf-idx+1} $0)]
  1144.     @ nicknme = [$left($idx $getf)]
  1145.     xdccecho I am autogetting $filenme from $nicknme\.
  1146.     //^dcc get $nicknme $filenme
  1147. }
  1148.  
  1149. on ^exec "DCG* *" {
  1150.     @ dcclen = [$0]
  1151.     @ getf = [$right(${@dcclen-3} $0)]
  1152.     @ idx = [$index(/ $getf)]
  1153.     @ filenme = [$right(${@getf-idx+1} $0)]
  1154.     @ nicknme = [$left($idx $getf)]
  1155.     if ([$OVERWRITE]==[ON]) {
  1156.     xdccecho Autogetting $filenme from $nicknme \(Overwriting file\).
  1157.     //^dcc get $nicknme $filenme
  1158.     }
  1159.     {
  1160.     pecho $nicknme offered $filenme\ but it already exists.
  1161.     if ([$AUTORENAME]!=[ON]) {
  1162.         @ dctemp = [$"[E/X] Enter new filename or ENTER to close: "]
  1163.         if (dctemp!=[]) {
  1164.         if ([$[1]dctemp]!=[/]) {^assign dctemp ${downloaddir}/${dctemp}}
  1165.         pecho Getting $filenme renamed to $dctemp from $nicknme\.
  1166.         //^dcc rename $nicknme $filenme $dctemp
  1167.         //^dcc get $nicknme $dctemp
  1168.         }
  1169.         {
  1170.            /pecho Closing DCC GET request from $nicknme\.
  1171.            //^dcc close get $nicknme $filenme
  1172.         }
  1173.     }
  1174.     {
  1175.         ^assign dctemp $filenme\.$rand(999)
  1176.         pecho Autorenaming to $dctemp\ and receiving.
  1177.         if ([$[1]dctemp]!=[/]) {^assign dctemp ${downloaddir}/${dctemp}}
  1178.         //^dcc rename $nicknme $filenme $dctemp
  1179.         //^dcc get $nicknme $dctemp
  1180.     }
  1181.     }
  1182. }
  1183.  
  1184. ### Server Connection ONs (by Vassago)
  1185.  
  1186. on ^connect "*" wait -CMD _connect
  1187.  
  1188. on ^disconnect "*" {
  1189.     pecho Connection closed. Autoconnecting to $default_server\
  1190.     serv
  1191. }
  1192.  
  1193. on ^window "% *Use /server to connect*" {
  1194.     pecho Connection closed. Autoconnecting to $default_server\
  1195.     serv
  1196. }
  1197.  
  1198. ### Miscellaneous ON Commands (by TG, Mods by Vassago)
  1199.  
  1200. on ^send_msg "*" {
  1201.    echo <-[$0]-> $1-
  1202.   ^addmsg $encode($0) $msglist
  1203. }
  1204.  
  1205. on ^dcc_chat "*" {
  1206.     echo =$0= $1-
  1207.    ^addmsg $encode(\=$0) $msglist
  1208. }
  1209.  
  1210. on ^send_action "*" if ([$[1]0]!=[#])
  1211.  {/echo * $0 >> $N $1-}
  1212.  {/echo * $N $1-}
  1213.  
  1214. on ^send_public "*" {
  1215.     if ([$0]==[$C]) {/echo <${N}> $1-} {/echo -> <${N}> $1-}
  1216. }
  1217.  
  1218. on ^send_dcc_chat "*" {
  1219.    echo <=$0=> $1-
  1220.   ^addmsg $encode(\=$0) $msglist
  1221. }
  1222.  
  1223. on ^action "*" if ([$[1]1]!=[#])
  1224.    {/echo * $0 $2-}
  1225.    {if ([$C]!=[$1]) {/echo * $1 >> $0 $2-}
  1226.    {/echo * $0 $2-}
  1227. }
  1228.  
  1229. on ^exec "from *" pecho Mail: From $safe2($1-)
  1230. on ^exec_error "from *" #
  1231.  
  1232. on ^mail "*" {
  1233.    if ([$SCRIPTLOADING]==[]) {
  1234.        pecho You have new email. \(Mail waiting $1\).
  1235.       ^exec -name from frm | tail -$0
  1236.    }
  1237. }
  1238.  
  1239. alias do317 {
  1240.    ^on ^317 "*" {
  1241.     if (index(012345679 $3) != -1) {
  1242.        ^assign -sectime
  1243.        ^assign -mintime
  1244.        ^assign sectime $2
  1245.         @ mintime = sectime / 60
  1246.         echo *** $1 has been idle for $2 seconds \($mintime minute\(s\)\)
  1247.         echo *** $1 signed on $stime($3)
  1248.      }
  1249.      {
  1250.         ^assign -sectime
  1251.         ^assign -mintime
  1252.         ^assign sectime $2
  1253.          @ mintime = sectime / 60
  1254.          echo *** $1 has been idle for $2 seconds \($mintime minute\(s\)\)
  1255.      }
  1256.    }
  1257. }
  1258.  
  1259. ### Message Handler Commands (by Vassago)
  1260.  
  1261. on ^msg "*" {
  1262.     ^assign msghost $safe($Userhost())
  1263.     if ([$fcheck($encode($0) MSG $msghost $1-)]!=[ON]) {
  1264.      if ([$encode( *$0*  $1-)]!=[$lmes]) {
  1265.            if ([$extmes]==[ON]) {/echo [$0:$Userdomain($msghost)] $1-}
  1266.            {/echo [$0] $1-}
  1267.       }
  1268.      if ([$isaway]==[YES]) {
  1269.            ^exec echo "[$Z] [$safe($0):$userdomain($msghost)] $safe($1-)" >> $awayfle
  1270.            @ away_messages = away_messages + 1
  1271.      }
  1272.      ^assign lmes $encode( *$0*  $1-)
  1273.     }
  1274.     {^assign lmes $encode( *$0*  [Flood Detected])}
  1275.     ^addmsg $encode($0) $msglist
  1276. }
  1277.  
  1278. alias dirlm {
  1279.     if ([$0]) {//msg $0 $decode($lmes)}
  1280.     {/say $decode($lmes)}
  1281. }
  1282.  
  1283. ### Notice Commands (by Vassago)
  1284.  
  1285. on ^notice "*" {
  1286.    if ([$floodcheck($encode($0) NOTICE $safe($Userhost()) $1-)]!=[ON]) {
  1287.     if (rmatch($1 *WallOp*)) {/echo [-$0\-] $1-}
  1288.     {/echo -$0- $1-}
  1289.     ^assign lastnotice $encode(-$0- $1-)
  1290.    }
  1291.    {^assign lastnotice $encode(-$0- [Flood Detected])}
  1292.    ^addmsg $encode($0) $msglist
  1293. }
  1294.  
  1295. alias dirln {
  1296.     if ([$0]) {//msg $0 $decode($lastnotice)}
  1297.     {/say $decode($lastnotice)}
  1298. }
  1299.  
  1300. ### Timer/Idle Control
  1301.  
  1302. on -timer "*" {
  1303.    ^autoping
  1304.    ^netclean
  1305.     if (rmatch($0 %:00%)) {/pecho The time is now $0\.}
  1306. }
  1307.  
  1308. on -idle "*" {
  1309.     if (([$0]==[$idle_time])&&([$isaway]==[NO])) {
  1310.     setaway $idlemes
  1311.     pecho Setting you away after being idle for $idle_time minutes.
  1312.     }
  1313. }
  1314.  
  1315. ### Tabkey Handlers
  1316.  
  1317. alias addmsg {
  1318.      @ matched = rmatch($0 $^\1-)
  1319.      if (matched) {@ msglist = [$(0-${matched-1}) $(${matched+1}-)]}
  1320.      {@ msglist = [$(0-${msgmax-1})]}
  1321.      @ msgcnt = 0
  1322.      ^assign -matched
  1323. }
  1324.  
  1325. alias getmsg {
  1326.      @ msgcnt = msgcnt + [$0]
  1327.      if (#msglist < msgcnt) {@ msgcnt = 1}
  1328.      if (msgcnt <= 0) {@ msgcnt =  #msglist}
  1329.      @ junk = K ## [m]
  1330.      type ^U$junk $^^{[$decode($($msgcnt))]} 
  1331. }
  1332.  
  1333. ### Ban Handlers (by YaZoO, Mods from Fred1 and Vassago)
  1334.  
  1335. alias bandef {
  1336.   if ([$0]==[n]) {
  1337.     @ defban = [n]
  1338.     ^assign ban_name NORMAL
  1339.   }
  1340.   if ([$0]==[e]) {
  1341.     @ defban = [e]
  1342.     ^assign ban_name ELITE
  1343.   }
  1344.   if ([$0]==[h]) {
  1345.     @ defban = [h]
  1346.     ^assign ban_name HOST
  1347.   }
  1348.   if ([$0]==[d]) {
  1349.     @ defban = [d]
  1350.     ^assign ban_name DOMAIN
  1351.   }
  1352.   if ([$0]==[s]) {
  1353.     @ defban = [s]
  1354.     ^assign ban_name SCREW
  1355.   }
  1356.   pecho Default ban is $ban_name\.
  1357. }
  1358.  
  1359. alias ban {
  1360.   if ([$0]) {
  1361.     if (!rmatch($0 *@* *!* *.*)) {
  1362.     @ param = [$0]
  1363.     if (index(! $0)!=-1) {@ band = [$1]}
  1364.     {@ band = [$0]}
  1365.     if ([$param]==[$band]) {@ param = [!$defban]}
  1366.     Userhost $band -CMD if ([$4]!=[<UNKNOWN>]) {
  1367.      ^assign -theban
  1368.      if ([$param]==[!n]) {
  1369.        ^assign theban $nban($3 $4)
  1370.        pecho Banning $0 with a NORMAL ban.
  1371.      }
  1372.      if ([$param]==[!e]) {
  1373.        ^assign theban $0!*@*
  1374.        pecho Banning $0 with a ELITE ban.
  1375.      }
  1376.      if ([$param]==[!h]) {
  1377.        ^assign theban $hban($3 $4)
  1378.        pecho Banning $0 with a HOST ban.
  1379.      }
  1380.      if ([$param]==[!d]) {
  1381.        ^assign theban $dban($3 $4)
  1382.        pecho Banning $0 with a DOMAIN ban.
  1383.      }
  1384.      if ([$param]==[!s]) {
  1385.        ^assign theban $sban($3 $4)
  1386.        pecho Banning $0 with a SCREW ban.
  1387.      }
  1388.      if ([$param]==[!?]) {}
  1389.      {
  1390.        if ([$theban]==[]) {
  1391.         ^assign theban $nban($3 $4)
  1392.         pecho Banning $0 with a NORMAL \(default\) ban.
  1393.        }
  1394.        if (isop($0 $C)) {/mmode $C -o+b $0 $theban}
  1395.        {/mmode $C +b $theban}
  1396.      }
  1397.     }
  1398.     {/pecho I can't find $0 on IRC.}
  1399.   }
  1400.   {/banlop $0-}
  1401.   }
  1402.   {/pecho USAGE: /Ban <BanType> <Nick>, or /BAN <filter\(s\)>}
  1403. }
  1404.  
  1405. alias nban @ function_return = [*!] ## fixname($0) ## [@] ## fixdomain($1)
  1406. alias hban @ function_return = [*!*@] ## fixhost($1)
  1407. alias dban @ function_return = [*!*@] ## fixdomain($1)
  1408. alias fixname @ function_return = [*] ## mid(1 99 $0)
  1409.  
  1410. alias fixhost {
  1411.   if (index(. $0)==rindex(. $0)) {@ function_return = [*] ## [$0]} 
  1412.   {@ function_return = [$0]}
  1413. }
  1414.  
  1415. alias fixdomain {
  1416.   if (index(. $0)==rindex(. $0)) {@ function_return = [*] ## [$0]} 
  1417.   {
  1418.     if (is_ip($0) == [1]) {@ function_return = left($rindex(. $0) $0) ## [.*]} 
  1419.     {@ function_return = [*] ## mid($index(. $0) 99 $0)}
  1420.   }
  1421. }
  1422.  
  1423. alias is_ip {
  1424.   if ((right(1 $0) >= [0]) && (right(1 $0) <= [9])) {@ function_return = [1]} 
  1425.   {@ function_return = [0]}
  1426. }
  1427.  
  1428. alias bk {
  1429.   if ([$0]) {
  1430.     @ param = [$0]
  1431.     if (index(! $0)!=-1) {
  1432.      @ band = [$1]
  1433.      @ kbreason = [$2-]
  1434.     }
  1435.     {
  1436.      @ band = [$0]
  1437.      @ kbreason = [$1-]
  1438.     }
  1439.     if ([$kbreason]!=[]) {^assign kbreason  ${kbreason} }
  1440.     {^assign kbreason $pk}
  1441.     if ([$param]==[$band]) {@ param = [!$defban]}
  1442.     Userhost $band -CMD if ([$4]!=[<UNKNOWN>]) {
  1443.      @ theban = []
  1444.      if ([$param]==[!n]) {^assign theban $nban($3 $4)}
  1445.      if ([$param]==[!e]) {^assign theban $0!*@*}
  1446.      if ([$param]==[!d]) {^assign theban $dban($3 $4)}
  1447.      if ([$param]==[!h]) {^assign theban $hban($3 $4)}
  1448.      if ([$param]==[!s]) {^assign theban $sban($3 $4)}
  1449.      if ([$param]==[!?]) {}
  1450.      {
  1451.         if ([$theban]==[]) {^assign theban $nban($3 $4)}
  1452.         /mmode $C -o+b $0 $theban
  1453.         /kkick $C $0 $kbreason
  1454.      }
  1455.     }
  1456.     {/pecho I can't find $0 on IRC.}
  1457.   }
  1458.   {/pecho Usage: /BKICK <BanType> <Nick> <Reason>}
  1459. }
  1460.  
  1461. alias sban {
  1462.   @ cnt = 0
  1463.   @ tomake = [$0@$1]
  1464.   @ temp = [$1]
  1465.   ^assign tomake $0@*$right(${@temp-index(. $1)} $1)
  1466.   ^assign -temp 
  1467.   if ((mid($cnt 1 $0)==[~])||(mid($cnt 1 $0)==[#])) {@ cnt = 1}
  1468.   while (mid($cnt 1 $tomake)!=[]) {
  1469.     @ rnd = rand(10)
  1470.     if ((mid($cnt 1 $tomake)==[*])||(mid($cnt 1 $tomake)==[@])||(mid($cnt 1 $tomake)==[.])||(mid($cnt 1 $tomake)==[])||(mid($cnt 1 $tomake)==[])) {@ temp = [$temp$mid($cnt 1 $tomake)]}
  1471.     {
  1472.      if (rnd>4) {@ temp = [$temp?]}
  1473.      {@ temp = [$temp$mid($cnt 1 $tomake)]}
  1474.     }
  1475.     @ cnt = cnt + 1
  1476.   }
  1477.   @ function_return = [*!*$temp]
  1478. }
  1479.  
  1480. alias cdban {
  1481.   /pecho Clearing channel of bans.
  1482.   ^assign -bunband
  1483.   ^on ^367 "*" {^assign bunband $2 ${bunband}}
  1484.   //mode $C +b
  1485.    wait -cmd cdban2
  1486. }
  1487.  
  1488. alias unban {
  1489.   if ([$0]) {
  1490.     ^assign -bunband
  1491.     if (!rmatch($0 *@* *!*)) {
  1492.        Userhost $0 -CMD if ([$4]!=[<UNKNOWN>]) {
  1493.       ^assign dbanz $0!$3@$4
  1494.       ^on ^367 "*" {
  1495.           if (match($2 $dbanz)) {^assign bunband $2 ${bunband}}
  1496.       }
  1497.       //mode $C +b
  1498.       wait -CMD cdban2
  1499.        }
  1500.     }
  1501.     {
  1502.        ^assign dbanz $0
  1503.        ^on ^367 "*" {
  1504.        if ((match($2 $dbanz))||(rmatch($2 $dbanz))) {^assign bunband $2 ${bunband}}
  1505.        }
  1506.        //mode $C +b
  1507.        wait -CMD cdban2
  1508.     }
  1509.   }
  1510.   {/pecho Usage: /UNBAN <nick/filter> to unban on your current channel.}
  1511. }
  1512.  
  1513. alias cdban2 {
  1514.     unbanlop $bunband
  1515.    ^assign -dbanz
  1516.    ^assign -bunband
  1517.    ^on 367 - "*"
  1518. }
  1519.  
  1520. alias nunbanlop {
  1521.   if ([$4]) {
  1522.     /mmode $0 -bbb $1 $2 $3
  1523.     /nunbanlop $0 $4-
  1524.   }
  1525.   {
  1526.     if ([$3]) {/mmode $0 -bbb $1 $2 $3}
  1527.     {
  1528.        if ([$2]) {/mmode $0 -bb $1 $2}
  1529.        {
  1530.       if ([$1]) {/mmode $0 -b $1}
  1531.        }
  1532.     }
  1533.   }
  1534. }
  1535.  
  1536. alias banlop {
  1537.   if ([$3]) {
  1538.     /mmode $C +bbb $0 $1 $2
  1539.     /banlop $3-
  1540.   }
  1541.   {
  1542.     if ([$2]) {/mmode $C +bbb $0 $1 $2}
  1543.     {
  1544.        if ([$1]) {/mmode $C +bb $0 $1}
  1545.        {
  1546.       if ([$0]) {/mmode $C +b $0}
  1547.        }
  1548.     }
  1549.   }
  1550. }
  1551.  
  1552. alias dobans {
  1553.     pecho Doing bans in AutoBkick list.
  1554.     banlop $BKLIST
  1555. }
  1556.  
  1557. ### Status Screen
  1558.  
  1559. alias status {
  1560.    pecho +-----------+ Your Current PhoEniX Configuration +-----------+
  1561.    pecho  CTCP Op/Invite                    : $ctcpauto 
  1562.    pecho  Setaway Time                      : $idle_time 
  1563.    pecho  IRC Logging                       : $logirc 
  1564.    pecho  AutoRejoin on KICK                : $rejoin 
  1565.    pecho  Extended Message Display          : $extmes 
  1566.    pecho  Server KILL display in OpView     : $showkill 
  1567.    pecho  Kick/MassDeop Protection          : $prot 
  1568.    pecho  Personal Flood Protection         : $floodp 
  1569.    pecho  Channel Protection                : $chanprot 
  1570.    pecho  Netsplit Hack Protection          : $nhp 
  1571.    pecho  Ban/Bkick Type Setting            : $ban_name 
  1572.    pecho  PhoEniX SENSOR Settings:
  1573.    pecho   Deop: $msensor Kick: $ksensor Nick Flood: $nicksensor 
  1574.    pecho   Message Flood: $msgsensor Notice Flood: $noticesensor 
  1575.    pecho   CTCP Flood: $ctcpsensor Timer resets after: $resetcount 
  1576.    pecho   Flood-triggered Ignores last $ignorecount seconds.
  1577.    pecho   Ignores stop: $ignore_types\.
  1578.    pecho +-------+ Type /XDCC STATUS for XDCC information. +-------+
  1579. }
  1580.  
  1581. ### Toggleable Commands
  1582.  
  1583. alias up_it {^assign $0 $toupper($1)}
  1584.  
  1585. alias servkill {
  1586.    if (match($0 ON OFF)) {/up_it showkill $0}
  1587.    pecho Server kill showing in the OpView window is $showkill\.
  1588. }
  1589.  
  1590. alias extmes {
  1591.   if (match($0 ON OFF)) {/up_it extmes $0;chgst}
  1592.   pecho Extended messages display is $extmes\.
  1593. }
  1594.  
  1595. alias prot {
  1596.   if (match($0 ON OFF)) {/up_it prot $0;chgst}
  1597.   pecho Megadeop/Kick Protection is $prot\.
  1598. }
  1599.  
  1600. alias nhprot {
  1601.   if (match($0 ON OFF)) {/up_it nhp $0;chgst}
  1602.   pecho Netsplit hack/ban protection is $nhp\.
  1603. }
  1604.  
  1605. alias autoop {
  1606.   if (match($0 ON OFF)) {/up_it autoop $0;chgst}
  1607.   pecho Auto OP friends on JOIN is $autoop\.
  1608. }
  1609.  
  1610. alias auto {
  1611.   if (match($0 ON OFF)) {/up_it ctcpauto $0;chgst}
  1612.   pecho CTCP op/invite is $ctcpauto\.
  1613.   if ([$1]) {^assign AutoChannels $tolower($strip(# $1-))}
  1614.   pecho AUTO functions will work in channels: $AutoChannels\
  1615. }
  1616.  
  1617. alias autochan {
  1618.   if ([$0]) {^assign AutoChannels $tolower($strip(# $0-))}
  1619.   if ([$AutoChannels]!=[ALL]) {/pecho AUTO functions will work in: $AutoChannels\}
  1620.   {/pecho AUTO functions will work in ALL your current channels.}
  1621. }
  1622.  
  1623. alias floodp {
  1624.   if (match($0 ON OFF)) {/up_it floodp $0;chgst}
  1625.   pecho Message/Notice/CTCP flood protection is $floodp\.
  1626. }
  1627.  
  1628. alias cprot {
  1629.   if (match($0 ON OFF)) {/up_it chanprot $0;chgst}
  1630.   pecho Channel flood/bomb protection is $chanprot\.
  1631. }
  1632.  
  1633. alias rejoin {
  1634.   if (match($0 ON OFF)) {/up_it rejoin $0;chgst}
  1635.   pecho AutoRejoin on kick is $rejoin\.
  1636. }
  1637.  
  1638. alias irclog {
  1639.   if (match($0 ON OFF)) {
  1640.      ^set log $0
  1641.       up_it logirc $0
  1642.       chgst
  1643.   }
  1644.   pecho The IRC Logfile is $logirc\.
  1645. }
  1646.  
  1647. alias autotime {
  1648.   if ([$0]) {^assign idle_time $0}
  1649.   pecho Auto setaway idle time is $idle_time\.
  1650. }
  1651.  
  1652. alias allprot {
  1653.   if (match($0 ON OFF)) {
  1654.     up_it chanprot $0
  1655.     up_it floodp $0
  1656.     up_it prot $0
  1657.     up_it nhp $0
  1658.     pecho All of PhoEniX's protective coding now $floodp\.
  1659.     chgst
  1660.   }
  1661.   {/pecho You must specify whether you want ALL protection ON or OFF.}
  1662. }
  1663.  
  1664. alias pause {
  1665.   if ([$pauseset]==[]) {
  1666.      ^SET HOLD_MODE ON
  1667.      ^assign pauseset ON
  1668.       pecho Pause mode activated.
  1669.   } 
  1670.   {
  1671.      ^SET HOLD_MODE OFF
  1672.      ^assign -pauseset
  1673.       pecho Back to normal scroll mode.
  1674.   }
  1675. }
  1676.  
  1677. ### MDeop, MOp, MVoice, MRemoveVoice, LK, and MK (by YaZoO and Vassago)
  1678.  
  1679. alias mass {
  1680.   if ([$0]) {
  1681.    if (([$0]!=[lk])&&([$0]!=[k])) {
  1682.     if ([$0]==[d]) {@ mass_mode = [-ooo];^on ^names "*" /findops $$1-\;^on ^names - "*"}
  1683.     {
  1684.        if ([$0]==[o]) {@ mass_mode = [+ooo]}
  1685.        if ([$0]==[v]) {@ mass_mode = [+vvv]}
  1686.        if ([$0]==[s]) {@ mass_mode = [-vvv]}
  1687.        if ([$mass_mode]!=[]) {^on ^names "*" /findnonops $$1-\;^on ^names - "*"}
  1688.     }
  1689.     //names $C
  1690.     wait -CMD domassmode
  1691.    }
  1692.    {
  1693.     if ([$0]==[lk]) {
  1694.     ^on ^names "*" {^assign lamkick $1-}
  1695.     ^names $C
  1696.     wait
  1697.     ^assign lktmp no
  1698.     @ lcnt = 0
  1699.     pecho LKick started, please wait.
  1700.     while ([$(#lamkick)]>lcnt) {
  1701.     if (!match(@* $word($lcnt $lamkick))) {
  1702.       if ([$word($lcnt $lamkick)]!=[$N]) {
  1703.         if ([!$word($lcnt $lamkick)]!=[!]) {
  1704.          ^assign bkicked $word($lcnt $lamkick) ${bkicked}
  1705.          ^assign lktmp ppl
  1706.         }
  1707.       }
  1708.     }
  1709.     @ lcnt = lcnt + 1
  1710.      }
  1711.      if ([$lktmp]==[ppl]) {
  1712.      @ lcnt = 0
  1713.      while ([$(#bkicked)]>=lcnt) {
  1714.        /kkick $C $word($lcnt $bkicked) $pk
  1715.        @ lcnt = lcnt + 1
  1716.      }
  1717.       /pecho $bkicked have been kicked from $C.
  1718.       }
  1719.       {/pecho Everyone is opped on $C\.}
  1720.       ^on names - "*"
  1721.       ^assign -bkicked
  1722.       ^assign -lcnt
  1723.       ^assign -lktmp
  1724.     }
  1725.     if ([$0]==[k]) {
  1726.     /pecho Masskicking everyone from $C\.
  1727.     ^on ^441 "*" #
  1728.     ^on ^names "*" findops $$1-
  1729.      names $C
  1730.      wait -cmd _kickcont
  1731.     }
  1732.    }
  1733.  }
  1734.  {
  1735.       pecho Usage: /MASS <o,d,v,s,k,lk> - O to op all non channel ops,
  1736.       pecho d to deop all ops on the channel, v to give non-ops voice,
  1737.       pecho and s to remove voice from all non-ops \(silence\), lk to
  1738.       pecho mass kick all non-ops from the channel, and k to masskick 
  1739.       pecho EVERYONE from your current channel.
  1740.  }
  1741. }
  1742.  
  1743. alias _kickcont {
  1744.     ^assign kicklist $mdchange
  1745.      kickthem
  1746.     ^assign -mdchange
  1747.     ^on ^names "*" findnonops $$1-
  1748.      names $C
  1749.      wait -cmd _kickcont2
  1750. }
  1751.  
  1752. alias _kickcont2 {
  1753.     ^assign kicklist $mdchange
  1754.      kickthem
  1755.     ^assign -mdchange
  1756.     ^on 441 - "*"
  1757.     ^on names - "*"
  1758. }
  1759.  
  1760. alias domassmode {
  1761.     @ mdchangecnt = 1
  1762.     while ([$(#mdchange)]>=mdchangecnt) {
  1763.     /mmode $C $mass_mode $decode($word(${mdchangecnt-1} $mdchange)) $decode($word($mdchangecnt $mdchange)) $decode($word(${mdchangecnt+1} $mdchange))
  1764.     @ mdchangecnt = mdchangecnt + 3
  1765.     }
  1766.     ^assign -mdchangecnt
  1767.     ^assign -mdchange
  1768.     ^assign -mass_mode
  1769. }
  1770.  
  1771. alias findops {
  1772.    if (([$[1]0] == [@]) && (match($0 @${N} $N)==0)) {^assign mdchange $encode($strip(@ $0)) ${mdchange}}
  1773.    if (([$[1]1] == [@]) && (match($1 @${N} $N)==0)) {^assign mdchange $encode($strip(@ $1)) ${mdchange}}
  1774.    if (([$[1]2] == [@]) && (match($2 @${N} $N)==0)) {^assign mdchange $encode($strip(@ $2)) ${mdchange}}
  1775.    if ([$3]) {/findops $3-}
  1776. }
  1777.  
  1778. alias findnonops {
  1779.    if (([$[1]0] != [@]) && (match($0 @${N} $N)==0)) {^assign mdchange $encode($strip(+ $0)) ${mdchange}}
  1780.    if (([$[1]1] != [@]) && (match($1 @${N} $N)==0)) {^assign mdchange $encode($strip(+ $1)) ${mdchange}}
  1781.    if (([$[1]2] != [@]) && (match($2 @${N} $N)==0)) {^assign mdchange $encode($strip(+ $2)) ${mdchange}}
  1782.    if ([$3]) {/findnonops $3-}
  1783. }
  1784.  
  1785. alias kickthem {
  1786.    @ mcnt = 0
  1787.    if ([$kicklist]!=[]) {
  1788.        while ([$(#kicklist)]>mcnt){
  1789.        kkick $C $decode($word($mcnt $kicklist)) $pk
  1790.        @ mcnt = mcnt + 1
  1791.        if ([$(#kicklist)]>mcnt) {
  1792.            kkick $C $decode($word($mcnt $kicklist)) $pk
  1793.            @ mcnt = mcnt + 1
  1794.        }
  1795.        }
  1796.    }
  1797.    ^assign -kicklist
  1798.    ^assign -mcnt
  1799. }
  1800.  
  1801. ### Other KICK Routines (by YaZoO, Mods by Vassago)
  1802.  
  1803. alias fk {
  1804.   if ([$0]) {
  1805.      pecho FilterKick of $0 in $C started, please wait...
  1806.     ^assign fkfilt $0
  1807.     ^on ^who "*" {
  1808.      if ((rmatch($1!$3@$4 $fkfilt))&&([$1]!=[$N])) {^assign ftbkick $encode($1) ${ftbkick}}
  1809.     }
  1810.     //who $C
  1811.     wait -CMD dofilterkick
  1812.   }
  1813.   {/pecho Usage: /fk <hostname/*filter*>. Wildcards allowed.}
  1814. }
  1815.  
  1816. alias fbk {
  1817.   if ([$0]) {  
  1818.       mmode $C +b $0
  1819.       fk $0
  1820.   }
  1821.   {/pecho Usage: /fbk <hostname/*filter*>. Wildcards allowed.}
  1822. }
  1823.  
  1824. alias dofilterkick {
  1825.     @ fkcnt = 0
  1826.     while ([$(#ftbkick)]>fkcnt) {
  1827.     kkick $C $decode($word($fkcnt $ftbkick)) | Filter Kick $fkfilt |
  1828.     @ fkcnt = fkcnt + 1
  1829.     }
  1830.     if ([$ftbkick]!=[]) {/pecho $fkcnt people kicked from $C with the filter $fkfilt\.}
  1831.     {/pecho No one matching filter $fkfilt is in channel $C\.}
  1832.     ^on who - "*"
  1833.     ^assign -ftbkick
  1834.     ^assign -fkcnt
  1835.     ^assign -fkfilt
  1836. }
  1837.  
  1838. alias k {
  1839.   if ([$0]) {
  1840.     if ([$1]) {/kkick $C $0  $1- }
  1841.     {/kkick $C $0 $pk}
  1842.   }
  1843.   {/pecho You must specify a nickname.}
  1844. }
  1845.  
  1846. ### Setaway & Setback Routines (by Vassago)
  1847.  
  1848. alias setaway {
  1849.     if ([$0]) {^assign reason $encode($0-)}
  1850.     {^assign reason $encode($defumes)}
  1851.      //away $decode($reason) \(Away since $Z $left(10 $stime($time()))\)
  1852.      //me is away - $decode($reason) - messages will be saved.
  1853.      ^assign isaway YES
  1854.      ^exec echo "[$left(10 $stime($time())) $Z] Setaway: $safe($decode($reason)) " >> $awayfle
  1855.      @ away_messages = 0
  1856.      @ logged_entries = 0
  1857. }
  1858.  
  1859. alias away {
  1860.    if ([$0]) {/setaway $0-}
  1861.    {/setback}
  1862. }
  1863.  
  1864. alias setback {
  1865.   ^assign isaway NO
  1866.    /me has returned.
  1867.    //away
  1868.    /pecho You have $away_messages messages and $logged_entries script logs waiting.
  1869.    ^assign temp $"[E/X] Display message file? (y/n) "
  1870.    if (([$temp]==[y])||([$temp]==[yes])) {^exec cat $awayfle}
  1871.    ^assign temp $"[E/X] Save message file? (y/n) "
  1872.    if (([$temp]==[n])||([$temp]==[no])) {
  1873.       ^exec rm $awayfle
  1874.        pecho Setaway message list has been deleted.
  1875.    }
  1876.    {/pecho Setaway message list has not been deleted.}
  1877.    @ away_messages = 0
  1878.    @ logged_entries = 0
  1879.    ^assign -temp
  1880. }
  1881.  
  1882. alias log {
  1883.    if ([$isaway]==[YES]) {
  1884.     ^assign ltext $safe($0-)
  1885.     ^exec echo "[$left(10 $stime($time())) $Z] $ltext " >> $awayfle
  1886.      @ logged_entries = logged_entries + 1
  1887.     ^assign -ltext
  1888.    }
  1889. }
  1890.  
  1891. ### Script Variable Save Routines (by YaZoO - Mods from Vassago)
  1892.  
  1893. alias save sve
  1894.  
  1895. alias avar {^assign $0 $1-}
  1896.  
  1897. alias adadddfriend {
  1898.    @ FRIENDS[$FRIENDADD] = [$0]
  1899.    @ FRIENDADD = FRIENDADD + 1
  1900. }
  1901.  
  1902. alias adadddpriv {
  1903.    @ PRIVS[$PRIVADD] = [$0-]
  1904.    @ PRIVADD = PRIVADD + 1
  1905. }
  1906.  
  1907. alias adadddenemy {
  1908.    @ ENEMIES[$ENEMYADD] = [$0]
  1909.    @ ENEMYADD = ENEMYADD + 1
  1910. }
  1911.  
  1912. alias adadddcomment {
  1913.    @ COMMENTS[$COMMENTADD] = [$0-]
  1914.    @ COMMENTADD = COMMENTADD + 1
  1915. }
  1916.  
  1917. alias sve {
  1918.    pecho Save started, please wait...
  1919.   ^on ^exec_error "sve *" #
  1920.   ^exec -name sve rm $baksve $PhoEniXDir/notify.ex
  1921.    wait %sve
  1922.   ^exec -name sve mv $asve $baksve
  1923.    wait %sve
  1924.   ^on ^exec_error - "sve *"
  1925.   ^exec -name exsve cat >> $asve
  1926.    wait
  1927.   ^msg %exsve ### Save file for PhoEniX Version 2.13 from Vassago
  1928.    wait
  1929.   ^msg %exsve ### Last saved: $left(10 $stime($time())) at $Z
  1930.    wait
  1931.    pecho Saving miscellaneous script settings...
  1932.   ^writeln TOOPVIEW $TOOPVIEW
  1933.   ^writeln idle_time $idle_time
  1934.   ^writeln showkill $showkill
  1935.   ^writeln defban $defban
  1936.   ^writeln ban_name $ban_name
  1937.   ^writeln change_stat $change_stat
  1938.   ^writeln extmes $extmes
  1939.   ^writeln ctcpauto $ctcpauto
  1940.   ^writeln autochannels $autochannels
  1941.   ^writeln fingermsg $fingermsg
  1942.   ^writeln uban_kickmsg $uban_kickmsg
  1943.   ^writeln pingmsg $pingmsg
  1944.   ^writeln default_server $default_server
  1945.   ^writeln flood_msg $flood_msg
  1946.   ^writeln ex $ex
  1947.   ^writeln pk $pk
  1948.   ^writeln abkickmsg $abkickmsg
  1949.   ^writeln channel_floodmsg $channel_floodmsg
  1950.   ^writeln nick_floodmsg $nick_floodmsg
  1951.   ^writeln ignore_types $ignore_types
  1952.   ^writeln defumes $defumes
  1953.   ^writeln idlemes $idlemes
  1954.   ^writeln signmsg $signmsg
  1955.   ^writeln shell_pgm $shell_pgm
  1956.    pecho Saving Flood/Mass Protection settings...
  1957.   ^writeln ignore_types $ignore_types
  1958.   ^writeln prot $prot
  1959.   ^writeln flood_ok $flood_ok
  1960.   ^writeln floodp $floodp
  1961.   ^writeln nhp $nhp
  1962.   ^writeln chanprot $chanprot
  1963.   ^writeln resetcount $resetcount
  1964.   ^writeln ignorecount $ignorecount
  1965.   ^writeln msensor $msensor
  1966.   ^writeln ksensor $ksensor
  1967.   ^writeln msgsensor $msgsensor
  1968.   ^writeln noticesensor $noticesensor
  1969.   ^writeln ctcpsensor $ctcpsensor
  1970.   ^writeln nicksensor $nicksensor
  1971.    pecho Saving XDCC settings...
  1972.   ^writeln autoget $autoget
  1973.   ^writeln autosend $autosend
  1974.   ^writeln autoclose $autoclose
  1975.   ^writeln autorename $autorename
  1976.   ^writeln noise $noise
  1977.   ^writeln security $security
  1978.    pecho Saving Friends and AutoBkick lists...
  1979.    foreach FRIENDS XX {
  1980.     ^msg %exsve adadddfriend $FRIENDS[$XX]
  1981.      wait
  1982.    }
  1983.    foreach PRIVS XX {
  1984.     ^msg %exsve adadddpriv $PRIVS[$XX]
  1985.      wait
  1986.    }
  1987.    foreach ENEMIES XX {
  1988.     ^msg %exsve adadddenemy $ENEMIES[$XX]
  1989.      wait
  1990.    }
  1991.    foreach COMMENTS XX {
  1992.     ^msg %exsve adadddcomment $COMMENTS[$XX]
  1993.      wait
  1994.    }
  1995.   ^exec -CLOSE %exsve
  1996.    wait
  1997.    pecho Saving your notify list...
  1998.   ^exec -name nsve cat >> $PhoEniXDir/notify.ex
  1999.    wait
  2000.   ^msg %nsve ### NOTIFY file for PhoEniX Version 2.13 from Vassago
  2001.    wait
  2002.   ^msg %nsve ### Last saved: $left(10 $stime($time())) at $Z
  2003.    wait
  2004.    @ notify_size = [$#notify.ex]
  2005.    @ notify_counter = 0
  2006.    while (notify_counter < notify_size) {
  2007.     @ ind =0
  2008.     ^assign -notify_write
  2009.      while (ind < 7) {
  2010.         ^assign notify_write $notify_write $word($notify_counter $notify.ex)
  2011.         @ ind=ind+1
  2012.         @ notify_counter = notify_counter + 1
  2013.      }
  2014.      ^msg %nsve NOTIFY$notify_write
  2015.       wait
  2016.    }
  2017.   ^exec -CLOSE %nsve
  2018.    wait
  2019.    pecho Save has been completed.
  2020. }
  2021.  
  2022. alias writeln {
  2023.    ^msg %exsve avar $0 $1-
  2024.     wait
  2025. }
  2026.  
  2027. ### AUTOBKICK LIST Routines (by Vassago)
  2028.  
  2029. alias check_enemy {
  2030.     @ NUMENEMIES = 0
  2031.     foreach ENEMIES XX {
  2032.     @ NUMENEMIES = NUMENEMIES + 1
  2033.       if ((rmatch($ENEMIES[$XX] $0))||(match($ENEMIES[$XX] $0))) {^assign blah ON}
  2034.     }
  2035.     if ([$blah]==[ON]) {^assign FUNCTION_RETURN ON}
  2036.     ^assign -blah
  2037. }
  2038.  
  2039. alias add_enemy {
  2040.   @ NUMENEMIES = NUMENEMIES + 1
  2041.    ^assign ENEMIES[$NUMENEMIES] $0
  2042.    if ([$1]) {
  2043.        ^assign COMMENTS[$NUMENEMIES]  $1- 
  2044.     pecho Added $0 to your AutoBKick list with comment: $1-
  2045.    }
  2046.    {/pecho Added $0 to your AutoBKick list with no comment.}
  2047. }
  2048.  
  2049. alias delete_enemy {
  2050.    foreach ENEMIES XX {
  2051.      if ((rmatch($ENEMIES[$XX] $0))||(match($ENEMIES[$XX] $0))||([$ENEMIES[$XX]]==[$0])) {
  2052.          pecho Match: Removing $ENEMIES[$XX] from list.
  2053.         ^assign ENEMIES[$XX] $ENEMIES[$NUMENEMIES]
  2054.         ^assign COMMENTS[$XX] $COMMENTS[$NUMENEMIES]
  2055.         ^assign -ENEMIES[$NUMENEMIES]
  2056.         ^assign -COMMENTS[$NUMENEMIES]
  2057.         @ NUMENEMIES = NUMENEMIES - 1
  2058.      }
  2059.    }
  2060. }
  2061.  
  2062. alias addbk {
  2063.   if ([$0]) {
  2064.     if (rmatch($0 *@* *!* *.*)) {
  2065.       if ([$check_enemy($0)]==[ON]) {/delete_enemy $0}
  2066.       add_enemy $0 $1-
  2067.     }
  2068.     {
  2069.      pecho Searching for nickname $0\...
  2070.      ^assign tempcomment $1-
  2071.      Userhost $0 -CMD if ([$4]!=[<UNKNOWN>]) {
  2072.          ^assign TOADD $safe($3)@$4
  2073.           if ([$check_enemy(*!*$TOADD)]==[ON]) {/delete_enemy *!*$TOADD}
  2074.           add_enemy $nban($safe($3) $4) $tempcomment
  2075.          ^assign -TOADD
  2076.          ^assign -tempcomment
  2077.      }
  2078.      {/pecho I can't find $0 on IRC.}
  2079.     }
  2080.   }
  2081.   {
  2082.       pecho Usage: /ADDBK <nick/filter> <comment> to add a nick/filt to your
  2083.       pecho AUTOBKICK list. You can place your bans in your bkick list by
  2084.       pecho typing /DOBANS. If someone joins one of your channels with a
  2085.       pecho user@host that matches in your list, they will be deopped,
  2086.       pecho banned, and kicked from the channel automatically. If you don't
  2087.       pecho specify a comment, it will default to a standard message.
  2088.   }
  2089. }
  2090.  
  2091. alias listbk {
  2092.   /pecho Listing Enemies/Filters in your list:
  2093.   @ THELIST = 0
  2094.   foreach ENEMIES XX {
  2095.     @ THELIST = THELIST + 1
  2096.     if ([$COMMENTS[$XX]]!=[]) {/pecho #$THELIST $ENEMIES[$XX] \($COMMENTS[$XX]\)}
  2097.     {/pecho #$THELIST $ENEMIES[$XX]}
  2098.   }
  2099.   pecho End of AutoBKick list. A total of $THELIST people/filters.
  2100.   ^assign -THELIST
  2101. }
  2102.  
  2103. alias rembk {
  2104.     if ([$0]) {
  2105.       if ([$0]==[ALL]) {
  2106.      purge ENEMIES
  2107.      purge COMMENTS
  2108.      pecho Your AutoBkick list has been cleared.
  2109.       }
  2110.       {
  2111.       if (rmatch($0 *@* *!* *.*)) {
  2112.       if ([$check_enemy($0)]==[ON]) {/delete_enemy $0}
  2113.       {/pecho $0 is not in your AutoBKick list.}
  2114.       }
  2115.       {
  2116.        Userhost $0 -CMD if ([$4]!=[<UNKNOWN>]) {
  2117.          ^assign TOREMOVE $safe($3)@$4
  2118.          if ([$check_enemy(*!*$TOREMOVE)]==[ON]) {/delete_enemy *!*$TOREMOVE}
  2119.          {/pecho *!*$TOREMOVE is not in your AutoBkick list.}
  2120.          ^assign -TOREMOVE
  2121.         }
  2122.         {/pecho I can't find $0 on IRC.}
  2123.       }
  2124.       }
  2125.     }
  2126.     {
  2127.     pecho Usage: /REMBK <nick or filter to remove from Auto Bkick list>.
  2128.     pecho Type /REMBK ALL to clear your AutoBkick list.
  2129.     }
  2130. }
  2131.  
  2132. ### CTCP Friends List Functions (by Vassago)
  2133.  
  2134. alias check_friend {
  2135.     @ NUMFRIENDS = 0
  2136.     foreach FRIENDS XX {
  2137.     @ NUMFRIENDS = NUMFRIENDS + 1
  2138.     if ((rmatch($FRIENDS[$XX] $0))||(match($FRIENDS[$XX] $0))) {^assign blah ON}
  2139.     }
  2140.     if ([$blah]==[ON]) {^assign FUNCTION_RETURN ON}
  2141.     ^assign -blah
  2142. }
  2143.  
  2144. alias add_friend {
  2145.    @ NUMFRIENDS = NUMFRIENDS + 1
  2146.    ^assign FRIENDS[$NUMFRIENDS] $0
  2147.    setprivs $1-
  2148.    pecho Added $0 to your Friends list with
  2149.    pecho CTCP access of: $PRIVS[$NUMFRIENDS]
  2150.    makefriends
  2151. }
  2152.  
  2153. alias delete_friend {
  2154.    foreach FRIENDS XX {
  2155.      if ((rmatch($FRIENDS[$XX] $0))||(match($FRIENDS[$XX] $0))||([$FRIENDS[$XX]]==[$0])) {
  2156.         /pecho Match: Removing $FRIENDS[$XX] from list.
  2157.         ^assign FRIENDS[$XX] $FRIENDS[$NUMFRIENDS]
  2158.         ^assign PRIVS[$XX] $PRIVS[$NUMFRIENDS]
  2159.         ^assign -FRIENDS[$NUMFRIENDS]
  2160.         ^assign -PRIVS[$NUMFRIENDS]
  2161.         @ NUMFRIENDS = NUMFRIENDS - 1
  2162.      }
  2163.    }
  2164.    makefriends
  2165. }
  2166.  
  2167. alias addf {
  2168.   if ([$0]) {
  2169.     if (rmatch($0 *@* *!* *.*)) {
  2170.      if ([$check_friend($0)]==[ON]) {/delete_friend $0}
  2171.      add_friend $0 $1-
  2172.     }
  2173.     {
  2174.      ^assign STUFF $1-
  2175.      pecho Searching for nickname $0\...
  2176.      Userhost $0 -CMD if ([$4]!=[<UNKNOWN>]) {
  2177.         ^assign TOADD $safe($3)@$4
  2178.         if ([$check_friend($0!$TOADD)]==[ON]) {/delete_friend $0!$TOADD}           
  2179.         add_friend $nban($safe($3) $4) $STUFF
  2180.         nnotice $0 You have been added to my Friends list with CTCP
  2181.         nnotice $0 access of: $PRIVS[$NUMFRIENDS]
  2182.         nnotice $0 Type /CTCP $N HELP for more information.
  2183.         ^assign -STUFF
  2184.         ^assign -TOADD
  2185.      }
  2186.      {/pecho I can't find $0 on IRC.}
  2187.     }
  2188.   }
  2189.   {
  2190.       pecho Usage: /ADDF <nick/filter> <privileges>. Available privileges are
  2191.       pecho INVITE, OP, & XDCC. To give them all access, type /ADDF <nick/filt>
  2192.       pecho ALL. To change someone's privileges, just /ADDF them again.
  2193.   }
  2194. }
  2195.  
  2196. alias setprivs {
  2197.   ^assign -PRIVS[$NUMFRIENDS]
  2198.   if ([$0]) {
  2199.     if (match(INVITE $0-)) {@ PRIVS[$NUMFRIENDS] = PRIVS[$NUMFRIENDS] ## [INVITE ]}
  2200.     if (match(OP $0-)) {@ PRIVS[$NUMFRIENDS] = PRIVS[$NUMFRIENDS] ## [OP ]}
  2201.     if (match(XDCC $0-)) {@ PRIVS[$NUMFRIENDS] = PRIVS[$NUMFRIENDS] ## [XDCC ]}
  2202.     if (match(ALL $0-)) {@ PRIVS[$NUMFRIENDS] = PRIVS[$NUMFRIENDS] ## [INVITE OP XDCC]}
  2203.     if (!match($0 OP INVITE ALL XDCC)) {
  2204.        pecho You must specify OP, INVITE, XDCC or ALL.
  2205.        pecho Setting privileges to INVITE and XDCC. (default).
  2206.        @ PRIVS[$NUMFRIENDS] = [INVITE XDCC]
  2207.     }
  2208.   }
  2209.   {@ PRIVS[$NUMFRIENDS] = [INVITE XDCC]}
  2210. }
  2211.  
  2212. alias listf {
  2213.   pecho Listing Friends/Filters in your list and their access:
  2214.   @ THELIST = 0
  2215.   foreach FRIENDS XX {
  2216.     @ THELIST = THELIST + 1
  2217.     /pecho #$THELIST $FRIENDS[$XX]
  2218.     /pecho    Privileges: $PRIVS[$XX]
  2219.   }
  2220.   /pecho End of Friends list. A total of $THELIST people.
  2221.   ^assign -THELIST
  2222. }
  2223.  
  2224. alias remf {
  2225.    if ([$0]) {
  2226.    if ([$0]==[ALL]) {
  2227.        purge FRIENDS
  2228.        purge PRIVS
  2229.        pecho Your friends list has been cleared.
  2230.    }
  2231.    {
  2232.      if (rmatch($0 *@* *!* *.*)) {
  2233.       if ([$check_friend($0)]==[ON]) {/delete_friend $0}
  2234.       {/pecho $0 is not on your Friends list.}
  2235.      }
  2236.      {
  2237.      Userhost $0 -CMD if ([$4]!=[<UNKNOWN>]) {
  2238.           ^assign TOREMOVE $safe($3)@$4
  2239.           if ([$check_friend($0!$TOREMOVE)]==[ON]) {/delete_friend $0!$TOREMOVE}
  2240.           {/pecho $0!$TOREMOVE is not on your Friends list.}
  2241.           ^assign -TOREMOVE
  2242.      }
  2243.      {/pecho I can't find $0 on IRC.}
  2244.      }
  2245.    }
  2246.    }
  2247.    {
  2248.       pecho Usage: /REMF <nick/filter to remove from Friends list>.
  2249.       pecho To clear your friends list, type /REMF ALL.
  2250.    }
  2251. }
  2252.  
  2253. alias makefriends {
  2254.     EVAL pecho Building INVITE, OP and XDCC Friends Lists...
  2255.    ^assign -OPLIST
  2256.    ^assign -FRIENDLIST
  2257.    ^assign -INVITELIST
  2258.    ^assign -SECLIST
  2259.     foreach FRIENDS ii {
  2260.     ^assign FTMP *$uhostonly($FRIENDS[$ii])
  2261.     if (match(OP $PRIVS[$ii])) {@ OPLIST = OPLIST ## [$FTMP ]}
  2262.     if (match(INVITE $PRIVS[$ii])) {@ INVITELIST = INVITELIST ## [$FTMP ]}
  2263.     if (match(XDCC $PRIVS[$ii])) {@ SECLIST = SECLIST ## [$FTMP ]}
  2264.     @ FRIENDLIST = FRIENDLIST ## [$FTMP ]
  2265.     }
  2266. }
  2267.  
  2268. alias uhostonly {
  2269.    ^assign uhost_tmp $0
  2270.    ^assign FUNCTION_RETURN $right(${@uhost_tmp-index(! $0)} $0)
  2271. }
  2272.  
  2273. ### Notify Functions
  2274.  
  2275. on ^notify_signon "*" {
  2276.    Userhost $0 -CMD if ([$4]!=[<UNKNOWN>]) {/pecho Signon at $Z for $0 [$safe($3)@$4] detected.}
  2277.    {/pecho Signon/Signoff at $Z for $0 detected.}
  2278. }
  2279.  
  2280. on ^notify_signoff "*" pecho Signoff at $Z for $0 detected.
  2281.  
  2282. ### NOTIFY Alias (by TG, save mods by Vassago)
  2283.  
  2284. alias notify {
  2285.   if ([$0]) {
  2286.     if ([$left(1 $0)]==[-])
  2287.     {
  2288.      //notify $0-
  2289.      ^assign notify.ex $rem_w($mid(1 1000 $0-) $notify.ex)
  2290.     } 
  2291.     {
  2292.      ^assign notify.ex $notify.ex $strip(+ $0-)
  2293.      //notify $0-
  2294.     }
  2295.     } 
  2296.     {
  2297.     /pecho Notify List: $notify.ex
  2298.     //notify +
  2299.     }
  2300. }
  2301.  
  2302. ### Miscellaneous Functions (by Jeremy Nelson)
  2303.  
  2304. alias rem_w {
  2305.     @ _pattern = rmatch($0 $1-) - 1
  2306.     if (_pattern != -1) {@ function_return = notw($_pattern $1-)}
  2307.     {@ function_return = [$1-]}
  2308. }
  2309. alias notw {
  2310.     if ([$0]) {@ _pad = [ ]}
  2311.     {@ _pad = []}
  2312.     @ _words = [$1-]
  2313.     @ function_return = [$leftw($0 $1-)] ## [$_pad] ## [$restw(${[$0]+1} $1-)]
  2314. }
  2315. alias leftw {@ function_return = [$(1-$0)]}
  2316. alias restw {@ function_return = [$(${[$0]+1}-)]}
  2317.  
  2318. ### Miscellaneous Aliases
  2319.  
  2320. alias finger {
  2321.     ^exec -kill %finger
  2322.     if (([$0]==[-h])&&([$1]!=[])) {
  2323.     Userhost $1 -cmd if ([$3] != [<UNKNOWN>]) {
  2324.         pecho Launching Host finger on: $0 -> @$4
  2325.         ^eval exec -name finger exec finger @$$4
  2326.     }
  2327.     {/pecho I can't find $0 on IRC.}
  2328.     }
  2329.     {
  2330.     if (index(@ $0) > -1) {^exec -name finger exec finger $0}
  2331.     {
  2332.        if ([$0]) {
  2333.            Userhost $0 -cmd if ([$3] != [<UNKNOWN>]) {
  2334.            pecho Launching finger on $0!$strip(#~!> $3)@$4
  2335.            ^eval exec -name finger exec finger $strip(#~!> $3)@$$4
  2336.            }
  2337.            {/pecho I can't find $0 on IRC.}
  2338.        }
  2339.        {/pecho Usage: /FINGER [[-h] <nickname>][[user]@full.hostname]}
  2340.     }
  2341.     }
  2342. }
  2343.  
  2344. alias _connect {
  2345.    ^timer 2 EVAL quote MODE $N $usermode
  2346.     wait -CMD ^timer 5 autoping
  2347. }
  2348.  
  2349. alias chgst {
  2350.   if ([$change_stat]==[ON]) {
  2351.        ^assign ptmp $ptmp${TOTPACK}-
  2352.        ^assign ptmp $ptmp${GETCOUNT}
  2353.        if ([$AUTOGET] == [ON])
  2354.          { ^assign ptmp ${ptmp}:G}
  2355.          { ^assign ptmp ${ptmp}:g}
  2356.        if ([$AUTOSEND] == [ON])
  2357.          { ^assign ptmp ${ptmp}S}
  2358.          { ^assign ptmp ${ptmp}s}
  2359.        if ([$AUTOCLOSE] == [ON])
  2360.          { ^assign ptmp ${ptmp}C}
  2361.          { ^assign ptmp ${ptmp}c}
  2362.        if ([$AUTORENAME]==[ON])
  2363.          { ^assign ptmp ${ptmp}N}
  2364.          { ^assign ptmp ${ptmp}n}
  2365.        if ([$SECURITY]==[ON])
  2366.          { ^assign ptmp ${ptmp}X}
  2367.          { ^assign ptmp ${ptmp}x}
  2368.        if ([$ctcpauto]==[ON])
  2369.          { ^assign ptmp ${ptmp}A}
  2370.          { ^assign ptmp ${ptmp}a}
  2371.        if ([$LOGIRC] == [ON])
  2372.          { ^assign ptmp ${ptmp}L}
  2373.          { ^assign ptmp ${ptmp}l}
  2374.        if ([$FLOODP]==[ON])
  2375.          { ^assign ptmp ${ptmp}F}
  2376.          { ^assign ptmp ${ptmp}f}
  2377.        if ([$prot]==[ON])
  2378.          { ^assign ptmp ${ptmp}M}
  2379.          { ^assign ptmp ${ptmp}m}
  2380.        if ([$chanprot]==[ON])
  2381.          { ^assign ptmp ${ptmp}P}
  2382.          { ^assign ptmp ${ptmp}p}
  2383.        if ([$nhp]==[ON])
  2384.          { ^assign ptmp ${ptmp}H}
  2385.          { ^assign ptmp ${ptmp}h}
  2386.        if ([$rejoin]==[ON])
  2387.          { ^assign ptmp ${ptmp}R}
  2388.          { ^assign ptmp ${ptmp}r}
  2389.        ^assign ptmp [${ptmp}]$OLD_STATUS
  2390.        ^set STATUS_FORMAT $ptmp
  2391.        ^assign -ptmp
  2392.     }
  2393.     {^set STATUS_FORMAT $OLD_STATUS}
  2394. }
  2395.  
  2396. alias cstat {
  2397.   if ([$change_stat]==[ON]) {^assign change_stat OFF}
  2398.   {^assign change_stat ON}
  2399.    pecho Changing the status line is now $change_stat\.
  2400.    chgst
  2401. }
  2402.  
  2403. alias your_host {
  2404.     EVAL Userhost $N -CMD if ([$3]) {/EVAL ^assign ownadd $0!$strip(~ $3)@$4}
  2405.     {^timer 30 your_host}
  2406. }
  2407.  
  2408. alias sensor {
  2409.    pecho Enter deop sensitivity \(currently $msensor\).
  2410.    @ temp = [$"[E/X] Deop value: "]
  2411.    if (temp!=[]){@ msensor = temp}
  2412.    pecho Enter kick sensitivity \(currently $ksensor\).
  2413.    @ temp = [$"[E/X] Kick value: "]
  2414.    if (temp!=[]){@ ksensor = temp}
  2415.    pecho Enter nickname flood sensitivity \(currently $nicksensor\).
  2416.    @ temp = [$"[E/X] Channel Nickname Flood value: "]
  2417.    if (temp!=[]){@ nicksensor = temp}
  2418.    pecho Enter message flood sensitivity \(currently $msgsensor\).
  2419.    @ temp = [$"[E/X] FloodP Msg Flood value: "]
  2420.    if (temp!=[]){@ msgsensor = temp}
  2421.    pecho Enter notice flood sensitivity \(currently $noticesensor\).
  2422.    @ temp = [$"[E/X] FloodP Notice Flood value: "]
  2423.    if (temp!=[]){@ noticesensor = temp}
  2424.    pecho Enter CTCP flood sensitivity \(currently $ctcpsensor\).
  2425.    @ temp = [$"[E/X] FloodP CTCP Flood value: "]
  2426.    if (temp!=[]){@ ctcpsensor = temp}
  2427.    pecho Enter # of seconds auto-ignores should last \(currently $ignorecount\).
  2428.    @ temp = [$"[E/X] Automatic ignores last <in seconds>: "]
  2429.    if (temp!=[]){@ ignorecount = temp}
  2430.    pecho Enter ignore type\(s\) \(Currently $ignore_types\).
  2431.    pecho Valid: MSGS CTCP NOTICES WALLS WALLOPS INVITES NOTES PUBLIC CRAP, or ALL.
  2432.    @ temp = [$"[E/X] Ignore type\(s\): "]
  2433.    if (temp!=[]){@ ignore_types = temp}
  2434.    pecho Enter the # of seconds until the timer resets \(currently $resetcount\).
  2435.    @ temp = [$"[E/X] FloodP timer subtraction value: "]
  2436.    if (temp!=[]){@ resetcount = temp}
  2437.    ^assign -temp
  2438. }
  2439.  
  2440. alias signoff {
  2441.   if ([$0]) {
  2442.     EVAL echo *** Signoff: $N \($0-\)
  2443.     //signoff $0-
  2444.   }
  2445.   {
  2446.     EVAL echo *** Signoff: $N \($signmsg\)
  2447.     EVAL //signoff $signmsg
  2448.   }
  2449. }
  2450.  
  2451. alias exit {/signoff $0-}
  2452. alias quit {/signoff $0-}
  2453.  
  2454. alias cycle {
  2455.    /pecho Cycling on channel $C\, one moment...
  2456.    ^assign tmpchan $C
  2457.    //leave $C
  2458.    wait -CMD //join $tmpchan
  2459. }
  2460.  
  2461. # Channel Stats Generator (by YaZoO)
  2462.  
  2463. alias chanst {
  2464.   /pecho Gathering information for channel $C\...
  2465.   if ([$0]) {^assign chnl $0}
  2466.   {^assign chnl $C}
  2467.   @ cnscnt = 0
  2468.   @ opedpl = 0
  2469.   @ unoppl = 0
  2470.   @ awaypl = 0
  2471.   @ herepl = 0
  2472.   @ ircopl = 0
  2473.   ^assign -ircopz
  2474.   ^on ^who "*" {
  2475.     if (index(@ $2)!=-1) {@ opedpl = opedpl + 1}
  2476.     {@ unoppl = unoppl + 1}
  2477.     if (index(H $2)!=-1) {@ herepl = herepl + 1}
  2478.     if (index(G $2)!=-1) {@ awaypl = awaypl + 1}
  2479.     if (index(* $2)!=-1) {
  2480.      @ ircopl = ircopl + 1
  2481.     ^assign ircopz $1 ${ircopz}
  2482.     }
  2483.     @ cnscnt = cnscnt + 1
  2484.   }
  2485.   //who $chnl
  2486.   wait -CMD givestats
  2487. }
  2488.  
  2489. alias givestats {
  2490.   ^on who - "*"
  2491.    pecho Current channel statistics for $chnl 
  2492.    pecho Total users: $cnscnt  | Ops: $opedpl | Unopped: $unoppl 
  2493.    pecho Users here: $herepl  | Users Set Away: $awaypl 
  2494.   if ([$ircopz]!=[]) {/pecho IRC Ops: $ircopl \($ircopz\)}
  2495.   {/pecho IRC Ops: $ircopl }
  2496. }
  2497.  
  2498. alias shell {
  2499.     ^window new name UnixShell
  2500.     ^window scroll on
  2501.     ^set hold_mode off
  2502.     ^window level none
  2503.     ^exec -window -name UnixShell $shell_pgm
  2504.     ^query %UnixShell
  2505.     ^on ^exec_exit UnixShell {
  2506.     ^window show $shell_pgm kill
  2507.      pecho Unix Shell window has been closed.
  2508.     ^on exec_exit - UnixShell
  2509.     }
  2510. }
  2511.  
  2512. ### Ignoring/Unignoring Functions (by Vassago)
  2513.  
  2514. alias ig {
  2515.     if ([$0]) {
  2516.        if (!rmatch($0 *!* *@* *.*)) {
  2517.        Userhost $0 -CMD if ([$4]!=[<UNKNOWN>]) {
  2518.            ^assign to_ignore $hignore($safe($3) $4)
  2519.            EVAL //^ignore $to_ignore $ignore_types
  2520.            pecho Now ignoring $to_ignore\.
  2521.        }
  2522.        {/pecho I can't find $0 on IRC.}
  2523.        }
  2524.        {
  2525.         EVAL //^ignore $0 $ignore_types
  2526.        pecho Now ignoring $0\.
  2527.        }
  2528.     }
  2529.     {/pecho Usage: /IG <nickname of person to ignore by user@hostmask>.}
  2530. }
  2531.  
  2532. alias noig {
  2533.    if ([$0]) {
  2534.        Userhost $0 -CMD if ([$4]!=[<UNKNOWN>]) {
  2535.        //^ignore *@$4 NONE
  2536.        EVAL //^ignore $hignore($safe($3) $4) NONE
  2537.        pecho $0 has been unignored.
  2538.        }
  2539.        {/pecho I can't find $0 on IRC.}
  2540.    }
  2541.    {/pecho Usage: /NOIG <nickname of person to unignore>.}
  2542. }
  2543.  
  2544. ### CHANNEL WALLOPS (by Eagle-1, Mods from Vassago)
  2545.  
  2546. alias wall {
  2547.     if ([$C]==0) {/pecho You must be on a channel to use /WALL.}
  2548.     {
  2549.      ^on ^401 "*" #
  2550.       pecho Sending WallOp message to $C, please wait...
  2551.      ^assign message $encode($0-)
  2552.       pecho [WallOp/$C] $decode($message)
  2553.      ^on ^names "*" sendwall $$1-
  2554.      ^names $C
  2555.       wait -CMD _undowall
  2556.     }
  2557. }
  2558.  
  2559. alias sendwall {
  2560.    if ([$0]) {
  2561.      if (([$[1]0] == [@]) && ([$0] != [@] ## N)) {
  2562.       if ([$sendlist]==[]) {
  2563.         ^assign sendlist $strip(@ $0)
  2564.         ^assign showlist $strip(@ $0)
  2565.          sendwall $1-
  2566.       }
  2567.       {
  2568.         ^assign sendlist $strip(@ $0),$sendlist
  2569.         ^assign showlist $strip(@ $0) $showlist
  2570.          sendwall $1-
  2571.       }
  2572.      }
  2573.      {/sendwall $1-}
  2574.    }
  2575.    {
  2576.        if ([$sendlist]!=[]) {
  2577.        //^notice $sendlist [WallOp/$C] $decode($message)
  2578.         pecho WALLOPED: $showlist
  2579.        ^assign -sendlist
  2580.        ^assign -showlist
  2581.        }
  2582.    }
  2583. }
  2584.  
  2585. alias _undowall {
  2586.    ^on names - "*"
  2587.    ^timer 15 ^on 401 - "*"
  2588. }
  2589.  
  2590. ### NET Alias for Window Control (by Vassago)
  2591.  
  2592. alias net {
  2593.   if ([$0]) {
  2594.     /pecho Hit CONTROL-W then ? for help on windowing commands.
  2595.     /pecho Creating a window on server $0, please wait...
  2596.     ^window new
  2597.     if ([$1]) {/EVAL window server $0:$1::_$N}
  2598.     {/EVAL window server $0:6667::_$N}
  2599.   }
  2600.   {
  2601.        pecho Usage: /net <server> [<port>]
  2602.        pecho  /NET creates a new window and connects it to <server>.
  2603.        pecho   CONTROL-W + <Letter> is used for most window commands:
  2604.        pecho   ^W? - Shows you this help screen.
  2605.        pecho   ^WK - kills the current window.
  2606.        pecho   ^WH - hides the current window.
  2607.        pecho   ^WS - shows and balances all windows.
  2608.        pecho   ^WC - clears the current window.
  2609.        pecho   ^WL - lists all windows.
  2610.        pecho   ^WP - Goes to the previous window.
  2611.        pecho   ^WN - Goes to the next window. 
  2612.        pecho   ^W<1-9> - Changes to window number <1-9>.
  2613.        pecho   /wr <n> to reduce a window <n> number of lines.
  2614.        pecho   /wg <n> to grow a window <n> number of lines.
  2615.   }
  2616. }
  2617.  
  2618. bind ^W meta2_character 
  2619. bind ^W? parse_command net
  2620. bind ^Wh parse_command window hide
  2621. bind ^Wn parse_command window next
  2622. bind ^Wp parse_command window previous
  2623. bind ^Wk parse_command window kill
  2624. bind ^Wl parse_command window list
  2625. bind ^Wc parse_command clear -a
  2626. bind ^Ws parse_command win_show
  2627. bind ^W1 parse_command window goto 1
  2628. bind ^W2 parse_command window goto 2
  2629. bind ^W3 parse_command window goto 3
  2630. bind ^W4 parse_command window goto 4
  2631. bind ^W5 parse_command window goto 5
  2632. bind ^W6 parse_command window goto 6
  2633. bind ^W7 parse_command window goto 7
  2634. bind ^W8 parse_command window goto 8
  2635. bind ^W9 parse_command window goto 9
  2636.  
  2637. alias wr window shrink
  2638. alias wg window grow
  2639. alias win_show {
  2640.    ^window show 2
  2641.    ^window show 1
  2642.    ^window balance
  2643. }
  2644.  
  2645. ### XDCC File Transfer Script (By XaBi, Mods from YaZoO, Vassago, and Spooge)
  2646.  
  2647. on -window "% ??? DCC SEND:* lost" if ([$1]==[***]) {/subdccs}
  2648. on -window "% ??? DCC SEND:* %sec" if ([$1]==[***]) {/subdccs}
  2649.  
  2650. alias subdccs {
  2651.   if (dccsent > 0) {@ dccsent = dccsent - 1}
  2652.    if ([$gonnacount]==[]) {
  2653.       ^assign gonnacount ON
  2654.       ^timer 55 updatecount
  2655.    }
  2656. }
  2657.  
  2658. alias updatecount {
  2659.    if ([$counting]!=[ON]) {
  2660.      ^assign counting ON
  2661.      @ dccsent = 0
  2662.      ^on ^window "*" {/if ([$1]==[SEND]) {@ dccsent = dccsent + 1}}
  2663.     //dcc list
  2664.     ^on window - "*"
  2665.     ^assign -counting
  2666.     ^assign -gonnacount
  2667.    }
  2668.    {^timer 30 updatecount}
  2669. }
  2670.  
  2671. alias iswaiting {
  2672.    ^assign counting ON
  2673.    ^assign dccfilename none
  2674.    ^assign liststarted no
  2675.    ^assign listdone no
  2676.    ^assign chnick $0
  2677.    ^assign chfile $1
  2678.    ^assign dccwaiting no
  2679.    ^on ^window "*" {
  2680.       if (([$listdone]==[no])&&([$liststarted]==[yes])) {
  2681.      if (([$1]==[SEND])&&([$3]==[Waiting])&&(match(*$chfile $6)!=0)&&([$2]==[$chnick])) {
  2682.          ^assign dccwaiting yes
  2683.          ^assign dccfilename $6
  2684.      }
  2685.       }
  2686.       {
  2687.      if (([$listdone]==[no])&&([$1]==[Type])&&([$2]==[nick])&&([$3]==[status])) {^assign liststarted yes}
  2688.       }
  2689.    }
  2690.    //dcc list
  2691.    ^on window - "*"
  2692.    if ([$liststarted]==[no]) {^assign dccwaiting dunno}
  2693.    ^assign -listdone
  2694.    ^assign -liststarted
  2695.    ^assign -chnick
  2696.    ^assign -chfile
  2697.    ^assign -counting 
  2698. }
  2699.  
  2700. alias checksend {
  2701.     iswaiting $0 $1
  2702.     if ([$dccwaiting]==[dunno]) {^timer 1 checksend $0 $1}
  2703.     {
  2704.     if ([$dccwaiting]==[yes]) {
  2705.         ^timer 60 closesend $0 $1
  2706.         if ([$lastnotdcc]!=[$0]) {
  2707.          nnotice $0 You have DCCs pending. Type /DCC GET $N\.
  2708.         ^assign lastnotdcc $0
  2709.         ^timer -delete 224
  2710.         ^timer -refnum 224 15 ^assign -lastnotdcc
  2711.         }
  2712.     }
  2713.     }
  2714.     ^assign -dccwaiting
  2715.     ^assign -dccfilename
  2716. }
  2717.  
  2718. alias closesend {
  2719.     iswaiting $0 $1
  2720.     if ([$dccwaiting]==[dunno]) {^timer 1 closesend $0 $1}
  2721.     {
  2722.     if ([$dccwaiting]==[yes]) {
  2723.         //^dcc close send $0 $dccfilename
  2724.         ^subdccs
  2725.         if ([$lastnotdcc]!=[$0]) {
  2726.          XDCCecho One or more DCC SENDs to $0 have timed out.
  2727.         ^assign lastnotdcc $0
  2728.         ^timer -delete 224
  2729.         ^timer -refnum 224 30 ^assign -lastnotdcc
  2730.         }
  2731.     }
  2732.     }
  2733.    ^assign -dccfilename
  2734. }
  2735.  
  2736. alias xdccmsg {
  2737.      if ([$right(10 $1)]!=[$LASTXDCCMSG]) {
  2738.      if (match($2 HELP LIST SEND)) {/$2COMMAND $0 $1 $3-}
  2739.      {/nnotice $0 Try /MSG $N XDCC HELP.}
  2740.      ^assign LASTXDCCMSG $right(10 $1)
  2741.      ^timer -delete 334
  2742.      ^timer -refnum 334 5 ^assign -LASTXDCCMSG
  2743.      }
  2744. }
  2745.  
  2746. alias HELPcommand {
  2747.    if ([$right(10 $1)]!=[$LASTHELPED]) {
  2748.      nnotice $0 /MSG $N XDCC LIST - to get the list of offered packs.
  2749.      nnotice $0 /MSG $N XDCC LIST #<N> - to get more info on pack #<N>.
  2750.      nnotice $0 /MSG $N XDCC SEND #<N> - to send pack #<N>.
  2751.     ^assign LASTHELPED $right(10 $1)
  2752.     ^timer -delete 330
  2753.     ^timer -refnum 330 45 ^assign -LASTHELPED
  2754.    }
  2755. }
  2756.  
  2757. alias LISTcommand {
  2758.     if ([$right(10 $1)]!=[$lastlister]) {
  2759.        if (([$SECURITY]==[OFF])||([$sec_check($0!$1)] == [YES])) {
  2760.       if ([$2]) {
  2761.           if ([$[1]2] == [#]) {
  2762.          @ TEMP = [$2]
  2763.          @ NUM  = right(${@TEMP-index(# $2)+1} $2)
  2764.          if (NUM <= TOTPACK) {
  2765.             xdccecho List of pack #$NUM request received from $0\.
  2766.             @ TEMPFILE = []
  2767.             @ TEMPTOT  = 0
  2768.             @ COUNT0   = 1
  2769.             nnotice $0 Pack: $ARRAYDESC[$NUM]
  2770.             nnotice $0 Length     File
  2771.             while (COUNT0 <= ARRAYTOTF[$NUM]) {
  2772.                nnotice $0 $[10]ARRAYLENG[$NUM][$COUNT0] $X_FILE($ARRAYFILE[$NUM][$COUNT0])
  2773.                @ TEMPTOT  = TEMPTOT + ARRAYLENG[$NUM][$COUNT0]
  2774.                @ COUNT0   = COUNT0 + 1
  2775.             }
  2776.             nnotice $0 ---------- --------------------------------
  2777.             nnotice $0 $[10]TEMPTOT $ARRAYTOTF[$NUM] file\(s\)
  2778.          }
  2779.          {/nnotice $0 Pack $2 doesn't exist. Try /MSG $N XDCC LIST}
  2780.           }
  2781.           {/nnotice $0 XDCC LIST $2 is invalid. /MSG $N XDCC HELP.}
  2782.       }
  2783.       {
  2784.           if (TOTPACK > 0) {
  2785.          xdccecho All pack list request received from $0\.
  2786.          @ COUNT0 = 1
  2787.          nnotice $0 Pack Description
  2788.          while (COUNT0 <= TOTPACK) {
  2789.             nnotice $0 #$[3]COUNT0 $ARRAYDESC[$COUNT0]
  2790.             @ COUNT0 = COUNT0 + 1
  2791.          }
  2792.           }
  2793.           {/nnotice $0 No files offered.}
  2794.       }
  2795.       ^assign lastlister $right(10 $1)
  2796.       ^timer -delete 329
  2797.       ^timer -refnum 329 15 ^assign -lastlister
  2798.        }
  2799.        {
  2800.       nnotice $0 No files offered.
  2801.       pecho Unregistered user XDCC LIST request from $0.
  2802.        }
  2803.     }
  2804. }
  2805.  
  2806. alias SENDcommand {
  2807.    if ([$AUTOSEND] == [ON] || [$MYSEND] == [YES]) {
  2808.      if (([$SECURITY]==[OFF])||([$sec_check($0!$1)] == [YES])) {
  2809.       if ([$2]) {
  2810.      if ([$[1]2] == [#]) {
  2811.         @ TEMP = [$2]
  2812.         @ NUM  = right(${@TEMP-index(# $2)+1} $2)
  2813.         if (NUM <= TOTPACK) { 
  2814.            @ dcctmp = dcclimit - dccsent
  2815.            if (ARRAYTOTF[$NUM]>dcctmp) {
  2816.            xdccecho Sending $2 to $0 would exceed my limit of $dcclimit - $dccsent active.
  2817.            nnotice $0 I already have $dccsent DCCs active. Try later, please.
  2818.            }
  2819.            {
  2820.           xdccecho Sending $2 to $0\.
  2821.           nnotice $0 Sending you $ARRAYDESC[$NUM]\.
  2822.           xdcclog Sent $ARRAYDESC[$NUM] to $0\.
  2823.           @ COUNT1 = 1
  2824.           @ TEMPTOT = 0
  2825.           while (COUNT1 <= ARRAYTOTF[$NUM]) {
  2826.              ^dcc send $0 $ARRAYFILE[$NUM][$COUNT1]
  2827.              @ TEMPTOT = TEMPTOT + ARRAYLENG[$NUM][$COUNT1]
  2828.              @ COUNT1 = COUNT1 + 1
  2829.           }
  2830.          nnotice $0 Total files sent: $ARRAYTOTF[$NUM]\. You'll need $TEMPTOT bytes.
  2831.            }
  2832.         }
  2833.         {/nnotice $0 File $2 does not exist. /MSG $N XDCC LIST.}
  2834.      }
  2835.      {/nnotice $0 XDCC SEND $2 is invalid. /MSG $N XDCC HELP.}
  2836.       }
  2837.       {/nnotice $0 There is no such file.}
  2838.      }
  2839.      {
  2840.     nnotice $0 There is no such file.
  2841.     pecho Unregistered user XDCC SEND request from $0.
  2842.      }
  2843.    }
  2844.    {/nnotice $0 That function has been disabled.}
  2845. }
  2846.  
  2847. alias xdcc {
  2848.     if (match($0 LOAD PSEND CLOSE SAVE GET DIR AUTOCLOSE HELP LIST PLIST SEND STATUS NOTICE OFFER DOFFER LIMIT AUTOGET AUTOSEND NOISE GLIST OVERWRITE ULDIR DLDIR AUTORENAME AWAYCLOSE SEC))
  2849.     {$0MCOMMAND $1-}
  2850.     {/HELPMCOMMAND}
  2851. }
  2852.  
  2853. alias HELPMCOMMAND {/pecho Try /XDCC HELP. \(You must have PHOENIX.HLP loaded first\).}
  2854.  
  2855. alias LIMITmcommand {
  2856.     if ([$0]) {^assign TMPLIMIT $0}
  2857.     {^assign TMPLIMIT $word(0 $"[E/X] Enter new limit for DCC SENDS: ")}
  2858.     if ([$TMPLIMIT]!=[]) {
  2859.     ^assign dcclimit $TMPLIMIT
  2860.     ^assign -TMPLIMIT
  2861.     }
  2862.     /pecho XDCC Limit: $dcclimit\
  2863. }
  2864.  
  2865. alias PSENDmcommand {
  2866.      if (TOTPACK > 0)
  2867.      { @ TMPVAR = []
  2868.        @ NICKLIST = []
  2869.        ^assign TMPVAR $"[E/X] Pack to send: "
  2870.        if ([$TMPVAR]!=[])
  2871.          { if (TMPVAR <= TOTPACK)
  2872.            { ^assign NICKLIST $"[E/X] Nicks: "
  2873.             if ([$NICKLIST])
  2874.             { @ COUNT2 = 0
  2875.               @ MYSEND = [YES]
  2876.               while (word($COUNT2 $NICKLIST))
  2877.                 { SENDcommand $word($COUNT2 $NICKLIST) #$TMPVAR
  2878.                   @ COUNT2 = COUNT2 + 1 }
  2879.               @ MYSEND = [NO] }
  2880.             {} }
  2881.            { /pecho Pack #$TMPVAR doesn't exist. Try /XDCC LIST. } }
  2882.          {} }
  2883.      { /pecho There are no packs created.}
  2884. }
  2885.  
  2886. alias LISTmcommand {
  2887.    if ([$0]) {
  2888.        if ([$[1]0] == [#]) {
  2889.       @ TEMP = [$0]
  2890.       @ NUM  = right(${@TEMP-index(# $0)+1} $0)
  2891.       if (NUM <= TOTPACK) {
  2892.          @ COUNT2 = 1
  2893.          @ TEMPTOT = 0
  2894.          pecho PACK: $ARRAYDESC[$NUM]
  2895.          while (COUNT2 <= ARRAYTOTf[$NUM]) {
  2896.         pecho FILE: $ARRAYFILE[$NUM][$COUNT2]
  2897.         @ TEMPTOT = TEMPTOT + ARRAYLENG[$NUM][$COUNT2]
  2898.         @ COUNT2 = COUNT2 + 1
  2899.          }
  2900.          pecho TOTAL : $TEMPTOT Bytes on $ARRAYTOTF[$NUM] file\(s\) }
  2901.          {/pecho $0 pack doesn't exist.}
  2902.       }
  2903.       {/pecho /XDCC LIST $0 is not a valid format. Try /XDCC HELP LIST.}
  2904.        }
  2905.        {
  2906.        if (TOTPACK > 0) {
  2907.       @ COUNT2 = 1
  2908.       pecho Pack Description
  2909.       while (COUNT2 <= TOTPACK) {
  2910.          pecho #$[2]COUNT2  $ARRAYDESC[$COUNT2]
  2911.          @ COUNT2 = COUNT2 + 1
  2912.       }
  2913.        }
  2914.        {/pecho There are no files offered.}
  2915.    }
  2916. }
  2917.  
  2918. alias NOTICEmcommand {/say ** To get a list of files I'm offering /MSG $N XDCC LIST.}
  2919.  
  2920. alias PLISTmcommand {
  2921.      if (TOTPACK > 0)
  2922.      { /say ** PACKS OFFERED. /MSG $N XDCC SEND #N for autosend pack #N
  2923.        @ COUNT3 = 1
  2924.        while (COUNT3 <= TOTPACK)
  2925.           { /say #$COUNT3  $ARRAYDESC[$COUNT3]
  2926.            @ COUNT3 = COUNT3 + 1 } }
  2927.      { /pecho There are no files offered. }
  2928. }
  2929.  
  2930. alias SENDmcommand {
  2931.     @ TMPVAR = []
  2932.     ^assign TMPVAR $"[E/X] Files to send: "
  2933.      if ([$TMPVAR]!=[]) {
  2934.     if ([$getdir()] == [OK]) {
  2935.        ^assign NICKLIST $"[E/X] Nicks: "
  2936.        if ([$NICKLIST]) {
  2937.           dosend
  2938.           xdccecho Send finished.
  2939.        }
  2940.     }
  2941.     {/pecho Please check the files.}
  2942.      }
  2943. }
  2944.  
  2945. alias getdir {
  2946.      @ FILECOUNT = 0
  2947.      ^on -exec_error "DIR1 *" {/pecho Error: $1-}
  2948.      ^on ^exec "DIR1 *" addfile $$1-
  2949.      @ COUNT4 = 0
  2950.      while (word($COUNT4 $TMPVAR))
  2951.         { @ TMPFILE = word($COUNT4 $TMPVAR)
  2952.          if ([$[1]TMPFILE] == [/]) {}
  2953.          { @ TMPFILE = [$UPLOADDIR/$TMPFILE] }
  2954.          ^exec -name DIR1 ls -ld $TMPFILE
  2955.          ^wait %DIR1
  2956.          @ COUNT4 = COUNT4 + 1 }
  2957.      if ( FILECOUNT == 0 )
  2958.      { @ function_return = [ERROR] }
  2959.      { @ function_return = [OK] }
  2960. }
  2961.  
  2962. alias addfile {
  2963.      if ([$[1]0] == [-])
  2964.      { @ FILECOUNT = FILECOUNT + 1
  2965.        if ([$8])
  2966.          { @ FILELIST[$FILECOUNT] = [$8]
  2967.         @ FILELENG[$FILECOUNT] = [$4] }
  2968.          { @ FILELIST[$FILECOUNT] = [$7]
  2969.         @ FILELENG[$FILECOUNT] = [$3] } }
  2970. }
  2971.  
  2972. alias dosend {
  2973.      @ COUNT5 = 0
  2974.      while (word($COUNT5 $NICKLIST))
  2975.         { @ COUNT6  = 1
  2976.          @ SENDTOT = 0
  2977.          while (COUNT6 <= FILECOUNT)
  2978.             { ^dcc send $word($COUNT5 $NICKLIST) $FILELIST[$COUNT6]
  2979.         @ SENDTOT = SENDTOT + FILELENG[$COUNT6]
  2980.              @ COUNT6  = COUNT6 + 1 
  2981.         }
  2982.          /nnotice $word($COUNT5 $NICKLIST) $SENDTOT Bytes in $FILECOUNT file\(s\).
  2983.          @ COUNT5 = COUNT5 + 1 }
  2984. }
  2985.  
  2986. alias STATUSmcommand {
  2987.    pecho +--------+ Current XDCC Configuration +--------+
  2988.    pecho  Autoget Offered DCCs       $AUTOGET 
  2989.    pecho  Autosend from List         $AUTOSEND 
  2990.    pecho  Autoclose DCC SENDS        $AUTOCLOSE 
  2991.    pecho  Autoclose when AWAY        $AUTOCLOSEWHENAWAY 
  2992.    pecho  XDCC Noise                 $NOISE 
  2993.    pecho  Overwrite existing files   $OVERWRITE 
  2994.    pecho  AutoRename existing files  $AUTORENAME 
  2995.    pecho  Files Offered              $TOTPACK 
  2996.    pecho  Get Count                  $GETCOUNT 
  2997.    pecho  Upload Directory           $UPLOADDIR 
  2998.    pecho  Download directory         $DOWNLOADDIR 
  2999.    pecho +----------------------------------------------+
  3000. }
  3001.  
  3002. alias OFFERmcommand {
  3003.      @ TMPVAR  = []
  3004.      @ TMPDESC = []
  3005.      ^assign TMPVAR $"[E/X] Files: "
  3006.      if ([$TMPVAR])
  3007.      { if ([$getdir()] == [OK])
  3008.          { ^assign TMPDESC $"[E/X] Description: "
  3009.         if ([$TMPDESC])
  3010.            { @ TOTPACK = TOTPACK + 1
  3011.             @ COUNT = 1
  3012.             @ SENDTOTAL = 0
  3013.             while (COUNT <= FILECOUNT)
  3014.                { @ ARRAYFILE[$TOTPACK][$COUNT] = [$FILELIST[$COUNT]]
  3015.                 @ ARRAYLENG[$TOTPACK][$COUNT] = [$FILELENG[$COUNT]]
  3016.                 @ SENDTOTAL                   = SENDTOTAL + FILELENG[$COUNT]
  3017.                 @ ARRAYTOTF[$TOTPACK]         = [$FILECOUNT]
  3018.                 @ COUNT                       = COUNT + 1 }
  3019.                 @ SENDTOTAL = SENDTOTAL / 1024
  3020.                 if (FILECOUNT==1) {@ ARRAYDESC[$TOTPACK] = [$TMPDESC \[$SENDTOTAL\kb, $FILECOUNT file\]]}
  3021.                 {@ ARRAYDESC[$TOTPACK] = [$TMPDESC \[$SENDTOTAL\kb, $FILECOUNT files\]]}
  3022.                xdccecho $FILECOUNT files added to Pack #$TOTPACK\.
  3023.             
  3024.             chgst }
  3025.            {} }
  3026.          {/pecho Error: one or more of this files don't exist. } }
  3027. }
  3028.  
  3029. alias DOFFERmcommand {
  3030.      if (TOTPACK > 0)
  3031.      { @ TMPNUM = []
  3032.        ^assign TMPNUM $"[E/X] Pack to remove (* for all): "
  3033.        if ([$TMPNUM])
  3034.          { if ([$TMPNUM] == [*])
  3035.            { @ TOTPACK = 0
  3036.             chgst
  3037.             pecho All packs removed from offer list. }
  3038.            { if ((TMPNUM <= TOTPACK) && (TMPNUM > 0))
  3039.             { @ COUNT7 = TMPNUM
  3040.               while (COUNT7 < TOTPACK)
  3041.                 { @ COUNT8 = ARRAYTOTF[${COUNT7+1}]
  3042.                   while (COUNT8 > 0)
  3043.                     { @ ARRAYFILE[$COUNT7][$COUNT8] = [$ARRAYFILE[${COUNT7+1}][$COUNT8]]
  3044.                       @ ARRAYLENG[$COUNT7][$COUNT8] = [$ARRAYLENG[${COUNT7+1}][$COUNT8]]
  3045.                       @ COUNT8 = COUNT8 - 1 }
  3046.                   @ ARRAYDESC[$COUNT7] = [$ARRAYDESC[${COUNT7+1}]]
  3047.                   @ ARRAYTOTF[$COUNT7] = [$ARRAYTOTF[${COUNT7+1}]]
  3048.                   @ COUNT7             = COUNT7 + 1 }
  3049.               @ TOTPACK = TOTPACK - 1
  3050.               pecho Pack #$TMPNUM removed from offer list.
  3051.               chgst }
  3052.             { pecho Try a number between 1 and $TOTPACK\. } } }
  3053.         {} }
  3054.      { pecho There are no files offered. }
  3055. }
  3056.  
  3057. alias AUTOGETmcommand {
  3058.    if (match($0 ON OFF)) {/up_it AUTOGET $0}
  3059.    pecho Autogetting of offered files is $AUTOGET\.
  3060.    chgst
  3061. }
  3062.  
  3063. alias SECmcommand {
  3064.    if (match($0 ON OFF)) {/up_it SECURITY $0}
  3065.    pecho XDCC Security is $SECURITY\.
  3066.    chgst
  3067. }
  3068.  
  3069. alias AUTOSENDmcommand {
  3070.    if (match($0 ON OFF)) {/up_it AUTOSEND $0}
  3071.    pecho Autosending from offer list is $AUTOSEND\.
  3072.    chgst
  3073. }
  3074.  
  3075. alias AUTOCLOSEmcommand {
  3076.     if (match($0 ON OFF)) {/up_it AUTOCLOSE $0}
  3077.     pecho Autoclose offered files \(refuse send\) is $AUTOCLOSE\.
  3078.     chgst
  3079. }
  3080.  
  3081. alias AWAYCLOSEmcommand {
  3082.     if (match($0 ON OFF)) {/up_it AUTOCLOSEWHENAWAY $0}
  3083.     pecho Autoclose offered files \(refuse send\) when away is $AUTOCLOSEWHENAWAY\.
  3084.     chgst
  3085. }
  3086.  
  3087. alias AUTORENAMEmcommand {
  3088.    if (match($0 ON OFF)) {/up_it AUTORENAME $0}
  3089.    pecho AutoRenaming of existing offered files is $AUTORENAME\.
  3090.    chgst
  3091. }
  3092.  
  3093. alias NOISEmcommand {
  3094.     if (match($0 ON OFF)) {/up_it NOISE $0}
  3095.     pecho XDCC Noise is $NOISE\.
  3096.     chgst
  3097. }
  3098.  
  3099. alias OVERWRITEmcommand {
  3100.     if (match($0 ON OFF)) {/up_it OVERWRITE $0}
  3101.     pecho Overwrite existing files \(no prompting\) is $OVERWRITE\.
  3102. }
  3103.  
  3104. alias ULDIRmcommand {
  3105.    if ([$0]) {^assign newdir $0}
  3106.    {^assign newdir $"[E/X] New upload directory: " }
  3107.    if ([$newdir]!=[]) {
  3108.       ^assign olddir $W
  3109.       ^cd $newdir
  3110.       ^assign uploaddir $W
  3111.       ^cd $olddir
  3112.       ^assign -olddir
  3113.    }
  3114.    ^assign -newdir
  3115.    pecho Upload directory: $uploaddir\.
  3116. }
  3117.  
  3118. alias DLDIRmcommand {
  3119. if ([$0]) {^assign newdir $0}
  3120. {^assign newdir $"[E/X] New download directory: " }
  3121.    if ([$newdir]!=[]) {
  3122.       ^assign olddir $W
  3123.       ^cd $newdir
  3124.       ^assign downloaddir $W
  3125.       ^cd $olddir
  3126.       ^assign -olddir
  3127.     }
  3128.    ^assign -newdir
  3129.    pecho Download directory: $downloaddir\.
  3130. }
  3131.  
  3132. alias xdccecho if ([$NOISE] == [ON]) {/pecho $0-}
  3133.  
  3134. alias x_file {
  3135.      ^assign TMP $0
  3136.      if (rindex(/ $TMP))
  3137.      { @ function_return = right(${@TMP-rindex(/ $0)+1} $0) }
  3138.      { @ function_return = [$0] }
  3139. }
  3140.  
  3141. alias adddccrequest {
  3142.      @ GETCOUNT = GETCOUNT + 1
  3143.      @ ARRAYFILEGET[$GETCOUNT] = [$0]
  3144.      @ ARRAYNICKGET[$GETCOUNT] = [$1]
  3145.      chgst
  3146. }
  3147.  
  3148. alias CLOSEmcommand {
  3149.      if (GETCOUNT > 0)
  3150.      { @ TMPNICK = []
  3151.        ^assign TMPNICK $"[E/X] Nick to remove get files (* for all): "
  3152.        if ([$TMPNICK])
  3153.          { if ([$TMPNICK] == [*])
  3154.            { @ GETCOUNT = 0
  3155.             foreach ARRAYFILEGET XX
  3156.                 { //^dcc close get $ARRAYNICKGET[$XX] }
  3157.             chgst
  3158.             pecho All files removed from get list. }
  3159.            { @ COUNT8 = 1
  3160.             @ COUNT9 = 1
  3161.             @ COUNT10 = GETCOUNT
  3162.             while (COUNT9 <= COUNT10)
  3163.                { if ([$ARRAYNICKGET[$COUNT9]] != [$TMPNICK])
  3164.                 { @ ARRAYFILEGET[$COUNT8] = [$ARRAYFILEGET[$COUNT9]]
  3165.                   @ ARRAYNICKGET[$COUNT8] = [$ARRAYNICKGET[$COUNT9]]
  3166.                   @ COUNT8 = COUNT8 + 1 }
  3167.                 { //^dcc close get $TMPNICK
  3168.                   @ GETCOUNT = GETCOUNT - 1 }
  3169.                   @ COUNT9 = COUNT9 + 1 }
  3170.             chgst } }
  3171.          {} }
  3172.      { pecho There are no pending files. }
  3173. }
  3174.  
  3175. alias DIRmcommand {
  3176.      @ TMPVAR = []
  3177.      ^assign TMPVAR $"[E/X] Dir: "
  3178.      if ([$getdir()] == [OK])
  3179.      { @ COUNT8 = 1
  3180.        pecho Length     File
  3181.        while (COUNT8 <= FILECOUNT)
  3182.          { pecho $[10]FILELENG[$COUNT8] $FILELIST[$COUNT8]
  3183.            @ COUNT8 = COUNT8 + 1 } }
  3184. }
  3185.  
  3186. alias GETmcommand {
  3187.      if (GETCOUNT > 0)
  3188.      { @ TMPNICK = []
  3189.        ^assign TMPNICK $"[E/X] Nick to get files (* for all): "
  3190.        if ([$TMPNICK])
  3191.          { if ([$TMPNICK] == [*])
  3192.            { @ GETCOUNT = 0
  3193.             foreach ARRAYFILEGET XX {//^dcc get $ARRAYNICKGET[$XX] $ARRAYFILEGET[$XX]}
  3194.             chgst
  3195.             pecho All files taken from get list. }
  3196.            { @ COUNT8 = 1
  3197.             @ COUNT9 = 1
  3198.             @ COUNT10 = GETCOUNT
  3199.             pecho Getting all files offered from $TMPNICK\.
  3200.             while (COUNT9 <= COUNT10)
  3201.                { if ([$ARRAYNICKGET[$COUNT9]] != [$TMPNICK])
  3202.                 { @ ARRAYFILEGET[$COUNT8] = [$ARRAYFILEGET[$COUNT9]]
  3203.                   @ ARRAYNICKGET[$COUNT8] = [$ARRAYNICKGET[$COUNT9]]
  3204.                   @ COUNT8 = COUNT8 + 1 }
  3205.                 { //^dcc get $TMPNICK $ARRAYFILEGET[$COUNT9]
  3206.               @ GETCOUNT = GETCOUNT - 1 }
  3207.                 @ COUNT9 = COUNT9 + 1 }
  3208.             chgst } }
  3209.          {} }
  3210.      { pecho There are no files offered. }
  3211. }
  3212.  
  3213. alias GLISTmcommand {
  3214.      if (GETCOUNT > 0)
  3215.      { @ TMPNICK = []
  3216.        ^assign TMPNICK $"[E/X] Nick to list pending files (* for all): "
  3217.        if ([$TMPNICK])
  3218.          { @ COUNT11 = 1
  3219.         pecho Nick      File
  3220.         while (COUNT11 <= GETCOUNT)
  3221.              { if (match($TMPNICK $ARRAYNICKGET[$COUNT11]))
  3222.                { pecho $[9]ARRAYNICKGET[$COUNT11] $ARRAYFILEGET[$COUNT11] }
  3223.                {}
  3224.             @ COUNT11 = COUNT11 + 1 } }
  3225.          {} }
  3226.      { pecho There are no pending files. }
  3227. }
  3228.  
  3229. alias LOADmcommand {
  3230.      if ([$0])
  3231.      { eval /pecho Loading XDCC Offer file....
  3232.        @ OLDNUM     = TOTPACK
  3233.        @ LOAD_ERROR = [NO]
  3234.        @ LINECOUNT  = 0
  3235.        @ COUNT12    = [desc comment]
  3236.        ^on exec_error "load_files *" {
  3237.           pecho Error: $1-
  3238.           @ LOAD_ERROR = [YES] }
  3239.        ^on ^exec "load_files *" add_line $$1-
  3240.        ^exec -name load_files cat $0
  3241.        ^wait %load_files
  3242.        if ([$LOAD_ERROR] == [NO])
  3243.          { eval /pecho Checking file...
  3244.         @ COUNT = 1
  3245.         while (COUNT <= LINECOUNT)
  3246.              { add_file $XDCCFILELINE[$COUNT]
  3247.             @ COUNT = COUNT + 1 }
  3248.         if (ARRAYTOTF[$TOTPACK] == 0)
  3249.            { @ TOTPACK = TOTPACK - 1 }
  3250.            {}
  3251.         chgst }
  3252.          {}
  3253.        if ([$LOAD_ERROR] == [NO])
  3254.          { eval /pecho Offer file loaded correctly.}
  3255.          { @ TOTPACK = OLDNUM } }
  3256.      {
  3257.               if ([$OFFERFILE]!=[]) {
  3258.                   /pecho Default: loading $OFFERFILE\...
  3259.                   /loadmcommand $OFFERFILE
  3260.               }
  3261.               {/pecho No such file. Try /XDCC HELP LOAD.}
  3262.      }
  3263. }
  3264.  
  3265. alias SAVEmcommand {
  3266.      if ([$0])
  3267.      { /pecho Saving file...
  3268.        @ TEMP1      = [$1-]
  3269.        @ SAVE_ERROR = [NO]
  3270.        @ TEMP2 = []
  3271.        @ COUNT = 0
  3272.        @ LINECOUNT = 0
  3273.        if ([$1])
  3274.          { while (word($COUNT $TEMP1))
  3275.              { if ([$[1]word($COUNT $TEMP1)] != [#])
  3276.                { /pecho Error: $word($COUNT $TEMP1) is not a valid pack format.
  3277.                 @ SAVE_ERROR = [YES] }
  3278.                { @ TEMP = word($COUNT $TEMP1)
  3279.                 @ NUM  = right(${@TEMP-1} $TEMP)
  3280.                 if (NUM > TOTPACK)
  3281.                 { /pecho Error: #$NUM does't exist.
  3282.                   @ SAVE_ERROR = [YES] }
  3283.                 { @ TEMP2 = [$TEMP2] ## [ $NUM] } }
  3284.             @ COUNT = COUNT + 1 } }
  3285.          { while (COUNT < TOTPACK)
  3286.              { @ COUNT = COUNT + 1
  3287.             @ TEMP2 = [$TEMP2] ## [ $COUNT] } }
  3288.        if ([$SAVE_ERROR] != [YES])
  3289.          { @ COUNT = 0
  3290.         @ SAVE_ERROR = [NO]
  3291.         while (word($COUNT $TEMP2))
  3292.              { add_line Comment Pack $COUNT
  3293.             add_line desc $ARRAYDESC[$word($COUNT $TEMP2)]
  3294.             @ COUNT1 = 0
  3295.             while (COUNT1 < ARRAYTOTF[$word($COUNT $TEMP2)])
  3296.                  { @ COUNT1 = COUNT1 + 1
  3297.                 add_line files $ARRAYFILE[$word($COUNT $TEMP2)][$COUNT1] }
  3298.             @ COUNT = COUNT + 1 }
  3299.         ^on exec_error "save_xdcc_file *" {
  3300.             pecho Error: $1-
  3301.             @ SAVE_ERROR = [YES] }
  3302.         @ COUNT = 0
  3303.         while (COUNT < LINECOUNT)
  3304.              { @ COUNT = COUNT + 1
  3305.             ^exec -name s_xdcc_f echo $XDCCFILELINE[$COUNT] >> $0
  3306.             wait %s_xdcc_f }
  3307.         if ([$SAVE_ERROR] = [NO])
  3308.            { /pecho File saved correctly.}
  3309.            {} }
  3310.          {} }
  3311.      { /pecho What filename? Try /XDCC HELP SAVE. }
  3312. }
  3313.  
  3314. alias add_line {
  3315.      @ LINECOUNT                = LINECOUNT + 1
  3316.      @ XDCCFILELINE[$LINECOUNT] = [$0-]
  3317. }
  3318.  
  3319. alias add_file {
  3320.      if (match($0 $COUNT12))
  3321.      { if ([$0] == [desc])
  3322.          { @ OLDNUM = TOTPACK
  3323.         if ((TOTPACK >= 0) && (ARRAYTOTF[$TOTPACK] == 0)) {}
  3324.         { @ TOTPACK = TOTPACK + 1 }
  3325.         @ ARRAYDESC[$TOTPACK] = [$1-]
  3326.         @ ARRAYTOTF[$TOTPACK] = 0
  3327.         @ COUNT12             = [files comment] }
  3328.          { if ([$0] == [files])
  3329.            { @ COUNT12 = [desc files comment]
  3330.             @ TMPVAR = [$1-]
  3331.             if ([$getdir()] == [OK])
  3332.             { @ COUNT13 = 1
  3333.               while (COUNT13 <= FILECOUNT)
  3334.                 { @ ARRAYTOTF[$TOTPACK] = ARRAYTOTF[$TOTPACK] + 1
  3335.                   @ ARRAYFILE[$TOTPACK][$ARRAYTOTF[$TOTPACK]] = [$FILELIST[$COUNT13]]
  3336.                   @ ARRAYLENG[$TOTPACK][$ARRAYTOTF[$TOTPACK]] = [$FILELENG[$COUNT13]]
  3337.                   @ COUNT13 = COUNT13 + 1 } }
  3338.             {} }
  3339.            {} }
  3340.          {} }
  3341.      { @ LOAD_ERROR = [YES]
  3342.        pecho Error loading offer file on line:
  3343.        pecho [$COUNT] $0-
  3344.        pecho First word on line isn't [$COUNT12]\.
  3345.        @ COUNT = LINECOUNT }
  3346. }
  3347.  
  3348. ### Miscellaneous Junk
  3349.  
  3350. alias bye {
  3351.    sf_assigning
  3352.    @ byecount = [$rand($byenum)]
  3353.    ^assign gone $(sf$byecount)
  3354.    signoff $gone
  3355. }
  3356.  
  3357. alias sf_assigning {
  3358.   ^assign byenum 68
  3359.   @ sf1=[Sorrow paid for valor is too much to recall.]
  3360.   @ sf2=[Shun words of the bible, we need implements of war.]
  3361.   @ sf3=[Destiny, the crooked schemer, says the dead shall rise again.]
  3362.   @ sf4=[Demonic link?]
  3363.   @ sf5=[bad, Bad, REAL BAD link?]
  3364.   @ sf6=[Missing link?]
  3365.   @ sf7=[Chain link?]
  3366.   @ sf8=[Where do we go from here?]
  3367.   @ sf9=[And should we really care?]
  3368.   @ sf10=[The end is finally here. God have mercy!]
  3369.   @ sf11=[Sweet taste of vindication, It turns to ashes in your mouth.]
  3370.   @ sf12=[If you're fighting to live, It's ok to die!]
  3371.   @ sf13=[The answer to your question is...Welcome to tomorrow!]
  3372.   @ sf14=[Blue sky, Black death, I'm off to meet my maker!]
  3373.   @ sf15=[Jump or die!]
  3374.   @ sf16=[Assassin in stealth, Assailant from hell.]
  3375.   @ sf17=[Part Bionic, and Organic...Not a Cyborg.]
  3376.   @ sf18=[Feeling claustrophobic, like the walls are closing in.]
  3377.   @ sf19=[Blood stains on my hands and I don't know where I've been.]
  3378.   @ sf20=[Killed (AliJah (Flood ME, will ya??!?@!@))]
  3379.   @ sf21=[Killed (GOD (Flood ME, will ya???!?@1!@1!!))]
  3380.   @ sf22=[Fucked up link?]
  3381.   @ sf23=[Funky link?]
  3382.   @ sf24=[I'm in trouble for the things I haven't got to yet.]
  3383.   @ sf25=[I'm sharpening the axe and my palms are getting wet.]
  3384.   @ sf26=[Sweating Bullets!]
  3385.   @ sf27=[My icy fingers claw your back...here I come again!]
  3386.   @ sf28=[No escaping pain, you belong to me.]
  3387.   @ sf29=[Clinging on to life, by the skin o' my teeth.]
  3388.   @ sf30=[I need a ride to the morgue, that's what 911 is for.]
  3389.   @ sf31=[That that doesn't kill me, only makes me stronger.]
  3390.   @ sf32=[Born from the dark, in the black cloak of night.]
  3391.   @ sf33=[Set the world Afire!!!]
  3392.   @ sf34=[They said it'd never come, we knew it was a lie.]
  3393.   @ sf35=[All forms of life die now, the humans all succumb.]
  3394.   @ sf36=[Time to kiss your ass goodbye, the end has just begun.]
  3395.   @ sf37=[No time to change your fate, no time left, it's too late.]
  3396.   @ sf38=[And if it comes, the living will envy the dead!]
  3397.   @ sf39=[No one will be left to prove the humans existed.]
  3398.   @ sf40=[We all live on one planet and it will all go up in smoke.]
  3399.   @ sf41=[To bad they couldn't see this lethal energy.]
  3400.   @ sf42=[And now the final scene, a global darkening...]
  3401.   @ sf43=[Einstein said `We'll use rocks on the other side'.]
  3402.   @ sf44=[Oh shit, cops at my door!1!!@!!1!1!@!@@1!!]
  3403.   @ sf45=[Badd link?]
  3404.   @ sf46=[Supercalifragilisticexpealidotious link?]
  3405.   @ sf47=[Killed (Vassago (Hey, who said you could use this script? :>))]
  3406.   @ sf48=[No Survivors!!!!!! Set the World Afire!!!!]
  3407.   @ sf49=[I walk, I walk alone, into the promised land...]
  3408.   @ sf50=[There's a better place for me, but it's far, far away...]
  3409.   @ sf51=[Everlasting life for me, in a perfect world.]
  3410.   @ sf52=[But I gotta die first, please God send me on my way!]
  3411.   @ sf53=[You just laughed, ha ha, bitch.]
  3412.   @ sf54=[But the time has come when all things shall pass.]
  3413.   @ sf55=[This good thing passed away.]
  3414.   @ sf56=[Forgive me father, for I have sinned.]
  3415.   @ sf57=[I'm a child of the air, I'm a witch of the wind.]
  3416.   @ sf58=[Lie, steal and cheat, a real bad guy!]
  3417.   @ sf59=[I'm not a fish, I'm a man!]
  3418.   @ sf60=[Perhaps I'll try real life for awhile.]
  3419.   @ sf61=[Pull over, shithead, this is the cops!]
  3420.   @ sf62=[Rot in hell, it's time you know...to your master, off you go!]
  3421.   @ sf63=[/<rad link?]
  3422.   @ sf64=[Illegal w00p by link?]
  3423.   @ sf65=[Unbelievable Error]
  3424.   @ sf66=[Excess Lameness]
  3425.   @ sf67=[Killed (Mom (Don't hang around with them!  They're troublemakers!))]
  3426. }
  3427.  
  3428. alias ABOUTGCOMMAND {
  3429.   echo +------------------+  PhoEniX Version 2.13 from Vassago  +------------------+
  3430.   echo  This script has been made possible through the hard work and testing of    
  3431.   echo  many people. To create it, I used many different scripts as well as my own,
  3432.   echo  edited and changed to work correctly with PhoEniX. To date, these people
  3433.   echo  are YaZoO, XaBi, TG, & CKeeper. Thanks also go to the following script
  3434.   echo  contributors: Robey, Fred1, Eagle-1, Daemon, WinterHawk, and BeeF.
  3435.   echo +----------------------------------------------------------------------------+
  3436. }
  3437.  
  3438. ### Ending/Loading Stuff
  3439.  
  3440. EVAL pecho Loading Save, XDCC file list, and Notify files...
  3441. EVAL load $asve
  3442. EVAL load $PhoEniXDir/notify.ex
  3443. EVAL if ([$TOOPVIEW]==[ON]) {/EVAL OV}
  3444. EVAL makefriends
  3445. EVAL chgst
  3446. EVAL pecho Vassago's PhoEniX Version 2.13 is now loaded.
  3447. EVAL do301
  3448. EVAL do317
  3449. EVAL your_host
  3450. EVAL $srand($time())
  3451. EVAL quote PING $time() $S
  3452. EVAL quote MODE $N $usermode
  3453. EVAL ^timer 30 ^assign -SCRIPTLOADING
  3454.  
  3455.