EpicNet.Ru - Форум IRC Чата

Информация о пользователе

Привет, Гость! Войдите или зарегистрируйтесь.


Вы здесь » EpicNet.Ru - Форум IRC Чата » HELP SCRIPTS - Помощь по mIRC скриптам » Editing of 2 previously created scripts


Editing of 2 previously created scripts

Сообщений 1 страница 3 из 3

1

Hello, Here I am again.

The recent changes to the script you created in my previous topic, "auto reply query", made me think of two previous scripts you created (that of "allowed characters" and that of "bad words", I don't know if you remember them but I'll post them here now anyway then) and a possible addition of code for both.

The scripts are perfect and finished, it's just a matter of adding a timer that activates them to the connection after 10 seconds (this was the last change to the "auto query reply" script that I thought might be needed to add on these two scripts).

Here is the bad words script:

Код:
menu channel {
  Bad Words (Script) $chr(58) %bw_work
  .On/Off $chr(58) %bw_works $+ :{
    if (%bw_work == OFF) { %bw_work = ON | %bw_works = Active | .echo -a "Bad Words" - Active:03 ON }
    else { %bw_work = OFF | %bw_works = Deactivated | .echo -a "Bad Words" - Deactivated:04 OFF }
  }
  .Exception $chr(58) $numtok(%bw_exceptnick,44)
  ..List: .echo -a "Bad Words" - Exception nicks:03 %bw_exceptnick
  ..-
  ..Add:{
    var %addn $$?="Enter all nicknames to be excluded separated by a comma:"
    if ($len(%addn) > 0) { $bwextlist(%addn,add) | .echo -a "Bad Words" - Add except nicks:03 %addn }
  }
  ..Del:{
    var %deln $$?="Enter all comma-separated nicknames you want to remove from the exception list:"
    if ($len(%deln) > 0) { $bwextlist(%deln,del) | .echo -a "Bad Words" - Del except nicks:04 %deln }
  }
}
alias bwextlist {
  var %i 1 | while (%i <= $numtok($1,44)) {
    var %w $gettok($1,%i,44)
    if ($2 == add && !$istok(%bw_exceptnick,%w,44)) { %bw_exceptnick = $+(%bw_exceptnick,$chr(44),%w) }
    if ($2 == del && $istok(%bw_exceptnick,%w,44)) { %bw_exceptnick = $remove(%bw_exceptnick,%w) }
    %bw_exceptnick = $replace(%bw_exceptnick,$+($chr(44),$chr(44)),$chr(44),$chr(32),$chr(44))
    if ($mid(%bw_exceptnick,1,1) == $chr(44)) %bw_exceptnick = $mid(%bw_exceptnick,2,10000)
    inc %i
  } | return
}
alias bwextcheck { if ($istok(%bw_exceptnick,$1,44)) return $true }
------------------------
on @*:TEXT:*try1*:#try1: if (%bw_work == ON && !$bwextcheck($nick)) { .ban $chan $nick 2 | .ban $chan $nick 3 | echo -st 04 Line $scriptline  Nick: $nick was banned in the channel $chan for saying: " $1- " }

ON *:EXIT: { 
  %bw_work = OFF | %bw_works = Deactivated
}

Mentre questo è lo script "Allow Chars":

Код:
alias -l allowchars_set {
  if (!%ach_work) %ach_work = yes
  if (!%ach_kick) %ach_kick = no
  if (!%ach_ban) %ach_ban = yes
  if (!%ach_reason) %ach_reason = 
  if (!%ach_btype) %ach_btype = 2,3
  if (!%ach_btime) %ach_btime = 0
  if (!%ach_exceptpref) %ach_exceptpref = [+%@&~!]
  if (!%ach_exceptnick) %ach_exceptnick = MyNick
  if (!%ach_charfile) %ach_charfile = path\allowchars.txt
}
menu channel {
  1,1Separator:/
  Allow Chars
  .On/Off
  ..$iif(%ach_work == yes,$style(1)) Active: %ach_work = yes | .echo -a Script allow chars:03 active.
  ..$iif(%ach_work == no,$style(1)) Deactivated: %ach_work = no | .echo -a Script allow chars:04 deactivated.
  .Characters
  ..File $+([,$nopath(%ach_charfile),]): allowchars_set | if ($exists(%ach_charfile)) .run %ach_charfile
  ..Path $+([..\,$nopath(%ach_charfile),]): var %p $$?="Enter the full path to the files with allowed characters:" | if ($len(%p) > 0) { %ach_charfile = %p | .echo -a Path file:03 %ach_charfile }
  .Kick
  ..$iif(%ach_kick == yes,$style(1)) Active: %ach_kick = yes | .echo -a Kick:03 active.
  ..$iif(%ach_kick == no,$style(1)) Deactivated: %ach_kick = no | .echo -a Kick:04 deactivated.
  ..-
  ..Kick reason: var %r $$?="Insert kick reason:" | if ($len(%r) > 0) { %ach_reason = %r | .echo -a Kick reason:03 %ach_reason }
  .Ban
  ..$iif(%ach_ban == yes,$style(1)) Active: %ach_ban = yes | .echo -a Ban:03 active.
  ..$iif(%ach_ban == no,$style(1)) Deactivated: %ach_ban = no | .echo -a Ban:04 deactivated.
  ..-
  ..Ban types $+([,%ach_btype,]): var %t $$?="Enter one or more comma separated types of bans:" | if ($len(%t) > 0) { %ach_btype = %t | .echo -a Ban types:03 %ach_btype }
  ..Duration Ban $+([,%ach_btime,]) sec: var %t $$?="Enter the number in seconds of the ban duration:" | if ($len(%t) > 0) { %ach_btime = %t | .echo -a Duration Ban:03 %ach_btime }
  .Exceptions
  ..Grade prefixes %ach_exceptpref: var %p $$?="Enter the prefix of the degrees to exclude:" | if ($len(%p) > 0) { %ach_exceptpref = $+([,$remove(%p,]),]) | .echo -a Prefix exceptions:03 %ach_exceptpref }
  ..Nick to be excluded $+([,$numtok(%ach_exceptnick,44),]): var %n $$?="Enter the nicknames to be excluded separated by a comma:" | if ($len(%n) > 0) { %ach_exceptnick = %n | .echo -a Nick exceptions:03 %ach_exceptnick }
}
on @*:TEXT:*:#hot: allowchars $nick $chan $1-
on @*:ACTION:*:#hot: allowchars $nick $chan $1-
alias -l allowchars {
  allowchars_set | if (%ach_work == yes) {
    var %ach_pnick $remove($nick($2,$1).pnick,$1)
    if (%ach_pnick isin %ach_exceptpref) || ($istok(%ach_exceptnick,$1,44)) { halt }
    if ($exists(%ach_charfile)) {
      var %text $remove($3-,$chr(32),$chr(160),$chr(8194),$chr(8195),$chr(8196),$chr(8197),$chr(8198),$chr(8199),$chr(8201),$chr(8202),$chr(8203),$chr(8239),$chr(8287),$chr(12288),$chr(65279))
      var %c 1 | while (%c <= $lines(%ach_charfile)) { %chars = $+(%chars,$read(%ach_charfile,n,%c)) | inc %c }
      var %pattern $+(/[^,$replacecs(%chars,\,\\,[,\[,],\],-,\-,^,\^),]/iuS) | unset %chars
      if ($regex(%text,%pattern) > 0) { allowchars_ban $1 $2 | .echo -st 07 Characters Not Allowed  Nick $1 was banned in the channel $2 for saying: $+(",$3-,") }
    }
  }
}
alias -l allowchars_ban {
  if (%ach_ban == yes) {
    if (!%ach_btype) %ach_btype = 2,3 | if (%ach_btime > 0) var %ach_key $+(-u,%ach_btime)
    var %i 1 | while (%i <= $numtok(%ach_btype,44)) { .ban %ach_key $2 $1 $gettok(%ach_btype,%i,44) | inc %i }
  }
  if (%ach_kick == yes) { if ($len(%ach_reason) > 1) var %ach_kr %ach_reason | else var %ach_kr - | .kick $2 $1 %ach_kr }
}

ON *:EXIT: { 
  %ach_work = no
}

As I said, you worked a lot on it and they were both finished and tested, so you really don't need to add anything other than this piece of code to activate the connection with the timer after 10 seconds (I tried to create it but it didn't go well...  http://epicnet.ru/smiles/kolobok/facepalm.gif ), if possible, thank you very much

2

1367,366 написал(а):

The scripts are perfect and finished, it's just a matter of adding a timer that activates them to the connection after 10 seconds (this was the last change to the "auto query reply" script that I thought might be needed to add on these two scripts).

Ок. Я внёс некоторые изменения и обновления в эти 2 кода скриптов, чтобы они оба могли работать в соответствии с вашими запросами.
Теперь вы можете настроить время задержки для запуска скрипта через меню.


Попробуйте использовать это обновление для "Bad Words":

Код:
menu channel {
  Bad Words $chr(58) %bw_work
  .ON/OFF $chr(58) %bw_works : if (%bw_work == OFF) bw_work_on | else bw_work_off
  .ON - Delay time $chr(58) %bw_wdtime sec: var %t $$?="Enter the time in seconds to delay the enable of the script:" | if ($len(%t) > 0) { %bw_wdtime = %t | .echo -a "Bad Words" - Delay time:03 %bw_wdtime }
  .Exception $chr(58) $numtok(%bw_exceptnick,44)
  ..List: .echo -a "Bad Words" - Exception nicks:03 %bw_exceptnick
  ..-
  ..Add:{
    var %addn $$?="Enter all nicknames to be excluded separated by a comma:"
    if ($len(%addn) > 0) { $bwextlist(%addn,add) | .echo -a "Bad Words" - Add except nicks:03 %addn }
  }
  ..Del:{
    var %deln $$?="Enter all comma-separated nicknames you want to remove from the exception list:"
    if ($len(%deln) > 0) { $bwextlist(%deln,del) | .echo -a "Bad Words" - Del except nicks:04 %deln }
  }
}
alias bwextlist {
  var %i 1 | while (%i <= $numtok($1,44)) {
    var %w $gettok($1,%i,44)
    if ($2 == add && !$istok(%bw_exceptnick,%w,44)) { %bw_exceptnick = $+(%bw_exceptnick,$chr(44),%w) }
    if ($2 == del && $istok(%bw_exceptnick,%w,44)) { %bw_exceptnick = $remove(%bw_exceptnick,%w) }
    %bw_exceptnick = $replace(%bw_exceptnick,$+($chr(44),$chr(44)),$chr(44),$chr(32),$chr(44))
    if ($mid(%bw_exceptnick,1,1) == $chr(44)) %bw_exceptnick = $mid(%bw_exceptnick,2,10000)
    inc %i
  } | return
}
alias bwextcheck { if ($istok(%bw_exceptnick,$1,44)) return $true }
--------------------------------------------------
on *:CONNECT: if (%bw_wdtime) .timerBW 1 %bw_wdtime bw_work_on
on *:EXIT: bw_work_off
alias -l bw_work_on { %bw_work = ON | %bw_works = Active | .echo -a "Bad Words" - Active:03 ON }
alias -l bw_work_off { %bw_work = OFF | %bw_works = Deactivated | .echo -a "Bad Words" - Deactivated:04 OFF }
--------------------------------------------------
on @*:TEXT:*badword1*:#test: if (%bw_work == ON && !$bwextcheck($nick)) { .ban $chan $nick 2 | .ban $chan $nick 3 | echo -st 04Line $scriptline  Nick: $nick was banned in the channel $chan for saying:06 $+(",$1-,") }
on @*:TEXT:*badword2*:#test: if (%bw_work == ON && !$bwextcheck($nick)) { .ban $chan $nick 2 | .ban $chan $nick 3 | echo -st 04Line $scriptline  Nick: $nick was banned in the channel $chan for saying:06 $+(",$1-,") }
on @*:TEXT:*badword3*:#test: if (%bw_work == ON && !$bwextcheck($nick)) { .ban $chan $nick 2 | .ban $chan $nick 3 | echo -st 04Line $scriptline  Nick: $nick was banned in the channel $chan for saying:06 $+(",$1-,") }

Попробуйте использовать это обновление для "Allow Chars":

Код:
#####################################################################
#   Name: Allow Chars v1.3
#   Author: Epic (epicnet@mail.ru, http://epicnet.ru)
#   Description: Allows to use in channel messages only those characters that are specified in the script.
#####################################################################

alias -l allowchars_set {
  if (!%ach_work) %ach_work = yes
  if (!%ach_wdtime) %ach_wdtime = 10
  if (!%ach_kick) %ach_kick = no
  if (!%ach_ban) %ach_ban = yes
  if (!%ach_reason) %ach_reason = There are forbidden characters in your message!
  if (!%ach_btype) %ach_btype = 2,3
  if (!%ach_btime) %ach_btime = 3600
  if (!%ach_exceptpref) %ach_exceptpref = [+%@&~!]
  if (!%ach_exceptnick) %ach_exceptnick = Epic,krisb34213
  if (!%ach_charfile) %ach_charfile = scripts\AllowСhars\allowchars.txt
}
---------------------------------------------------------------------
menu channel {
  Allow Chars
  .Work
  ..$iif(%ach_work == yes,$style(1)) Enable: ach_work_yes
  ..$iif(%ach_work == no,$style(1)) Disable: ach_work_no
  ..-
  ..Enable - Delay time $chr(58) %ach_wdtime sec: var %t $$?="Enter the time in seconds to delay the enable of the script:" | if ($len(%t) > 0) { %ach_wdtime = %t | .echo -a "Allow Chars" - Delay time:03 %ach_wdtime }
  .Characters
  ..File $chr(58) $nopath(%ach_charfile): allowchars_set | if ($exists(%ach_charfile)) .run %ach_charfile
  ..Path $chr(58) $+(..\,$nopath(%ach_charfile)): var %p $$?="Enter the full path to the file with allowed characters:" | if ($len(%p) > 0) { %ach_charfile = %p | .echo -a "Allow Chars" - The path to the file:03 %ach_charfile }
  .Kick
  ..$iif(%ach_kick == yes,$style(1)) Enable: %ach_kick = yes | .echo -a "Allow Chars" - Kick:03 enabled.
  ..$iif(%ach_kick == no,$style(1)) Disable: %ach_kick = no | .echo -a "Allow Chars" - Kick:04 disabled.
  ..-
  ..Reason: var %r $$?="Enter the reason for the kick:" | if ($len(%r) > 0) { %ach_reason = %r | .echo -a "Allow Chars" - Kick reason:03 %ach_reason }
  .Ban
  ..$iif(%ach_ban == yes,$style(1)) Enable: %ach_ban = yes | .echo -a "Allow Chars" - Ban:03 enabled.
  ..$iif(%ach_ban == no,$style(1)) Disable: %ach_ban = no | .echo -a "Allow Chars" - Ban:04 disabled.
  ..-
  ..Type $chr(58) %ach_btype: var %t $$?="Enter one or more types of bans separated by commas:" | if ($len(%t) > 0) { %ach_btype = %t | .echo -a "Allow Chars" - Ban type:03 %ach_btype }
  ..Time $chr(58) %ach_btime sec: var %t $$?="Enter the number of seconds after which you want to remove the ban:" | if ($len(%t) > 0) { %ach_btime = %t | .echo -a "Allow Chars" - Ban time:03 %ach_btime }
  .Except
  ..Prefixes $chr(58) %ach_exceptpref: var %p $$?="Enter the prefixes of the channel operators to exclude:" | if ($len(%p) > 0) { %ach_exceptpref = $+([,$remove(%p,]),]) | .echo -a "Allow Chars" - Except prefixes:03 %ach_exceptpref }
  ..Nicks $chr(58) $numtok(%ach_exceptnick,44): var %n $$?="Enter all users nicks separated by commas that you want to exclude:" | if ($len(%n) > 0) { %ach_exceptnick = %n | .echo -a "Allow Chars" - Except nicks:03 %ach_exceptnick }
}
---------------------------------------------------------------------
on *:CONNECT: if (%ach_wdtime) .timerAC 1 %ach_wdtime ach_work_yes
on *:EXIT: ach_work_no
on @*:TEXT:*:#test: allowchars $nick $chan $1-
on @*:ACTION:*:#test: allowchars $nick $chan $1-
---------------------------------------------------------------------
alias -l ach_work_yes { %ach_work = yes | .echo -a "Allow Chars" - Script:03 enabled. }
alias -l ach_work_no { %ach_work = no | .echo -a "Allow Chars" - Script:04 disabled. }
alias -l allowchars {
  allowchars_set | if (%ach_work == yes) {
    var %ach_pnick $remove($nick($2,$1).pnick,$1)
    if (%ach_pnick isin %ach_exceptpref) || ($istok(%ach_exceptnick,$1,44)) { halt }
    if ($exists(%ach_charfile)) {
      var %text $remove($3-,$chr(32),$chr(160),$chr(8194),$chr(8195),$chr(8196),$chr(8197),$chr(8198),$chr(8199),$chr(8201),$chr(8202),$chr(8203),$chr(8239),$chr(8287),$chr(12288),$chr(65279))
      var %c 1 | while (%c <= $lines(%ach_charfile)) { %chars = $+(%chars,$read(%ach_charfile,n,%c)) | inc %c }
      var %pattern $+(/[^,$replacecs(%chars,\,\\,[,\[,],\],-,\-,^,\^),]/iuS) | unset %chars
      if ($regex(%text,%pattern) > 0) { allowchars_ban $1 $2 | .echo -st "Allow Chars" Violation detected - Channel05 $2 Nick:05 $1 Message: $+("04,$3-,") }
    }
  }
}
alias -l allowchars_ban {
  if (%ach_ban == yes) {
    if (%ach_btime > 0) var %ach_key $+(-u,%ach_btime)
    var %i 1 | while (%i <= $numtok(%ach_btype,44)) { .ban %ach_key $2 $1 $gettok(%ach_btype,%i,44) | inc %i }
  }
  if (%ach_kick == yes) { if ($len(%ach_reason) > 1) var %ach_kr %ach_reason | else var %ach_kr - | .kick $2 $1 %ach_kr }
}
Подпись автора

