mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2007
Posts: 5
G
Gwydion Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
G
Joined: Jan 2007
Posts: 5
I can't get it done with my limited knowledge so can someone pls. help me - I need a litttle script for the following:

when I join a specified channel (#mytest)
it should say a random line from a file (greets.txt)
one time
to the channel



Joined: Dec 2004
Posts: 87
I
Babel fish
Offline
Babel fish
I
Joined: Dec 2004
Posts: 87
on *:join:#mytest: {
if ($nick !== $me) {
timer 1 2 msg # $read greets.txt
}
}

this will greet a person when he joins your #mytest

Joined: Aug 2005
Posts: 525
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2005
Posts: 525
You could use the "!" prefix instead of "if ($nick != $me)", it has the same effect. Also, your $read is flawed. The proper syntax in this case is $read(file). I'm not sure why you're using a timer either.

Code:
on !*:JOIN:#mytest:{
  msg # $read(greets.txt)
}

Joined: Jan 2007
Posts: 5
G
Gwydion Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
G
Joined: Jan 2007
Posts: 5
But as I understand it "on join" works when somebody else joins a channel.
That's not what I want to do.
When I join a channel it should read a random line from greets.txt and my nick says it to the channel.
I also wouldn't need any timer.

I tried it with this (first code):

on *:join:#mytest: {
if ($nick !== $me) {
msg # $read(greets.txt)
}
}

doesn't work though. However I thought on join does not work if you are the one who joins.


Last edited by Gwydion; 11/08/07 09:26 PM.
Joined: Dec 2004
Posts: 87
I
Babel fish
Offline
Babel fish
I
Joined: Dec 2004
Posts: 87
remove the ! in ($nick == $me)

Code:

on *:join:#mytest:{
  if ($nick == $me) {
    timer 1 2 msg # $read greets.txt
  }
}




dont forget in this example roomname is #mytest

Last edited by ik000ike; 11/08/07 09:58 PM.
Joined: Jan 2007
Posts: 5
G
Gwydion Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
G
Joined: Jan 2007
Posts: 5
Works. Thank you.

Joined: Dec 2004
Posts: 87
I
Babel fish
Offline
Babel fish
I
Joined: Dec 2004
Posts: 87
your welcome smile

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Alternatively, and using an undocumented prefix, you could use
Code:
on me:*:join:#mytest: timer 1 2 msg # $read(greets.txt)


That also uses the correct format for the $read identifier. The format that you were using is only supported due to compatability reasons with older versions of mIRC.


Link Copied to Clipboard