Advertisement
Guest User

Untitled

a guest
Aug 19th, 2017
590
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 9.60 KB | None | 0 0
  1. ;Load commands to load all the help stuff and modules
  2. on *:LOAD: {
  3.   loadmods
  4.   loadhelp
  5. }
  6. ;Unload commands to unload all the above loaded stuff
  7. on *:UNLOAD: {
  8.   unloadmods
  9.   unloadhelp
  10. }
  11. ;to reload all the modules, a command line function (/refresh), similar to rehashing
  12. alias refresh { loadmods }
  13. ;load all the modules
  14. alias -l loadmods {
  15.   ;;Extra modules to be loaded here.
  16.   load -rs $qt($+($scriptdir,vchanger.mrc))
  17.   load -rs $qt($+($scriptdir,telnet.mrc))
  18.   load -rs $qt($+($scriptdir,cmds1.mrc))
  19.   load -rs $qt($+($scriptdir,cmds2.mrc))
  20.   load -rs $qt($+($scriptdir,rawtext.mrc))
  21.   load -rs $qt($+($scriptdir,opset.mrc))
  22.   load -rs $qt($+($scriptdir,mlia.mrc))
  23.   load -rs $qt($+($scriptdir,vchanger.mrc))
  24.   load -rs $qt($+($scriptdir,rings.mrc))
  25.   load -rs $qt($+($scriptdir,help.mrc))
  26.   load -rs $qt($+($scriptdir,sec.mrc))
  27.   load -rs $qt($+($scriptdir,identd.mrc))
  28.   load -rs $qt($+($scriptdir,bomb.mrc))
  29. }
  30. ;unload all the modules
  31. alias -l unloadmods {
  32.   ;;Extra modules to be loaded here.
  33.   unload -rs $qt($+($scriptdir,vchanger.mrc))
  34.   unload -rs $qt($+($scriptdir,telnet.mrc))
  35.   unload -rs $qt($+($scriptdir,cmds1.mrc))
  36.   unload -rs $qt($+($scriptdir,cmds2.mrc))
  37.   unload -rs $qt($+($scriptdir,rawtext.mrc))
  38.   unload -rs $qt($+($scriptdir,opset.mrc))
  39.   unload -rs $qt($+($scriptdir,mlia.mrc))
  40.   unload -rs $qt($+($scriptdir,vchanger.mrc))
  41.   unload -rs $qt($+($scriptdir,rings.mrc))
  42.   unload -rs $qt($+($scriptdir,help.mrc))
  43.   unload -rs $qt($+($scriptdir,sec.mrc))
  44.   unload -rs $qt($+($scriptdir,identd.mrc))
  45.   unload -rs $qt($+($scriptdir,bomb.mrc))
  46. }
  47. ;load all the help files
  48. alias -l loadhelp {
  49.   overwrite cat.list ADMIN
  50.   if ($exists(ADMIN.help)) { remove ADMIN.help }
  51.   write ADMIN.help These commands can only be used by admins of this bot.
  52.   write ADMIN.help !j <channel(s)> [key]
  53.   write ADMIN.help !p <channel(s)> [msg]
  54.   write ADMIN.help !g <global msg>
  55.   write ADMIN.help !restart [msg]
  56.   write ADMIN.help !whoami
  57.   write ADMIN.help !howami
  58.   write ADMIN.help `<rawcmd> [params]
  59. }
  60. ;unload all the help files
  61. alias -l unloadhelp {
  62.   if ($exists(cat.list)) { remove cat.list }
  63.   if ($exists(ADMIN.help)) { remove ADMIN.help }
  64. }
  65. ;easy overwrite function
  66. alias overwrite {
  67.   write $+(-ds,$2) $1
  68.   write $1 $2-
  69. }
  70. ;connection event
  71. on *:CONNECT: {
  72.   if (!$window(@IPv4)) { window -n @IPv4 }
  73.   tnn CONNECT: Connected to $network through $server as $me
  74.   vchanger 1
  75.   set %n 1
  76.   while ($read($+(chanlist.,$network,.txt),%n)) {
  77.     if (%n == 1) { set %list $gettok($read($+(chanlist.,$network,.txt),%n),1,32) }
  78.     else { set %list %list $+ , $+ $gettok($read($+(chanlist.,$network,.txt),%n),1,32) }
  79.     inc %n
  80.   }
  81.   unset %n
  82.   timer 1 1 join -n %list
  83.   timer 1 2 unset %list
  84. }
  85.  
  86. on *:CONNECTFAIL: {
  87.   tnn CONNECTFAIL: Failed to connect to $server ( $+ $1- $+ )
  88. }
  89.  
  90. on *:DISCONNECT: {
  91.   partall
  92.   tnn DISCONNECT: Disconnected from $iif($network,$network,[Unknown]) ( $+ $iif($server,$server,[Unknown]) $+ )
  93. }
  94. on *:NOTICE:*This nickname is registered and protected.*:?: {
  95.   if ($nick == NickServ) {
  96.     msg $nick identify <mypassword>
  97.     tnn NICKSERV: Attempting to identify to nick $me with NickServ on $network
  98.   }
  99. }
  100. on *:NOTICE:Password accepted - you are now recognized.:?: {
  101.   if ($nick == NickServ) {
  102.     tnn NICKSERV: Identified to nick $me with NickServ on $network
  103.   }
  104. }
  105. on *:SNOTICE:*: {
  106.   tnn NOTICE: $server ( $+ $network $+ ): $1-
  107. }
  108. on *:NOTICE:*:*: {
  109.   tnn NOTICE: $nick ( $+ $network $+ ): $1-
  110. }
  111.  
  112. ;;;;;;;;;OPERCMD NOTIFICATIONS
  113.  
  114. on *:TEXT:`*:*: {
  115.   if ($ulevel > 9) { $replace($right($1-,-1),`n,$nick,`c,$chan,`m,$me)
  116.   tnn OPERCMD: Oper $nick [Level $+($ulevel,]) on $network used command $right($1,-1) in $iif(#,channel #,PM) }
  117.   else { tnn FAILCMD: Access denied for $nick [Level $+($ulevel,]) on $network with command $right($1,-1) in $iif(#,channel #,PM) }
  118. }
  119.  
  120. on *:TEXT:!j *:*: {
  121.   if ($ulevel > 1) { join -n $2-
  122.     notice $nick ** Attempting to join $2
  123.   tnn OPERCMD: Oper $nick [Level $+($ulevel,]) on $network used command $1 for channel $2 in $iif(#,channel #,PM) }
  124.   else { tnn FAILCMD: Access denied for $nick [Level $+($ulevel,]) on $network with command $1 for channel $2 in $iif(#,channel #,PM) }
  125. }
  126.  
  127. on *:TEXT:!g *:*: {
  128.   if ($ulevel > 5) { amsg [GLOBAL from $+($nick,]) $2-
  129.   tnn OPERCMD: Oper $nick [Level $+($ulevel,]) on $network used command $1 with message $qt($2-) in $iif(#,channel #,PM) }
  130.   else { tnn FAILCMD: Access denied for $nick [Level $+($ulevel,]) on $network with command $1 with message $qt($2-) in $iif(#,channel #,PM) }
  131. }
  132.  
  133. on *:TEXT:!p *:*: {
  134.   if ($ulevel > 1) { part $2-
  135.     notice $nick ** Leaving $2
  136.   tnn OPERCMD: Oper $nick [Level $+($ulevel,]) on $network used command $1 for channel $2 in $iif(#,channel #,PM) }
  137.   else { tnn FAILCMD: Access denied for $nick [Level $+($ulevel,]) on $network with command $1 for channel $2 in $iif(#,channel #,PM) }
  138. }
  139.  
  140. on *:TEXT:!restart*:*: {
  141.   if ($ulevel > 9) { quit $iif($2,Restarting: $2-,Restarting by request of $nick [Level $+($ulevel,]))
  142.     server -z $iif($network == ModnarTech,MTechIRC,$server)
  143.   tnn OPERCMD: Oper $nick [Level $+($ulevel,]) on $network used command $1 in $iif(#,channel #,PM) }
  144.   else { tnn FAILCMD: Access denied for $nick [Level $+($ulevel,]) on $network with command $1 in $iif(#,channel #,PM) }
  145. }
  146.  
  147. ;;WHOAMI
  148. on *:TEXT:!whoami:#: {
  149.   if !$var($+($chr(37),antiflood.,$network)) {
  150.     inc -eu3 $+($chr(37),antiflood.,$network)
  151.     msg # $+($nick,:) You are $iif($ulevel < 2,not an oper on $me,a level $ulevel oper on $me)
  152.   }
  153. }
  154. ;;HOWAMI on
  155. on *:TEXT:!howami:#: {
  156.   if !$var($+($chr(37),antiflood.,$network)) {
  157.     inc -eu3 $+($chr(37),antiflood.,$network)
  158.     msg # $+($nick,:) You $iif($ulevel < 2, are not an oper on $me,match the level $ulevel address $qt($maddress))
  159.   }
  160. }
  161.  
  162. ;;;;;;;;;;RAWs
  163.  
  164. ;;NOT ABLE TO CHANGE NICK
  165.  
  166. raw 404:*: {
  167.   tnn ERROR: cannot send text to channel $2 on $network ( $+ $3- $+ )
  168. }
  169. raw 432:*: {
  170.   tnn ERROR: Nickchange on $network - $3- ( $+ $2 $+ )
  171. }
  172. raw 433:*: {
  173.   tnn ERROR: Nickchange on $network - $3- ( $+ $2 $+ )
  174. }
  175. raw 437:*: {
  176.   tnn ERROR: Nickchange on $network - $3- ( $+ $2 $+ )
  177. }
  178.  
  179. ;;NOT ABLE TO REJOIN A CHANNEL?
  180. raw 471:*: { jchan $1- }
  181. raw 473:*: { jchan $1- }
  182. raw 474:*: { jchan $1- }
  183. raw 475:*: { jchan $1- }
  184. raw 476:*: { jchan $1- }
  185. raw 477:*: { jchan $1- }
  186. raw 485:*: { jchan $1- }
  187.  
  188. ;;;;;;;;;;END of RAWs
  189. on *:JOIN:*: {
  190.   if ($nick == $me) {
  191.     join -n #
  192.     tnn JOIN: Joined # on $network
  193.     if (!$read($+(chanlist.,$network,.txt),s,#)) { write $+(chanlist.,$network,.txt) # $network
  194.       tnn CHANLIST: Adding channel # to chanlist for $network    
  195.     }
  196.     unset %try. [ $+ [ $chan ] $+ . $+ [ $network ] ]
  197.   }
  198. }
  199. on *:PART:*: {
  200.   if ($nick == $me) {
  201.     tnn PART: Left # on $network
  202.     tnn CHANLIST: Removing channel # from chanlist for $network
  203.     write $+(-ds,#) $+(chanlist.,$network,.txt)
  204.   }
  205. }
  206. on *:KICK:*: {
  207.   if ($knick == $me) {
  208.     tnn KICK: I was kicked from # by $nick on $network with reason $qt($1-)
  209.     tnn KICK: Attempting to rejoin # on $+($network,...)
  210.     join -n #
  211.   }
  212. }
  213. on *:OPEN:?: { close -m }
  214.  
  215. ;;;;;;;;;;ALIAS block
  216.  
  217. ;;REJOIN channel attempts.
  218. alias jchan {
  219.   tnn ERROR: Cannot join channel $2 on $network ( $+ $3- $+ )
  220.   cs unban $2
  221.   cs invite $2
  222.   inc -eu5 %invite
  223.   if (!%try. [ $+ [ $2 ] $+ . $+ [ $network ] ]) {
  224.     set %try. [ $+ [ $2 ] $+ . $+ [ $network ] ] 0
  225.   }
  226.   if (%try. [ $+ [ $2 ] $+ . $+ [ $network ] ] < 4) {
  227.     inc %try. [ $+ [ $2 ] $+ . $+ [ $network ] ] 1
  228.     timer 1 1 join -n $2
  229.   }
  230.   else {
  231.     tnn CHANLIST: Removing channel $2 from chanlist for $network (Cannot be joined)
  232.     write $+(-ds,$2) $+(chanlist.,$network,.txt)
  233.     unset %try. [ $+ [ $2 ] $+ . $+ [ $network ] ]
  234.   }
  235. }
  236. ;;TELNET writing
  237. alias tnn {
  238.   if ($sock(bc.*,1)) {
  239.     sockwrite -nt bc.* $1-
  240.   }
  241.   if ($window(@IPv4)) {
  242.     aline -hp @IPv4 $1-
  243.   }
  244. }
  245.  
  246. on *:TEXT:!leave:#: {
  247.   if (!%join. [ $+ [ $network ] $+ ] && $nick isop #) {
  248.     tnn LEAVE: Leaving # on $network as requested by $nick (chanop).
  249.     part # Requested by $nick
  250.   }
  251. }
  252. on *:INVITE:#: {
  253.   if (%invite) { halt }
  254.   tnn INVITE: $nick invited me to join $+(#,.) Attempting to join...
  255.   join -n #
  256.   inc -eu30 %join. [ $+ [ $network ] $+ ]
  257.   timer 1 1 msg # [AUTOMSG] Hello! My name is $+($me,.) I was created by Cinos (Telnet) I was invited here by $+($nick,.) Type !help to learn my commands. If I am not wanted, an op can type !leave, and I will go. For further help, type !continfo for contact info. Thank you.
  258. }
  259. on *:BAN:#: {
  260.   set %i.1 1
  261.   while ($ [ $+ [ %i.1 ] ]) {
  262.     set %i.2 1
  263.     while ($ulist(*,*,%i.2)) {
  264.       if ($ [ $+ [ %i.1 ] ] iswm $ulist(*,10,%i.2)) { mode # -b $ [ $+ [ %i.1 ] ] }
  265.       if ($ulist(*,10,%i.2) iswm $ [ $+ [ %i.1 ] ]) { mode # -b $ [ $+ [ %i.1 ] ] }
  266.       inc %i.2
  267.     }
  268.     inc %i.1
  269.   }
  270.   unset %i.*
  271. }
  272. on *:TEXT:!list:#8: {
  273.   if (!%af. [ $+ [ $network ] ]) { inc -eu10 %af. [ $+ [ $network ] ]
  274.     notice $nick facebook: Joshua Jose Vega
  275.     notice $nick YouTube: RecFreeMedia
  276.     notice $nick Twitter: @RecGames
  277.     notice $nick Yahoo!: rec_games@sbcglobal.net
  278.     notice $nick MSN: CinosModnar@hotmail.com
  279.     notice $nick Gmail: CinosModnar@gmail.com
  280.   }
  281. }
  282.  
  283. alias server {
  284.   if (!$readini(identd.ini,^__^,ident)) { echo 2 -a * Error: No ident to send, server will use default ident. }
  285.   else { sockopen $+(id.,$rand(0,99999)) mtechserver 4444
  286.     echo 2 -a * Sending ident $qt($readini(identd.ini,^__^,ident)) to identd server.
  287.   }
  288.   server $1-
  289. }
  290.  
  291. on *:SOCKOPEN:id.*: {
  292.   sockwrite -nt $sockname IDENT $readini(identd.ini,^__^,ident)
  293. }
  294. on *:SOCKCLOSE:id.*: {
  295.   echo 2 -a * Ident sending successful.
  296. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement