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 

Greet script
Goto page 1, 2  Next
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
iNFERiON
Voice


Joined: 13 Nov 2004
Posts: 7

PostPosted: Wed Dec 07, 2005 7:32 pm    Post subject: Greet script Reply with quote

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 Wink

Code:
#############################
##                         ##
## 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 Smile
Back to top
View user's profile Send private message
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Wed Dec 07, 2005 8:02 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website
iNFERiON
Voice


Joined: 13 Nov 2004
Posts: 7

PostPosted: Thu Dec 08, 2005 3:29 pm    Post subject: Reply with quote

Alchera wrote:
You will test your script and debug!
Why ? You having problems with it ?
Back to top
View user's profile Send private message
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Thu Dec 08, 2005 7:57 pm    Post subject: Reply with quote

One does not post untested scripts for general release. Simple!
_________________
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Back to top
View user's profile Send private message Visit poster's website
Ehlanna
Voice


Joined: 21 Jul 2005
Posts: 15

PostPosted: Sat Dec 10, 2005 5:46 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sat Dec 10, 2005 12:24 pm    Post subject: Reply with quote

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.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts


Last edited by Sir_Fz on Sun Dec 11, 2005 12:45 pm; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
Ehlanna
Voice


Joined: 21 Jul 2005
Posts: 15

PostPosted: Sat Dec 10, 2005 1:03 pm    Post subject: Reply with quote

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! Wink
Back to top
View user's profile Send private message
iNFERiON
Voice


Joined: 13 Nov 2004
Posts: 7

PostPosted: Sat Dec 10, 2005 7:28 pm    Post subject: Reply with quote

Well, script is now tested and works just fine as expected, hope everybody is happy now Rolling Eyes
Back to top
View user's profile Send private message
De Kus
Revered One


Joined: 15 Dec 2002
Posts: 1361
Location: Germany

PostPosted: Sun Dec 11, 2005 1:25 am    Post subject: Reply with quote

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 Very Happy

@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...
Back to top
View user's profile Send private message MSN Messenger
drfox
Voice


Joined: 09 Oct 2005
Posts: 26

PostPosted: Sun Dec 11, 2005 3:36 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Ehlanna
Voice


Joined: 21 Jul 2005
Posts: 15

PostPosted: Sun Dec 11, 2005 8:41 am    Post subject: Reply with quote

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! Smile
Back to top
View user's profile Send private message
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Sun Dec 11, 2005 9:24 am    Post subject: Reply with quote

Guide to TCL scripting for Eggdrop 1.6
man/tcl8.4/TclCmd/
A beginners guide to TCL with focus on Eggdrop
Eggdrop Tcl Commands
How to write eggdrop scripts that won't choke on special characters

Might help you Ehlanna Smile
_________________
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Back to top
View user's profile Send private message Visit poster's website
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sun Dec 11, 2005 12:43 pm    Post subject: Reply with quote

De Kus wrote:
@Sir_Fz: Ehlanna is not supposed to be the original poster Very Happy

Yeah, I realized that Laughing but said oh what da hell.... Razz Sorry Ehlanna, my reply was for iNFERiON.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
Ehlanna
Voice


Joined: 21 Jul 2005
Posts: 15

PostPosted: Sun Dec 11, 2005 4:08 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
minted
Halfop


Joined: 20 Jul 2005
Posts: 64

PostPosted: Sun Dec 11, 2005 5:33 pm    Post subject: Reply with quote

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"
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 Support & Releases All times are GMT - 4 Hours
Goto page 1, 2  Next
Page 1 of 2

 
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