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 

Channel greet script.

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


Joined: 01 Oct 2009
Posts: 3

PostPosted: Thu Oct 01, 2009 12:34 am    Post subject: Channel greet script. Reply with quote

I'm looking for a channel greet script that allows you to change the greeting through irc, and that can be turned off with perhaps some sort of flood protection. I've gone through all the scripts on egghelp, and they either don't meet those criteria, or they don't work with the current version of eggdrop.

I've tried 18 scripts. GreetWonder would be great if it worked, if anyone wanted to make it work with eggdrop1.6. I'm somewhat shocked there is no working script that meet the criteria.
Back to top
View user's profile Send private message
tueb
Halfop


Joined: 04 Oct 2007
Posts: 76
Location: #quiz.de @ irc.gamesurge.net

PostPosted: Thu Oct 01, 2009 8:41 am    Post subject: Reply with quote

http://www.egghelp.org/tclhtml/3478-4-0-0-1-TxTGreet.htm <-- this one is working fine for me. (and does what you asked for)
_________________
#Quiz.de @ irc.GameSurge.net
JavaChat
Back to top
View user's profile Send private message Visit poster's website
ariqs
Voice


Joined: 01 Oct 2009
Posts: 3

PostPosted: Thu Oct 01, 2009 1:04 pm    Post subject: Not quite. Reply with quote

It adds the person's nick to the greeting, which isn't what I want.
Back to top
View user's profile Send private message
ariqs
Voice


Joined: 01 Oct 2009
Posts: 3

PostPosted: Fri Oct 02, 2009 7:32 pm    Post subject: Reply with quote

It also won't work for me now, and when I went to get help with it, I was told it was programmed very poorly, and that it had huge security issues.
Back to top
View user's profile Send private message
tueb
Halfop


Joined: 04 Oct 2007
Posts: 76
Location: #quiz.de @ irc.gamesurge.net

PostPosted: Sun Oct 04, 2009 7:06 am    Post subject: Reply with quote

sorry, i missunderstood, what you wanted.

maybe this will help (untested):

Code:

#!greet being the command to set greetings
bind pub - !greet tueb_write_greeting
bind join - * tueb_on_joined


#variables
variable greetfile "greeting.txt"
variable lastjoined ""




proc tueb_on_joined {nick host handle channel} {
global lastjoined greetfile

 #don't show greeting if the same user joins twice, thrice etc.
 if {[string equal -nocase $lastjoined $nick]} {
    return
 } else {
    set lastjoined $nick
 }

 #see, if greeting.txt exists:
 if {[file exists $greetfile]&& [file readable $greetfile]} {
   #reading out greeting.txt
   set fp [open $greetfile "r"]
   set data [read -nonewline $fp]
   close $fp

   #only post, if greeting isnot ""
   if {$data != ""} {
      #posting greeting
      putserv "PRIVMSG $channel :$data"
   }
 }
}



proc tueb_write_greeting {nick host handle channel text} {
global greetfile

 #only ops can set greeting:
 if {![isop $nick $channel]} {
    #message: not accepted
    set showtext "You need to be op to set a new greeting."
    return
 }

 #writing greeting to greeting.txt, overwriting old greeting:
 set file [open $greetfile "w"]
 puts $file $text
 flush $file
 close $file

 #message: accepted
 set showtext "Set new greeting to: \002$showtext\002"
 putserv "PRIVMSG $channel :$showtext"

}



PS: fixed
_________________
#Quiz.de @ irc.GameSurge.net
JavaChat


Last edited by tueb on Sun Oct 04, 2009 1:14 pm; edited 2 times in total
Back to top
View user's profile Send private message Visit poster's website
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Sun Oct 04, 2009 12:35 pm    Post subject: Reply with quote

Code:
 #don't show greeting if the same user joins twice, thrice etc.
 if {$lastjoined == $nick} {
    return
 }

'lastjoined' is never set to anything, except in global-space to "". Maybe you meant to craft this part like it is below?
Code:
 #don't show greeting if the same user joins twice, thrice etc.
 if {[string equal -nocase $lastjoined $nick]} {
    return
 } else {
    set lastjoined $nick
 }


Also...
"GreetWonder would be great if it worked, if anyone wanted to make it work with eggdrop1.6."

Find this procedure: proc greet:init { what idx } {

Then find the line below:
if {[lsearch -exact "1.1 1.2 1.3 1.4" $greet(bottype)] == -1} {

Change it to this:
if {[lsearch -exact "1.1 1.2 1.3 1.4 1.6" $greet(bottype)] == -1} {

1.6 supported now. How hard was that?
_________________
speechles' eggdrop tcl archive
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