mIRC Homepage
Posted By: Dan On Join message to user one time only ? - 15/08/17 11:16 AM
Hi guys,

I'm sure maybe its quite simple , but how do you send a message to a user On Join but only for the first time they join and never again ?
Posted By: Blas Re: On Join message to user one time only ? - 15/08/17 11:32 AM
You could just add the persons name to some kind of database when they join. Then whenever someone joins, mIRC would see if they are in that database. If they are, then don't display the message.
Posted By: Dan Re: On Join message to user one time only ? - 15/08/17 11:37 AM
Actually if I can just check the ignore list on JOIN then that would do it surely.... But I cant work out the code for that , I'm still learning. Anyone ?
Originally Posted By: Dan
Actually if I can just check the ignore list on JOIN then that would do it surely.... But I cant work out the code for that , I'm still learning. Anyone ?


Not sure what an ignore list is, but I can come up with an alternative. I assume you already have the "on Join" and some way to trigger an event when you get it, so here's what I'd do.

Code:
on WhateverEventThisIs:#: {
  if (!$readini(onJoin.ini,WelcomedUsers,$nick)) {
    msg $chan This is your welcome message.
    writeini onJoin.ini WelcomedUsers $nick true
  }
}


When someone joins, it'll check the list to see if they've been welcomed before. If they have already been welcomed, the if-statement fails.
Posted By: maroon Re: On Join message to user one time only ? - 17/08/17 04:22 AM
Just thought I'd point out that you're running into the nick-vs-address issue that affects a lot of things. If someone comes into channel with their away-nick, they'll get a greeting again. If you're wanting to base it on addresses, you could great a named user-level with guser and check it $ulist. Of course that also has the problem of someone's address changing in the future.
© mIRC Discussion Forums