mIRC Home    About    Download    Register    News    Help

Print Thread
Need user loggin for an onjoin message #175224 19/04/07 06:08 AM
Joined: Apr 2007
Posts: 9
D
dvduh Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
D
Joined: Apr 2007
Posts: 9
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?

Re: Need user loggin for an onjoin message [Re: dvduh] #175231 19/04/07 12:06 PM
Joined: Dec 2002
Posts: 2,021
R
RoCk Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,021
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

Re: Need user loggin for an onjoin message [Re: dvduh] #175251 19/04/07 06:36 PM
Joined: Apr 2007
Posts: 9
D
dvduh Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
D
Joined: Apr 2007
Posts: 9
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?

Re: Need user loggin for an onjoin message [Re: dvduh] #175252 19/04/07 07:07 PM
Joined: Dec 2002
Posts: 2,021
R
RoCk Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,021
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
}