botlending forum  

Go Back   botlending forum > Eggdrop & TCL > a&a light script

a&a light script a&a light script support, suggestions & discussions

Reply
 
LinkBack Thread Tools Display Modes
Old 28-02-2007, 23:05   #1 (permalink)
Member
 
Join Date: Jun 2004
Location: Canada
Age: 18
Posts: 141
Rep Power: 0
AdrianK is on a distinguished road
Default Greet

Am observat ca sunt probleme cu multigreet, adauga {} in greet si altele...
Poftim un greet fara aceasta problema.
Code:
####################################################################
# Author: StarteR2                                                 #
# Email: starter2@sympatico.ca                                     #
# Description: Greet, on join, user will receive channel's greet.  #
# Version: Alpha Testing                                           #
#                                                                  #
# Known Problems:                   		  		   #
#                             				           #
#     - If you already have a greet and you ask the bot to add     #
#       another greet, he will, and on join the user will get 2    #
#       greets. This should be fixed                               #
#                									 #
#     - If you ask the bot to remove the greet he will, even if    #
#       there is no greets he will still say that he removed greet #
#       This must be fixed  							 
# 										       
#     - Verify doesnt work. Still don't know why.			 
#											 
# Usage:										 	
#       !greet -add <greet>							 
#       !greet -remove								 
#       !greet -verify (doesn't work)					 
#											 	
# Install:										 
#											 	
#       1) Creat an empty file name greet.db in the eggdrops main  
#       dir.									 	
#       Default: ~/eggdrop							 
#   											 		
#       2) Load the script. (i.e. source greet.tcl)                      
####################################################################

a:command -add greet    pub:greet   1099 593 N
proc pub:greet {hand chan args x mix} {
global settings
	set file "greet.db"
	set aqwzsx       [lindex $args 0]   ;#option
      set greet      [join [lrange $args 1 end]]   ;#reason

if {$aqwzsx == ""} {
                   putquick "privmsg $chan :Usage:\0032 !greet -add <greet> \0034To add a greet to your channel"
                   putquick "privmsg $chan :Usage:\0032 !greet -remove\0034 To remove the greet from the channel"
				return
}
		        
	switch  -- $aqwzsx {         
		
             -add {
			set fd [open $file a+]
			puts $fd "$chan $greet\n"
			close $fd
			puthelp "PRIVMSG $chan :\002GREET\002 Added greeting \0032$greet\0031 to channel \0034$chan"
		}           
		-remove {
			set fd [open $file r]
			set reads [read $fd]
			close $fd
			set data ""
			
			if {[llength $reads]} {
				set fd [open $file w]
			        foreach line [split $reads \n] {
					if {![string match -nocase "$chan*" $line]} {
						if {[llength $line]} {puts $fd "$line\n"}
					}
				puthelp "PRIVMSG $chan :\002GREET\002 Removed greet from channel \0032$chan"
				}
				close $fd
				}
               -verify {
                         set fd [open $file r]
				 set cont [read $fd]
			       close $fd
			       foreach abuse [split $cont \n] {if {[string match -nocase "$chan*" $abuse]} {
                  	set a1       [lindex $abuse 0]   		;#chan
                        set b2       [join [lrange $abuse 1 end]]	;#greet
				putquick "PRIVMSG $chan :Greet for channel \0034$chan\0031 is \0032$b2"}
					}
                       }
			}
		
}


bind join -|- * greetnote
proc greetnote {nick uhost hand chan} {
set file "greet.db"
			set fd [open $file r]
			set cont [read $fd]
			close $fd
			foreach abuse [split $cont \n] {if {[string match -nocase "$chan*" $abuse]} {
                  	set a1       [lindex $abuse 0]   		;#chan
                        set b2       [join [lrange $abuse 1 end]]	;#greet
				putquick "NOTICE $nick :$b2"}
			}
                  return
		}
}

putlog "Alpha Greet Loaded"
AdrianK is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Correct script] Eroare Botnet [Welcome,Leave,Greet] SoLLo Tcl scripting 1 24-05-2007 19:07
[Correct script] HELP - greet :) vR|Ar Tcl scripting 5 07-04-2007 16:11
Exista greet la join? BizZu #a&a 3 27-09-2005 18:29
Need help with greet arcade Tcl scripting 21 09-09-2005 17:01


All times are GMT +3. The time now is 16:56.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.