This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

# of args /mysqltcl

Help for those learning Tcl or writing their own scripts.
Post Reply
S
SL0RD
Voice
Posts: 19
Joined: Sun Oct 05, 2008 11:44 am

# of args /mysqltcl

Post by SL0RD »

having a problem with this script its saying wrong # args but i can't figure out how to fix it.

Code: Select all

#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.
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

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).
Last edited by nml375 on Tue Oct 28, 2008 9:34 am, edited 1 time in total.
NML_375
S
SL0RD
Voice
Posts: 19
Joined: Sun Oct 05, 2008 11:44 am

Post by SL0RD »

i changed the args to { handle database } and i get

TCL error [feed_sl0rd]:wrong # args: should be "feed_sl0rd handle database"
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

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
S
SL0RD
Voice
Posts: 19
Joined: Sun Oct 05, 2008 11:44 am

Post by SL0RD »

Ok i got it to work now, thanks for the help ;)
Post Reply