+  HandyCache форум
|-+  Главная категория» English forum» monitor string after init
Имя пользователя:
Пароль:
Страниц: [1]   Вниз
  Отправить эту тему    Печать  
Автор Тема: monitor string after init  (Прочитано 108 раз)
0 Пользователей и 1 Гость смотрят эту тему.
truefriend-cz
Постоялец
***

Репутация: +3/-1
Offline Offline

Сообщений: 108


« : 10 Октябрь 2018, 06:23:00 »

How i can send to monitor string after start HC? (Or as Timer1m)? Thanks
Сообщить модератору   Записан
mai62
Автор HC
*****

Репутация: +221/-4
Offline Offline

Сообщений: 6317


« Ответ #1 : 12 Октябрь 2018, 00:14:29 »

Код:
--[[ <HCExtension>
@name   timer_Test
@event  Timer1s
</HCExtension> ]]

function Timer1s()
  hc.play_sound('SystemExclamation')
  hc.monitor_string = 'Timer'
end
Сообщить модератору   Записан
truefriend-cz
Постоялец
***

Репутация: +3/-1
Offline Offline

Сообщений: 108


« Ответ #2 : 12 Октябрь 2018, 01:30:16 »

No. In monitor anything. And no errors in log.
Extension is reading after add show text window only. No sounds (Sound play if using wav only (all system sounds i have disabled)), no monitor text.
Tested on latest new version ...860
Tested variations:
hc.monitor_string = 'Timer'
hc.monitor_string = ('Timer')
hc.monitor_string = 'Timer';
hc.monitor_string = ('Timer');
hc.monitor_string('Timer')
hc.monitor_string([[Timer]])
hc.action=hc.monitor_string..'Timer'
execute_cmd(hc.monitor_string..'Timer')
put_msg(3, hc.monitor_string..'Timer')
put_to_log(hc.monitor_string..'Timer')
put_to_log(hc.monitor_string'Timer')
put_to_log(hc.monitor_string='Timer')

put_to_log(hc.monitor_string('Timer'))
maybe accepted, (but no show in monitor) but ended with error:
[string "--[[ <HCExtension>
..."]:12: attempt to call field 'monitor_string' (a string value)


Код:
--[[ <HCExtension>
@name   timer_Test
@event  Timer1s
</HCExtension> ]]

function Timer1s()
  hc.play_sound('SystemExclamation')
  hc.monitor_string = 'Timer'
end
« Последнее редактирование: 12 Октябрь 2018, 02:21:08 от truefriend-cz » Сообщить модератору   Записан
mai62
Автор HC
*****

Репутация: +221/-4
Offline Offline

Сообщений: 6317


« Ответ #3 : 13 Октябрь 2018, 03:14:11 »

You're right. I made a mistake. The Timer1s event handler can not display the text in monitor line.
Only events associated with a specific request can output text to the line that is associated with its request.
You can get a line in the monitor from a timer event in this way:
Код:
--[[ <HCExtension>
@name   timer_Test
@event  Timer1s
</HCExtension> ]]

function Timer1s()
  hc.play_sound('SystemExclamation')
  local hdr = 'GET http://__timer__.org HTTP/1.0\r\nConnection: close\r\n\r\n'
  hc.send_request(hdr)
end
Сообщить модератору   Записан
truefriend-cz
Постоялец
***

Репутация: +3/-1
Offline Offline

Сообщений: 108


« Ответ #4 : 13 Октябрь 2018, 06:37:16 »

The solution is not a hurry. I'm not talking about the line of the monitor with a link, but rather just about displaying custom text with a color parameter, variables, etc. as well as when it goes through the monitor while loading the item by the standard way (with blank URL).

Do you plan to future add this option (for running hc.monitor_string in Init, Timer1s, Timer1m) to HandyCache? If so, in what version?
Сообщить модератору   Записан
mai62
Автор HC
*****

Репутация: +221/-4
Offline Offline

Сообщений: 6317


« Ответ #5 : 13 Октябрь 2018, 14:14:21 »

Each line in the monitor is associated with an http request. The line number in the monitor is the request number. I have no desire to destroy this congruence.
I don't understand why you need to create new lines from a timer event.
Сообщить модератору   Записан
truefriend-cz
Постоялец
***

Репутация: +3/-1
Offline Offline

Сообщений: 108


« Ответ #6 : 13 Октябрь 2018, 18:18:56 »

After runing and timer1x as status show variables and text. Or if have Extension groups add to monitor separate strings.
With hc. for sound combinations is good combination. Maybe, if connect user... play sound... and show colorized text. Or, if size limit 85% user. Playing sound and show in monitor status, User have 85% of data limit, or tuning, etc.

A pop-up window or log_window is not always desirable. And when it disappears, nothing seems to have happened. Or, if it is a problem to modify the existing solution, then add a new parameter for this feature. Exclusively for the init and timers section, or anything else associated with the passage of a request but only for sending a message to the monitor, such as a special command at any time working for the LOG window or popup window.

Basically, I lack a feature that would send text to the monitor, such as a text-to-pop-up feature and a window log. Plus, to be able to use the associated function like hc.monitor_color.. For example hc.monitor_info('My text') supported with hc.monitor_color function and variables.

I'm missing support for sending text to the monitor (view text only in the rule column). Just as the existing features do hc.put_to_log or hc.put_msg. A possible solution might be to add a function like: hc.put_to_monitor (with supporting the use of existing feature hc.monitor_color).

Sorry for many words Улыбка
« Последнее редактирование: 13 Октябрь 2018, 18:33:07 от truefriend-cz » Сообщить модератору   Записан
Страниц: [1]   Вверх
  Отправить эту тему    Печать  

 
Перейти в: