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.

Greet script

Support & discussion of released scripts, and announcements of new releases.
i
iNFERiON
Voice
Posts: 7
Joined: Sat Nov 13, 2004 4:23 pm

Greet script

Post by iNFERiON »

I wrote a greet script that will make your bot say "Good morning/afternoon/evening/night" depending on the time of the day.

Script is untested, but should work, if you experience problems, let me know ;)

Code: Select all

#############################
##                         ##
## iNFERiON's Greet Script ##
##    v1.0 - 12/08/2005    ##
##                         ##
#############################

## INFO
##
## This script will greet anyone who joins the channel with a specified line, depending on the hour of the day.
## This way you can let your bot say "Good morning/afternoon/evening/night". You can offcourse also use other greets.
## Note that the time settings in your eggdrop.conf file must be set correctly for this script to work properly.
## 
## Short explanation of the strings:
##
## Use $nick to have the bot say the joining users's nickname
## Use $chan to have the bot say the name of the channel the user is joining
##
## For example: JohnDoe joins #foobar and the bot is set to say "Good morning $nick, welcome to $chan !" it will say:
## "Good morning JohnDoe, welcome to #foobar !"
##
## END OF INFO

bind join - * inf_greet

#########################
## CONFIGURATION START ##
#########################

# Enter the botmaster hostname here, the botmaster will be greeted with a special line =)
set mhost "~yourident@your.host.here"

# Enter the special line the botmaster should be greeted with
set mmsg "I bow to my master $nick"

# The greet to be used between 00:00 and 06:00
set ngreet "Good night $nick, welcome to $chan"

# The greet to be used between 06:00 and 12:00
set mgreet "Good morning $nick, welcome to $chan"

# The greet to be used between 12:00 and 18:00
set agreet "Good afternoon $nick, welcome to $chan"

# The greet to be used between 18:00 and 00:00
set egreet "Good evening $nick, welcome to $chan"

# Alternative greet, in case the bot is unable to determine what time it is (unlikely, but just to be sure ;))
set altgreet "Hello $nick, welcome to $chan"

#######################
## CONFIGURATION END ##
## DO NOT EDIT BELOW ##
#######################

proc inf_greet {nick host handle chan} {
	if {$host == $mhost} {
		putmsg $chan $mmsg
	} else {
		if {$nick != $botnick} {
			set time [clock format [clock seconds] -format "%H"]
			if {$time < 06} {
				putmsg $chan $ngreet
			} elseif {$time <= 11} {
				putmsg $chan $mgreet
			} elseif {$time <= 17} {
				putmsg $chan $agreet
			} elseif {$time >= 18} {
				putmsg $chan $egreet
			} else {
				putmsg $chan $altgreet
			}
			unset time
		}
	} 
}
Have fun :)
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

iNFERiON wrote:Script is untested, but should work...
You will test your script and debug!
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
i
iNFERiON
Voice
Posts: 7
Joined: Sat Nov 13, 2004 4:23 pm

Post by iNFERiON »

Alchera wrote:You will test your script and debug!
Why ? You having problems with it ?
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

One does not post untested scripts for general release. Simple!
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
E
Ehlanna
Voice
Posts: 15
Joined: Thu Jul 21, 2005 12:08 pm

Post by Ehlanna »

I am still learning how to code in tcl, but I thought that you had to use putmsg $chan : $egreet - i.e., include a colon.
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Ehlanna wrote:I am still learning how to code in tcl, but I thought that you had to use putmsg $chan : $egreet - i.e., include a colon.
If you wanted people to test your script then you should've said so and not put it in a way as if you've released this script out to the public. Also, you can easily test it yourself, it's not that big or complicated script.

Edit: reply was for iNFERiON not Ehlanna.
Last edited by Sir_Fz on Sun Dec 11, 2005 12:45 pm, edited 1 time in total.
E
Ehlanna
Voice
Posts: 15
Joined: Thu Jul 21, 2005 12:08 pm

Post by Ehlanna »

Sir_Fz wrote:If you wanted people to test your script
LOL, don't blame me, I am a pro!!!! I code and test in a live environment! ;)
i
iNFERiON
Voice
Posts: 7
Joined: Sat Nov 13, 2004 4:23 pm

Post by iNFERiON »

Well, script is now tested and works just fine as expected, hope everybody is happy now :roll:
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

Sir_Fz wrote:
Ehlanna wrote:I am still learning how to code in tcl, but I thought that you had to use putmsg $chan : $egreet - i.e., include a colon.
If you wanted people to test your script then you should've said so and not put it in a way as if you've released this script out to the public. Also, you can easily test it yourself, it's not that big or complicated script.
@Sir_Fz: Ehlanna is not supposed to be the original poster :D

@Ehlanna: no, no :, take a look at alltools.tcl. this is not putquick/putserv/puthelp ^-^.
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
d
drfox
Voice
Posts: 26
Joined: Sun Oct 09, 2005 1:51 am

Post by drfox »

nice script but can it be done so the bot tells a new visitor he is the xxxx number to visit the cannel and to tell a returning visitor that he has been here be for x number of times and was last here on such and such a date

i.e
new visitor= <13@Zeon> Welcome krbhhr! You're visitor #13050 to join #chat-room Since 03 December 05.

returning visitor= <13@Zeon> Welcome Back vghgcghc. Last time you joined #chat-room was on 12/10/2005, 11hrs 34mins 47secs ago. (Your total visits: 3)

at the moment im usin a mrc script
Last edited by drfox on Sun Dec 11, 2005 9:22 am, edited 1 time in total.
E
Ehlanna
Voice
Posts: 15
Joined: Thu Jul 21, 2005 12:08 pm

Post by Ehlanna »

De Kus wrote:@Ehlanna: no, no :, take a look at alltools.tcl. this is not putquick/putserv/puthelp ^-^.
Thank you, that is what I wished to know! tcl I am getting ok with, the inner workings of how it all hangs together is more problematic! :)
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

De Kus wrote:@Sir_Fz: Ehlanna is not supposed to be the original poster :D
Yeah, I realized that :lol: but said oh what da hell.... :P Sorry Ehlanna, my reply was for iNFERiON.
E
Ehlanna
Voice
Posts: 15
Joined: Thu Jul 21, 2005 12:08 pm

Post by Ehlanna »

Thank you Alchera and Sir_Fz - I do not think I have found all of those links as yet, so will go have a peek. My updates to the eggdrop I have inherited seem to be ok thus far, only a couple of um .... typos dropping in here and there.
m
minted
Halfop
Posts: 64
Joined: Wed Jul 20, 2005 9:58 am

Post by minted »

seems a good idea, but the internets a worldwide thing. wont it say the wrong message 75% of the time? im in the u.k, and it would bug me if everytime i joined a channel in the morning, the bot said "good evening"
Post Reply