egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Simple script for the latest eggdrop

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
raijinken
Voice


Joined: 21 Jan 2007
Posts: 2

PostPosted: Sun Jan 21, 2007 7:15 pm    Post subject: Simple script for the latest eggdrop Reply with quote

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
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sun Jan 21, 2007 9:11 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
raijinken
Voice


Joined: 21 Jan 2007
Posts: 2

PostPosted: Sun Jan 21, 2007 11:16 pm    Post subject: Reply with quote

thank you that was perfect
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber