mIRC Home    About    Download    Register    News    Help

Print Thread
#250943 03/02/15 06:04 PM
Joined: Feb 2015
Posts: 17
F
Pikka bird
OP Offline
Pikka bird
F
Joined: Feb 2015
Posts: 17
I'd like mIRC to show a tip when I get a PM or when somebody mentions my nickname. The problem is that $tip command only allows to create a popup that lasts from 3 to 60 seconds. I'd like a popup to stay permanently until I click on it.

Is there some kind of work around that would allow to have an indefinite desktop notification, tip etc. after receiving a PM?

Here's a script code:

Code:
; http://hawkee.com/snippet/7101
; $tip command only allows to create a popup that lasts from 3 to 60 seconds. I'd like a popup to stay permanently until I click on it.
; The same functionality can be achieved withing mIRC tools > options > display > options > tips
; To set an alert word or phrase use: /alert

on *:OPEN:?:alert $1-
on *:TEXT:*:*:alert $1-
on *:ACTION:*:*:alert $1-
on *:NOTICE:*:*:alert $1-
alias alert {
  var %msg $strip($1-)
  if !$chan || $nick = $snick(#,1) || $count(%msg,$me,$snick(#,1),%alert) {
    if !$tip($nick) && !$istok(NickServChanServ,$nick,7) && (!$appactive || $activewid != $window($iif(#,#,$iif($nick,$v1,$active))).wid) {
      flash -b1r2
      %msg = $iif($len(%msg) < 333,%msg,$left(%msg,330) $+ ...)
      noop $tip($nick,$iif(#,#,Private Message), $nick  %msg,60,,,window -ax # $iif($window($nick),$nick,$iif($comchan($nick,1),$v1,"status window")))
    }
  }
  if (!$nick) $iif($input(Enter Alert Text,toe,Alert!,%alert),set %alert $!,unset %alert)
}



Would it be possible to repeat again this notification (tip) script after 60 seconds again, if I don't open mIRC or click on tip balloon?
In other words, repeat the tip again if I don't open mIRC window or check the PM. Something like that.

Or maybe it's possible to get a permanent desktop notification about mIRC PMs by using some other commands or options?

Thank you.

Last edited by FraneHines; 03/02/15 06:06 PM.
Joined: Jul 2006
Posts: 4,149
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,149
Tips probably never were meant to be displayed indefinitely, you may want to ask for that feature for $tip.
You can right click the tip to prevent it's counter from decreasing but that's not very a workaround frown
You can use custom @windows with /window to create some customs tips


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
Is there an event that trigger on click on tips? If that was the case then it could've been scripted to re-enable the tip each time a variable hasn't been set (which would be set on tip-click) - or unset for that matter, probably preferable in this situation.

Maybe even an infinite while, not sure how that would work in terms of memory and processing power though. While (%var) noop $tip(...)


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Feb 2015
Posts: 243
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Feb 2015
Posts: 243
You can make a dialog table that will open in every private message and if you click on it , it will close and take you to the right window. I can make it for you but not right now cause im busy and on phone .. if you could wait like 2-3 days max ??:) Or someone else can make it if you want it earlier smile

Last edited by OrFeAsGr; 03/02/15 08:23 PM.
Joined: Feb 2015
Posts: 17
F
Pikka bird
OP Offline
Pikka bird
F
Joined: Feb 2015
Posts: 17
Thank you all for replying.

Yes, a dialog table that opens on a PM is a great idea.

I could wait as long as it takes for you, OrFeAsGr, to write the code. Thanks for your help smile

Joined: Feb 2015
Posts: 243
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Feb 2015
Posts: 243
hey laugh i found out that a custom window could be more usefull and easy and it can be desktop as well. So Here Are 2 Versions Of The Same Script.
This Version Is Multi-Network
Code:
on *:open:?:*: {
  if (!$window($+(@Private`Messages`,$network))) { window -mdk0 $+(@Private`Messages`,$network) }
  aline $+(@Private`Messages`,$network) 3User14:7 $nick 6 $chr(124) 3Date&Time14: $+($date,&,$time) 6 $chr(124) 3Text14: $1-
  aline $+(@Private`Messages`,$network) 6---------------------------------------------------------------------------------
}

This means it will open a different window for each network.
----------------------------------------------------------------
And The Following Script Is The Same But It Will Keep All Messages In A Single Window And Mention The Network In The Line
Code:
on *:open:?:*: {
  if (!$window(@Private`Messages)) { window -mdk0 @Private`Messages }
  aline @Private`Messages 3User14:7 $nick 6 $chr(124) 3Network14:7 $network 6 $chr(124) 3Date&Time14: $+($date,&,$time) 6 $chr(124) 3Text14: $1-
  aline @Private`Messages 6-----------------------------------------------------------------------------------
}

Pick The One You Want smile And Let Me Know If You'd Like Something More smile
-OrFeAsGr-

Last edited by OrFeAsGr; 07/02/15 03:51 PM.
Joined: Jul 2006
Posts: 4,149
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,149
No event for tips. You could do what you are suggesting with a timer, however, an 'infinite while' means mIRC is simply not responsive and freezing, it's not an option.

@OrFeAsGr: Just like I suggested!


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Feb 2015
Posts: 243
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Feb 2015
Posts: 243
yeah you were right ,windows are better for this function and a lot easier to script than scripting a dialog smile

Last edited by OrFeAsGr; 07/02/15 04:36 PM.
Joined: Feb 2015
Posts: 17
F
Pikka bird
OP Offline
Pikka bird
F
Joined: Feb 2015
Posts: 17
First of all - thank you, OrFeAsGr, for these great scripts. These scripts work just the way I've wanted them to work!

I've tested both scripts and settled on one that keeps all messages in a single window.

OrFeAsGr script has allowed me to achieve what I've wanted. We could end this topic here, but I'd like to ask 3 questions related to this.

1. First question.

So I've modified OrFeAsGr script to my preferences. Now the script code looks like this:

Code:
on *:open:?:*: {
  if (!$window(@mIRC-PM)) { window -mdk0 @mIRC-PM }
  aline @mIRC-PM Nick: $nick
  aline @mIRC-PM Network: $network
  aline @mIRC-PM Date&Time: $+($date,$chr(32),$time)
  aline @mIRC-PM Text: $1-
  aline @mIRC-PM -----------------------------------------------------------------------------------
}


Visually the script looks like this:



Originally, OrFeAsGr script included code fragments like: 3User14:7; 3Date&Time14.

Why were those numbers like 3; 14:7 used?

Visually original script looked like this:



Why were those numbers like 3; 14:7 (underlined by a red line) used?



2. Second question.

Which script command does actually detect that I've received a PM? Looking at code I assume it's this part of the code:

Code:
on *:open:?:*:


I've tried googling about this command without any luck. How does it actually detect that I've received particularly a PM?



3. Third question.

Are you able to copy-paste script code from this page into mIRC script editor without any formatting issues?

Because I'm having a problem copy-pasting the script code.

Here's how I see the script code in this page using Chrome:



^^ No formatting issues.

Here's how I see the script code after pasting it into mIRC script editor:



^^ Formatting issues underlined by a red line.

Here's how I see the script code after pasting it into MS Word 2013:



^^ Formatting issues underlined by a red line.

I've tried these options, but neither fixed this issue:

1. Pasting as plain text only.
2. Pasting into Notepad first.
3. Copying the script code from this page using Firefox, Chrome or Internet Explorer.
4. Changing Chrome encoding from Western (windows-1252) to Unicode (UTF-8).
5. Using or not using a clipboard manager like Ditto.
6. Using another PC.

Finally, I've found the only solution that fixes this issue for me:
Copy-pasting script code from this page to Google Docs. Then copy-pasting script code from Google Docs to mIRC script editor.
This method copy-pastes code from this page to mIRC script editor or any other word processor like Notepad or MS Word without any issues. Pasted code looks the same way as it looks on this page in web browser.

Somehow I think it has something to do with character encoding: Western (windows-1252); Unicode (UTF-8) and PHP, HTML (web browser thing) vs whatever is used in other text editors like mIRC script editor, Notepad, MS Word etc.

Do you all experience such behavior or is the problem only on my side?

Once again, thank you all for your input smile

Joined: Feb 2015
Posts: 243
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Feb 2015
Posts: 243
I'm glad i helped smile
The Numbers Before Or After The Words Are mIRC Colour Codes. I guess that in web text it's different and not visible and when you copy them from web they are not copied.
Now about the PRV Messages. The events that a private message triggers are:
On *:open:?:*: this event is triggered only when a query is opened
The event that triggers in all private messages is on *:text:*:?: which the known on text event but with a ? Instead of # . ? is for private msg , # is for channel
If you want the script to aline all messages you can change the event to on *:text:*:?: {
About the copy paste , i havent copied any code from here yet , but i will try it and let you know soon. I think it's not your problem only , it's probably something about the webpage format (or something like that) . So it would be better for all of us to use $chr(03) which is the same colour code but in ascii. The best way to do this is $+($chr(03),3) which is green. The number would be changed depending on the colour you want. So the colours will be visible and the code will be copied without format issuess

P.S Credits For This Script Go To Wims which First suggested a custom window smile

Last edited by OrFeAsGr; 09/02/15 03:37 PM. Reason: Added P.S :)
Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
Originally Posted By: FraneHines
Why were those numbers like 3; 14:7 used?

Those are control codes for colors.

Originally Posted By: FraneHines
How does it actually detect that I've received particularly a PM?

The ? is the part that specifies a PM.

Originally Posted By: FraneHines
Are you able to copy-paste script code from this page into mIRC script editor without any formatting issues?

The boxes or dashes you see are control code for colors (press ctrl+k to insert it, 0x03). While the character is not usually rendered in browsers it is copied correctly and displays in the script editor - this is not a problem.

Joined: Feb 2015
Posts: 17
F
Pikka bird
OP Offline
Pikka bird
F
Joined: Feb 2015
Posts: 17
Originally Posted By: Loki12583
The boxes or dashes you see are control code for colors (press ctrl+k to insert it, 0x03). While the character is not usually rendered in browsers it is copied correctly and displays in the script editor - this is not a problem.


Thanks for clarification, Loki12583. That's completely true. Here's how OrFeAsGr original script looks when you simply copy-paste it from browser to mIRC script editor:




Using OrFeAsGr original script as an example, I've also made a script that creates a Desktop Window when somebody mention my nick on mIRC channel window (Nick alert script). Every time someone mention your nick, new entry is added into a single Desktop Window.

In case someone needs it, here's the script code:

Code:
on *:Text:$(* $+ $me $+ *):#: {
  if (!$window(@mIRC-NickAlert)) { window -mdk0 @mIRC-NickAlert }
  window @mIRC-NickAlert
  aline @mIRC-NickAlert 3Network: $str($chr(160),8), 6 $network 
  aline @mIRC-NickAlert 3Channel: $str($chr(160),8), 8 $chan 
  aline @mIRC-NickAlert 3Nick: $str($chr(160),14), 12 $nick 
  aline @mIRC-NickAlert 3Date & Time: $str($chr(160),2), 4 $+($date(yyyy mmmm d) ,$chr(32),2 $chr(40),$date(dddd),$chr(41) ,$chr(32),10 $time )
  aline @mIRC-NickAlert $crlf
  aline @mIRC-NickAlert 13T e x t: $str($chr(160),12), $1-
  aline @mIRC-NickAlert $crlf
  aline @mIRC-NickAlert 5-----------------------------------------------------------------------------------
  aline @mIRC-NickAlert$crlf
}


Here's how the nick alert script looks in reality:



Thank you all who contributed! smile


Link Copied to Clipboard