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

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

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



Auto reply query

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

1

Hi! I need some help on this script

Код:
#anti-pv off
on *:TEXT:*:?: if ($me == MyNick) { /msg $nick The auto query is active }
#anti-pv END

menu menubar {
  Auto-reply query
  .$iif($group(#anti-pv).status == on,$style(1)) Active : .enable #anti-pv | window -ez @AutoReplyON
  .$iif($group(#anti-pv).status == off,$style(1)) Disabled : .disable #anti-pv | /close -@ @AutoReplyON
}

ON *:CONNECT: { 
  .enable #anti-pv | window -ez @AutoReplyON
}

ON *:EXIT: { 
  .disable #anti-pv
}

The first problem is: how do I get the message to appear only once? When the script is active, every time they write me a message it repeats, I would like the automatic reply message to be sent only once.

Second problem: how can I prevent the message from being sent as soon as i connect to the nicknames who wrote me in private when I was offline? Like, if my nick is always online in bnc, and i connect, the script is activated thanks to the on connect event, and the message is sent to whoever wrote me... is it possible to avoid this thing? I state that I have not yet tried if it happens, but I assumed it could happen.

Third, this is not a problem but a possible addition: is it possible to create a list of nicknames, registered and unregistered (all those that are put on the list in short) who can write to me without the message appearing? A kind of nick exception.

2

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

The first problem is: how do I get the message to appear only once? When the script is active, every time they write me a message it repeats, I would like the automatic reply message to be sent only once.

Я решил эту проблему при помощи команды создания хэщ-таблицы ".hadd -mz arq $nick 3600". Теперь каждый ник, который получил авто сообщение будет сохранён в хэш-таблицу на 3600 секунд = 1 час (вы можете изменить это время). При проверке условием "if (!$hget(arq,$nick))" все отсутствующие в хэш-таблице ники будут получать авто сообщение, кроме тех, кто там уже записан.


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

Second problem: how can I prevent the message from being sent as soon as i connect to the nicknames who wrote me in private when I was offline? Like, if my nick is always online in bnc, and i connect, the script is activated thanks to the on connect event, and the message is sent to whoever wrote me... is it possible to avoid this thing? I state that I have not yet tried if it happens, but I assumed it could happen.

Я решил эту проблему при помощи команды таймера для алиаса ".timerARQ -m 1 3000 arq_enable". Теперь после подключения к сети для активизации скрипта будет использоваться задержка на 3000 миллисекунд = 3 секунды (вы можете изменить это время). Это значит, что все сообщения, которые были оставлены для вашего аккаунта BNC в момент вашего отсутствия будут проигнорированы скриптом и не получат в ответ авто сообщение.


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

Third, this is not a problem but a possible addition: is it possible to create a list of nicknames, registered and unregistered (all those that are put on the list in short) who can write to me without the message appearing? A kind of nick exception.

Я добавил в меню новый пункт "Exclusion nicks", который выполняет алиас "arq_exc_nicks" для создания и открытия текстового файла, в котором вы сможете записать (в столбик) все ники для исключения. Вы можете изменить путь к файлу в значении переменной "%arq_path = scripts\arq_nicks.txt".


Итак, вы можете попробовать использовать эту версию скрипта с обновлением вашего кода:

Код:
#anti-pv off
on *:TEXT:*:?:{
  if (!$read(%arq_path, w, $nick)) {
    if (!$hget(arq,$nick)) {
      .msg $nick The auto query is active | .hadd -mz arq $nick 3600
      if (!$window(@AutoReplyQuery)) .window -ez @AutoReplyQuery
      .aline -hp @AutoReplyQuery $+([,$time,]) $nick - was denied access to private.
    }
    .close -m $nick
  }
  else { if ($hget(arq,$nick)) .hdel -sw arq $nick }
}
#anti-pv END
---------------------------------------------------
menu menubar,status,channel,query,@AutoReplyQuery {
  Auto-reply-query
  .$iif($group(#anti-pv).status == on,$style(1)) Enabled : arq_enable
  .$iif($group(#anti-pv).status == off,$style(1)) Disabled : arq_disable
  .-
  .Reset hash nicks : .hfree -sw arq | .echo -a Reset hash nicks.
  .-
  .Exclusion nicks : arq_exc_nicks
}
on *:CONNECT: .timerARQ -m 1 3000 arq_enable
on *:EXIT: arq_disable
---------------------------------------------------
alias arq_enable { .enable #anti-pv | .window -ez @AutoReplyQuery }
alias arq_disable { .disable #anti-pv | .close -@ @AutoReplyQuery }
alias arq_exc_nicks { %arq_path = scripts\arq_nicks.txt | if (!$exists(%arq_path)) .write %arq_path | .run %arq_path }
Подпись автора

[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="http://forumstatic.ru/files/000d/c9/8c/34681.jpg"></td><td><a href="http://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

Thanks a lot Epic! I am testing it and it works perfectly.

I just have a few questions:

1: To remove the automatic closing of the query when they write to me, I just need to remove this line, right?

Код:
.close -m $nick

2: The "Reset hash nicks" entry, if I understand correctly, only removes the nicknames in the provisional list, right? Not the ones that are in the "arq_nicks.txt" file (and that's okay, I'm better off adding and removing them from the .txt manually)

3: If I wanted to remove the message that warns me of the query denied to the nick, would it be enough for me to remove this line?

Код:
.aline -hp @AutoReplyQuery $+([,$time,]) $nick - was denied access to private.

4: Still as regards the line of code above, can I modify it without problems in case I want to keep it to make other useful information appear instead of the message? Like, common channels of the nick who wrote me and things like that...

4

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

1: To remove the automatic closing of the query when they write to me, I just need to remove this line, right?

Да. Вы можете либо закомментировать эту строку ";.close -m $nick", либо просто удалить её.


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

2: The "Reset hash nicks" entry, if I understand correctly, only removes the nicknames in the provisional list, right? Not the ones that are in the "arq_nicks.txt" file (and that's okay, I'm better off adding and removing them from the .txt manually)

Этот список никак не связан с файлом "arq_nicks.txt". Этот пункт меню служит для удаления всех ников хранящихся в хэш-таблице, которые получили от вас уже одно авто сообщение и больше не могут получить его повторно в течении определённого времени. При необходимости вы можете удалить их, чтобы дать возможность получить от вас повторное авто сообщение.


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

3: If I wanted to remove the message that warns me of the query denied to the nick, would it be enough for me to remove this line?

Да. Вы можете либо закомментировать эту строку ";.aline -hp @AutoReplyQuery $+([,$time,]) $nick - was denied access to private.", либо просто удалить её.


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

4: Still as regards the line of code above, can I modify it without problems in case I want to keep it to make other useful information appear instead of the message? Like, common channels of the nick who wrote me and things like that...

Да, конечно. Вы можете использовать эту строку с командой ".aline -hp @AutoReplyQuery - any of your text" для добавления любой необходимой вам информации в окно "@AutoReplyQuery" в момент, когда срабатывает это событие. Подробнее о команде: https://en.wikichip.org/wiki/mirc/commands/aline

Подпись автора

[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="http://forumstatic.ru/files/000d/c9/8c/34681.jpg"></td><td><a href="http://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]

5

Ok perfect, all clear. Everything works perfectly, in case there is any problem I will update the discussion!

Thank you so much for your help!

6

There is a small problem, or rather, a strange thing that happens:

I tried to connect via browser to the chat and write a message to my nickname (nick that was online, not offline), and, as soon as I wrote the message, the message of the script that I had set appeared, in short, the script worked, but when I went to mirc to see the query, there was only the message of the nick and not my answer!

Example to better understand:

Browser Chat:
Nick 1: Hello!
Nick 2: Hi, this is an autoresponder!

And here everything seems ok, the script works ... But then when I go to see the query on mIRC, there is only this:

Nick 1: Hello!

And that's it ... There is not my automatic message, but on the browser chat instead the automatic message is there!

How is it possible?

7

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

I tried to connect via browser to the chat and write a message to my nickname (nick that was online, not offline), and, as soon as I wrote the message, the message of the script that I had set appeared, in short, the script worked, but when I went to mirc to see the query, there was only the message of the nick and not my answer!

Просто это магия  ✨ http://www.kolobok.us/smiles/big_standart/greeting.gifhttp://epicnet.ru/smiles/kolobok/cool.gif

На самом деле мне показалось, что это необязательно видеть, так как вы итак знаете какой текст в авто сообщении.
Но если вы всё-таки хотите видеть собственные авто сообщения, то уберите из команды точку ".msg" ➔ "msg".

Подпись автора

[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="http://forumstatic.ru/files/000d/c9/8c/34681.jpg"></td><td><a href="http://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]

8

Oh, it really was magic then  http://epicnet.ru/smiles/kolobok/rofl.gif

I prefer the message to appear, if it doesn't appear it looks like it doesn't work, and when I sent the message myself to my nick, which appeared on one side and on the other not, I was like... wtf  http://www.kolobok.us/smiles/icq/wacko1.gif

It's okay now, thanks  http://www.kolobok.us/smiles/icq/drinks.gif

9

Ok I found another little problem.

In the script I posted in the first message there was this piece of code:

Код:
if ($me == MyNick)

This is because I only need the script to work when I have a specific nick. Is it possible to add this functionality please?

10

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

This is because I only need the script to work when I have a specific nick. Is it possible to add this functionality please?

Да, конечно. Вы можете добавить это в код в качестве ещё одного условия "if ($me == MyNick)".
Но я решил добавить в меню ещё один пункт "Set offline nick" для более удобной настройки необходимого вам ника, который будет сохранён в переменной "%arq_nick_off".


Таким образом обновлённый код скрипта теперь выглядит так:

Код:
#anti-pv off
on *:TEXT:*:?:{
  if ($me == %arq_nick_off) {
    if (!$read(%arq_path, w, $nick)) {
      if (!$hget(arq,$nick)) {
        .msg $nick The auto query is active | .hadd -mz arq $nick 3600
        if (!$window(@AutoReplyQuery)) .window -ez @AutoReplyQuery
        .aline -hp @AutoReplyQuery $+([,$time,]) $nick - was denied access to private.
      }
      .close -m $nick
    }
    else { if ($hget(arq,$nick)) .hdel -sw arq $nick }
  }
}
#anti-pv END
---------------------------------------------------
menu menubar,status,channel,query,@AutoReplyQuery {
  Auto-reply-query
  .$iif($group(#anti-pv).status == on,$style(1)) Enabled : arq_enable
  .$iif($group(#anti-pv).status == off,$style(1)) Disabled : arq_disable
  .-
  .Set offline nick : %arq_nick_off = $$?="Enter the nick with which the script should work:"
  .-
  .Reset hash nicks : .hfree -sw arq | .echo -a Reset hash nicks.
  .-
  .Exclusion nicks : arq_exc_nicks
}
on *:CONNECT: .timerARQ -m 1 3000 arq_enable
on *:EXIT: arq_disable
---------------------------------------------------
alias arq_enable { .enable #anti-pv | .window -ez @AutoReplyQuery }
alias arq_disable { .disable #anti-pv | .close -@ @AutoReplyQuery }
alias arq_exc_nicks { %arq_path = scripts\arq_nicks.txt | if (!$exists(%arq_path)) .write %arq_path | .run %arq_path }
Подпись автора

[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="http://forumstatic.ru/files/000d/c9/8c/34681.jpg"></td><td><a href="http://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]