Archiv verlassen und diese Seite im Standarddesign anzeigen : [Gelöst] [eggdrop] echo in anderen channel und datei
Hi,
hab das Board über google gefunden und hoffe das man mir hier helfen kann
Ziel ist es das der Bot in channel A zeilen die bestimmte Wörter beinhaltet in einen anderen channel postet und gleichzeitig in eine Datei abspeichert mit Datum/Zeit
### Config ###
set predb "/home/bot/scripts/predb.txt"
set chan_a_(ecouter) "#pre-1"
set chan_a_(echo) "#pre-2"
### Config zu ende ###
bind pub - *PRE* echo:yap
proc echo:yap { nick uhost handle chan arg } {
global predb chan_a_
set preyap [lindex $arg 4]
if { $chan == $chan_a_(ecouter) } {
set file [open $predb a]
puts $file "$preyap [unixtime]"
close $file
putserv "PRIVMSG $chan_a_(echo) :PRED - $preyap"
}
}
bind pubm - *NEW>>* pub:echonew
proc pub:echonew { nick uhost handle chan arg } {
global predb chan_a_ time
set premksh [lindex $arg 1]
if { $chan == $chan_a_(ecouter) } {
set file [open $predb a]
puts $file "$premksh [unixtime]"
close $file
putserv "PRIVMSG $chan_a_(echo) :PRED - $premksh
So schreibt er nur komische zahlen in die predb.txt und das echon in den anderen chan sieht so aus: [5:00pm] <PREDB> PRED - ·
Da wo der punkt ist sollte eigendlich das stehen, was er im anderen channel aufgeschnappt hat.
Hab das dann so probiert
proc isin { text } {
global predb
catch {open $predb r} x
while {![eof $x]} {
gets $x return
if {"[string tolower $return]"=="[string tolower $text]"} {
return "1"
} else {
return "-1"
}
catch {close $x}
}
}
bind pub - *PRE* echo:test
proc echo:test { nick uhost handle chan arg } {
global predb chan_a_
set text [lindex $arg 0]
if {[isin $text]=="1"} { putlog "$text est deja dans le fichier" }
if {[isin $text]=="-1"} {
putserv "PRIVMSG $chan_a_(echo) :PRED - $text"
set file [open $predb a]
puts $file "$text [unixtime]"
close $file
}
}
IS genauso wie beim oberen source :( Wenn ich aber "*PRE*" mit z.b. "!test" austausche, postet er alles was nach !test steht in den anderen channel und speichert das auch in die predb.txt
Also eigendlich soll er folgendes können. Vielleicht kennt ja jemand ein fertigen source der ähnliches kann .
1. Sätze von channel A komplett in channel B posten, die bestimmte wörter beinhalten.
2. Die Sätze da nach auswerten und nur ein Teil in die predb.txt mit aktuellem Datum/zeit abspeichern. Also den Satzteil der bestimmte wörter enthält. Beispiel " Da gibts wieder was neues und zwar (uiui.da.gehts.schon.wieder.los-test) in blablabla" Daraus soll er nur nur das in die predb speichern was in klammern steht weil es z.b. "test" beinhaltet oder das Wort "schon"
3. In channel A sollen die daten abrufbar sein wie z.b. so: "!pre da gehts"
Antwort vom bot:
"Gefunden 1 Hier die letzten 3:"
"[pred] [uiui.da.gehts.schon.wieder.los-test] am 27.12.2004 um 17:00Uhr, das ist 0w 0d 0h und 30min her
Also wenn jemand so ein tcl script kennt oder sogar hat, würd ich mich sehr darüber freuen :D
Also ich hab so ein ähnliches script gefunden, allerdings funzt das nur mit nem win32 eggdrop. praktisch ist es, das er ne mysql db benutzt. schade das man sowas nicht convertieren kann. Also script läd ohne probs, aber reagiert nicht im channel... und die db läßt er unberührt. Auch keinerlei errors in der eggdrop partyline. Beim win32 eggdrop hab ich wenigstens errors wenn ich was falsch gemacht hab. Weiß jemand ob man sowas fixen könnte, so das es auch unter nem linux eggdrop funzt? Oder kennt jemand n script das 100%ig unter linux eggdrop geht?
package require mysqltcl 2.0
##pretime.tcl hacked into shape by b|\d v1.8 thx to SomeoneWhoCares
##ChangeLog:
##1.8
##+ NUKE added
##1.7
##- fixed timeoffset for date
##1.6
##+ cleaned up bits
##+ added list for ignores
##- bug on 'Not Found'
##1.5
##- bugs on max output
##- some other bugs
##- removed curry-o-meter from !pre/d
##1.4
##- removed wildcard on auto check
##1.3
##+ curry-o-meter (WTF)
##1.2
##+ Added backfill check
##- some crap
##
##Requires in eggdrop/lib/tcl8.4/sql folder included for sql access!
##
##
##prebotlist is space delimited if you wish to include more bots (for auto check)
set prebotlist "test"
##set sql stuff
set sql(mysqlhost) "localhost"
set sql(mysqlport) "3306"
set sql(mysqluser) "mysql"
set sql(mysqlpassword) "mysql"
set sql(mysqldatabase) "PreDB"
set sql(mysqltablename) "RelSection"
set sql(mysqltimefield) "ReleaseDate"
set sql(mysqlrelnamefield) "ReleaseName"
##
##
##set ignore names
set ignore {
cd?
cd??
covers
sample
disc?
disc??
disk?
disk??
extra
}
##
##
##set offset (+ or - without space) in seconds
set offset "+0"
##set backfill warning in wrong dir 0=no
set backfill 1
##set format of dated dirs
set bfilldir "%m%d"
##set splitter to newdir NOTE: THIS IS IMPORTANT! IT SHOULD BE THE ONLY THING BETWEEN BIND AND DIRNAME
set nsplitter ":"
##set max results
set maxout 5
##
##
##set binds
bind pub -|- !pred botfindpre
bind pub -|- !pre botfindpre
bind pubm - *NEW*:* _echo
##pubm - bind is whats used for auto announce YOU WILL NEED TO FIGURE THE WILDCARDS FOR IT.
## IF YOU USE CONTROL CHARS FOR UNDERLINE, etc. USE '*' TO ALLOW FOR THESE !
## YOU WILL ALSO NEED TO MAKE YOUR 'NEW' ANNOUNCE SPLITTER TO CONTAIN $nsplitter TO
## THE NEWDIR ie.
## NEW in MP3: -> 0414/Crusz-Redemption-Promo-2004-JUST by t/iND. or
## [NEW][MP3] t/iND blah blah > 0414/Crusz-Redemption-Promo-2004-JUST etc.
##
##
##end of config!
set myarse 0
##
##
##color, underline, bold, reverse.
proc u {} {return \037}; #underline
proc r {} {return \026}; #reverse
proc c {} {return \003}; #color
proc b {} {return \002}; #bold
##
##
##
proc vcheck:filterString {myString} {
# Filter out some characters that mysql does not like.
regsub -all -- {'} $myString "`" myString
regsub -all -- {\\} $myString "/" myString
regsub -all -- {\{} $myString "<" myString
regsub -all -- {\}} $myString ">" myString
# Take out all control characters. After the comment/album, etc. for id3 tag the hex character 0x00 starts and is repeated until 0x0A (marking the end). Tcl recognizes these as control characters. Note the double brackets, `[:cntrl:]' is actually a list of characters, thus it needs to be enclosed with [ and ].
regsub -all -- {[[:cntrl:]]} $myString {} myString
return $myString
}
##
##
##wtf
proc curry {secs} {
if {$secs > 60001} {return "\([b]::::::::::::[b]\)"}
if {$secs > 48001} {return "\([b]#:::::::::::[b]\)"}
if {$secs > 36001} {return "\([b]##::::::::::[b]\)"}
if {$secs > 24001} {return "\([b]###:::::::::[b]\)"}
if {$secs > 15001} {return "\([b]####::::::::[b]\)"}
if {$secs > 9601} {return "\([b]#####:::::::[b]\)"}
if {$secs > 7201} {return "\([b]######::::::[b]\)"}
if {$secs > 5401} {return "\([b]#######:::::[b]\)"}
if {$secs > 3601} {return "\([b]########::::[b]\)"}
if {$secs > 2701} {return "\([b]#########:::[b]\)"}
if {$secs > 1860} {return "\([b]##########::[b]\)"}
if {$secs > 601} {return "\([b]###########:[b]\)"}
return "\([b]############[b]\)"
}
##
##
##convert time
proc con_time {secs} {
if {$secs == 0} {return "0s|0secs|"} else {
if {$secs < 60} {return "${secs}s|${secs}secs|" } else {
set mins [expr $secs / 60]
set secs [expr $secs % 60]
}
if {$mins < 60} {
set hrs 0
set mins [expr $mins % 60]
} else {
set hrs [expr $mins / 60]
set mins [expr $mins % 60]
}
if {$hrs < 24} {
set days 0
set hrs [expr $hrs % 24]
} else {
set days [expr $hrs / 24]
set hrs [expr $hrs % 24]
}
if {$days < 365} {
set yrs 0
set days [expr $days % 365]
} else {
set yrs [expr $days / 365]
set days [expr $days % 365]
}
if {$days == 0} {set daysm "" ; set daysmm ""} else {set daysm " [b]${days}[b]d" ; set daysmm " [b]${days}[b]days"}
if {$hrs == 0} {set hrsm "" ; set hrsmm ""} else {set hrsm " [b]${hrs}[b]h" ; set hrsmm " [b]${hrs}[b]hrs"}
if {$mins == 0} {set minsm "" ; set minsmm ""} else {set minsm " [b]${mins}[b]m" ; set minsmm " [b]${mins}[b]mins"}
if {$secs == 0} {set secsm "" ; set secsmm ""} else {set secsm " [b]${secs}[b]s" ; set secsmm " [b]${secs}[b]secs"}
set x [string trim "${daysmm}${hrsmm}${minsmm}${secsmm}"]
set y [string trim "${daysm}${hrsm}${minsm}${secsm}"]
return $x
}
}
##
##
##auto
proc _echo {nick uhost handle chan arg} {global myarse prebotlist nsplitter dive ignore
foreach bot $prebotlist {
if {$bot == $nick} {
set myarse 1
break
}
}
set arg [vcheck:filterString $arg]
if {$myarse != 1} {return}
foreach ig $ignore {
if {[string match -nocase "*/$ig *" $arg]} {
return
}
}
set give [split $arg $nsplitter]
set give [string trim [lindex $give 1]]
##now 2nd part
set give [lindex $give 0]
set give [string trim $give /]
if {[string match */* $give]} {
set give [split $give /]
set dive [lindex $give 0]
set give [lindex $give 1]
} else {
set dive ""
}
botfindpre $nick $uhost $handle $chan [string trim [lindex $give 0]]
return
}
##
##
##get teh shit
proc findpre {text} {global sqlserverhandle sql myarse
if {$myarse == 1} {
set data [mysqlsel $sqlserverhandle "SELECT *, $sql(mysqlrelnamefield) FROM $sql(mysqltablename) WHERE $sql(mysqlrelnamefield) LIKE \"[lindex $text 0]\" ORDER BY $sql(mysqltimefield) DESC;" -list]
} else {
set data [mysqlsel $sqlserverhandle "SELECT *, $sql(mysqlrelnamefield) FROM $sql(mysqltablename) WHERE $sql(mysqlrelnamefield) LIKE \"%[lindex $text 0]%\" ORDER BY $sql(mysqltimefield) DESC;" -list]
}
return $data
}
##
##
##main
proc botfindpre {nick uhost handle chan arg} {global prebotlist sqlserverhandle sql myarse offset maxout dive bfilldir backfill
set sqlserverhandle [mysqlconnect -host $sql(mysqlhost) -port $sql(mysqlport) -u $sql(mysqluser) -password $sql(mysqlpassword) -db $sql(mysqldatabase)]
set data [findpre [lindex $arg 0]]
putlog >>>$data
##putlog "Release not found."
if {$myarse == 0 && $data == ""} {
puthelp "PRIVMSG $chan :$nick: Pre-Release not found"
catch {mysqlclose $sqlserverhandle}
catch {mysqlclose}
return
}
putlog $data
if {$myarse == 0} {
if {[lindex [split $arg] 1] != ""} {
set m2 [lindex [split $arg] 1]
if {[regexp ^(\[0-9\])+$ $m2] == 1} {
if {$m2 <= $maxout} {
set maxouts $m2
}
} else {
puthelp "PRIVMSG $chan :Usage: !pred Release.name?like*this \[amount\]"
catch {mysqlclose $sqlserverhandle}
catch {mysqlclose}
return
}
} else {
set maxouts 1
}
} else {
set maxouts 1
}
set warn ""
if {$backfill == 1} {
if {$myarse == 1} {
if {$dive != ""} {
##check backfill
set check [clock format [expr [lindex [lindex $data 0] 2] + $offset] -format "$bfilldir"]
if {$dive > $check} {
set warn "\[[c]04[b]BACKFILL[b][c]\]"
}
}
}
}
for {set i 0} {$i < $maxouts} {incr i} {
if {[lindex $data $i] != ""} {
if {[string match -nocase *[lindex [split $arg] 0]* [lindex [lindex $data $i] 0]]} {
if {[lindex [lindex $data $i] 3] != 0} {
##nuked
set NUKE "and was [c]04NUKED[c] for [b][string trim [lindex [lindex $data $i] 4]][b] "
} else {
set NUKE ""
}
if {$myarse == 0} {
puthelp "PRIVMSG $chan :$warn[lindex [lindex $data $i] 0] was pred [clock format [expr [lindex [lindex $data $i] 2] + $offset] -format "%D %H:%M%p %Z"] - [con_time [expr [clock seconds] - [lindex [lindex $data $i] 2]]] ago $NUKE- ([b][lindex [split [lindex [lindex $data $i] 0] -] end]\|[lindex [lindex $data $i] 1][b])"
} else {
puthelp "PRIVMSG $chan :$warn[lindex [lindex $data $i] 0] was pred [clock format [expr [lindex [lindex $data $i] 2] + $offset] -format "%D %H:%M%p %Z"] - [con_time [expr [clock seconds] - [lindex [lindex $data $i] 2]]] ago $NUKE- ([b][lindex [split [lindex [lindex $data $i] 0] -] end]\|[lindex [lindex $data $i] 1][b]) - curry-o-meter [curry [expr [clock seconds] - [lindex [lindex $data $i] 2] + $offset]]"
}
##putlog "Reported pre time to $nick"
}
}
}
catch {mysqlclose $sqlserverhandle}
catch {mysqlclose}
return
}
##
##
##
putlog "mysql/tcl prebot loaded and fukt up by b|\\d 1.8"
ChaosKrieger
27.12.2004, 22:57
hi, wieso sollte es nur auf win laufen? das is nicht ganz richtig..
tcl scripte laufen eigendlich alle auch auf linux wie auf windows.. tcl ist tcl
was sein kann ist das dir die passenden module (sql) fehlern.
d.h. besorg dir die richtigen module für dein eggi(tcl) und es sollte funzen.
By Chaos
hi, wieso sollte es nur auf win laufen? das is nicht ganz richtig..
tcl scripte laufen eigendlich alle auch auf linux wie auf windows.. tcl ist tcl
was sein kann ist das dir die passenden module (sql) fehlern.
d.h. besorg dir die richtigen module für dein eggi(tcl) und es sollte funzen.
By Chaos
Ja, aber normalerweise muß ich doch n error in der partyline haben oder nicht?
Ich brauch mysqltcl, hab aber neueste version drauf.
[root@shell] apt-get install mysqltcl
Reading Package Lists... Done
Building Dependency Tree... Done
Sorry, mysqltcl is already the newest version.
Versteh nicht warum das dann nicht reagiert :confused:
Also du meinst das ich zusätzlich noch nach nem Modul für den eggi suchen soll? k, das mach ich dann jetzt :)
Klappt nicht. Modul gibs nicht, per tclsh finde ich auch mysql... scheint alles in ordnung zu sein. Trotzdem reagiert das script nicht unter meinem linux eggi
Hm, kann mir dann wenigstens einer sagen wie ich die DB und tables richtig anlegen muß damit das script klappt?
ChaosKrieger
29.12.2004, 19:14
sry, habe noch nie mit sql gearbeitet.
ich weis nur das man nen extra modul fürn eggi braucht.
Hi Leutz,
vielleicht kann mir wer weiter helfen. Ich habe das TCL in mein windrop scriptdir gepackt ( ist der neuste windrop), läd das tcl auch ohne probs.
Wenn ich jetzt im Chan den Befehl ausführe bekomm ich in der Partyline folgenden fehler
[16:44] Tcl error [botfindpre]: invalid command name "mysqlconnect"
Aus den mysql.log kann ich entnegmen das er noch nicht einmal versucht sich einzulogen.
Vielleicht ist beim connect irgendein Parameter verkehrt.
Kann wer helfen.
package require mysqltcl 2.0
##pretime.tcl hacked into shape by b|\d v1.8 thx to SomeoneWhoCares
##ChangeLog:
##1.8
##+ NUKE added
##1.7
##- fixed timeoffset for date
##1.6
##+ cleaned up bits
##+ added list for ignores
##- bug on 'Not Found'
##1.5
##- bugs on max output
##- some other bugs
##- removed curry-o-meter from !pre/d
##1.4
##- removed wildcard on auto check
##1.3
##+ curry-o-meter (WTF)
##1.2
##+ Added backfill check
##- some crap
##
##Requires in eggdrop/lib/tcl8.4/sql folder included for sql access!
##
##
##prebotlist is space delimited if you wish to include more bots (for auto check)
set prebotlist "test"
##set sql stuff
set sql(mysqlhost) "localhost"
set sql(mysqlport) "3306"
set sql(mysqluser) "mysql"
set sql(mysqlpassword) "mysql"
set sql(mysqldatabase) "PreDB"
set sql(mysqltablename) "RelSection"
set sql(mysqltimefield) "ReleaseDate"
set sql(mysqlrelnamefield) "ReleaseName"
##
##
##set ignore names
set ignore {
cd?
cd??
covers
sample
disc?
disc??
disk?
disk??
extra
}
##
##
##set offset (+ or - without space) in seconds
set offset "+0"
##set backfill warning in wrong dir 0=no
set backfill 1
##set format of dated dirs
set bfilldir "%m%d"
##set splitter to newdir NOTE: THIS IS IMPORTANT! IT SHOULD BE THE ONLY THING BETWEEN BIND AND DIRNAME
set nsplitter ":"
##set max results
set maxout 5
##
##
##set binds
bind pub -|- !pred botfindpre
bind pub -|- !pre botfindpre
bind pubm - *NEW*:* _echo
##pubm - bind is whats used for auto announce YOU WILL NEED TO FIGURE THE WILDCARDS FOR IT.
## IF YOU USE CONTROL CHARS FOR UNDERLINE, etc. USE '*' TO ALLOW FOR THESE !
## YOU WILL ALSO NEED TO MAKE YOUR 'NEW' ANNOUNCE SPLITTER TO CONTAIN $nsplitter TO
## THE NEWDIR ie.
## NEW in MP3: -> 0414/Crusz-Redemption-Promo-2004-JUST by t/iND. or
## [NEW][MP3] t/iND blah blah > 0414/Crusz-Redemption-Promo-2004-JUST etc.
##
##
##end of config!
set myarse 0
##
##
##color, underline, bold, reverse.
proc u {} {return \037}; #underline
proc r {} {return \026}; #reverse
proc c {} {return \003}; #color
proc b {} {return \002}; #bold
##
##
##
proc vcheck:filterString {myString} {
# Filter out some characters that mysql does not like.
regsub -all -- {'} $myString "`" myString
regsub -all -- {\\} $myString "/" myString
regsub -all -- {\{} $myString "<" myString
regsub -all -- {\}} $myString ">" myString
# Take out all control characters. After the comment/album, etc. for id3 tag the hex character 0x00 starts and is repeated until 0x0A (marking the end). Tcl recognizes these as control characters. Note the double brackets, `[:cntrl:]' is actually a list of characters, thus it needs to be enclosed with [ and ].
regsub -all -- {[[:cntrl:]]} $myString {} myString
return $myString
}
##
##
##wtf
proc curry {secs} {
if {$secs > 60001} {return "\([b]::::::::::::[b]\)"}
if {$secs > 48001} {return "\([b]#:::::::::::[b]\)"}
if {$secs > 36001} {return "\([b]##::::::::::[b]\)"}
if {$secs > 24001} {return "\([b]###:::::::::[b]\)"}
if {$secs > 15001} {return "\([b]####::::::::[b]\)"}
if {$secs > 9601} {return "\([b]#####:::::::[b]\)"}
if {$secs > 7201} {return "\([b]######::::::[b]\)"}
if {$secs > 5401} {return "\([b]#######:::::[b]\)"}
if {$secs > 3601} {return "\([b]########::::[b]\)"}
if {$secs > 2701} {return "\([b]#########:::[b]\)"}
if {$secs > 1860} {return "\([b]##########::[b]\)"}
if {$secs > 601} {return "\([b]###########:[b]\)"}
return "\([b]############[b]\)"
}
##
##
##convert time
proc con_time {secs} {
if {$secs == 0} {return "0s|0secs|"} else {
if {$secs < 60} {return "${secs}s|${secs}secs|" } else {
set mins [expr $secs / 60]
set secs [expr $secs % 60]
}
if {$mins < 60} {
set hrs 0
set mins [expr $mins % 60]
} else {
set hrs [expr $mins / 60]
set mins [expr $mins % 60]
}
if {$hrs < 24} {
set days 0
set hrs [expr $hrs % 24]
} else {
set days [expr $hrs / 24]
set hrs [expr $hrs % 24]
}
if {$days < 365} {
set yrs 0
set days [expr $days % 365]
} else {
set yrs [expr $days / 365]
set days [expr $days % 365]
}
if {$days == 0} {set daysm "" ; set daysmm ""} else {set daysm " [b]${days}[b]d" ; set daysmm " [b]${days}[b]days"}
if {$hrs == 0} {set hrsm "" ; set hrsmm ""} else {set hrsm " [b]${hrs}[b]h" ; set hrsmm " [b]${hrs}[b]hrs"}
if {$mins == 0} {set minsm "" ; set minsmm ""} else {set minsm " [b]${mins}[b]m" ; set minsmm " [b]${mins}[b]mins"}
if {$secs == 0} {set secsm "" ; set secsmm ""} else {set secsm " [b]${secs}[b]s" ; set secsmm " [b]${secs}[b]secs"}
set x [string trim "${daysmm}${hrsmm}${minsmm}${secsmm}"]
set y [string trim "${daysm}${hrsm}${minsm}${secsm}"]
return $x
}
}
##
##
##auto
proc _echo {nick uhost handle chan arg} {global myarse prebotlist nsplitter dive ignore
foreach bot $prebotlist {
if {$bot == $nick} {
set myarse 1
break
}
}
set arg [vcheck:filterString $arg]
if {$myarse != 1} {return}
foreach ig $ignore {
if {[string match -nocase "*/$ig *" $arg]} {
return
}
}
set give [split $arg $nsplitter]
set give [string trim [lindex $give 1]]
##now 2nd part
set give [lindex $give 0]
set give [string trim $give /]
if {[string match */* $give]} {
set give [split $give /]
set dive [lindex $give 0]
set give [lindex $give 1]
} else {
set dive ""
}
botfindpre $nick $uhost $handle $chan [string trim [lindex $give 0]]
return
}
##
##
##get teh shit
proc findpre {text} {global sqlserverhandle sql myarse
if {$myarse == 1} {
set data [mysqlsel $sqlserverhandle "SELECT *, $sql(mysqlrelnamefield) FROM $sql(mysqltablename) WHERE $sql(mysqlrelnamefield) LIKE \"[lindex $text 0]\" ORDER BY $sql(mysqltimefield) DESC;" -list]
} else {
set data [mysqlsel $sqlserverhandle "SELECT *, $sql(mysqlrelnamefield) FROM $sql(mysqltablename) WHERE $sql(mysqlrelnamefield) LIKE \"%[lindex $text 0]%\" ORDER BY $sql(mysqltimefield) DESC;" -list]
}
return $data
}
##
##
##main
proc botfindpre {nick uhost handle chan arg} {global prebotlist sqlserverhandle sql myarse offset maxout dive bfilldir backfill
set sqlserverhandle [mysqlconnect -host $sql(mysqlhost) -port $sql(mysqlport) -u $sql(mysqluser) -password $sql(mysqlpassword) -db $sql(mysqldatabase)]
set data [findpre [lindex $arg 0]]
putlog >>>$data
##putlog "Release not found."
if {$myarse == 0 && $data == ""} {
puthelp "PRIVMSG $chan :$nick: Pre-Release not found"
catch {mysqlclose $sqlserverhandle}
catch {mysqlclose}
return
}
putlog $data
if {$myarse == 0} {
if {[lindex [split $arg] 1] != ""} {
set m2 [lindex [split $arg] 1]
if {[regexp ^(\[0-9\])+$ $m2] == 1} {
if {$m2 <= $maxout} {
set maxouts $m2
}
} else {
puthelp "PRIVMSG $chan :Usage: !pred Release.name?like*this \[amount\]"
catch {mysqlclose $sqlserverhandle}
catch {mysqlclose}
return
}
} else {
set maxouts 1
}
} else {
set maxouts 1
}
set warn ""
if {$backfill == 1} {
if {$myarse == 1} {
if {$dive != ""} {
##check backfill
set check [clock format [expr [lindex [lindex $data 0] 2] + $offset] -format "$bfilldir"]
if {$dive > $check} {
set warn "\[[c]04[b]BACKFILL[b][c]\]"
}
}
}
}
for {set i 0} {$i < $maxouts} {incr i} {
if {[lindex $data $i] != ""} {
if {[string match -nocase *[lindex [split $arg] 0]* [lindex [lindex $data $i] 0]]} {
if {[lindex [lindex $data $i] 3] != 0} {
##nuked
set NUKE "and was [c]04NUKED[c] for [b][string trim [lindex [lindex $data $i] 4]][b] "
} else {
set NUKE ""
}
if {$myarse == 0} {
puthelp "PRIVMSG $chan :$warn[lindex [lindex $data $i] 0] was pred [clock format [expr [lindex [lindex $data $i] 2] + $offset] -format "%D %H:%M%p %Z"] - [con_time [expr [clock seconds] - [lindex [lindex $data $i] 2]]] ago $NUKE- ([b][lindex [split [lindex [lindex $data $i] 0] -] end]\|[lindex [lindex $data $i] 1][b])"
} else {
puthelp "PRIVMSG $chan :$warn[lindex [lindex $data $i] 0] was pred [clock format [expr [lindex [lindex $data $i] 2] + $offset] -format "%D %H:%M%p %Z"] - [con_time [expr [clock seconds] - [lindex [lindex $data $i] 2]]] ago $NUKE- ([b][lindex [split [lindex [lindex $data $i] 0] -] end]\|[lindex [lindex $data $i] 1][b]) - curry-o-meter [curry [expr [clock seconds] - [lindex [lindex $data $i] 2] + $offset]]"
}
##putlog "Reported pre time to $nick"
}
}
}
catch {mysqlclose $sqlserverhandle}
catch {mysqlclose}
return
}
##
##
##
putlog "mysql/tcl prebot loaded and fukt up by b|\\d 1.8"
Gruß Iceman
ChaosKrieger
17.03.2005, 16:44
hi,
[16:44] Tcl error [botfindpre]: invalid command name "mysqlconnect"
steht doch da, er kennt den befehl nicht.. entweder er ist falsch oder du hast vergessen die richtigen module zu laden
By Chaos
Hi ChaosKrieger.
das Problem ist soweit gelöst. Jetzt möchte ich eine weitere Funktion einfügen. Und zwar möcht ein release nachträglich mit den Befehl !add in die myqsl db adden.
und zwar so das der timestap gleich in die unix zeit umgerechnet wird.
sollt dann so aussehn.
!add Mueller.meier.schulze Frankfurt 17.02.2005 02:27:00
und so sollt das dann in der myqsl.db sein
+-----------------------------+-----------+--------------+
| name | type | timestamp |
+------------------------- ---+-----------+--------------+
| !add Mueller.meier.schulze | Frankfurt | 1108603620 |
+-----------------------------+-----------+--------------+
Die Basisdaten hab ich so geändert
set sql(mysqlhost) "localhost"
set sql(mysqlport) "3306"
set sql(mysqluser) "mysql"
set sql(mysqlpassword) "mysql"
set sql(mysqldatabase) "PreDB"
set sql(mysqltablename) "type"
set sql(mysqltimefield) "timestap"
set sql(mysqlrelnamefield) "name"
hi,
[16:44] Tcl error [botfindpre]: invalid command name "mysqlconnect"
steht doch da, er kennt den befehl nicht.. entweder er ist falsch oder du hast vergessen die richtigen module zu laden
By Chaos
Leider habe ich den Selben error!
Kann mir wer weiterhelfen?!
Was muss ich machen um ihn zu beseitigen?
ChaosKrieger
02.11.2005, 17:08
Leider habe ich den Selben error!
Kann mir wer weiterhelfen?!
Was muss ich machen um ihn zu beseitigen?
das, was ich oben auch schon sagte
Hmm..
also der Pro tcl scripter bin ich leider nicht ..aber das richtige modul, mysqltcl2.0 für windows habe ich geladen.
und an den befhelen hab ioch auch nix geändert.sind genauso wie sie oben im script stehen!
Kann mir einer vllt genau sagen welche module ich alle brauche?
DarkAngel52457
03.11.2005, 18:20
mache es mal so
load /usr/lib/mysqltcl-2.30/libmysqltcl2.30.so
undf wenn dann immer noch ein fehler kommt versuch mal die datei fbsql zu laden die du natürlich erst hoch laden must
load /home/eggdrop/scripts/fbsql.so
mfg.
nur zur info .. hab das ding auf nem windrop laufen :)
DarkAngel52457
04.11.2005, 03:05
ist doch latte wie hose besorg dir
libmySQL.dll , mysqltcl.dll, pkgIndex.tcl
dann
load libmysqltcl.dll in dem tcl fertig aber nur so zur info das script ist müll du kannst dir viel einfacher eins selber erstellen dann verstehst du vieleicht auch wieso es die und jenes tut und so sehr schwer ist es nicht
hi teste mit dem script auch gerade ein wenig rum evt hat jemand hier jemand erfahrungen mit meinem Problem !
Also ich habe MYSQl dll geladen bekomme beim starten des windrops aber noch denn fehler !
Can't load modules libmySQL: No start function defined.
ist dieses Prob schon bei jemanden aufgetaucht ?
MFG
Tag
Also ich hab das auch zum laufen gebracht (linux)...nur
wie würde die tabelle aussehen (mysql) ???
mfg
Sooo, nach meinem post damals Hm, kann mir dann wenigstens einer sagen wie ich die DB und tables richtig anlegen muß damit das script klappt? hatte ich eigendlich aufgegeben. Jetzt setzt ich mich wieder damit auseinander und finde durch google diesen thread wieder. Mittlerweile haben einige Leute Beiträge gepostet die mich im gegensatz zu damals schon einen ganzen Schritt näher bringt. Nu is immer noch das Problem vorhanden warum das script nicht auf mysql connected. Kein error kein nichts bei der Zeichenfolge die eigendlich den mysql eintrag machen sollte, das einzige was ich bekomme ist ein Error wenn ich die Datenbank leer lasse und versuche mit !pre die Datenbank zu durchsuche.
Ich währe sehr Dankbar wenn mittlerweile jemand wie Iceman (der es scheinbar geschafft hat aber nicht mehr im Board aktiv ist) das script zum laufen gebracht hat.
Zusammenfassung: Script lässt sich laden, mysqltcl 2.0 vorhanden und geladen, mysql 3.23.57 läuft, eggdrop mit -n gestartet, Befehle wie "New : bla.bla.blablaa" werden in der eggdrop konsole angezeigt, Kein versuch auf die mysqldb zu verbinden, bei !pre allerdings schon.
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.