Public paste
Undefined
By: Guest | Date: Oct 9 2022 13:54 | Format: None | Expires: never | Size: 8.11 KB | Hits: 41

  1. on *:text:!request*:#ohnoes:{
  2.   if ($ulvl($auth($nick),$chan) == 8) {
  3.     if ($2 == set) {
  4.       if (!$3) { .notice $nick Wrong setting, syntax: !request set on/off | halt }
  5.       if ($3 == on) || ($3 == off) { .notice $nick Request has been turned $3 | set %request $3 } | else { .notice $nick Wrong setting, syntax: !request set on/off | halt }
  6.     }
  7.     if ($2 == status) { .notice $nick Request is actually %request | halt }
  8.   }
  9.   if (%request == off) { msg # Request temporaly 4 OFF . | halt }
  10.   if (%request == on) {
  11.     if ($ini(request.ini,suspended,$2)) { msg # Channel $2 is suspended, for info type !info | halt }
  12.     if (!$auth($nick)) { msg # You must be authed and have +x setted | halt }
  13.     if (*!*@*users.quakenet.org !iswm $address($nick,5)) { msg # You must be Authed and have +x setted | halt }
  14.     if (%requesting == on) { msg # Request in process, please try again in minute. | halt }
  15.     if ($me ison $2) { msg # I am already on $2 $+ . | halt }
  16.     if (!$2) { msg # Syntax: !request #channel | halt }
  17.     if ($timer(request)) { msg # Request in process, please try again in minute. | halt }
  18.     if ($left($2,1) != $chr(35)) { if ($2 == set) { halt } else { msg # Channel Name must start with $chr(35) | halt } }
  19.     set %requester $nick
  20.     set %channeltorequest $2
  21.     set %requesting on
  22.     if ($ini(request.ini,react,$2)) { writeini $inifile react $2 0 }
  23.     joinchan
  24.   }
  25. }
  26. alias joinchan {
  27.   join %channeltorequest
  28.   timerrequest 1 2 checkforuser
  29. }
  30.  
  31. alias checkforuser {
  32.   if (%requester ison %channeltorequest) {
  33.     checkifop
  34.   }
  35.   elseif (%requester !ison %channeltorequest) {
  36.     msg #ohnoes %requester $+ : You're not on %channeltorequest -  4request failed
  37.     unsetall
  38.     $+(.timer(checkflag.,$1)) off
  39.     halt
  40.   }
  41. }
  42. alias checkifop {
  43.   if (%requester !isop %channeltorequest) {
  44.     msg #ohnoes %requester $+ : You need to be op'd in %channeltorequest -  4request failed
  45.     unsetall
  46.     $+(.timer(checkflag.,$1)) off
  47.     halt
  48.   }
  49.   elseif (%requester isop %channeltorequest) {
  50.     checkq
  51.   }
  52. }
  53. alias checkq {
  54.   if (Q !ison %channeltorequest) {
  55.     msg #ohnoes %requester $+ : Q must be in on %channeltorequest -  4request failed
  56.     unsetall
  57.     $+(.timer(checkflag.,$1)) off
  58.     halt
  59.   }
  60.   elseif (Q ison %channeltorequest) {
  61.     checkusers
  62.   }
  63. }
  64. alias checkusers {
  65.   if (wowbot ison %channeltorequest) { inc %qnetbots }
  66.   if (triviabot ison %channeltorequest) { inc %qnetbots }
  67.   if (snailbot ison %channeltorequest) { inc %qnetbots }
  68.   if (fishbot ison %channeltorequest) { inc %qnetbots }
  69.   if ($nick(%channeltorequest,0) < $calc( 12 + %qnetbots )) {
  70.     msg #ohnoes %requester $+ : There is not enought users in %channeltorequest (minimum 10 realusers) -  4request failed
  71.     unsetall
  72.     $+(.timer(checkflag.,$1)) off
  73.     halt
  74.   }
  75.   elseif ($nick(%channeltorequest,0) >= $calc( 12 + %qnetbots )) {
  76.     msg #ohnoes %requester $+ :  9Request passed , $me should already be there, Do not forget to add $me +op on %channeltorequest ( 7/msg Q chanlev %channeltorequest $me +ao )
  77.     unset %requester
  78.     unset %channeltorequest
  79.     set %requesting off
  80.   }
  81. }
  82.  
  83. alias unsetall {
  84.   part %channeltorequest
  85.   unset %requester
  86.   unset %channeltorequest
  87.   set %requesting off
  88.   set %qnetbots 0
  89. }
  90. raw *:*: {
  91.   if (%requesting == on) {
  92.     if ($istok(471 473 474 475 477 479,$numeric,32)) {
  93.       if ($numeric == 471) { var %r = channel is full +l }
  94.       elseif ($numeric == 473) { var %r = channel is invite only +i }
  95.       elseif ($numeric == 474) { var %r = I am banned +b }
  96.       elseif ($numeric == 475) { var %r = channel key is set +k }
  97.       else { var %r = channel is G-lined: $left($7-,-1) }
  98.       msg #ohnoes %requester $+ : Following modes were setted: %r which is not allowed -  4request failed
  99.       $+(.timer(checkflag.,$1)) off
  100.       timerrequest off
  101.       set %requesting off
  102.     }
  103. } }
  104. on *:kick:#: {
  105.   if (%requesting == on) {
  106.     if ($knick == $me) && (%channeltorequest == $chan) {
  107.       $+(.timer(checkflag.,$1)) off
  108.       timerrequest off
  109.       set %requesting off
  110.       msg #ohnoes %requester $+ : I've been kicked while chcking requirements -  4request failed
  111. } } }
  112. on *:ban:#: {
  113.   if (%requesting == on) {
  114.     if ($banmask iswm $address($me,5)) {
  115.       $+(.timer(checkflag.,$1)) off
  116.       timerrequest off
  117.       set %requesting off
  118.       msg #ohnoes %requester $+ : I've been banned while chcking requirements -  4request failed
  119.       part %channeltorequest
  120. } } }
  121. on *:text:!rules:#ohnoes: {
  122.   msg # To request bot You must be authed and have +x setted. Your channel must have Quakenet service (Q) and minimum 10 users on (not including Q and $me $+ or fish,snail,wow,trivia).
  123.   msg # You must be OP/@ in channel and have access to add bot to Q, channel can't be secret, invite, or passworded means: no modes that would disturb in request.
  124. }
  125.  
  126. on *:text:!suspend*:#: {
  127.   if ($ulvl($auth($nick),$chan) == 8) {
  128.     if ($2 == list) {
  129.       if (%antispam) { halt }
  130.       if (!$ini(request.ini,suspended,0)) { .notice $Nick No suspended channels. | halt }
  131.       var %x 1
  132.       set -u10 %antispam
  133.       while (%x <= $ini(request.ini,suspended,0)) {
  134.         timer $+ %x 1 %x .notice $nick Channel: $chr(35) $+ %x $+ . $ini(request.ini,suspended,%x)  Reason: $readini(request.ini,suspended,$ini(request.ini,suspended,%x))
  135.         inc %x
  136.       }
  137.     }
  138.     if ($chan == #ohnoes) {
  139.       if ($2 == list) { halt }
  140.       if ($left($2,1) != $chr(35)) { .notice $nick Channel Name must start with $chr(35) | halt }
  141.       if (!$2) { .notice $nick Syntax: !suspend #chan <reason> | halt }
  142.       if (!$3) { writeini request.ini $2 Not setted. }
  143.       else {
  144.         writeini request.ini suspended $2 $3-
  145.         .notice $nick Done. Suspended channel $2 with reason $3-
  146.         if ($me ison $2) { part $2 Channel suspended by admin, reason: $3- }
  147.       }
  148.     }
  149.     if ($chan != #ohnoes) {
  150.       if (!$2) { .notice $nick Syntax: !suspend <reason> - suspends active channel | halt }
  151.       writeini request.ini suspended # $2-
  152.       .notice $Nick Done. Suspended channel # with reason $2-
  153.       part $chan Channel suspended by admin, reason: $2-
  154.     }
  155.   }
  156. }
  157. on *:text:!unsuspend*:#: {
  158.   if ($ulvl($auth($nick),$chan) == 8) {
  159.     if (!$2) { .notice $nick Syntax: !unsuspend #channel | halt }
  160.     if ($left($2,1) != $chr(35)) { .notice $nick Channel Name must start with $chr(35) | halt }
  161.     if (!$ini(request.ini,suspended,$2)) { .notice $nick No such channel in suspends list. | halt }
  162.     if ($ini(request.ini,suspended,$2)) { remini request.ini suspended $2 | .notice $nick Done. Unsuspended channel $2 }
  163.   }
  164. }
  165. on *:text:!info*:#ohnoes: {
  166.   if (!$2) { msg # Syntax: !info #channel | halt }
  167.   if ($left($2,1) != $chr(35)) { msg # Channel Name must start with $chr(35) | halt }
  168.   if (!$ini(request.ini,suspended,$2)) { msg # $nick $+ : Channel ( $+ $2 $+ ) is NOT suspended. | halt }
  169.   if ($ini(request.ini,suspended,$2)) { msg # $nick $+ : Channel ( $+ $2 $+ ) is suspended with reason: $readini(request.ini,suspended,$2) }
  170.   else { halt }
  171. }
  172.  
  173. alias -l inifile { return request.ini }
  174. alias -l developmentchannel { return #ohnoes }
  175. alias -l totalstrike { return 3 }
  176.  
  177. on *:join:#: {
  178.   if ($nick == $me) {
  179.     if (%requesting == on) {
  180.       .checktimer %channeltorequest
  181. } } }
  182. alias checktimer {
  183.   if ($ini($inifile,knownchans,%channeltorequest)) { halt }
  184.   if ($readini($inifile,react,$1) => $totalstrike) {
  185.     if ($me ison $1) {
  186.       part $1 No flags added, channel suspended. | writeini request.ini suspended $1 Flagsless on Q.
  187.     }
  188.     $+(.timer(checkflag.,$1)) off
  189.     msg $developmentchannel Strike out on $+($chr(2),$1,$chr(2)) - I'm parting the channel.
  190.     return
  191.   }
  192.   if (!$timer(checkflag. [ $+ [ $1 ] ])) {
  193.     $+(.timer.checkflag.,$1) 1 180 checktimer $1
  194.     .msg Q chanlev $1
  195.   }
  196. }
  197. on *:NOTICE:*:?: {
  198.   if ($nick == Q) {
  199.     if (*You do not have sufficient access on* iswm $1-) {
  200.       .writeini $inifile react $8 $calc($readini($inifile,react,$8)+1)
  201.       msg $developmentchannel I have no flags on $+($chr(2),$8,$chr(2)) Strike: $+($chr(2),$readini($inifile,react,$8),$chr(2),/,$chr(2),$totalstrike,$chr(2))
  202.     }
  203.   }
  204. }
  205.