Maybe you should experiment on your own for a bit.
We will help along the way, but simply continously posting code, and expecting us to complete, fix or point your correctly every time, without giving the slightest though, to looking it over yourself (after making an attempt at correcting it).
As for the code: No.
Too be hoenst, I don't know where you got it from.
We are making pointers, showing you example code, that would help in your tracks, and you simply dump it in and expect it to work. THat is not how the forum operates.
You should take the code, review it, understand it, understand your own code and how the provided code could help you. You can then adapt it for your own use.
Think of how you want your script to operate in english first. How would you discribe what your script does? Give a numbered list, of every action and reactiont hat should take place.
IE. This is for a one-join script
1: Check to see if the joining party is know by me. If so, and he has the the +D channel flag, ont he channle he has joined, move to step 2, otherwise quit.
2: Send message to joining person.
3: Check if he has any notes. If yes, move to step 4, otherwise quit.
4: Tell the person how many notes they have and exit
This could be created (using fiction commands in some cases) like so. If you read the two of them side-by-side, you will note how much alike the code and english rules are.
Code: Select all
proc on:join {nick uh hand channel} {
if {[matchatrr $hand +D $channel]} {
puthelp "PRIVMSG $channel :Welcome $nick"
} else {
return
}
if {[UserHasNotes $hand]} {
puthelp "NOTICE $nick :You have [NumberOfNotes $hand] waiting"
}
}