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.

Simple script for the latest eggdrop

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
r
raijinken
Voice
Posts: 2
Joined: Sun Jan 21, 2007 7:11 pm

Simple script for the latest eggdrop

Post by raijinken »

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.
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

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: Select all

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"
}
r
raijinken
Voice
Posts: 2
Joined: Sun Jan 21, 2007 7:11 pm

Post by raijinken »

thank you that was perfect
Post Reply