| View previous topic :: View next topic |
| Author |
Message |
genti Voice
Joined: 30 Nov 2005 Posts: 7
|
Posted: Thu Jun 22, 2006 8:58 am Post subject: Bookmarks script |
|
|
Hi all!
I need a tcl script to append, by a trigger, an url from irc to a text file, and with another it read the text file and write the output in the client query. Does it is possible?
p.s.
sorry for my english  |
|
| Back to top |
|
 |
deadite66 Halfop
Joined: 30 May 2005 Posts: 74 Location: Great Yarmouth, UK
|
Posted: Thu Jun 22, 2006 10:47 am Post subject: |
|
|
use commands !url and !listurl
| Code: | bind pub - !url saveurl
proc saveurl {nick uhost hand chan arg} {
if {$arg == ""} {
puthelp "PRIVMSG $chan : Usage is !url web_page_url"
} else {
set fname "urlsave.txt"
set fp [open $fname "a"]
puts $fp $arg
close $fp
}
}
bind pub - !listurl listurl
proc listurl {nick uhost hand chan arg} {
set fp [open "urlsave.txt" "r"]
set data [read -nonewline $fp]
set lines [split $data "\n"]
close $fp
foreach x $lines {
puthelp "PRIVMSG $nick :$x"
}
} |
_________________ <- tcl newb |
|
| Back to top |
|
 |
genti Voice
Joined: 30 Nov 2005 Posts: 7
|
Posted: Thu Jun 22, 2006 11:52 am Post subject: |
|
|
:*
thx |
|
| Back to top |
|
 |
|