mIRC Home    About    Download    Register    News    Help

Print Thread
Notify List #269978 02/03/22 04:05 PM
Joined: Jul 2014
Posts: 284
TECO Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Jul 2014
Posts: 284
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!


TECO
irc.PTirc.org (Co-Admin)
Re: Notify List [Re: TECO] #269979 03/03/22 11:53 AM
Joined: Jul 2014
Posts: 284
TECO Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Jul 2014
Posts: 284
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!


TECO
irc.PTirc.org (Co-Admin)
Re: Notify List [Re: TECO] #269980 03/03/22 02:06 PM
Joined: Jul 2006
Posts: 3,929
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,929
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 -
  }
}

Last edited by Wims; 03/03/22 04:55 PM.

#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Re: Notify List [Re: Wims] #269981 03/03/22 02:51 PM
Joined: Jul 2014
Posts: 284
TECO Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Jul 2014
Posts: 284
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

Last edited by TECO; 03/03/22 02:57 PM.

TECO
irc.PTirc.org (Co-Admin)
Re: Notify List [Re: TECO] #269982 03/03/22 03:06 PM
Joined: Jul 2006
Posts: 3,929
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,929
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.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Re: Notify List [Re: Wims] #269983 03/03/22 03:17 PM
Joined: Jul 2014
Posts: 284
TECO Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Jul 2014
Posts: 284
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!


TECO
irc.PTirc.org (Co-Admin)
Re: Notify List [Re: TECO] #269984 03/03/22 03:24 PM
Joined: Jul 2014
Posts: 284
TECO Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Jul 2014
Posts: 284
Wims
I tested now to be connected to 3 networks and the code stops working, the Notify List menu is disabled.


TECO
irc.PTirc.org (Co-Admin)
Re: Notify List [Re: TECO] #269985 03/03/22 04:59 PM
Joined: Jul 2006
Posts: 3,929
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,929
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?


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Re: Notify List [Re: Wims] #269986 03/03/22 05:28 PM
Joined: Jul 2014
Posts: 284
TECO Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Jul 2014
Posts: 284
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

Last edited by TECO; 03/03/22 05:31 PM.

TECO
irc.PTirc.org (Co-Admin)
Re: Notify List [Re: TECO] #269987 03/03/22 07:54 PM
Joined: Jul 2006
Posts: 3,929
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,929
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 -
  }
}


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Re: Notify List [Re: Wims] #269988 03/03/22 08:43 PM
Joined: Jul 2014
Posts: 284
TECO Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Jul 2014
Posts: 284
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]


TECO
irc.PTirc.org (Co-Admin)
Re: Notify List [Re: TECO] #269989 03/03/22 08:52 PM
Joined: Jul 2006
Posts: 3,929
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,929
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.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Re: Notify List [Re: Wims] #269990 03/03/22 08:59 PM
Joined: Jul 2014
Posts: 284
TECO Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Jul 2014
Posts: 284
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


TECO
irc.PTirc.org (Co-Admin)
Re: Notify List [Re: TECO] #269991 03/03/22 09:28 PM
Joined: Jul 2006
Posts: 3,929
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,929
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 -
}
}

Last edited by Wims; 03/03/22 09:56 PM.

#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Re: Notify List [Re: Wims] #269992 03/03/22 09:46 PM
Joined: Jul 2014
Posts: 284
TECO Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Jul 2014
Posts: 284
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


TECO
irc.PTirc.org (Co-Admin)
Re: Notify List [Re: TECO] #269993 03/03/22 09:57 PM
Joined: Jul 2006
Posts: 3,929
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,929
smile


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Re: Notify List [Re: Wims] #269999 05/03/22 12:44 PM
Joined: Jul 2014
Posts: 284
TECO Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Jul 2014
Posts: 284
Wims can you add that it returns "none" when I'm disconnected from all networks?


TECO
irc.PTirc.org (Co-Admin)
Re: Notify List [Re: TECO] #270000 05/03/22 02:09 PM
Joined: Jul 2006
Posts: 3,929
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,929
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 -
  }
}


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Re: Notify List [Re: Wims] #270001 05/03/22 02:29 PM
Joined: Jul 2014
Posts: 284
TECO Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Jul 2014
Posts: 284
Wims, great.
Thank you for all.
Hug wink


TECO
irc.PTirc.org (Co-Admin)