Code: Select all
timer 10 [list puthelp "PRIVMSG #mychannel :I'm $botnick"]
timer 10 [list puthelp {PRIVMSG #mychannel :I'm $botnick}]
Code: Select all
bind pub - * battle:mainchan
proc battle:warnnick {nick host hand chan text} {
putserv "NOTICE $nick :You almost stepped on a landmine there Mr. Rock star. check out @rockrules and @advertising"
}
proc battle:mainchan {nick host hand chan text} {
global text1 text2 mainchan
set chan [string tolower $chan]
if {[string equal $chan $mainchan]} {
set text [stripcodes bcruag $text]
if {[string match -nocase "text1" $text] || [string match -nocase "text2" $text} {
return 0
} elseif {[string match -nocase "#" $text] || [string match -nocase "www" $text] || [string match -nocase ".com" $text] || [string match -nocase ".net" $text] || [string match -nocase ".org" $text] || [string match -nocase "http" $text]} {
battle:warnnick nick host hand chan text
if {$nick.warned == 1} {
putserv "PRIVMSG Chanserv :$mainchan addtimedban $nick 3m Ads"
set $nick.warned 0
} else {
set $nick.warned 1
timer 60 if {$nick.warned == 1} {set $nick.warned 0}
}
} else {
return 0
}
}
}
Code: Select all
timer 60 if {$nick.warned == 1} {set $nick.warned 0}
Code: Select all
timer 60 [list if {$nick.warned == 1} {set $nick.warned 0}]
Code: Select all
proc whatever {nick uhost hand chan text} {
global mychans
if {[lsearch -exact $mychans $chan]} {
#this is a matching channel
# do stuff
} else {
# this is not a match
# return
}
Code: Select all
proc someproc {nick}
global nickwarned
if {$nick.warned == 1} {set $nick.warned 0}
}
Code: Select all
proc bla {nick uhost hand chan} {
global warned
# ...etc
set warned($nick) 0
timer 60 [list blo $nick]
}
proc blo nick {
global warned
if {$warned($nick) == 1} { set warned($nick) 0 }
}
Code: Select all
proc test_nicks {} {
global warned
foreach nick [array names warned] {
if {$warned($nick) == 1} {
#evil spammer
}
}
}