This is the new home of the egghelp.org community forum. this announcement post . Click the X in the top right-corner of this box to dismiss this message. 
Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
			
		
				
			
				
								tuShai 							 
						Voice 			
		Posts:  9 Joined:  Fri Feb 18, 2005 5:02 am 
		
						
					
													
							
						
									
						Post 
					 
								by tuShai  Wed Aug 27, 2008 7:04 am 
			
			
			
			
			
			Hi.
I have a little Script here that needs a Spamtrigger but i am not shure where to insert it. Hopefully you can help me with this.
Well, first the Script
Code: Select all 
namespace eval rules {
   namespace eval variable {
      variable trigger ".rules"
      variable channel "#channel"
      variable filename "scripts/rules.txt"
      variable method "privmsg"
   }
   bind PUBM - "$::rules::variable::channel $::rules::variable::trigger*" [namespace current]::public
   proc public {nickname hostname handle channel arg} {
      set file [open $::rules::variable::filename r]
      while {![eof $file]} {
         switch $::rules::variable::method {
            privmsg {
               putmsg $nickname [gets $file]
            }
            notice {
               putnotc $nickname [gets $file]   
            }
         }
      }
      close $file
   }
}
and here is an example of an Spamcheck Trigger i would like to use
Maybe you have a better one...
Code: Select all 
set inuse 0
proc pub:info {nick host hand chan arg} {
    global inuse
    if { $inuse == 1 } {
    putquick "PRIVMSG $nick :Pls wait 20 Secs. Function is in use"
    return 
Thanks to all for helping me
 
		 
				
		
		 
	 
				
		
				
			
				
								r0t3n 							 
						Owner 			
		Posts:  507 Joined:  Tue May 31, 2005 6:56 pmLocation:  UK 
		
						
					
						 
													
							
						
									
						Post 
					 
								by r0t3n  Wed Aug 27, 2008 8:50 am 
			
			
			
			
			
			Code: Select all 
namespace eval rules {
	namespace eval variable {
		variable trigger ".rules"
		variable channel "#channel"
		variable filename "scripts/rules.txt"
		variable method "privmsg"
		variable use "0"
		
		if {![info exists timer]} { 
		    variable timer "" 
		} elseif {$timer != ""} { 
		    catch {killutimer $timer}
			variable timer ""
		}
		
		variable timeout "20"; # in seconds
		
	}
	bind PUBM - "$::rules::variable::channel $::rules::variable::trigger*" [namespace current]::public
	proc public {nickname hostname handle channel arg} {
		if {$rules::variable::use} {
			putserv "$rules::variable::method $nickname :Function in use, please try again in around 20 seconds."
		} else {
			set rules::variable::use "1"
			set rules::variable::timer [utimer $rules::variable::timeout [list set rules::variable::use "0"]]
			set file [open $rules::variable::filename r]
			set data [read -nonewline $file]
			close $file
			if {[llength $data] < 1} {
				putserv "$rules::variable::method $nickname :There are no rules..."
			} else {
				foreach line [split $data \n] {
					if {$line == ""} { continue }
					putserv "$rules::variable::method $nickname :$line"
				}
			}
		}
	}
	
}
Untested
r0t3n @ #r0t3n @ Quakenet
			
						 
		 
				
		
		 
	 
				
		
				
			
				
								Fraud 							 
						Op 			
		Posts:  101 Joined:  Mon May 19, 2008 7:57 am 
		
						
					
						 
													
							
						
									
						Post 
					 
								by Fraud  Thu Aug 28, 2008 7:24 am 
			
			
			
			
			
			Works good for me.
			
			
									
						
										
						 
		 
				
		
		 
	 
				
		
				
			
				
								r0t3n 							 
						Owner 			
		Posts:  507 Joined:  Tue May 31, 2005 6:56 pmLocation:  UK 
		
						
					
						 
													
							
						
									
						Post 
					 
								by r0t3n  Thu Aug 28, 2008 10:27 am 
			
			
			
			
			
			
			
			
									
						
							r0t3n @ #r0t3n @ Quakenet
			
						 
		 
				
		
		 
	 
				
		
				
			
				
								Fraud 							 
						Op 			
		Posts:  101 Joined:  Mon May 19, 2008 7:57 am 
		
						
					
						 
													
							
						
									
						Post 
					 
								by Fraud  Thu Aug 28, 2008 5:51 pm 
			
			
			
			
			
			Thanks
			
			
									
						
										
						 
		 
				
		
		 
	 
				
		
				
			
				
								tuShai 							 
						Voice 			
		Posts:  9 Joined:  Fri Feb 18, 2005 5:02 am 
		
						
					
						 
													
							
						
									
						Post 
					 
								by tuShai  Sat Aug 30, 2008 7:49 am 
			
			
			
			
			
			Japp all can write too