Hi,
Start -> Run -> wordpad.exe -> paste code -> copy code to mIRC Scripts Editor (alt+r):
Before doing anything type: /write urls.txt
menu channel {
.$iif($group(#urlscript) == on,Disable,Enable) URL Script:{
$iif($group(#urlscript) == on,disable,enable) #urlscript
}
}
[color:red] [/color]
#urlscript on
on *:START: hmake urls | hload -i urls urls.txt
on *:EXIT: hsave -i urls urls.txt
[color:red] [/color]
on *:TEXT:*:#:{
if ($1-2 == !add $nick) && $3 {
if !$regex($3,/^www\..+?\.com\/php\d*$/i) { msg # Incorrect url syntax. | return }
hadd urls $nick $addtok($hget(urls,$nick),$3,32)
.msg $nick Added url $3 to your account
}
elseif ($1 == !links) && $hget(urls,$2) {
.msg $nick Here are $2's links:
tokenize 32 $ifmatch
.msg $nick $*
}
}
#urlscript end
How does it work?
1. When someone types
!add <
hisownnick> <
url> the url will be added, if it's syntax is
www.whatever.com/php..... (dots are numbers)
2. When someone types
!links <
somenick> the snippet will pm the requester, but only if the requested nick has urls in the hash table.
3. When starting up mIRC a hash table urls will be created, which will load the contents of url.txt in it. That's why you had to type /write urls.txt before using the script. You are of course free to choose what name you want to give that .txt file. But then be sure to change urls.txt to whatever in the code.
4. You might want to change # to whatever channels you want to let this script trigger at.
5. Right now there is a limit of around 30 urls for each user, but that is of course depending on how long they will be. If you think this could be an issue, let me know and I'll modify the script.
6. About the
www.smut.com, well there can be literaly thousands of websites that can be seen as "bad"..there's really no way to ban all of them. If you really insist, I can add it so it will ban a user when they type
www.smut.com, but well, they can come up with anything.
7. You might get flooded off the server when there is an excessive !links request. Try the script like this first...if you seem to experience trouble flooding out or anything, then I'll modify the script using the /play command which has a queueing system and where you can specify a message interval.
Greets