Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

4 226 Posts in 996 Topics- by 1 092 Members - Latest Member: AmyAaron

24 April 2017, 13:23
Select Language English | Russian ru | German
Main PageIRC Client KVIrc forumKVIrc discussionKVIrc scriptingNotify Window Script
Pages: [1]
Print
Author Topic: Notify Window Script  (Read 288 times)
0 Members and 1 Guest are viewing this topic.
c0rmega
Новичок
*

Репутация: 1
Posts: 5


View Profile
« on: 28 February 2017, 01:36 »

I'm new to KVIrc, and I was hoping somebody would be willing to write a script for me, if it's possible to do in KVIrc. Here's the script for mIRC and how it looks:
Code:
on *:TEXT:*c0rmega*:*: {
  if (!$window(@NickAlerts)) { window -k0n @NickAlerts }
  echo @NickAlerts 8,1Date:0,1 $asctime(dddd) $+ , $asctime(mmmm dd) $+ , $asctime(yyyy) - $asctime(hh:nn:ss TT)
  echo @NickAlerts 8,1Network:0,1 $network 8,1/0,1 $server
  echo @NickAlerts 8,1Channel:0,1 $chan
  echo @NickAlerts 8,1User:0,1 $nick
  echo @NickAlerts 11,1 $1-
  echo @NickAlerts 1,1-
}


It's somewhat similar to the built in Notifier in KVIrc, except instead of opening a separate window outside of KVIrc, it would open a window inside of KVIrc in the Tree list, with the information provided like in the screenshot. Additionally, if I could edit it to use wildcards for certain keywords, for instance like "c0rm*ga" that would be great.

I've tried to wrap my head around making scripts for KVIrc, but I'm completely lost. Any help would be greatly appreciated.
Logged
alexzulu
Постоялец
***

Репутация: 34
Posts: 211



View Profile Email
« Reply #1 on: 28 February 2017, 07:00 »

I have a script performs a similar function.
See how it works, you can here https://youtu.be/4cc_AuIjU6Y
Download script, you can here http://kvirc.alexzulu.ru/pool/4/hlog-0.4.0.tar.gz
Logged

Network: freenode. Channels: #kvirc and #kvirc-ru
c0rmega
Новичок
*

Репутация: 1
Posts: 5


View Profile
« Reply #2 on: 28 February 2017, 16:59 »

This is useful, thank you. I'll keep trying to learn so I can hopefully figure out how to integrate this hlog window to be visible in the tree list when a highlight happens.

Do you know if it's possible to utilize wildcards like * or ? in KVIrc's highlight tool? The settings seem to take them literally instead of as wildcards.
Logged
kns
Постоялец
***

Репутация: 38
Gender: Male
Posts: 232


View Profile WWW
« Reply #3 on: 28 February 2017, 23:57 »

You should also try wodim's script https://github.com/wodim/kvirc-scripts/blob/master/OnHighlight.highlightwindow.kvs
Logged
c0rmega
Новичок
*

Репутация: 1
Posts: 5


View Profile
« Reply #4 on: 1 March 2017, 10:15 »

kns, what does this script do exactly? I'm having trouble deducing what it does just from reading it.
Logged
c0rmega
Новичок
*

Репутация: 1
Posts: 5


View Profile
« Reply #5 on: 1 March 2017, 15:10 »

I've found a script that adds the highlight log to the channel tree list, similar to how I had it setup in mIRC: https://github.com/OmegaPhil/kvirc-highlight-management-script

If I could just figure out how to add wildcards to the highlighted words, it would be almost perfect.
Logged
alexzulu
Постоялец
***

Репутация: 34
Posts: 211



View Profile Email
« Reply #6 on: 2 March 2017, 23:50 »

I don't know much regular expressions. Please test the script. http://kvirc.alexzulu.ru/pool/4/nick_alerts-0.0.1.tar.gz
« Last Edit: 2 March 2017, 23:54 by alexzulu » Logged

Network: freenode. Channels: #kvirc and #kvirc-ru
c0rmega
Новичок
*

Репутация: 1
Posts: 5


View Profile
« Reply #7 on: 9 March 2017, 17:20 »

The script you made is more in line with what I was using on mIRC, thank you.

I'm having an issue with the words that are meant to be highlighted, though. It still doesn't accept wildcards (? and *). Is there any way to fix that? So for instance let's say I added "c0r?ega" as a word to be highlighted, it would highlight "c0rmega" as well as things like "c0rpega" or "c0r1ega". Basically ? representing any 1 character and * representing any number of characters.

Thank you for your help.

EDIT: Just to clarify, by highlight I mean to be added to the notify window (Nick Alerts). Sorry for that confusion.
« Last Edit: 9 March 2017, 17:33 by c0rmega » Logged
Cabji
Новичок
*

Репутация: 0
Posts: 7


View Profile
« Reply #8 on: 16 April 2017, 05:49 »

Some code tips.
To create a windows inside kvirc (checks if window exists, creates if it doesn't):

%windowName = "Hilights"
if ($window.exists($window(%windowName)) == 0)
{
   # create hilight window
   $window.open("mq", %windowName,0,305)
}

note that you can change the parameters of $window.open (ie: "mq" for the window type and the numbers at the end for icons etc. see kvirc doc for function $window.open for details: http://www.kvirc.net/doc/fnc_window.open.html)

You can find values either exact strings, with wildcard characters * ? or as regex by using $str.grep function: http://www.kvirc.net/doc/fnc_str.grep.html in an Event Handler in onChannelMessage (or onQueryMessage, or any other event you want to handle for hilighting)

Code example is something like:

# check a specific channel name by setting value of %chanName
if ($chan.name() == %chanName)
{
   # we are doing a wildcard str.grep() here. see str.grep documentation for details
   if ($str.grep(%stringToFind, $3, w))
   {
      echo -w=$window(%windowName) whatever you want to echo to hilight window
   }
}

This should get you on your way to outputting stuff to windows inside kvirc. If you want to handle and send messages from and to multiple networks at the same time its a little more than this, but this is good for the basics and for just catching incoming messages.
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic