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

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

Сообщений: 118


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

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

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

Сообщений: 6383


« Ответ #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

Сообщений: 118


« Ответ #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
*****

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

Сообщений: 6383


« Ответ #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

Сообщений: 118


« Ответ #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
*****

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

Сообщений: 6383


« Ответ #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

Сообщений: 118


« Ответ #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 » Сообщить модератору   Записан
mai62
Автор HC
*****

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

Сообщений: 6383


« Ответ #7 : 21 октября 2018, 16:40:42 »

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

function Timer1s()
  hc.play_sound('SystemExclamation')
  local hdr = 'GET http://__timer__ HTTP/1.0\r\nConnection: close\r\n\r\n'
  hc.send_request(hdr)
end

function RequestHeaderReceived()
  hc.extensions_on = false
  hc.answer_header = 'HTTP/1.1 200\r\nConnection: close\r\n\r\n'
  hc.answer_body = ''
  hc.action = 'dont_save'
  hc.monitor_string = hc.monitor_string .. 'Short message#~#Extended message#~#'
  hc.monitor_text_color = 36095
end
Сообщить модератору   Записан
truefriend-cz
Постоялец
***

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

Сообщений: 118


« Ответ #8 : 28 октября 2018, 14:59:32 »

Thanks, it is good alternative  Отлично!

I have one small question. Why not no function this?... (in Timer1s)

Код:
if i == nil then
i=1
end
local i=i+1

I want 1+1... +1... +1.
Every 1 second.

This script output only: 2
« Последнее редактирование: 28 октября 2018, 16:11:25 от truefriend-cz » Сообщить модератору   Записан
truefriend-cz
Постоялец
***

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

Сообщений: 118


« Ответ #9 : 28 октября 2018, 19:53:47 »

Why is in monitor black only?

Код:
--[[ <HCExtension>
@name Test2
@event Init
@event RequestHeaderReceived
</HCExtension> ]]

function Init()
local hdr = 'GET http:// HTTP/1.0\r\nConnection: close\r\n\r\n'

coloris = '0'
for i = 1, 3 do
local count = i
if count == 1 then
coloris = 3937500
end
if count == 2 then
coloris = 16740484
end
if count == 3 then
coloris = 5737262
end
hc.send_request(hdr)
end
end

function RequestHeaderReceived()
hc.answer_header = 'HTTP/1.1 200\r\nConnection: close\r\n\r\n'
hc.answer_body = ''
hc.action = 'dont_save'

hc.monitor_string = hc.monitor_string .. 'Short message#~#Extended message#~#'
hc.monitor_text_color = coloris
end
« Последнее редактирование: 28 октября 2018, 20:49:44 от truefriend-cz » Сообщить модератору   Записан
Страниц: [1]   Вверх
  Отправить эту тему    Печать  

 
Перейти в: