mIRC Homepage

Need user loggin for an onjoin message

Posted By: dvduh

Need user loggin for an onjoin message - 19/04/07 06:08 AM

I have my on join message set up like so
Quote:
on *:join:#channel:{
if ($nick == $me) { halt }
if ($nick isop #channel) { halt }
else {

msg $nick MOTD goes here }
}


I want to make it so i can have the users $nick added to a text file after he is messaged once so that he doesn't get harrassed. i have seen code like this
Quote:
on *:JOIN:#: {
if ($nick isin $read(nicks.txt,w,$+(*,$nick))) { halt }
else /write nicks.txt $nick
/msg # your text
}


But when i implemented this code it did not work, would i have to manually create the text file or is it done automatically. Is this the correct way to accoplish this?
Posted By: RoCk

Re: Need user loggin for an onjoin message - 19/04/07 12:06 PM

Code:
on !*:JOIN:#chan: {
  if ($read(nicks.txt,w,$+($nick,!*))) return
  write nicks.txt $+($nick,!)
  msg $nick MOTD goes here
}


The ! prefix replaces if ($nick == $me) { halt }

if ($nick isop #channel) { halt }
is useless because
noone is ever opped when they join the channel
Posted By: dvduh

Re: Need user loggin for an onjoin message - 19/04/07 06:36 PM

is there a way to use a Hostmask or something, so that way i am doing each individual user as opposed to the nick itself?
Posted By: RoCk

Re: Need user loggin for an onjoin message - 19/04/07 07:07 PM

Code:
on !*:JOIN:#chan: {
  var %a = $gettok($mask($fulladdress,3),2,33)
  if ($read(nicks.txt,w,$+(%a,!*))) return
  write nicks.txt $+(%a,!)
  msg $nick MOTD goes here
}
© 2020 mIRC Discussion Forums