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.

windrop and mysqltcl

Support & discussion of released scripts, and announcements of new releases.
Post Reply
T
TewSmooth18
Voice
Posts: 9
Joined: Thu Mar 15, 2007 6:05 pm

windrop and mysqltcl

Post by TewSmooth18 »

I need some help getting a script to work.

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]
Here is the script that I have

(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"
}
}
Can somebody tell me what is wrong with all of that? I have the pkgIndex.tcl file loaded in the scripts directory and have the eggdrop.conf file editted for that and it's saying it is loading properly for that part

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
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

It appears the top most error is your problem.
[17:16] invalid command name "\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{ ....
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
T
TewSmooth18
Voice
Posts: 9
Joined: Thu Mar 15, 2007 6:05 pm

Post by TewSmooth18 »

ok well what am i supposed to do to fix it? I don't really know all that much about windrops so that doesnt really explain much to me
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

Actually, it would seem one of the script-files (the one that tries to load the libmysqltcl dll module) was edited with a nasty editor, such as wordpad; and then saved in RichText Format rather than plain text...
Figure out which file is screwed, open it in wordpad or such, and make sure you save it as plain text, nothing else...
NML_375
T
TewSmooth18
Voice
Posts: 9
Joined: Thu Mar 15, 2007 6:05 pm

Post by TewSmooth18 »

ok it seems that was part of the problem, but now i am getting this error

[20:20] Tcl error in file 'eggdrop.conf':
[20:20] couldn't change working directory to "/lib/mysqltcl/": no such file or d
irectory
while executing
"cd $dir"
(procedure "loadmysqltcl" line 3)
invoked from within
"loadmysqltcl /lib/mysqltcl/"
("package ifneeded" script)
invoked from within
"package require mysqltcl"
(file "scripts/ircidle.tcl" line 1)
invoked from within
"source scripts/ircidle.tcl"
(file "eggdrop.conf" line 1341)
[20:20] * CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)
Last edited by TewSmooth18 on Thu Mar 15, 2007 9:22 pm, edited 1 time in total.
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

I'd suggest using whatever editor you used last time (I'm guessing wordpad).
From some menu, you should be able to choose "Save As..." or similar...
In the box that opens, there should be a dropdown box allowing you to choose which format to use when saving..

This is, of course assuming you indeed are using wordpad. Other editors may behave in other ways. In the future, I'd suggest you stick with notepad for any and all editing of scripts, as this editor does'nt support fancy formats...
NML_375
T
TewSmooth18
Voice
Posts: 9
Joined: Thu Mar 15, 2007 6:05 pm

Post by TewSmooth18 »

ok it seems that was part of the problem, but now i am getting this error

[20:20] Tcl error in file 'eggdrop.conf':
[20:20] couldn't change working directory to "/lib/mysqltcl/": no such file or d
irectory
while executing
"cd $dir"
(procedure "loadmysqltcl" line 3)
invoked from within
"loadmysqltcl /lib/mysqltcl/"
("package ifneeded" script)
invoked from within
"package require mysqltcl"
(file "scripts/ircidle.tcl" line 1)
invoked from within
"source scripts/ircidle.tcl"
(file "eggdrop.conf" line 1341)
[20:20] * CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

Setting up absolute paths in wineggs is pretty tricky...
Try and use relative paths instead, ie. change $dir to point to a directory under the location where you installed eggdrop, rather than "/lib/mysqltcl/"
NML_375
T
TewSmooth18
Voice
Posts: 9
Joined: Thu Mar 15, 2007 6:05 pm

Post by TewSmooth18 »

so what you are saying is change this

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]
To this

Code: Select all

proc loadmysqltcl { C:\eggdrop\lib\mysqltcl\ } { 
    set oldcwd [pwd] 
    cd C:\eggdrop\lib\mysqltcl\ 
    load libmysqltcl[info sharedlibextension] 
    cd $oldcwd 
} 

package ifneeded mysqltcl 3.02 [list loadmysqltcl C:\eggdrop\lib\mysqltcl\]
is that what you are saying that I need to do?
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

Most certainly not!

change this:

Code: Select all

set dir "/lib/mysqltcl/"
into something like this:

Code: Select all

set dir "where/you/put/the/dll-files/"
Looking at your previous code, I'd guess "lib/mysqltcl/" would be proper on your system...
NML_375
T
TewSmooth18
Voice
Posts: 9
Joined: Thu Mar 15, 2007 6:05 pm

Post by TewSmooth18 »

ummm i had it right then.. the .dll files are IN a directory called "mysqltcl" and that directory is inside of the "lib" directory

there for the /lib/mysqltcl/ is correct
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

No!
You're using an absolute path! Surely you don't have a directory named lib at the very top of the filesystem ("harddrive")...
Heck, just looking at your previous post suggests your "lib"-folder resides under a folder named "eggdrop"...
Just use a relative path instead of an absolute.
NML_375
T
TewSmooth18
Voice
Posts: 9
Joined: Thu Mar 15, 2007 6:05 pm

Post by TewSmooth18 »

ok I think I got it now, I am now getting a error but it's saying Access Denied so that's probably being denied from the mysql server on the website server..

So now I just gotta get all the correct information for that (as I am running this for somebody else) so I will have to have them give me access
T
TewSmooth18
Voice
Posts: 9
Joined: Thu Mar 15, 2007 6:05 pm

Post by TewSmooth18 »

I have one more question.. on this peice

set db_handle [mysqlconnect -host www.siteurl.com -user xxxxxx -password xxxxxxx -db trackerstrike]

can I use www.siteurl.com or do I need to use an actual IP Address for this? also beings that this is running on a windows system and not a linux system i removed the -socket information. Do I need to use -port PORTNUMBER in place of where -socket would be or do I need either of them?
T
TewSmooth18
Voice
Posts: 9
Joined: Thu Mar 15, 2007 6:05 pm

Post by TewSmooth18 »

Nevermind on that last post. I got everything working fine now. Thanks for the help from the people that gave me help
Post Reply