Next, I would like to add a 5 min. ban for non-reg. users (after they get the pm, of course). (3) attempts to join in 24 hours without registering gets a permanent ban.
thx for the script
would like to add use /msg NickServ REGISTER yourpassword youremail
to REGISTER
use /msg NIckServ IDENTIFY yourpassword to ID it you are REGISTERED
puthelp "privmsg $n :please identify or register your nick"
Should I added it here ?
}
}
bind join - * foo
proc foo {n u h c} {
puthelp "whois $n"
}
bind raw - 311 got311 ;# first WHOIS reply
bind raw - 307 got307 ;# nick has identified (registered)
bind raw - 318 got318 ;# End of /WHOIS list
proc got311 {f k t} {
set n [lindex [split $t] 1]
set ::whoised($n) 0
}
proc got307 {f k t} {
set n [lindex [split $t] 1]
incr ::whoised($n)
}
proc got318 {f k t} {
set n [lindex [split $t] 1]
if {$::whoised($n) == 0} {
puthelp "privmsg $n :please identify or register your nick" U can register your nick with this (/msg NickServ REGISTER yourpassword youremail) without the ()
Also you can use this to identify yourself if you already registered (/msg NickServ IDENTIFY yourpass) without the ()
}
}
putlog "nickreg loaded"
get this error from the bot
Tcl error [got318]: wrong # args: should be "puthelp text ?options?"
Can somebody help thx
Please use code-blocks for code snippets.. (and indenting it would also be nice)
The cause for the problem, is that you try to use " in your message without escaping it, thus tcl think it's the end of the string, and starts parsing a new argument.
Quick-fix, put a \ infront of any " within the string (not the ones marking the start and end of string tho)
kk changed it to this :
bind join - * foo
proc foo {n u h c} {
puthelp "whois $n"
}
bind raw - 311 got311 ;# first WHOIS reply
bind raw - 307 got307 ;# nick has identified (registered)
bind raw - 318 got318 ;# End of /WHOIS list
proc got311 {f k t} {
set n [lindex [split $t] 1]
set ::whoised($n) 0
}
proc got307 {f k t} {
set n [lindex [split $t] 1]
incr ::whoised($n)
}
proc got318 {f k t} {
set n [lindex [split $t] 1]
if {$::whoised($n) == 0} {
puthelp "privmsg $n :please identify or register your nick U can register your nick with this (/msg NickServ REGISTER yourpassword youremail) without the ()
Also you can use this to identify yourself if you already registered (/msg NickServ IDENTIFY yourpass) without the ()"
}
}
putlog "nickreg loaded"
but this line not showing up
Also you can use this to identify yourself if you already registered (/msg NickServ IDENTIFY yourpass) without the ()
bind join - * foo
proc foo {n u h c} {
puthelp "whois $n"
}
bind raw - 311 gotraw ;# first WHOIS reply
bind raw - 307 gotraw ;# nick has identified (registered)
bind raw - 318 gotraw ;# End of /WHOIS list
proc gotraw {f k t} {
global whoised
set n [lindex [split $t] 1]
if {$k == "311"} {
set whoised($n) "0"
} elseif {$k == "307"} {
incr whoised($n)
} elseif {$k == "318"} {
if {$whoised($n) == "0"} {
puthelp "privmsg $n :please identify or register your nick U can register your nick with this (/msg NickServ REGISTER yourpassword youremail) without the ()."
puthelp "privmsg $n :Also you can use this to identify yourself if you already registered (/msg NickServ IDENTIFY yourpass) without the ()."
}
}
}
putlog "nickreg loaded"
Not tested, but should work.
Last edited by r0t3n on Thu Sep 07, 2006 5:25 pm, edited 1 time in total.
for the second line if you want it on a separate line... (see Tosser^^'s example on this). And once again, please use [ code] [/code]-blocks when you post code...