mIRC Home    About    Download    Register    News    Help

Print Thread
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?

Joined: Dec 2002
Posts: 2,031
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,031
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

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?

Joined: Dec 2002
Posts: 2,031
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,031
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
}


Link Copied to Clipboard