mIRC Homepage

Notify List

Posted By: TECO

Notify List - 02/03/22 04:05 PM

Hey,
I have a code that I made to tell me the nicknames that are online on the network, but it doesn't work on multi-network. mIRC has the Notify List icon with submenu in the toolbar, but I can't get my code to work in multi-network like mIRC does in the toolbar.

Anyone who can help me change my code?

My code:
Code
menu menubar {
  Notify List
  .$submenu($notlist($1))
}
alias notlist {
  var %t = 1, %c = 2
  while ($notify(%t).ison <= %t) {
    var %nick = $notify(%t)
    if (!$server) && ($1 == 1) return $style(2) None :$null
    if ($server) && ($1 == 1) return $style(2) $network $br($server) :$null
    if ($1 == %c) && (%c <= 15) return $iif($notify(%t).ison == $true, %nick) :query %nick
    if ($1 == 16) && (%t >= 15) return More... :notify -s
    inc %c
    inc %t
  }
}

My code:
[Linked Image from i.ibb.co]

mIRC Notify List:
[Linked Image from i.ibb.co]

I've tried to change my code to work in the same way as the mIRC Notify List but I can't.
If anyone here can help me, I'd be grateful!
Posted By: TECO

Re: Notify List - 03/03/22 11:53 AM

I forgot to put the $br identifier that I created in the code.
Code
 alias br { return $+($lbr,$1-,$rbr) }
 alias lbr { return $chr(40) }
 alias rbr { return $chr(41) }

Thank you KindOne for calling my attention!
Posted By: Wims

Re: Notify List - 03/03/22 02:06 PM

Code
menu menubar {
  Notify List
  .$submenu($notlist($1))
}
alias notlist {
  if (%notlistnone) { 
    unset %notlistnone
    return $style(2) None : noop
  }
  if ($1 !isnum) return
  if (!%notlistservcount) {
    %notlistservcount = 1
    %notlistcount = 1
  }
  scon %notlistservcount
  if ($status == connected) {
    if (%notlistcount == 1) var %r $style(2) $network $br($server) : noop
    elseif ($notify($calc(%notlistcount - 1))) {
      if (%notlistcount isnum 2-16) var %r $iif($notify($calc(%notlistcount - 1)).ison,$notify($calc(%notlistcount - 1)) : scon % $+ notlistservcount query $notify($calc(%notlistcount - 1)))
      else return More... : scon % $+ notlistservcount notify -s
    }
    else goto next
    if (%r) {
      inc %notlistcount
      return %r
    }
  }
  else {
    :next
    if ($status != connected) && (%notlistcount == 1) set -u %notlistnone 1
    if (%notlistservcount == $scon(0)) {
      unset %notlistservcount %notlistcount
      return
    }
    inc %notlistservcount
    %notlistcount = 1
    return -
  }
}
Posted By: TECO

Re: Notify List - 03/03/22 02:51 PM

Hi Wims
Thanks for helping.

I tested your code but the result is this:

[Linked Image from i.ibb.co]

This is not the intended result. What I would like was something similar to what mIRC itself already does.
What I want is for the name of all networks and servers to which I am connected and the respective online nicknames of each network to appear in the same menu.
Hug
Posted By: Wims

Re: Notify List - 03/03/22 03:06 PM

I edited the code, some things were missing and some things were incorrect, I tested it so that it should display the server disabled in the menu, I don't have any nick in the notify list but it should work better.
Posted By: TECO

Re: Notify List - 03/03/22 03:17 PM

Wims
Thank you

The result is this:
[Linked Image from i.ibb.co]

But the code still has a problem. When I choose a nickname from another network, the code opens a query on the wrong network. And also writes in the query.

[Linked Image from i.ibb.co]
Thank you for your help!
Posted By: TECO

Re: Notify List - 03/03/22 03:24 PM

Wims
I tested now to be connected to 3 networks and the code stops working, the Notify List menu is disabled.
Posted By: Wims

Re: Notify List - 03/03/22 04:59 PM

I edited the code again to fix the query opening on the wrong connection.

When there is an error or something wrong happens, the global variables %notlistservcount and %notlistcount are not unset correctly, this makes the next attempts moot, makes sure to unset the two variables from the variables tab in the editor before trying.

How many status window do you have? Which one is connected? How many nick do you have in notify list per server?
Posted By: TECO

Re: Notify List - 03/03/22 05:28 PM

Hi Wims
I made a video so you can see what the problem is. At this moment the code does not open the query of any nickname. When I connect to more than 2 networks the code stops working.

Video:
Notify List
Thank you for your help
Posted By: Wims

Re: Notify List - 03/03/22 07:54 PM

I fixed more issues, I tested with one nickname this time.

