egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

# of args /mysqltcl

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
SL0RD
Voice


Joined: 05 Oct 2008
Posts: 19

PostPosted: Mon Oct 27, 2008 4:44 pm    Post subject: # of args /mysqltcl Reply with quote

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
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Mon Oct 27, 2008 7:24 pm    Post subject: Reply with quote

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
View user's profile Send private message
SL0RD
Voice


Joined: 05 Oct 2008
Posts: 19

PostPosted: Mon Oct 27, 2008 9:13 pm    Post subject: Reply with quote

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
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Tue Oct 28, 2008 9:35 am    Post subject: Reply with quote

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
View user's profile Send private message
SL0RD
Voice


Joined: 05 Oct 2008
Posts: 19

PostPosted: Tue Oct 28, 2008 3:29 pm    Post subject: Reply with quote

Ok i got it to work now, thanks for the help Wink
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber