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.

Channel greet script.

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
a
ariqs
Voice
Posts: 3
Joined: Thu Oct 01, 2009 12:29 am

Channel greet script.

Post by ariqs »

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.
t
tueb
Halfop
Posts: 76
Joined: Thu Oct 04, 2007 6:09 am
Location: #quiz.de @ irc.gamesurge.net
Contact:

Post by tueb »

http://www.egghelp.org/tclhtml/3478-4-0 ... TGreet.htm <-- this one is working fine for me. (and does what you asked for)
#Quiz.de @ irc.GameSurge.net
JavaChat
a
ariqs
Voice
Posts: 3
Joined: Thu Oct 01, 2009 12:29 am

Not quite.

Post by ariqs »

It adds the person's nick to the greeting, which isn't what I want.
a
ariqs
Voice
Posts: 3
Joined: Thu Oct 01, 2009 12:29 am

Post by ariqs »

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.
t
tueb
Halfop
Posts: 76
Joined: Thu Oct 04, 2007 6:09 am
Location: #quiz.de @ irc.gamesurge.net
Contact:

Post by tueb »

sorry, i missunderstood, what you wanted.

maybe this will help (untested):

Code: Select all

#!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
Last edited by tueb on Sun Oct 04, 2009 1:14 pm, edited 2 times in total.
#Quiz.de @ irc.GameSurge.net
JavaChat
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

Code: Select all

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

 #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?
Post Reply