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 

Dynamic Var :|

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive
View previous topic :: View next topic  
Author Message
benzon
Voice


Joined: 11 Apr 2004
Posts: 11

PostPosted: Fri Apr 16, 2004 7:25 am    Post subject: Dynamic Var :| Reply with quote

Code:
set mysql(host) "***"
set mysql(port) "3306"
set mysql(user) "***"
set mysql(pass) "***"
set mysql(data) "***"
set mysql(vers) "2.1"
package require mysqltcl $mysql(vers)

set channel "#onedaycup #sucsa"

set time 60

if {[string compare [string index $time 0] "!"] == 0} { set timer [string range $time 1 end] } { set timer [expr $time * 60] }
if {[lsearch -glob [utimers] "* gos *"] == -1} { utimer $timer gos }

proc gos {} {
global mysql channel time timer
foreach chan $channel {
set mysql(conn) [mysqlconnect -host $mysql(host) -port $mysql(port) -user $mysql(user) -password $mysql(pass)]
mysqluse $mysql(conn) $mysql(data)
foreach query [mysqlsel $mysql(conn) "SELECT * FROM cup_reklame ORDER BY id;" -list] {
putserv "PRIVMSG $chan :[lindex $query 1] "
}
}
if {[lsearch -glob [utimers] "* gos *"] == -1} { utimer $timer gos }
mysqlclose $mysql(conn)
}

putlog "\002Mysql advertising 1.0\002"



This is working grate for me but one problem is that i need to make the set time 60 dynamic, so i eg can type !cuprek on then it will type every 30 min and if itīs !cuprek off it will type every 60 min is that posible and is ther one ther can help me yoused a lot of time looking in here last night
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive 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