Author Topic: Help with creating a new 'Pop-up on channel message' window  (Read 5881 times)

nickbsd

  • Guest
Help with creating a new 'Pop-up on channel message' window
« on: August 28, 2007, 05:46:07 PM »
Hello All,

I was wondering if someone could help me with creating a script that will popup outside of ICEChat. I'd like to create a script that will detect if someone messages a specific channel and it would create a popup message on the desktop. Is this possible?

Any information would be appreciated.  :mrgreen:

Thanks!

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: Help with creating a new 'Pop-up on channel message' window
« Reply #1 on: August 28, 2007, 10:01:02 PM »
Yes, this is possible, but you would need to do it with an ActiveX DLL, and then CreateObject, and all those complicated things.
Not something a regular person can do, because you need the tools to create the DLL file.

With regular scripting, all the windows stay within IceChat (CreateDialog windows).
There was going to be a way to create balloon popups from the System Tray, but was never implemented.
The IceChat God

Fluteman

  • Newbie
  • *
  • Posts: 4
Re: Help with creating a new 'Pop-up on channel message' window
« Reply #2 on: October 08, 2007, 01:14:58 AM »
I'm not sure what a makes a popup be 'inside' or 'outside' of IceChat, as long as it appears onscreen.  It seems to me the routine 'MesBox' of IceChat scripting can work just fine, if I understand the original question.  A MesBox will pop up even if IceChat is minimized.

There are a couple tricks.  One trick is to make sure only one such popup appears at a time; you don't want runaway popups!  Another trick is to isolate this in its own ONTEXT subroutine which does JUST this and not any other ONTEXT processing you want (because the one ONTEXT execution that really does the MesBox popup will block on the MesBox and not finish other work until OK is clicked).  To accomplish the latter, put the ONTEXT Sub for the MesBox into its own *.ice script file.  You can do other ONTEXT processing in ONTEXT sups created in other script files; Icechat keeps track of them and calls them all.

Below is a script I wrote to test that this works.  The static variable 'PoppedUpNow' (defined outside the Sub) is what keeps track of whether one MesBox is displayed or not.

Let me know if any of this is a bad concept or implementation:


'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'

TestForChannel = "#Chris"        ' fill in your own channel name


PoppedUpNow = FALSE        ' declare globally and initialize

TestForChannel = LCase(TestForChannel)        ' use LCase to make matching the chan name case-insensitive

Sub ONTEXT(Message,Channel,Nickname,Host,ServerNumber)
  If LCase(Channel) = TestForChannel Then   
    If PoppedUpNow = FALSE Then
      PoppedUpNow = TRUE
      MesBox "FOUND IT!!!  -->  " & Nickname & " in " & Channel & " says:  ' " & Message & " '  "
      PoppedUpNow = FALSE
    End If
  End If
End Sub

'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: Help with creating a new 'Pop-up on channel message' window
« Reply #3 on: October 10, 2007, 04:15:32 PM »
Amusing, but, that Script won't actually ever work, the way you have it :)

But a MesBox is the trick, because it will not stop IceChat from functioning, and it will continue on.
The IceChat God

Fluteman

  • Newbie
  • *
  • Posts: 4
Re: Help with creating a new 'Pop-up on channel message' window
« Reply #4 on: October 13, 2007, 01:49:57 PM »
Gee, Snerf, I'll have to ask you to explain what you mean by this never being able to work.

I tested it before posting, and it worked then.

Just in case I entered it wrong into this Forum, I copied it into a fresh script in IceChat.  It works.

So, please, you have to say more than you have said so far.  If there is something wrong with this, what *exactly* is it?


Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: Help with creating a new 'Pop-up on channel message' window
« Reply #5 on: October 13, 2007, 04:33:58 PM »
Nm that, I see my mistake.
TestForChannel = "#Chris"        ' fill in your own channel name

TestForChannel = LCase(TestForChannel)        ' use LCase to make matching the chan name case-insensitive

I didnt see the Lcase() line, cuz w/o that, it will not work.
The IceChat God