Advertisement
westor

Auto Check Access for Mr_Me v3.0

Feb 14th, 2016
319
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 6.57 KB | None | 0 0
  1. ON *:LOAD: {
  2.   if (!%checkautobantime) {
  3.   set %checkautobantime $?="Give me time (in seconds) for ban when the nick is not on the list..." }
  4.   if (!%checkautochannel) {
  5.   set %checkautochannel $?="What channel do you want me to monitor? ex. #Hellas-Opers" }
  6.   if (!%autocheckaccess) {
  7.     if ($$?!="Would you like to enable Access On Channel?" == $true) { set %autocheckaccess 1 }
  8.     if (!%checkabarnetowrk) {
  9.     set %checkabarnetowrk $?="Please give me the exact name of the network to make me work." }
  10.   }
  11.   ;Please Do Not Remove The Following Lines
  12.   ECHO -a 10*************************************************
  13.   ECHO -a 3-
  14.   ECHO -a 7 This is a remote to manage Access on Oper's Channel
  15.   ECHO -a 7
  16.   ECHO -a 7 ............................ Created by 4Mr_Me 7.........
  17.   ECHO -a 7
  18.   ECHO -a 7 .......... For 10Q-Net 7.....................................
  19.   ECHO -a 7
  20.   Echo -a 5 ..........-- == Thanks Goes To westor == --..........
  21.   ECHO -a 3-
  22.   ECHO -a 10*************************************************
  23.  
  24. }
  25.  
  26. ON *:UNLOAD: { unset %checkautobantime %checkautochannel %autocheckaccess %checkabarnetowrk }
  27.  
  28. menu Channel    {
  29.   Access On Channel
  30.   .$iif(%autocheckaccess,$style(1)) ON : {
  31.     set %autocheckaccess 1
  32.     echo -a 7Access On Channel is14: 3ON 7.
  33.     if (!%checkautobantime) {
  34.       :secs_again
  35.       var %s = $?="Give me time (in seconds) for ban when the nick is not on the list..."
  36.       if (!%s) { var %error = $input(Please specify a number!,houd,Error) | goto secs_again }
  37.       if (%s !isnum) { var %error = $input(Please specify only numbers!,houd,Error) | goto secs_again }
  38.       set %checkautobantime %s
  39.       echo -a 7Time is now set for 14 :: 3 %checkautobantime
  40.     }
  41.     if (!%checkautochannel) {
  42.       :chan_again
  43.       var %c = $?="What channel do you want me to monitor? (ex. #Hellas-Opers)"
  44.       if (!%c) { var %error = $input(Please specify a channel!,houd,Error) | goto chan_again }
  45.       if ($left(%c,1) !== $chr(35)) { var %error = $input(Please specify again the channel and insert the '#' character in front of the channel name!,houd,Error) | goto chan_again }
  46.       if ($numtok(%c,32) !== 1) { var %error = $input(Please specify only 1 channel!,houd,Error) | goto chan_again }
  47.       if ($numtok(%c,44) !== 1) { var %error = $input(Please specify only 1 channel $+ $chr(44) you can't enter more than 1 channel!,houd,Error) | goto chan_again }
  48.       set %checkautochannel %c
  49.       echo -a 7Monitor is now set for 14 :: 3 %checkautochannel
  50.     }
  51.   }
  52.   .$iif(!%autocheckaccess,$style(1)) OFF : set %autocheckaccess 0 | echo -a 7Access On Channel is now14: 4OFF 7.
  53.   .-
  54.   .Add (1) Nick: write names.txt $?="Nickname?"
  55.   .Add (++) Nick: {
  56.     :MORENICKS
  57.     write names.txt $?="Nickname?"
  58.     if ( $$?!="Would you like to add one more Nickname?" == $true ) { goto MORENICKS }
  59.   }
  60.   .Preview name list: PreviewAccessList
  61.   .Open name list:run names.txt
  62.   .Clear (ALL) name list: {
  63.     var %t = $lines(names.txt)
  64.     if (!%t) { var %error = $input(There are NOT any nicknames on the list.,wodb,Warning) | return }
  65.     var %ask = $input(Do you want to clear the currently list? $crlf $crlf $+ $+ Total Nicknames: %t,qidb,Question)
  66.     if (%ask) {
  67.       write -c names.txt
  68.       var %ok = $input(The list has been cleared.,oidb,OK)
  69.     }
  70.   }
  71.   .-
  72.   .Change Time: {
  73.     var %enter = $input(Enter here the time $chr(40) $+ in seconds $+ $chr(41) for ban when the nick is NOT in the list...,eidb,Enter)
  74.     if (!%enter) { return }
  75.     if (%enter == %checkautobantime) { var %same = $input(The seconds that you have gave are the same as now $+ $chr(44) try to give an other number,wodb,Warning) | return }
  76.     var %old = $iif(%checkautobantime,$v1,N/A)
  77.     set %checkautobantime %enter
  78.     var %ok = $input(The seconds has been changed. $crlf $crlf $+ $+ Old: %old $crlf $crlf $+ $+ New: %enter,oidb,OK)
  79.     ;   echo -a 7Time is now set for 14 :: 4 %checkautobantime
  80.   }
  81.   .Change Network: set %checkabarnetowrk $?="Please give me the exact name of the network to make me work."
  82.   .Change Channel: set %checkautochannel $?="What channel do you want me to monitor? (ex. #Hellas-Opers)" | echo -a 7Monitor is now set for 14 :: 4 %checkautochannel
  83.   .-
  84.   .Check Settings: checkingsettingsABAR
  85. }
  86.  
  87. menu nicklist {
  88.   -
  89.   $iif($read(names.txt,ntw,$$1),$style(2)) Add On Access List:write -dw $+ $$1 names.txt | write names.txt $$1
  90.   $iif(!$read(names.txt,ntw,$$1),$style(2)) Del From Access List:write -dw $+ $$1 names.txt
  91.   -
  92. }
  93.  
  94. ON !*:JOIN:%checkautochannel: {
  95.   if (!%autocheckaccess) { return }
  96.   if ($read(names.txt,ntw,$nick)) { return }
  97.   if ($network == %checkabarnetowrk) {
  98.     mode # +b $nick $+ !*@*
  99.     .timer[ $+ $nick $+ ] 1 %checkautobantime mode # -b $nick $+ !*@*
  100.     kick # $nick You are not allowed to join this channel... - BAN TIME - %checkautobantime seconds
  101.   }
  102. }
  103.  
  104. alias PreviewAccessList {
  105.   var %w = @Preview.Access.List
  106.   window -a %w
  107.   clear %w
  108.   var %t = $lines(names.txt)
  109.   if (!%t) { aline -pl %w ***** There is NOT any nickname into the list. ***** | return }
  110.   var %x = 1
  111.   while (%x <= %t) { aline -pl %w $ord(%x) -> $read(names.txt,%x) | inc %x }
  112. }
  113.  
  114. menu @Preview.Access.List {
  115.   Reload Access List : { PreviewAccessList }
  116.   ADD
  117.   .Add (1) Nick: {
  118.     var %n = $?="Nickname?"
  119.     if ($read(names.txt,ntw,%n)) { var %error = $input(This nickname is already into the list!,houd,Error) | return }
  120.     write names.txt %n
  121.     PreviewAccessList
  122.   }
  123.   .Add (++) Nick: {
  124.     :MORENICKS2
  125.     var %n = $?="Nickname?"
  126.     if ($read(names.txt,ntw,%n)) { var %error = $input(This nickname is already into the list!,houd,Error) | goto next }
  127.     write names.txt %n
  128.     PreviewAccessList
  129.     :next
  130.     if ( $$?!="Would you like to add one more Nickname?" == $true ) { goto MORENICKS2 }
  131.   }
  132.   $iif(!$isfile(names.txt),$style(2)) Open Name List: run names.txt
  133.   $iif(!$isfile(names.txt),$style(2)) Clear (ALL) name list: write -c names.txt | previewaccesslist
  134.   Checking Settings: checkingsettingsABAR
  135.   -
  136.   Close:window -c @Preview.Access.List
  137.   -
  138. }
  139.  
  140. alias checkingsettingsABAR {
  141.   var %w = @Preview.Access.List
  142.   window -a %w
  143.   clear %w
  144.   aline -pl %w 10
  145.   aline -pl %w 10========================================
  146.   aline -pl %w 10-
  147.   aline -pl %w 10CHECKING SETTINGS .....
  148.   aline -pl %w 10
  149.   aline -pl %w 7Time is now set for 14 :: 4 %checkautobantime 7seconds
  150.   aline -pl %w 7Monitor is now set for 14 :: 4 %checkautochannel
  151.   aline -pl %w 7Monitor is set for 14:: 4 %checkabarnetowrk
  152.   aline -pl %w 10-
  153.   aline -pl %w 10========================================
  154. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement