mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Oct 2005
Posts: 122
O
Vogon poet
OP Offline
Vogon poet
O
Joined: Oct 2005
Posts: 122
Hi id like to make a script so when it is triggered it would search a txt file for a wildcard match of it then msg the nick all matches found, i.e

on *:TEXT:!design:#channel: {
msg $nick $read(files.txt, w, *design*)
}

then if the file had something liek this

file.txt

Software - Software 1 Cost $$$ Info XXX
Design - Website Template Cost $$$ Info XXX
Package - Softwares X and X Cost $$$ Info XXX
Design - Website Graphics Cost $$$ Info XXX
Support - 2yrs Cost $$$ Info XXX
Design - Clothing Cost $$$ info XXX

atm it will only pick up the 1st match it finds, i want all matches found pm'd to the user so they will recieve in pm

Design - Website Template Cost $$$ Info XXX
Design - Website Graphics Cost $$$ Info XXX
Design - Clothing Cost $$$ info XXX

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Code:
 on *:text:!design:#:{
var %line = 1
while %line <= $read(files.txt,w,*design*,%line)  {
.msg $nick $read(files.txt,w,*design*,%line)
var %line = $calc($readn + 1)
}
}

Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
filter -ffc files.txt tmp *design*
if ($filtered) {
.play $nick tmp
.remove tmp
}


Gone.
Joined: Oct 2005
Posts: 122
O
Vogon poet
OP Offline
Vogon poet
O
Joined: Oct 2005
Posts: 122
with the filter one, is there any way to make it read the whole line it was found on?

Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
It does.

It will msg the matched lines (not just the word) to the $nick.


Gone.

Link Copied to Clipboard