| View previous topic :: View next topic |
| Author |
Message |
Shahid Guest
|
Posted: Sat Feb 07, 2004 9:37 pm Post subject: Translate TCL to C++ Please!! |
|
|
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: |
# 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
|
|
|
| Back to top |
|
 |
Shahid Guest
|
Posted: Sun Feb 08, 2004 4:10 pm Post subject: |
|
|
| anyone please? |
|
| Back to top |
|
 |
Galadhrim Op
Joined: 11 Apr 2003 Posts: 123 Location: Netherlands, Enschede
|
Posted: Sun Mar 07, 2004 2:57 pm Post subject: |
|
|
You cant expect people to do the work for you. I'll have to translate it yourself  |
|
| Back to top |
|
 |
Galadhrim Op
Joined: 11 Apr 2003 Posts: 123 Location: Netherlands, Enschede
|
Posted: Fri Oct 29, 2004 10:50 am Post subject: |
|
|
| and btw modules are written in C not C++. C++ is for object oriented program which eggdrop isnt. |
|
| Back to top |
|
 |
makam Voice
Joined: 08 Jul 2004 Posts: 15 Location: Montevideo, Uruguay
|
Posted: Tue Aug 09, 2005 12:28 pm Post subject: |
|
|
Well, here u have...
Remember u can read the eggdrop core source code (and modules),
and learn from there.....
| Code: |
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;
}
|
_________________ --
Web: http://www.makam.org/
Chans: #Uruguay,#Hattricklatino@UnderNet |
|
| Back to top |
|
 |
De Kus Revered One

Joined: 15 Dec 2002 Posts: 1361 Location: Germany
|
Posted: Sun Aug 14, 2005 10:26 am Post subject: |
|
|
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... |
|
| Back to top |
|
 |
Galadhrim Op
Joined: 11 Apr 2003 Posts: 123 Location: Netherlands, Enschede
|
Posted: Wed Aug 17, 2005 4:58 am Post subject: |
|
|
| 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... |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Wed Aug 17, 2005 5:30 am Post subject: |
|
|
| it is a joke yet it provides all you need to know to start programming eggdrop modules |
|
| Back to top |
|
 |
|