I finally started setting up (my very first ever) EggDrop BOT....
So far it looks working pretty nicely like what I wanted to have
Now comes the "but"
I also enabled +greet on my channel and users known to the bot that have an infoline trigger the greet, all look fine.
But the greet messages are cut off after 93 chars. They are already saved cut off in the user file.
What do I have to do to increase the max. length of the greet messages / info lines?
I haven't been able to look over the eggdrop source code recently to check for a way to "change" the info line lenght, so i wrote a quick solution. The only testing i've done thou, is to see if XTRA user fields would allow alot of chars and since i got up to 105 chars. I thought it would work, so please let me know how it goes.
if {![info exists whois-fields]} {
set whois-fields "GREET"
} elseif {(![regexp -- {(GREET)} "$whois-fields"])} {
append whois-fields " GREET"
}
bind dcc -|- +greet add_greet:dcc
bind dcc -|- -greet del_greet:dcc
bind dcc m|- chgreet chg_greet:dcc
proc add_greet {handle idx text} {
if {([llength $text] == 0)} {putdcc $idx "Usage: +greet <greet-line>"; return 1}
set index 0; set end "end"; set newgreet [join [lrange $text $index $end]]; set oldgreet [getuser $handle XTRA GREET]
if {([llength $oldgreet] == "") && ([string match -nocase "none" "$newgreet"])} {putdcc $idx "No greet has been set."; return 1}
elseif {([llength $oldgreet] != "") && ([string match -nocase "none" "$newgreet"])} {setuser $handle XTRA GREET ""; putdcc $idx "Your info line has been cleared."; return 1}
elseif {([llength $oldgreet] == "") && (![string match -nocase "none" "$newgreet"])} {setuser $handle XTRA GREET "$newgreet"; putdcc $idx "Your info line has been set to: $newgreet"; return 1}
elseif {([llength $oldgreet] != "") && (![string match -nocase "none" "$newgreet"])} {setuser $handle XTRA GREET "$newgreet"; putdcc $idx "You info line has been changed to: $newgreet"; return 1}
}
proc del_greet {handle idx text} {
set oldgreet [getuser $handle XTRA GREET]
if {([llength $oldgreet] == "")} {putdcc $idx "No greet is currently set."; return 1}
else {setuser $handle XTRA GREET ""; putdcc $idx "Your info line has been cleared"; return 1}
}
proc chg_greet {handle idx text} {
if {([llength $text] == 0)} {putdcc $idx "Usage: chgreet <handle> \[new greet-line\]"; return 1}
set index 0; set end "end"
set hand [lindex $text $index]
if {(![validuser $hand])} {putdcc $idx "sorry, i dont know $hand"; return 1}
else {
set index [expr $index +1]
set newgreet [join [lrange $text $index $end]]
if {([llength $newgreet] == "")} {putdcc $idx "Usage: chgreet <handle> \[new greet-line\]"; return 1}
if {([string match -nocase "none" "$newgreet"])} {setuser $hand XTRA GREET ""; putdcc $idx "info line for $hand has been cleared."; return 1}
else {setuser $hand XTRA GREET "$newgreet"; putdcc $idx "info line for $hand has been set to: $newgreet"; return 1}
}
}
bind join -|- "* *" greet:join
proc greet:join {nick host handle channel} {
if {(![isbotnick $nick]) && ([validuser $handle]) && ([validchan $channel]) && ([channel get $channel greet] == "+") && ([getuser $handle XTRA GREET] != "")} {
puthelp "PRIVMSG $channel :\[$nick\] [getuser $handle XTRA GREET]"
return
}
}
Once its loaded, just use
.+greet <new greet line> - to set your self a greet line.
.-greet - to unset your self a greet line.
.chgreet <handle> <greet line> - to set someone else's greet line.
You can use the word 'none' as a greet line to remove (clear) a greet line.
It will be global, so any channel that has '+greet' channel option set it will display
a person's greet if they have one when they join the channel. This will currently happen "every" time
they join the channel.