[html]<style>img {vertical-align:middle;}.hnet{color:#FFFFFF;}.hstar{color:#DE0000;}.htext{font-family:Verdana;font-size:13px;color:#6E1E00;}.heading{font-family:Verdana;font-size:13px;font-weight:bold;background-color:#4897E7;}.stitle{font-family:Verdana;font-size:12px;}.dot{color:#808000;}.desc{color:#ADADAD;}a .curl{font-family:Verdana;font-size:13px;color:#3A92CD;}</style><table><tr><td width="20px" height="20px"><img src="https://forumstatic.ru/files/000d/c9/8c/34681.jpg"></td><td><a href="https://forum.epicnet.ru/viewtopic.php?id=234"><span class="heading"> <span class="hstar">★</span> <span class="hnet">EpicNet.Ru</span> <span class="hstar">★</span> </span><span class="htext"> - IRC Чат © 2008</span></a></td></tr><tr><td></td><td><div class="stitle"><span class="dot">•</span> <span class="desc">Вход через вебгейт:</span> <a href="http://irc.epicnet.ru"><span class="curl">http://irc.epicnet.ru</span></a><br><span class="dot">•</span> <span class="desc">Сервер:</span> irc.epicnet.ru <span class="desc">Порты:</span> 6667, 6668 (ssl)<br><div></td></tr></table>[/html]

3

Translated, inserted and tested and everything works perfectly  http://epicnet.ru/smiles/epic-mix/hi_all.gif

Thanks a lot this time too, see you soon!  http://www.kolobok.us/smiles/icq/drinks.gif


Вы здесь » EpicNet.Ru - Форум IRC Чата » HELP SCRIPTS - Помощь по mIRC скриптам » Editing of 2 previously created scripts