not 100% sure I understand

1. you wanna write to file if they are online or offline, but only 1 entry per user, which network they're on doesn't matter
2. if a user is already listed as ofline, but you find him online somewhere else you wanna overwrite
3. if a user is online but offline somewhere else you do not wanna overwrite

That right?

If so, I suggest you switch to an inifile or hashtable. Both have the advantage they only allow one of each item, which makes overwriting simple.

Code:
if ($notify(%notify).ison) && ($readini([color:blue]filename.ini[/color],[color:blue]SECTION[/color],$notify(%notify) == offline)) {
  writeini [color:blue]filename.ini[/color] [color:blue]SECTION[/color] $nick online $notify(%notify).note
}
elseif (!$readini([color:blue]filename.ini[/color],[color:blue]SECTION[/color],$notify(%notify)) {
  writeini [color:blue]filename.ini[/color] [color:blue]SECTION[/color] $nick online $notify(%notify).note
}


This will, if the nick is online, check if he is listed as offline in the inifile, and change that if he is. If he already is listed as online, we will skip rewriting that info.
If he is not online, we don't need to do anything -- if he is written as online, we don't want to change that, and if he is listed as offline we don't need to change that, so we don't need to use an else...
We just need an else to check if the user has not been written yet when found offline, so we write him as offline then.
The $notify(nick).note you added remains in tact in the inifile...


DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius