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 

Translate TCL to C++ Please!!

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Modules & Programming
View previous topic :: View next topic  
Author Message
Shahid
Guest





PostPosted: Sat Feb 07, 2004 9:37 pm    Post subject: Translate TCL to C++ Please!! Reply with quote

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) Smile

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





PostPosted: Sun Feb 08, 2004 4:10 pm    Post subject: Reply with quote

anyone please?
Back to top
Galadhrim
Op


Joined: 11 Apr 2003
Posts: 123
Location: Netherlands, Enschede

PostPosted: Sun Mar 07, 2004 2:57 pm    Post subject: Reply with quote

You cant expect people to do the work for you. I'll have to translate it yourself Confused
Back to top
View user's profile Send private message
Galadhrim
Op


Joined: 11 Apr 2003
Posts: 123
Location: Netherlands, Enschede

PostPosted: Fri Oct 29, 2004 10:50 am    Post subject: Reply with quote

and btw modules are written in C not C++. C++ is for object oriented program which eggdrop isnt.
Back to top
View user's profile Send private message
makam
Voice


Joined: 08 Jul 2004
Posts: 15
Location: Montevideo, Uruguay

PostPosted: Tue Aug 09, 2005 12:28 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
De Kus
Revered One


Joined: 15 Dec 2002
Posts: 1361
Location: Germany

PostPosted: Sun Aug 14, 2005 10:26 am    Post subject: Reply with quote

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

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
View user's profile Send private message MSN Messenger
Galadhrim
Op


Joined: 11 Apr 2003
Posts: 123
Location: Netherlands, Enschede

PostPosted: Wed Aug 17, 2005 4:58 am    Post subject: Reply with quote

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
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Wed Aug 17, 2005 5:30 am    Post subject: Reply with quote

it is a joke yet it provides all you need to know to start programming eggdrop modules
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Modules & Programming All times are GMT - 4 Hours
Page 1 of 1

 
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