I have a windrop bot (Eggdrop v1.6.18 Cygwin binary (Win95/98/ME/NT/2000/XP)
I have downloaded a file that has 3 files in it for mysqltcl
libmySQL.dll
libmysqltcl.dll
pkgIndex.tcl
Ok I have a directory called mysqltcl inside of my lib directory. so it looks like this lib/mysqltcl
this is what I have for my pkgIndex.tcl
Code: Select all
set dir "/lib/mysqltcl/"
proc loadmysqltcl { dir } {
set oldcwd [pwd]
cd $dir
load libmysqltcl[info sharedlibextension]
cd $oldcwd
}
package ifneeded mysqltcl 3.02 [list loadmysqltcl $dir]
(I have used xxxxx for my password,username and didn't put full site url all for privacy)
Code: Select all
package require mysqltcl
set db_handle [mysqlconnect -host www.siteurl.com -user xxxxxx -password xxxxxxx -db trackerstrike]
bind join - "#CHANNEL *" join_main
bind part - "#CHANNEL *" part_main
bind sign - "#CHANNEL *" sign_main
bind nick - "#CHANNEL *" nick_main
proc sign_main {nick uhost hand channel reason} {
global db_handle botnick
if {$nick==$botnick} {return 0}
set sql "UPDATE users SET onirc = 'no' WHERE username = '$nick'"
putloglev d * "ircstats: executing $sql"
set result [mysqlexec $db_handle $sql]
if {$result != 1} {
putlog "SQL - Error"
} else {
set id [mysqlinsertid $db_handle]
puthelp "PRIVMSG $channel :User Offline: \002$nick\002 - IRC bonus disabled"
}
}
proc join_main {nick uhost hand channel} {
global db_handle botnick
if {$nick==$botnick} {return 0}
set sql "UPDATE users SET onirc = 'yes' WHERE username = '$nick'"
putloglev d * "ircstats: executing $sql"
set result [mysqlexec $db_handle $sql]
if {$result != 1} {
putlog "SQL - error"
} else {
set id [mysqlinsertid $db_handle]
puthelp "PRIVMSG $channel :User Online: \002$nick\002 - IRC bonus enabled."
}
}
proc part_main {nick uhost hand channel msg} {
global db_handle botnick
if {$nick==$botnick} {return 0}
set sql "UPDATE users SET onirc = 'no' WHERE username = '$nick'"
putloglev d * "ircstats: executing $sql"
set result [mysqlexec $db_handle $sql]
if {$result != 1} {
putlog "SQL - Error"
} else {
set id [mysqlinsertid $db_handle]
puthelp "PRIVMSG $channel :User Offline: \002$nick\002 - IRC bonus disabled"
}
}
proc nick_main {nick uhost handle channel newnick} {
global db_handle botnick
# if {$nick==$botnick} {return 0}
set sql "UPDATE users SET onirc = 'no' WHERE username = '$nick'"
putloglev d * "ircstats: executing $sql"
set result [mysqlexec $db_handle $sql]
if {$result != 1} {
set sql "UPDATE users SET onirc = 'yes' WHERE username = '$newnick'"
putloglev d * "ircstats: executing $sql"
set result [mysqlexec $db_handle $sql]
putlog "SQL - Error"
if {$result != 1} {
putlog "SQL - Error"
} else {
set id [mysqlinsertid $db_handle]
puthelp "PRIVMSG $channel :User Online \002$newnick\002 - IRC bonus enabled"
}
} else {
set id [mysqlinsertid $db_handle]
puthelp "PRIVMSG $channel :User Offline \002$nick\002 - IRC bonus disabled"
}
}
Just so you all know, the bot is on a completely different computer/server then the server of the website. They are in 2 different locations.
This is the error that I get when I try to load the bot
[17:16] Tcl error in file 'eggdrop.conf':
[17:16] invalid command name "\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{
\f0\froman\fcharset0 Times New Roman;}{\f1\fswiss\fcharset0 Arial;}}
{\*\generator Msftedit 5.41.15.1507;}\viewkind4\uc1\pard\sb100\sa100\f0\fs24 loa
d libmysqltcl.dll\par
package require mysqltcl\line set db_handle [mysqlconnect -host www.siteurl.com -user XXXXXXX -password XXXXXXX -db trackerstrike]\line\line bind jo
in - "#CHANNEL *" join_main\line bind part - "#CHANNEL *" part_main\line b
ind sign - "#CHANNEL *" sign_main\line bind nick - "#CHANNEL *" nick_main\
line\line proc sign_main \{nick uhost hand channel reason\} \{\line global db_ha
ndle botnick\line if \{$nick==$botnick\} \{return 0\}\line set sql "UPDATE users
SET onirc = 'no' WHERE username =
[17:16] * CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)
I have editted the error and replaced password and username with XXXXX and host with siteurl instead of actual url and channel name with CHANNEL for privacy
If somebody can help me with this I would really appreciate it. Thanks