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.

TCL commands imported.

Old posts that have not been replied to for several years.
Locked
U
UmbraSG
Voice
Posts: 22
Joined: Sun Oct 20, 2002 3:21 am
Location: USA
Contact:

TCL commands imported.

Post by UmbraSG »

Can I get tcl commands imported into my module, like isop, isbotop, etc, etc., etc.?

TIA

*edited*
Nevermind, I have seemed to find the answer to the above question, but I have another if you all don't mind. I"m currently working on an fserver voicing module, but I can't seem to get it to processes what I'm looking for. I'll post the code below. Forgive me, it's been a while since I have programmed in depth in C (~3yrs).

*NOTE* 'char sv_channel[31]' is set by a tcl script.

UmbraSG
Last edited by UmbraSG on Sun Oct 26, 2003 4:35 pm, edited 1 time in total.
User avatar
BarkerJr
Op
Posts: 104
Joined: Sun Mar 30, 2003 1:25 am
Contact:

Re: TCL commands imported.

Post by BarkerJr »

UmbraSG wrote: Context;
Don't use Context anymore. It just wastes CPU and doesn't give any useful output.
UmbraSG wrote: dprintf(DP_SERVER, "PRIVMSG %s : !list\n", sv_channel);
I don't think you want the space after the colon. I don't think any file servers respond to !list if it's prefixed with a space.
UmbraSG wrote:static void notc_hook(char* nick, char* uhost, char* hand, char* msg)
Are you sure that's the right arguments? tcl-commands.doc shows: <nick> <user@host> <handle> <text> <dest>

Of course, if it works...
U
UmbraSG
Voice
Posts: 22
Joined: Sun Oct 20, 2002 3:21 am
Location: USA
Contact:

Post by UmbraSG »

hehe, yah I found out that space wasn't good, as well as the args for 'notc_hook' Learning C all over again, well, the more advanced parts of C like queues and linked lists. :-?

Currently, I need to implement a timer so I can track bans, since this too will be added to the module or another one.

Thanks for your comment. Any other suggestions/comments are welcome!
User avatar
BarkerJr
Op
Posts: 104
Joined: Sun Mar 30, 2003 1:25 am
Contact:

Post by BarkerJr »

There's some interesting hooks for timers.

You can make a function get called every second. Add the hook where you bind stuff and delete it where you unbind.

Code: Select all

add_hook(HOOK_SECONDLY, (Function)megahal_hook_secondly);

static void megahal_hook_secondly(void){
whatever
}

del_hook(HOOK_SECONDLY, (Function)megahal_hook_secondly);
Of course, if you only want it to happen every 5 seconds, you could do something easy like.

Code: Select all

static void mymod_hook_secondly(void)
{
  static unsigned char ctr;
  if (ctr >= 5) ctr=0;
  else
  {
    ctr++;
    return;
  }
whatever
}

HOOK_SECONDLY - called every second
HOOK_MINUTELY - called every minute
HOOK_5MINUTELY - called every 5 minutes
HOOK_HOURLY - called every hour (hourly-updates minutes past)
HOOK_DAILY - called when the logfiles are switched

See doc/MODULES.
U
UmbraSG
Voice
Posts: 22
Joined: Sun Oct 20, 2002 3:21 am
Location: USA
Contact:

Post by UmbraSG »

Thanks! I got the timers to work perfectly. Still learning my way around the eggy's code.
U
UmbraSG
Voice
Posts: 22
Joined: Sun Oct 20, 2002 3:21 am
Location: USA
Contact:

*frustrated, anuerisming, and postal*

Post by UmbraSG »

Well, I can't seem to get my module to check if the user is on the channel is op/voice. When I've tested it with putlog() function, it doesn't post any of the comments. Super, ultramega, uber frustrating!!!! Am I missing something?????

I've stolen this lil'snippet from the banpub module:

Code: Select all

static int isov (char *nick, char *channel) {
  memberlist *m;
  char s[UHOSTLEN];
  struct chanset_t *chan = findchan(channel);
  struct flag_record fr = { FR_GLOBAL | FR_CHAN, 0, 0, 0, 0, 0 };

  if (match_my_nick (nick)) return 0;
  if ((m = ismember(chan, nick)) && ((chan_hasop(m)) || (chan_hasvoice(m))))
    return 1;
  return 0;
}
Of course, I modified it a little (removed !kbop & !kbvoice int vars). However, it's still unresponsive.

Basically, I'm trying to make an fserver voice module for a channel that I'm on, however, I've been very unsuccessful. I don't like TCL, or any scrpts for that matter, but it seems that's all I'm left with since those work near perfectly.

Umbra
Locked