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.
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.
==================================
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.
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
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 .
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 .