Looks good the way you have it, but just a couple suggestions. First, and I think you know this because you don't use them everywhere... you don't need / in front of commands within a script. Of course, if you prefer them there, they don't hurt anything.

Second, you can use /filter for this:
Code:
Menu @Devoice {
  Refresh List: {
    /window @Devoice -l
    var %blahhityblah = 1
    while (%blahhityblah <= $lines(dvupkeep.txt) ) {
      /aline -c @Devoice $read( dvupkeep.txt, %blahhityblah )
      inc %blahhityblah
    }
  }  
}


So it looks like this:
Code:
Menu @Devoice {
  Refresh List: {
    if ($window(@Devoice)) { clear @Devoice }
    else { window @Devoice -l }
    filter -fw dvupkeep.txt @Devoice
  }  
}


If may not look much shorter, but one of those lines (the if line) is there to clear the list to avoid duplication of the list if refreshed while the window is already displaying a list. So that's an extra line that wasn't already there. Anyhow, besides being shorter, /filter is faster than $read() for this sort of thing.


* Note that this same change will also work for the View Devoice List menu item as well.


EDIT: One other change I would suggest making... You're saving the information in the file starting with "nick --". Currently, you're searching the file with just $nick. The problem with that is that If someone joins with a nick of "nick" and there's a nick in the file of "nickname", your search will find a match. If you instead search for "$nick --", it will only find a match if the nick is an exact match.

This also affects the timers as those will also potentially erase the wrong information for the same reason.

Another thing you might consider is checking to see if the nick is already in the text file before allowing a menu item to be used. Right now, you could add the same person to the file as many times as you want to (they won't overwrite).

And, thinking about this more, you might want to consider a "safer" method of tracking the timer information. Normally, the way you have it will work well. However, if you close mIRC (or it crashes) while timers are running, they will not be running when you start mIRC again. This means that anyone who was on a timed "mute" will end up being listed as permanently "muted" because nothing will remove them from the list. The "safer" method would be to also store $ctime + amount of time to be "muted" and use on START to remove anything that is expired.

EDIT2: Ok, something else... Personally, I'd silence every timer (.timer instead of timer) so they don't show up all of the time. Also, the timers do not verify that the nick is still in the channel. That means that anytime someone leaves the channel while "muted," there will be an error message when the timer triggers. It might not make any significant difference, but it's not nice to look at. I think I'd have all of the +v timers point to an alias that will check if the nick is still in the channel and voice them if they are. My using an alias, you save a lot of duplication of lines. You could also use an alias to avoid the duplication seen in the menu items already listed. It may not really matter, but I think learning to compress code down efficiently is a good skill to practice.

Also, I'm not sure why you have $+ inside $address(). It isn't necessary.

Last edited by Riamus2; 24/01/11 09:19 PM.

Invision Support
#Invision on irc.irchighway.net