| View previous topic :: View next topic |
| Author |
Message |
ariqs Voice
Joined: 01 Oct 2009 Posts: 3
|
Posted: Thu Oct 01, 2009 12:34 am Post subject: Channel greet script. |
|
|
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 |
|
 |
tueb Halfop
Joined: 04 Oct 2007 Posts: 76 Location: #quiz.de @ irc.gamesurge.net
|
|
| Back to top |
|
 |
ariqs Voice
Joined: 01 Oct 2009 Posts: 3
|
Posted: Thu Oct 01, 2009 1:04 pm Post subject: Not quite. |
|
|
| It adds the person's nick to the greeting, which isn't what I want. |
|
| Back to top |
|
 |
ariqs Voice
Joined: 01 Oct 2009 Posts: 3
|
Posted: Fri Oct 02, 2009 7:32 pm Post subject: |
|
|
| 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 |
|
 |
tueb Halfop
Joined: 04 Oct 2007 Posts: 76 Location: #quiz.de @ irc.gamesurge.net
|
Posted: Sun Oct 04, 2009 7:06 am Post subject: |
|
|
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 |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Sun Oct 04, 2009 12:35 pm Post subject: |
|
|
| 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 |
|
 |
|