mIRC Home    About    Download    Register    News    Help

Print Thread
#244775 28/03/14 03:37 PM
Joined: Mar 2014
Posts: 52
P
Babel fish
OP Offline
Babel fish
P
Joined: Mar 2014
Posts: 52
hi guys.
i need a help ._.

Code:
;write new members in txt
on *:join:#: {
  write names.txt $nick
}

so this is my code for now.
i want my bot to welcome every new member.
i need 1 if query now. something like that

on join
if $nick not on list then write in file and greet

thanks in advance laugh

Last edited by patrickplays; 28/03/14 03:38 PM.
Joined: Dec 2010
Posts: 89
D
Babel fish
Offline
Babel fish
D
Joined: Dec 2010
Posts: 89

Code:
on *:join:#: {
  if ($read(names.txt,s,$nick) == $null) {
    write names.txt $nick
  }
}


Not tested, should work laugh enjoy

Joined: Mar 2014
Posts: 4
N
Self-satisified door
Offline
Self-satisified door
N
Joined: Mar 2014
Posts: 4
Originally Posted By: dominic_eddy

Code:
on *:join:#: {
  if ($read(names.txt,s,$nick) == $null) {
    write names.txt $nick
  }
}


Not tested, should work laugh enjoy


Not working smile


løngiñg før dárknëss
Joined: Mar 2014
Posts: 52
P
Babel fish
OP Offline
Babel fish
P
Joined: Mar 2014
Posts: 52
Originally Posted By: dominic_eddy

Code:
on *:join:#: {
  if ($read(names.txt,s,$nick) == $null) {
    write names.txt $nick
  }
}


Not tested, should work laugh enjoy


not working frown

Joined: Dec 2010
Posts: 89
D
Babel fish
Offline
Babel fish
D
Joined: Dec 2010
Posts: 89
Code:
on *:join:#: {
  if ($read(names.txt,s,$nick) == $null) {
    write names.txt $nick joined
  }
}

how about that?

Last edited by dominic_eddy; 28/03/14 04:37 PM.
Joined: Mar 2014
Posts: 52
P
Babel fish
OP Offline
Babel fish
P
Joined: Mar 2014
Posts: 52
sorry i didnt specify what is going wrong.
your code is writing the member on the list no matter if he is already in it or not

Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
Use w instead of s for searching: $read(names.txt,nw,$nick)

Joined: Mar 2014
Posts: 52
P
Babel fish
OP Offline
Babel fish
P
Joined: Mar 2014
Posts: 52
thanks! nw is working <3

Joined: Mar 2014
Posts: 52
P
Babel fish
OP Offline
Babel fish
P
Joined: Mar 2014
Posts: 52
ok everything is working is working as intended now.

Code:
on *:join:#: {
  if ($read(names.txt,nw,$nick) == $null) {
    write names.txt $nick
    msg $chan hi there $nick ! welcome to the stream!
  }
}


my current output is
hi there patrick ! welcome to the stream!
but i want
hi there patrick! welcome to the stream!

i want the space removed. but $nick! wont give out the nick
if i change the code to
Code:
msg $chan hi there $nick! welcome to the stream!

it will give me
hi there welcome to the stream!

Last edited by patrickplays; 30/03/14 12:29 AM.
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Try replacing $nick with $+($nick,!)

Code:
on *:join:#: {
  if (!$read(names.txt,nw,$nick)) {
    write names.txt $nick
    msg $chan hi there $+($nick,!) welcome to the stream!
  }
}

Last edited by SladeKraven; 30/03/14 12:36 AM.

Link Copied to Clipboard