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.

motd & server link TCL

Old posts that have not been replied to for several years.
Locked
r
r0v3r
Voice
Posts: 6
Joined: Tue Feb 22, 2005 9:41 am

motd & server link TCL

Post by r0v3r »

Hello people :D

I need help about a tcl that write the motd (/motd) and linked server (/links) in a txt file , when eggdrop connect to server .

Help me please


Thanks :D
User avatar
YooHoo
Owner
Posts: 939
Joined: Thu Feb 13, 2003 10:07 pm
Location: Redwood Coast

Post by YooHoo »

r
r0v3r
Voice
Posts: 6
Joined: Tue Feb 22, 2005 9:41 am

Post by r0v3r »

Sorry , but in your link is reported how to write/read to/from file ... no how to receive a list of linked server and motd and write it to text file .
s
spock
Master
Posts: 319
Joined: Thu Dec 12, 2002 8:40 pm

Post by spock »

Code: Select all

bind raw - 375 { set ::motdfp [open motd.txt w];#}
bind raw - 372 raw:wf
bind raw - 376 { close $::motdfp;#}
proc raw:wf { f k t } { puts $::motdfp $t ; return }
kudos to user for the "args elimination" (as demond put it)

the numerics for "links" are 364 and 365(end of links) so have a go at it yourself before asking for more help.
photon?
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

r0v3r wrote:Sorry , but in your link is reported how to write/read to/from file ... no how to receive a list of linked server and motd and write it to text file .
Obviously they were reference links for you to understand how todo it yourself, not the exact script which would be obvious.

You have have to simply bind raw to the numbers which your ircd has for motd, links and etc then go ahead open a .txt or whatever extension file you want, write it in, and close it.

The whole code as spock gave some of it, shouldn't be more than 10 lines I'd say.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
User avatar
YooHoo
Owner
Posts: 939
Joined: Thu Feb 13, 2003 10:07 pm
Location: Redwood Coast

Post by YooHoo »

r0v3r wrote:Sorry , but in your link is reported how to write/read to/from file ... no how to receive a list of linked server and motd and write it to text file.
:shock: sorry right back at'cha, but in the end, the link I gave you is precisely what you will need to study and practice, so you can begin writing tcl, instead of relying on others forever and ever..
p.s. the puts command is probably the most common way to write something into a file... you might wish to read chapter 11 - working with files
:wink:
r
r0v3r
Voice
Posts: 6
Joined: Tue Feb 22, 2005 9:41 am

Post by r0v3r »

TNX TNX TNX !!!!

i've another question ...
you know how to put the motd into mysql db ?

(i use mysqltcl)
g
greenbear
Owner
Posts: 733
Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway

Post by greenbear »

r
r0v3r
Voice
Posts: 6
Joined: Tue Feb 22, 2005 9:41 am

Post by r0v3r »

Dear gb , my problem is not mysql syntax (this isnt mysql forum) but how to add at this script , a possibility to store data into mysql db .
I've tryed many time but i'm not a good tcl programmer .

tnx
r
r0v3r
Voice
Posts: 6
Joined: Tue Feb 22, 2005 9:41 am

Post by r0v3r »

I've edit the script ...

Code: Select all

set db_handle [mysqlconnect -host localhost -user username  -password mypass -db motd]

proc raw:wf { f k t } {
global db_handle

set sql "INSERT INTO motd values ('','$t');"
set result [mysqlexec $db_handle $sql]
}
it's correct ?

This code work fine at 90% ... at some line i receive this error :

Tcl error [raw:wf]: mysqlexec/db server: You have an error in your SQL s
yntax near '__/ __/ _` |')' at line 1

The script dont write this line and jump to next .

Result : some lines (like 5/50) isnt added to db .

Any idea ?
r
r0v3r
Voice
Posts: 6
Joined: Tue Feb 22, 2005 9:41 am

Post by r0v3r »

Stupid question ! :)

...

Code: Select all

set sql "INSERT INTO motd values ('',\"$t\");"
Tnx :D
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

spock wrote: kudos to user for the "args elimination" (as demond put it)
...and to eggdev team for passing those [bind] arguments together in a string ;)
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

demond wrote:
spock wrote: kudos to user for the "args elimination" (as demond put it)
...and to eggdev team for passing those [bind] arguments together in a string ;)
subtract some kudos for the dns module ;) (welcome back demond)
Have you ever read "The Manual"?
Locked