| View previous topic :: View next topic |
| Author |
Message |
anon Voice
Joined: 09 Dec 2007 Posts: 2
|
Posted: Sun Dec 09, 2007 3:53 pm Post subject: Two scripts work seperately but not together |
|
|
I have these two scripts, both work fine when only 1 is loaded. When both are loaded only the last one loaded works. Any ideas?
pre.tcl
| Code: | package require mysqltcl
set db_handle [mysqlconnect -host localhost -user root -password pass -db pre]
bind pub - !NEW pre_proc
set _version 0.2
proc insert {section name timestamp} {
global db_handle
set sql "INSERT INTO releases VALUES (null, '$section', '$name', '$timestamp', null, null, '0', null)"
set result [mysqlexec $db_handle $sql]
if {$result == 1} {
return 1
} else {
putlog "FAILURE - $sql"
return 0
}
}
proc pre_proc { nick host handle channel text } {
set section [lindex [split $text] 1]
set release [lindex [split $text] 3]
set timestamp "[lindex [split $text] 4] "
append timestamp [lindex [split $text] 5]
putlog "PRE $release"
set result [insert $section $release $timestamp]
if {$result == 1} {
puthelp "PRIVMSG #lfs-pre :PRE in $section :: $release $timestamp"
}
}
putlog "pre.tcl v$_version loaded." |
fix.tcl
| Code: |
package require mysqltcl
set db_handle [mysqlconnect -host localhost -user root -password pass -db pre]
bind pub - !FIX fix_proc
set _version 0.2
proc fix_size {name size files} {
global db_handle
set sql "UPDATE releases SET size='$size', files='$files' WHERE name='$name'"
set result [mysqlexec $db_handle $sql]
if {$result == 1} {
return 1
} else {
putlog "SIZE FAILURE - $sql"
return 0
}
}
proc fix_proc { nick host handle channel text } {
putlog "FIX [lindex [split $text] 1]"
set fixtype [lindex [split $text] 0]
if {$fixtype == "size"} {
fix_size [lindex [split $text] 1] [lindex [split $text] 2] [lindex [split $text] 3]
}
}
putlog "fix.tcl v$_version loaded." |
I have also tried putting them in the same file and that doesn't work either. |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Sun Dec 09, 2007 5:40 pm Post subject: |
|
|
Maybe try namespace? _________________ Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM |
|
| Back to top |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Sun Dec 09, 2007 8:14 pm Post subject: |
|
|
| Looks like a warez script.. |
|
| Back to top |
|
 |
anon Voice
Joined: 09 Dec 2007 Posts: 2
|
Posted: Sun Dec 09, 2007 9:41 pm Post subject: |
|
|
Creating a namespace around each existing script produced the same results.
EDIT: I have simplified it as much as possible and this still won't trigger both. Only the last one. Both putlogs are outputted so it is going though all of it.
| Code: | bind pub - !FIX fix::fix_proc
bind pub - !NEW pre::pre_proc
namespace eval fix {
namespace export fix_proc
set _version 0.3
proc fix_proc { nick host handle channel text } {
putlog "FIX"
}
putlog "fix v$_version loaded."
}
namespace eval pre {
namespace export pre_proc
set _version 0.1
proc pre_proc { nick host handle channel text } {
putlog "PRE"
}
putlog "pre v$_version loaded."
} |
|
|
| Back to top |
|
 |
metroid Owner
Joined: 16 Jun 2004 Posts: 771
|
Posted: Tue Dec 11, 2007 1:57 pm Post subject: |
|
|
| Warez is not supported on this forum. |
|
| Back to top |
|
 |
|