This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

help making a module

Discussion of Eggdrop's code and module programming in C.
Post Reply
r
r0t3n
Owner
Posts: 507
Joined: Tue May 31, 2005 6:56 pm
Location: UK

help making a module

Post by r0t3n »

Can someone help me make a module for eggdrop which if [getauthname $nickname] is used, the bot will /who $nick n%a and return 0 if $nickname is not online, return 1 if user is online but not authed, otherwise return $nickname's authname. I would start coding this myself, but have no idea about where to start with eggdrop programming. Im starting to learn C code.

Thanks in advance if possible!!
Chris :)
r0t3n @ #r0t3n @ Quakenet
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

you should have asked this after learning C

anyway, here's a tip:

use dprintf(DP_SERVER, ...); to output to the server and add_builtins(H_raw, ...); to bind your handlers (functions that handle server's numeric response for auth'ed nick)
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use

Code: Select all

 tag when posting logs, code
r
r0t3n
Owner
Posts: 507
Joined: Tue May 31, 2005 6:56 pm
Location: UK

Post by r0t3n »

Ok. I think i know what dprintf(DP_SERVER, ...); does but im not 100% sure about add_builtins(H_raw, ...);

Is it even possible to call [authname $nickname] within tcl and for this module to be able to return 0 for not found, 1 for not authed or return authname if authed.

I have no idea how to catch the raw 354 within the proc authname in C code.

Im a total newb at eggdrop C module coding...
I dont even know how to return the 0, 1 or authname in C code.

I hope you could give me some pointers on how to do this, im not asking anyone to code this for me, as im willing to learn how to build this myself, but at the rate im going i might be dead before i finish it. Any help is much appreciated.

Thanks in advance!
Chris :)
r0t3n @ #r0t3n @ Quakenet
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

other than recommending you to buy a C book, learn C programming, practice C programming, study eggdrop core source, study existing eggdrop modules, and ultimately, write your own (in that order!), I can't help you much
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use

Code: Select all

 tag when posting logs, code
r
r0t3n
Owner
Posts: 507
Joined: Tue May 31, 2005 6:56 pm
Location: UK

Post by r0t3n »

Ok, at this moment from looking at another post, i have got:

Code: Select all

static int authname(char *nickname) { 
dprintf(DP_SERVER, "WHO %s n%a", nickname);
....
}
thats as far as i have got, but i dont know how to catch the raw 354 within that code and then check to see if it returned if the person is not online, not authed or authed. I guess i will need to catch 2 raws, one for end of /who list, and the other which returns the 0 or the authname.

All help is appreciated!
Thanks!
Chris :)
r0t3n @ #r0t3n @ Quakenet
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

I wonder what's your rationale of asking questions here when you won't hear the answers

you are trying to program in C without really knowing C; that's like trying to solve calculus problem with no elementary math background whatsoever, which is simply ridiculous

get a clue already, do what you were told to, you won't be sorry
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use

Code: Select all

 tag when posting logs, code
User avatar
avilon
Halfop
Posts: 64
Joined: Tue Jul 13, 2004 6:58 am
Location: Germany

Post by avilon »

r
r0t3n
Owner
Posts: 507
Joined: Tue May 31, 2005 6:56 pm
Location: UK

Post by r0t3n »

avilon i have already tried that, but for some reason after i type /msg <botnick> hello the bot does not reply, i can't telnet or dcc the bot, and when i go to the shell promt and kill the bot, the bot stays on irc untill it pings out. Thats why im trying to make my own eggdrop module.
r0t3n @ #r0t3n @ Quakenet
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

Tosser^^ wrote:... but for some reason after i type /msg <botnick> hello the bot does not reply
Perchance you have not uncommented the following (in your bot conf)?
#unbind msg - hello *msg:hello
#bind msg - myword *msg:hello
As for the other (DCC Chat &c) it might be a good idea to compare your settings against the recommended ones.

PS: Until you do a course in the C programming language you're not going to have too much success in making your "own eggdrop module".
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
r
r0t3n
Owner
Posts: 507
Joined: Tue May 31, 2005 6:56 pm
Location: UK

Post by r0t3n »

The bot replys to the /msg botnick hello as it should. Then when i type /msg botnick pass <password_here> the bot does not reply. Usually the bot replys password set to: <password> but i get no reply. Also i get a timeout with dcc and ctcp chat, and when i telnet to the bot, if does not reply. It does no timeout or say port not found on the shell server. I have 5 other bots on the shell which work fine, but after i used the patch by thommey and compiled and loaded the bot, i started getting these errors. I will check the logfile later and post it here. But the last time i looked, it didnt show any errors.
r0t3n @ #r0t3n @ Quakenet
b
bluescreen
Voice
Posts: 1
Joined: Sat Jan 07, 2006 3:36 pm
Location: Sweden

Post by bluescreen »

I have been using Thommeys patch on a botnet with 7 bots on Quakenet for over a year without problems.

Make sure your bot is authed with Q (q.tcl or some other script works well for this)
Make sure you are authed with Q
Make sure you are running Thommeys qauth.tcl (or the lite version)
Just telnet to your bot and add yourself with your Q-auth as your handle, no need for hostmask, it's optional with this patch.
The qauth.tcl checks the channel once/minute for qauth's, so it might take up to a minute for the bot to recognize you.

//Blue.
Post Reply