Skip to content
General IRCX

Notify Listing Snippet Help

A TG007 community discussion started by Josh`.

Discussion 6 posts
Page 1 of 1
Open
Topic #6992 · 6 published posts · 1,326 views

Hello,

This really doesn't pertain just to IRCX I don't think, but I've been coding it for VSIXc, so I posted this here. Anyway, I'm trying to get a snippet to echo my notify list depending on their online/offline status. E.g. Here is my current notify list:

 

User1 (Online)

User2 (Offline)

User3 (Online)

 

What I want to do is make it so I can echo the notify list with the online users first and then the offline users. E.g.:

 

User1 (Online)

User3 (Online)

User2 (Offline)

 

the code I'm using is totally stumping me because the output of it is this:

 

err0r (Online)

ik000ike (Online)

ozzy10 (Online)

Warrior124 (Online)

X-Fusion (Online)

0 (Offline)

----------------------------------------------------------

 

Now that last person who is offline's name is really 'fdsa' yet the script is returning '0'. I don't know why it's returning 0, but it is. If anyone can take a look at my code, review it, edit and fix it, it would be greatly appreciated. Thanks to X-Fusion for giving me a handle on how to actually start this while loop. I never knew about $notify untill he told me about it. You will be credited in source code of a script that will never be released. :\

 

alias nlist.gen { 
 var %i 1
 var %x 0
 var %y 1
 while (%i <= $notify(0)) {
   if ($notify(%i).ison) {
     echo -a $notify(%i) (Online)
   }
   elseif (!$notify(%i).ison) {   
     set %notify.offline. $+ %x $notify(%i)
     inc %x
   }
   inc %i
 }
 while (%y <= %x) {
  ;echo -a %x
  ;echo -a %y
   echo -a $+(%notify.offline.,$calc(%y-1)) (Offline)
   unset %notify.offline. $+ %y
   inc %y
 }
 echo -a ----------------------------------------------------------
}

 

Thanks in advanced,

Josh

err0r: 666 + 1337 = 2003 backwards is 3002 which is how many people ozzy has banned from tg
err0r: spooky

Try to not to unset the last variable. Whenever you use the alias nlist.gen again, it will re-do the variable to correspond. So, you can try that. It doesnt look like you have an elseif or if for that, or a goto. So, that could be why its doing that. Just take out the unset, and see where that gets you.

nope....this is now the output.

 

err0r (Online)

ik000ike (Online)

ozzy10 (Online)

X-Fusion (Online)

0 (Offline)

0 (Offline)

---------------------------------------------------------

 

Warrior124 and fdsa are offline.

err0r: 666 + 1337 = 2003 backwards is 3002 which is how many people ozzy has banned from tg
err0r: spooky

You can try something like this .. if your echoing it ...

on *:notify: { notify.list }
alias -l notify.list {
 var %i 1, %x 0
 while (%i <= $notify(0)) {
   if ($server) { 
     if ($notify(%i).ison) { echo -s $notify(%i).note | inc %x }
     elseif ($rini(notify.sort) != online) { echo -s $notify(%i).note }
   }
   else { echo -s $notify(%i) Offline $chr(9) $notify(%i).note }
   inc %i
 }
}

I know its not exactly how you wrote yours, but, you can edit it and i based all that off the aliases that I gave yesterday. You can try it, hopefully it works.

Alias rini is referring to an ini file that I do not have? :\

err0r: 666 + 1337 = 2003 backwards is 3002 which is how many people ozzy has banned from tg
err0r: spooky

No, go back and look at the alias I put yesterday. Put the directory with it. Would probably make things easier if you did it through an actual settings file like an ini.