Black
06.05.2006, 17:08
Hallo vll kann mir hier jemand weiter helfen.
Ich und ne freund haben ne Problem mit ne Script.
####################################################
######## !unnuke ############
####################################################
######## !unnuke release-GROUP <REASON> ############
####################################################
proc bot:unnuke {bot cmd text} {
global null bots mysql
if {![matchattr $bot $mysql(sourceflag)]} { return 0 }
core:unnuke $bot $null $null $text
}
proc pub:unnuke {nick uhost hand chan text} {
global mysql bots
if {![channel get $chan source]} { return 0 }
core:unnuke $nick $uhost $hand $text
}
proc msg:unnuke {nick uhost hand text} {
global mysql bots
if {![matchattr $hand $mysql(sourceflag)]} { return 0 }
core:unnuke $nick $uhost $hand $text
}
proc core:unnuke {nick uhost hand text} {
global mysql bots pre recent addhandle
set text [strip:all $text]
set params [split $text " "]
if {([llength $params] != 2)} { return 0 }
set release [lindex $params 0]
set reason [lindex $params 1]
if {($mysql(status) == 1) && ($pre(mode)==1)} {
set dupe_query "SELECT id, $mysql(nukestatusfield) , $mysql(nukereasonfield) FROM $mysql(table) WHERE $mysql(relfield)='${release}' LIMIT 1"
set addhandle [connectdb_add]
set dupeid [mysqlexec $addhandle $dupe_query]
set num_dupes [mysqlresult $dupeid rows]
if {$num_dupes == 0} {
putlog "$nick sent an unnuke for $release, but we don't know it."
#disconnect(2)
mysqlendquery $dupeid
mysqlclose $addhandle
return 1
} else {
mysqlmap $dupeid { id status - } { }
switch -- $status {
2 -
0 {
# weird, its not nuked, or its already unnuked
putlog "$nick sent a unnuke for $release, but its not even nuked!"
mysqlendquery $dupeid
mysqlclose $addhandle
return 0
}
1 {
# its nuked. lets unnuke it!
mysqlendquery $dupeid
set query "UPDATE $mysql(table) SET $mysql(nukestatusfield)=$mysql(unnukedflag) , $mysql(nukereasonfield)='$reason' WHERE $mysql(relfield)='$release' LIMIT 1"
#putserv "PRIVMSG $pre(adminchan) :Query is $query "
mysqlexec $addhandle $query
mysqlclose $addhandle
foreach leafy $bots(leaf) {
if {[islinked $leafy]} { putbot $leafy "unnuke $release $reason" }
}
foreach this_channel [channels] {
if {[channel get $this_channel leak]} { putserv "PRIVMSG $this_channel :!unnuke $release $reason " }
if {[channel get $this_channel announce]} { putserv "PRIVMSG $this_channel :\(03UNNUKED\)-4››-\[ $release \]-4››-12\(5$reason12\) " }
}
}
default { putlog "something fucked up with your unnuked/nuked flags" }
}
}
}
}
Tcl error [pub:unnuke]: mysqlresult: not mysqltcl handle
Wir finden den fehlter einfach nicht.
Greetz
Ich und ne freund haben ne Problem mit ne Script.
####################################################
######## !unnuke ############
####################################################
######## !unnuke release-GROUP <REASON> ############
####################################################
proc bot:unnuke {bot cmd text} {
global null bots mysql
if {![matchattr $bot $mysql(sourceflag)]} { return 0 }
core:unnuke $bot $null $null $text
}
proc pub:unnuke {nick uhost hand chan text} {
global mysql bots
if {![channel get $chan source]} { return 0 }
core:unnuke $nick $uhost $hand $text
}
proc msg:unnuke {nick uhost hand text} {
global mysql bots
if {![matchattr $hand $mysql(sourceflag)]} { return 0 }
core:unnuke $nick $uhost $hand $text
}
proc core:unnuke {nick uhost hand text} {
global mysql bots pre recent addhandle
set text [strip:all $text]
set params [split $text " "]
if {([llength $params] != 2)} { return 0 }
set release [lindex $params 0]
set reason [lindex $params 1]
if {($mysql(status) == 1) && ($pre(mode)==1)} {
set dupe_query "SELECT id, $mysql(nukestatusfield) , $mysql(nukereasonfield) FROM $mysql(table) WHERE $mysql(relfield)='${release}' LIMIT 1"
set addhandle [connectdb_add]
set dupeid [mysqlexec $addhandle $dupe_query]
set num_dupes [mysqlresult $dupeid rows]
if {$num_dupes == 0} {
putlog "$nick sent an unnuke for $release, but we don't know it."
#disconnect(2)
mysqlendquery $dupeid
mysqlclose $addhandle
return 1
} else {
mysqlmap $dupeid { id status - } { }
switch -- $status {
2 -
0 {
# weird, its not nuked, or its already unnuked
putlog "$nick sent a unnuke for $release, but its not even nuked!"
mysqlendquery $dupeid
mysqlclose $addhandle
return 0
}
1 {
# its nuked. lets unnuke it!
mysqlendquery $dupeid
set query "UPDATE $mysql(table) SET $mysql(nukestatusfield)=$mysql(unnukedflag) , $mysql(nukereasonfield)='$reason' WHERE $mysql(relfield)='$release' LIMIT 1"
#putserv "PRIVMSG $pre(adminchan) :Query is $query "
mysqlexec $addhandle $query
mysqlclose $addhandle
foreach leafy $bots(leaf) {
if {[islinked $leafy]} { putbot $leafy "unnuke $release $reason" }
}
foreach this_channel [channels] {
if {[channel get $this_channel leak]} { putserv "PRIVMSG $this_channel :!unnuke $release $reason " }
if {[channel get $this_channel announce]} { putserv "PRIVMSG $this_channel :\(03UNNUKED\)-4››-\[ $release \]-4››-12\(5$reason12\) " }
}
}
default { putlog "something fucked up with your unnuked/nuked flags" }
}
}
}
}
Tcl error [pub:unnuke]: mysqlresult: not mysqltcl handle
Wir finden den fehlter einfach nicht.
Greetz