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. 
Discussion of Eggdrop's code and module programming in C.
			
		
				
			
				
																S 														
								Shahid  
									
						
		
						
						
		 
		
						
					
													
							
						
									
						Post 
					 
								by Shahid  Sat Feb 07, 2004 9:37 pm 
			
			
			
			
			
			Hello, I really wanted to learn how to code eggdrop modules using C/C++ language.  I just wanted to see how it work really..
Below is my TCL code I wrote, I wanted you to translate that Language in to C++ eggdrop modules if you can please (including header file if necessary,etc) 
Once you have coded that in to eggdrop module – please attachment the file.
Code: Select all 
# Channel
set channel "#Channe1"
# Trigger command
set trigger !stats
# URL of pisg stats
set url "http://www.google.com/bsd"
proc stats_trigger {nick uhost handle chan test} {
global channel url
foreach x $channel {
if {[string match -nocase $chan $x]} {
    putserv "PRIVMSG $chan :\002Stats\002: $chan stats at \00304$url\00304"
  }
 }
}
bind pub - $trigger stats_trigger
 
		 
				
		
		 
	 
				
		
				
			
				
																S 														
								Shahid  
									
						
		
						
						
		 
		
						
					
						 
													
							
						
									
						Post 
					 
								by Shahid  Sun Feb 08, 2004 4:10 pm 
			
			
			
			
			
			anyone please?
			
			
									
						
										
						 
		 
				
		
		 
	 
				
		
				
			
				
								Galadhrim 							 
						Op 			
		Posts:  123 Joined:  Fri Apr 11, 2003 8:38 amLocation:  Netherlands, Enschede 
		
						
					
						 
													
							
						
									
						Post 
					 
								by Galadhrim  Sun Mar 07, 2004 2:57 pm 
			
			
			
			
			
			You cant expect people to do the work for you. I'll have to translate it yourself  
 
		 
				
		
		 
	 
				
		
				
			
				
								Galadhrim 							 
						Op 			
		Posts:  123 Joined:  Fri Apr 11, 2003 8:38 amLocation:  Netherlands, Enschede 
		
						
					
						 
													
							
						
									
						Post 
					 
								by Galadhrim  Fri Oct 29, 2004 10:50 am 
			
			
			
			
			
			and btw modules are written in C not C++. C++ is for object oriented program which eggdrop isnt.
			
			
									
						
										
						 
		 
				
		
		 
	 
				
		
				
			
				
								makam 							 
						Voice 			
		Posts:  15 Joined:  Thu Jul 08, 2004 1:16 amLocation:  Montevideo, Uruguay
				Contact: 
				
			 
				
		 
		
						
					
						 
													
							
						
									
						Post 
					 
								by makam  Tue Aug 09, 2005 12:28 pm 
			
			
			
			
			
			Well, here u have...
Remember u can read the eggdrop core source code (and modules),
and learn from there.....
Code: Select all 
static char *stats_channel = "#Channe1";
static char *stats_url = "http://www.google.com/bsd";
static cmd_t stats_pub[] = {
 {"!stats",   	NULL, 	stats_trigger,    NULL},
 {NULL,   	NULL, 	NULL,      		 NULL}
};
static int stats_trigger(char *nick, char *host, char *hand, char *channel, char *text) {
                    
	if (!egg_strcasecmp(hannel,stats_channel)) {
		dprintf(DP_SERVER, "PRIVMSG %s :\002Stats\002: %s stats at \00304%s\00304",channel,
			channel, stats_url);
	}
	return 0;
}
 
		 
				
		
		 
	 
				
		
				
			
				
								De Kus 							 
						Revered One 			
		Posts:  1361 Joined:  Sun Dec 15, 2002 11:41 amLocation:  Germany 
		
						
					
						 
													
							
						
									
						Post 
					 
								by De Kus  Sun Aug 14, 2005 10:26 am 
			
			
			
			
			
			I have started something similar, but it isn't as easy as it might look in the first place. So my "project rewrite your tcl scripts to C modules" is currently delayed till... well.. till I get down to business again 
.
There is a module called "woobie.mod" which shows you how to init a module.
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...  
		 
				
		
		 
	 
				
		
				
			
				
								Galadhrim 							 
						Op 			
		Posts:  123 Joined:  Fri Apr 11, 2003 8:38 amLocation:  Netherlands, Enschede 
		
						
					
						 
													
							
						
									
						Post 
					 
								by Galadhrim  Wed Aug 17, 2005 4:58 am 
			
			
			
			
			
			the woobie.mod is a joke, there is a mod out called something like sheep.mod. its a bit more advanced. Ask questions here about certains things and we can help you...
			
			
									
						
										
						 
		 
				
		
		 
	 
				
		
				
			
				
								demond 							 
						Revered One 			
		Posts:  3073 Joined:  Sat Jun 12, 2004 9:58 amLocation:  San Francisco, CA
				Contact: 
				
			 
				
		 
		
						
					
						 
													
							
						
									
						Post 
					 
								by demond  Wed Aug 17, 2005 5:30 am 
			
			
			
			
			
			it is a joke yet it provides all you need to know to start programming eggdrop modules