Code: Select all
bind pubm f * check:connect
set aussie "0"
set kiwis "0"
proc check:connect { nick host hand chan arg } {
if {([string match -nocase "*connect*" [lindex $arg 0]])} {
set nick [lindex $arg 5]
regexp "(\[0-9]{1,3})\.(\[0-9]{1,3})\.(\[0-9]{1,3})\.(\[0-9]{1,3})" [lindex $arg 4] all
putserv "PRIVMSG #sl-oceania :$all"
dnslookup $all resolve_rep
}
if {[string match -nocase "*join*" [lindex $arg 2]]} {
putserv "PRIVMSG #sl-oceania :$arg !"
}
}
proc resolve_rep {ip host status} {
global aussie kiwis
if {!$status} { putlog "Unable to resolve \037\002$ip\017 ."
} else {
if {[string match -nocase "*.au" $host]} {
set newnumber [expr $aussie + 1]
set aussie $newnumber
putserv "privmsg #sl-oceania :Aussie's Connected: $aussie Woah!!!"
} elseif {[string match -nocase "*.nz" $host]} {
set newnumber [expr $kiwis + 1]
set kiwis $newnumber
putserv "privmsg #sl-oceania :Kiwi's Connected: $kiwis Woah!!!!"
}
}
}
now i want to make it a bit better, and have absolutely no idea if it'll work or how to do it....
i know its possible, at that much
Connect to a MySQL DB
then insert information when it comes in, stored by times
i.e. if its 1:30 and it gets the information, it UPDATES a field, named 1-30, the stuff in it and adds for example, "hello"
an then if its 2:45 it gets the information, it UPDATES the field, 2-30, and yeah.... done in half hour brackets.....
heres like a PHP Version if thats helpful
Code: Select all
$qry = "UPDATE `2-30` SET `kiwis`='$kiwis',`aussies`='$aussies'";
mysql_query($qry);