| View previous topic :: View next topic |
| Author |
Message |
SL0RD Voice
Joined: 05 Oct 2008 Posts: 19
|
Posted: Mon Oct 27, 2008 4:44 pm Post subject: # of args /mysqltcl |
|
|
having a problem with this script its saying wrong # args but i can't figure out how to fix it.
| Code: | #sever info
set host "(HOST)"
set user "(USER)"
set passwd "(PASS)"
set db "(DATABASE)"
#Bind
bind pubm - "% !feed sl0rd" feed_sl0rd
## Load the mysqltcl package
package require mysqltcl
proc feed_sl0rd {nick uhost hand chan topic} {
global host user passwd db
if {$chan == "#sops"} then {
set con [::mysql::connect -host $host -user $user -password $passwd]
set res [::mysql::use $db]
if {$res != 0} {
putlog "could not connect... "
}
::mysql::exec $con "UPDATE `streameronline` ( `streamerusc` ) VALUES (http://ustream.tv/e06,Q7h6Mbuey8aOxTltiQUyBKjIDFx4.usc)"
PUTHELP "PRIVMSG $chan Update successfull"
::mysql::close $con
}
}
putlog "Script loaded: Stream Switcher"
|
Last edited by SL0RD on Mon Oct 27, 2008 9:20 pm; edited 1 time in total |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Mon Oct 27, 2008 7:24 pm Post subject: |
|
|
Could you post the full error message, and if possible/reproducable, the content of the global variable errorInfo at the time of the error?
At a quick glance however, I would guess that the error is related to your ::mysql::use command, which actually expects two arguments, not one; namely "handle" and "database" (handle is not to be confused with handles in eggdrop). _________________ NML_375, idling at #eggdrop@IrcNET
Last edited by nml375 on Tue Oct 28, 2008 9:34 am; edited 1 time in total |
|
| Back to top |
|
 |
SL0RD Voice
Joined: 05 Oct 2008 Posts: 19
|
Posted: Mon Oct 27, 2008 9:13 pm Post subject: |
|
|
i changed the args to { handle database } and i get
TCL error [feed_sl0rd]:wrong # args: should be "feed_sl0rd handle database" |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Tue Oct 28, 2008 9:35 am Post subject: |
|
|
I'm not talking about your proc-head...
I'm talking about the very command I mentioned in my previous post. Please re-read it.. _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
SL0RD Voice
Joined: 05 Oct 2008 Posts: 19
|
Posted: Tue Oct 28, 2008 3:29 pm Post subject: |
|
|
Ok i got it to work now, thanks for the help  |
|
| Back to top |
|
 |
|