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.

[MySQL] Join several channels

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
T
T-Xorcist
Halfop
Posts: 47
Joined: Mon Nov 14, 2005 6:36 pm
Location: Netherlands
Contact:

[MySQL] Join several channels

Post by T-Xorcist »

Hi everybody,

I have been working with mysqltcl for a few days now, but I just can't get it done! :cry:
What I am looking for, is that the bot join several channels which are in a MySQL database. The table is called channels. It has 2 elements: ID and NAME. Name is the name of the channel.

Which one of you can write a script with use of mysqltcl that he joins the channels which are in the database? I just can't get it done.

Thanks alot! I would really appreciate it:

Greetings, T-Xorcist

PS: I had this script:

Code: Select all

set mysql(conn) [mysqlconnect -user mysqluser -db tbot -password xxxxxx]
foreach res [mysqlsel $mysql(conn) {select name from channels} -flatlist] {
  channel add $res
  putquick "JOIN :$res"
}
mysqlclose $mysql(conn)
But it only joins one channel out the database.
d
dwickie
Halfop
Posts: 76
Joined: Sat Aug 21, 2004 8:53 am
Location: /pub/beer

Post by dwickie »

try:

Code: Select all

foreach res [mysqlsel $mysql(conn) "SELECT name FROM channels" -list] { }
T
T-Xorcist
Halfop
Posts: 47
Joined: Mon Nov 14, 2005 6:36 pm
Location: Netherlands
Contact:

Post by T-Xorcist »

Thanks! But it only displays one channel .. there are 2 channels in the database. But it displays 1 channel!! Better than nothing :)

Do you know how to display all channels which are in the database ?
Post Reply