mIRC Home    About    Download    Register    News    Help

Print Thread
search #36740 16/07/03 05:31 PM
Joined: Feb 2003
Posts: 20
F
fallen248 Offline OP
Ameglian cow
OP Offline
Ameglian cow
F
Joined: Feb 2003
Posts: 20
ok, i have a file called members.txt now in this file each line contains a nickname, how would i have a bot check to see if a nick is present when given the command .searchmember [nick]. i want the outputs to be either:

[nick] not found
or
[nick] found

Re: search #36741 16/07/03 05:41 PM
Joined: Mar 2003
Posts: 1,271
L
LocutusofBorg Offline
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,271
assuming the nick is the first word on the line:

on *:TEXT:.searchmember*:#: {
if ($read(members.txt,w,$+($2,*))) msg # $2 found
else msg # $2 not found
}

note: the # in the eventline indicates a channel, use a = for a dcc chat or a ? for a query
when using a query, replace msg # with msg $nick
when using a dcc chat, replace msg # with msg =$nick


DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius
Re: search #36742 16/07/03 05:46 PM
Joined: Feb 2003
Posts: 20
F
fallen248 Offline OP
Ameglian cow
OP Offline
Ameglian cow
F
Joined: Feb 2003
Posts: 20
thanks alot, now if i wanted to remove one of the nicks in the members.txt file how would i do that?

Re: search #36743 16/07/03 05:49 PM
Joined: Mar 2003
Posts: 1,271
L
LocutusofBorg Offline
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,271
after the if statement, if the member was found, you can simply replace the
msg # $2 found
with
write $+(-dl,$readn) members.txt


DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius