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

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

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



Help with timer delay

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

1

I'm trying with zero results to trigger a script myself (the script works since it's not mine ... ) with the timer, where am I wrong? Here is the code:

Код:
#messagecontrol on
on @*:text:*die*:#geek: {
  window -enk0z @messagecontrol 70 43 490 400 Comic Sans MS 18
  echo @messagecontrol $timestamp nick: $nick said: " $1- " 
}
#messagecontrol end

------------------------------------------
on *:EXIT: .disable #messagecontrol

here is the activation code in the popups but I don't think it's needed, in any case I'll post it

Код:
messagecontrol
.Active:/.enable #messagecontrol | .echo -a messagecontrol is now active. | window -enz @messagecontrol
.Deactivate:/.disable #messagecontrol | .echo -a messagecontrol disabled | /close -@ @messagecontrol

And this is the On Connect command, to be added above On Exit, with the timer I tried to create:

Код:
on *:CONNECT:/timer -em 1 10000 .enable #messagecontrol | window -e @messagecontrol

I was trying to create a timer that after I connected, after 10 seconds, triggered the script. I've seen that -e runs the code and -m sets the milliseconds, but I don't know what I should put, or how to skip [time], before the milliseconds... and I'm not sure if the command for the appearance of the window, "window -e @messagecontrol" is also correct (I need to open the window so as to understand that the script is active), what would be the correct command?

2

1409,375 написал(а):

I was trying to create a timer that after I connected, after 10 seconds, triggered the script.

Чтобы таймер сработал 1 раз через 10 секунд вам достаточно указать через пробел числа 1 и 10, без дополнительных переключателей "/timer 1 10".


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

Код:
#messagecontrol off
on @*:TEXT:*die*:#geek:{
  if (!$window(@messagecontrol)) window -enkz @messagecontrol 70 43 490 400 Comic Sans MS 18
  aline @messagecontrol $timestamp nick:12 $nick said: $+("03,$1-,")
}
#messagecontrol end
------------------------------------------
on *:CONNECT: .timer 1 10 .enable #messagecontrol | window -enkz @messagecontrol 70 43 490 400 Comic Sans MS 18
on *:EXIT: .disable #messagecontrol

В всплывающем окне меню:

Код:
messagecontrol
.Active: .timer 1 10 .enable #messagecontrol | echo -a messagecontrol is now active. | window -enkz @messagecontrol 70 43 490 400 Comic Sans MS 18
.Deactivate: .disable #messagecontrol | echo -a messagecontrol disabled | close -@ @messagecontrol

[indent=0.8,0.5]
Подробнее о таймере вы можете прочитать здесь: https://en.wikichip.org/wiki/mirc/commands/timer

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

[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

Yes now it works. I checked the wikichip link you sent, but it's me who's really bad at these things.

In any case I removed "12" from "nick:12" because the number appeared in the message, and the same with "03" from ("03,$1-,").

Also, I think there is another problem now, in the versione I posted, the #messagecontrol window turned red when someone wrote the word, but not now, it seems almost inactive, but if you look in the window, the messages are there and it works

4

1412,375 написал(а):

I checked the wikichip link you sent, but it's me who's really bad at these things.

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


1412,375 написал(а):

In any case I removed "12" from "nick:12" because the number appeared in the message, and the same with "03" from ("03,$1-,").

Это не просто числа, а числовой код цвета. Вероятно вы не правильно скопировали код с форума. Переводчик сайта искажает код, поэтому вам нужно отключить онлайн переводчик и скопировать код в оригинале (когда форум отображается на русском языке). В любом случае вы можете это убрать. Я добавил цвет только для удобного различия отображаемого текста в окне.


1412,375 написал(а):

Also, I think there is another problem now, in the versione I posted, the #messagecontrol window turned red when someone wrote the word, but not now, it seems almost inactive, but if you look in the window, the messages are there and it works

Что вы имеете в виду под красным цветом? Это цвет фона окна или цвет, которым мигает окно на панели списка окон? Если окно работает, то в чём тогда проблема и что не так?

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

[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]

5

I imagined they were the colors, on my mIRC before passing a color code I have to use ctrl+k and then put the color number.

With red I meant this:

https://i.imgur.com/uXrMQ6v.jpeg

Without flashing

6

Подсвечивание красным цветом названия окна может быть настроено в опциях вашего клиента "mIRC Options/Display/Message".

Я не совсем понимаю, что вы хотите исправить или изменить 
Если у вас есть какие то проблемы, то пожалуйста опишите их подробнее по пунктам, а также как их можно воспроизвести. Или перечислите ваши предложения по обновлению скрипта.

Хотя это будет уже совсем другая (новая) проблема, которая не будет соответствовать заголовку первого поста, поэтому будет лучше, если вы создадите новую тему с новым вопросом.

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

[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]

7

The option in "mIRC Options/Display/Message" is enabled.  In my first message, where there is this version of the script:

Код:
#messagecontrol on
on @*:text:*die*:#geek: {
  window -enk0z @messagecontrol 70 43 490 400 Comic Sans MS 18
  echo @messagecontrol $timestamp nick: $nick said: " $1- " 
}
#messagecontrol end

------------------------------------------
on *:EXIT: .disable #messagecontrol
Код:
messagecontrol
.Active:/.enable #messagecontrol | .echo -a messagecontrol is now active. | window -enz @messagecontrol
.Deactivate:/.disable #messagecontrol | .echo -a messagecontrol disabled | /close -@ @messagecontrol

When someone typed the entered word, in this case "die", the "@messagecontrol" window turned red (as in the example image with the #trythis window)

With the later version you created, the script works normally but the window "@messagecontrol" no longer turns red. I hope I have explained myself well now.

And I noticed one thing, which may be the problem: in the first version of the script, the one posted by me, the window "@messagecontrol," had the snail (@), while in your version the window is without the snail, "messagecontrol." Could that be why it doesn't turn red?

8

1416,375 написал(а):

When someone typed the entered word, in this case "die", the "@messagecontrol" window turned red (as in the example image with the #trythis window)
With the later version you created, the script works normally but the window "@messagecontrol" no longer turns red. I hope I have explained myself well now.

Это потому, что окно @messagecontrol теперь записывает новые сообщения через команду "aline", а не через "echo", как это было у вас. Между ними есть разница.
Чтобы окно подсвечивалось цветом, когда в нём появляется новое сообщение вам нужно добавить к команде переключатель "aline -h".
Подробнее об этом можно прочитать здесь: https://en.wikichip.org/wiki/mirc/commands/aline


1416,375 написал(а):

And I noticed one thing, which may be the problem: in the first version of the script, the one posted by me, the window "@messagecontrol," had the snail (@), while in your version the window is without the snail, "messagecontrol." Could that be why it doesn't turn red?

Нет, это не влияет на подсвечивание окна. Префиксный значок "@" был спрятан благодаря установленному переключателю в команде "window -k", просто чтобы убрать лишнее.
Подробнее об этом можно прочитать здесь: https://en.wikichip.org/wiki/mirc/commands/window


[indent=0.8,0.5]
P.S. Пожалуйста не используйте переводчик текста для блока с кодом, это разрушает его целостность синтаксиса и делает неработоспособным 

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

[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]

9

Ok, I added "-h" to "aline", then "-k1" to "window", and now everything works fine, thanks.

And yes, I won't translate the code 

Отредактировано Lippy (14.08.2023 19:19)