Code
alias notlist {
  if (%notlistnone) { 
    unset %notlistnone
    return $style(2) None : noop
  }
  if ($1 !isnum) return
  if (!%notlistservcount) {
    %notlistservcount = 1
    %notlistcount = 1
  }
  scon %notlistservcount
  if ($status == connected) {
    if (%notlistcount == 1) var %r $style(2) $network $br($server) : noop
    else {
      while ($notify($calc(%notlistcount - 1)).ison == $false) inc %notlistcount
      if ($notify($calc(%notlistcount - 1))) {
        if (%notlistcount isnum 2-16) var %r $iif($notify($calc(%notlistcount - 1)).ison,$notify($calc(%notlistcount - 1)) : scon %notlistservcount query $notify($calc(%notlistcount - 1)))
        else return More... : scon %notlistservcount notify -s
      }
      else goto next
    }
    if (%r) {
      inc %notlistcount
      return %r
    }
  }
  else {
    :next
    if ($status != connected) && (%notlistcount == 1) set -u %notlistnone 1
    if (%notlistservcount == $scon(0)) {
      unset %notlistservcount %notlistcount
      scon -r
      return
    }
    inc %notlistservcount
    %notlistcount = 1
    return -
  }
}
Posted By: TECO

Re: Notify List - 03/03/22 08:43 PM

Wims, now i think everything is working. It's no longer a problem when I'm connected to more than 2 networks. But only one small detail is missing. The 16 nickname limit is not working and (More...) is not appearing.

[Linked Image from i.ibb.co]
Posted By: Wims

Re: Notify List - 03/03/22 08:52 PM

Seems fine to me, the limit is 16 per connection, you're never reaching that limit here so it shouldn't be showing "more".

If you want 16 nicknames limit overall and you don't want to show anything else after "more", then please state it.
Posted By: TECO

Re: Notify List - 03/03/22 08:59 PM

Wims
I'm sorry, but I thought you were aware of how the mIRC Notify List works and mIRC puts a general limit and not a per-network limit. But I apologize if I didn't mention that frown
Posted By: Wims

Re: Notify List - 03/03/22 09:28 PM

I never used the notify list, here is an update for 16 items, server and nickname included + one item for "more":

alias notlist {
if (%notlistnone) {
return $style(2) None : noop
}
if (%notlistmore) {
return $v1
}
if ($1 !isnum) return
if (!%notlistservcount) {
set -u %notlistservcount 1
set -u %notlistcount 1
set -u %notlistmorecount 1
}
scon %notlistservcount
if ($status == connected) {
if (%notlistcount == 1) var %r $style(2) $network $br($server) : noop
else {
while ($notify($calc(%notlistcount - 1)).ison == $false) inc %notlistcount
if ($notify($calc(%notlistcount - 1))) var %r $iif($notify($calc(%notlistcount - 1)).ison,$notify($calc(%notlistcount - 1)) : scon %notlistservcount query $notify($calc(%notlistcount - 1)))
else goto next
}
if (%r) {
inc %notlistcount
inc %notlistmorecount
if (%notlistmorecount == 18) {
set -u %notlistmore More... : notify -s
scon -r
return
}
return %r
}
}
else {
:next
if ($status != connected) && (%notlistcount == 1) set -u %notlistnone 1
if (%notlistservcount == $scon(0)) {
scon -r
return
}
inc %notlistservcount
%notlistcount = 1
return -
}
}
Posted By: TECO

Re: Notify List - 03/03/22 09:46 PM

Wims, now everything is working. I apologize if I didn't mention that detail and I didn't know you had never used the mIRC Notify List.

[Linked Image from i.ibb.co]

Thank you for everything and for your patience!
I am very grateful to you! wink
Posted By: Wims

Re: Notify List - 03/03/22 09:57 PM

smile
Posted By: TECO

Re: Notify List - 05/03/22 12:44 PM

Wims can you add that it returns "none" when I'm disconnected from all networks?
Posted By: Wims

Re: Notify List - 05/03/22 02:09 PM

Code
alias notlist {
  if (%notlistmore) {
    return $v1
  }
  if (%notlistnone) return $v1
  if ($1 !isnum) return
  if (!%notlistservcount) {
    set -u %notlistservcount 1
    set -u %notlistcount 1
    set -u %notlistmorecount 1
  }
  scon %notlistservcount
  if ($status == connected) {
    if (%notlistcount == 1) var %r $style(2) $network $!!br($server) : noop
    else {
      while ($notify($calc(%notlistcount - 1)).ison == $false) inc %notlistcount
      if ($notify($calc(%notlistcount - 1))) var %r $iif($notify($calc(%notlistcount - 1)).ison,$notify($calc(%notlistcount - 1)) : scon %notlistservcount query $notify($calc(%notlistcount - 1)))
      else goto next
    }
    if (%r) {
      inc %notlistcount
      inc %notlistmorecount
      if (%notlistmorecount == 18) {
        set -u %notlistmore More... : notify -s
        scon -r
        return
      }
      return %r
    }
  }
  else {
    inc -u %sconcocount
    :next
    if (%notlistservcount == $scon(0)) {
      if (%sconcocount == $scon(0)) set -u %notlistnone $style(2) None : noop
      scon -r
      return
    }
    inc %notlistservcount
    %notlistcount = 1
    return -
  }
}
Posted By: TECO

Re: Notify List - 05/03/22 02:29 PM

Wims, great.
Thank you for all.
Hug wink
© 2022 mIRC Discussion Forums