| View previous topic :: View next topic |
| Author |
Message |
raijinken Voice
Joined: 21 Jan 2007 Posts: 2
|
Posted: Sun Jan 21, 2007 7:15 pm Post subject: Simple script for the latest eggdrop |
|
|
Hello,
I need help creating a simple script. Basically I need a script that will notice every user when they join. However, I need the notice to be downloaded from a text file in the same folder.
Example.
I create a txt file with the name greeting.txt and put the line "Welcome to my #channel" in it.
I want this script to be able to read my text file and notice that message to every member when they join.
I would greatly appreciate it if you can help me. |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sun Jan 21, 2007 9:11 pm Post subject: |
|
|
I assume you want the message to change whenever you change it in the .txt file so I wrote the code to read from the file every time someone joins the channel (instead of reading it once and using the same line all the time).
| Code: | bind join - * noticenick
proc noticenick {nick uhost hand chan} {
set line [read -nonewline [set f [open scripts/myfile.txt]]][close $f]
puthelp "notice $nick :$line"
} |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
raijinken Voice
Joined: 21 Jan 2007 Posts: 2
|
Posted: Sun Jan 21, 2007 11:16 pm Post subject: |
|
|
| thank you that was perfect |
|
| Back to top |
|
 |
|