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 

windrop and mysqltcl

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
TewSmooth18
Voice


Joined: 15 Mar 2007
Posts: 9

PostPosted: Thu Mar 15, 2007 6:20 pm    Post subject: windrop and mysqltcl Reply with quote

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:

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:

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
Back to top
View user's profile Send private message
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Thu Mar 15, 2007 7:53 pm    Post subject: Reply with quote

It appears the top most error is your problem.
Quote:
[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
Back to top
View user's profile Send private message Visit poster's website
TewSmooth18
Voice


Joined: 15 Mar 2007
Posts: 9

PostPosted: Thu Mar 15, 2007 8:20 pm    Post subject: Reply with quote

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


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Thu Mar 15, 2007 9:11 pm    Post subject: Reply with quote

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, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
TewSmooth18
Voice


Joined: 15 Mar 2007
Posts: 9

PostPosted: Thu Mar 15, 2007 9:17 pm    Post subject: Reply with quote

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


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Thu Mar 15, 2007 9:22 pm    Post subject: Reply with quote

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, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
TewSmooth18
Voice


Joined: 15 Mar 2007
Posts: 9

PostPosted: Thu Mar 15, 2007 9:24 pm    Post subject: Reply with quote

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


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Thu Mar 15, 2007 9:50 pm    Post subject: Reply with quote

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, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
TewSmooth18
Voice


Joined: 15 Mar 2007
Posts: 9

PostPosted: Thu Mar 15, 2007 10:02 pm    Post subject: Reply with quote

so what you are saying is change this

Code:

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:

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


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Thu Mar 15, 2007 10:06 pm    Post subject: Reply with quote

Most certainly not!

change this:
Code:
set dir "/lib/mysqltcl/"

into something like this:
Code:
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, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
TewSmooth18
Voice


Joined: 15 Mar 2007
Posts: 9

PostPosted: Thu Mar 15, 2007 10:08 pm    Post subject: Reply with quote

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


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Thu Mar 15, 2007 10:11 pm    Post subject: Reply with quote

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, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
TewSmooth18
Voice


Joined: 15 Mar 2007
Posts: 9

PostPosted: Thu Mar 15, 2007 10:12 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
TewSmooth18
Voice


Joined: 15 Mar 2007
Posts: 9

PostPosted: Thu Mar 15, 2007 11:27 pm    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message
TewSmooth18
Voice


Joined: 15 Mar 2007
Posts: 9

PostPosted: Fri Mar 16, 2007 3:26 am    Post subject: Reply with quote

Nevermind on that last post. I got everything working fine now. Thanks for the help from the people that gave me help
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 -> Script Support & Releases 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