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.

Adding Users - Host Mask - Flags

Help for those learning Tcl or writing their own scripts.
Post Reply
d
diMension
Voice
Posts: 11
Joined: Fri Mar 23, 2007 10:52 pm

Adding Users - Host Mask - Flags

Post by diMension »

Hello, my name is "diMension". First off, let me tell you that the eggdrop is a sweet bot and nothing else is better ;). Lets get down to business.

1) Adding Users - Limit on how long name can be.
2) Host Mask - For bans.
3) The flag +a - Auto-Opping.


1 - My first question is, how do i get the eggdrop to accept a longer "HANDLE"
i have a tcl script that binds
~addowner to adding the +n flag in the given channel. I don't feel like posting code, but i can sum it up.

***************EDIT - after reading some other tcl helps, i'm going to paste all of the code. :)

Code: Select all

bind pub n ~addowner add_owner_chan

proc add_owner_chan {n u h c a} {
  global botnick
  if {[lindex $a 0] == ""} {
	putquick "NOTICE $n : ~addowner <nick>"
      return 0
  } 

  set newop [lindex $a 0]
  set newhost [maskhost [getchanhost $newop $c]]
if {[finduser $newhost] != "*"} { 
	putserv "NOTICE $n :$newop\[$newhost\] is known as user [finduser $newhost]"
 	return 1
  }
 
  adduser $newop $newhost
  chattr $newop +n $c

  putserv "NOTICE $n :$newop\[$newhost\] has been added in $c as owner"
  putserv "NOTICE $newop :$n has added you in $c as owner"
  save
}

I also use this code to addpeon/addops (auto) - Because i run a club or 3 and i want them to get auto-peon'd or auto-op'd without actually having "ACCESS" to the bot, and i can't addpeon them publicly if there name is too big.

Now, this code WORKS. I have TESTED It, it works fine. But the issue i am having is, if then nick of the person is "iloveggysWOO" Well, the eggdrop will add "iloveegg" to the "handle" part, and when i do "chattr $newop" it is "chattr $iloveeggyswOO" instead of "iloveegg".

Any way i can get the eggy to accept larger "handles" in its user database? Thanks. :)

2 - The hostmask that "comes with the bot" is *!ident@host.com - I am on a network that allows +x - So obviously, this hostmask is easily ban evadable. I need a hostmask that is *!*@host.com - How can i do this? - It will be easier and more secure when i add users to the bot using the pub command :)

3 - The +a flag doesn't work for some reason, i had to bind a join event
And YES , i had +autoop set in the channel :)

Code: Select all

bind join a|a * op_chan
proc op_chan {nick uhost hand chan} {
  if {[matchattr $hand -]} {putserv "MODE $chan +o $nick"}
  return 1
}


C
Callisto
Halfop
Posts: 86
Joined: Sun Mar 13, 2005 11:04 am

Post by Callisto »

you need to edit the eggdrop.h file (usually eggdropx.x.xx/src/eggdrop.h)

Line 63 - change to read
#define HANDLEN 32 /* valid values 9->NICKMAX */

Then recompile the bot and restart

as for your other questions, sorry a bit beyond my abilities
User avatar
iamdeath
Master
Posts: 323
Joined: Fri Feb 11, 2005 2:32 pm
Location: *HeLL*
Contact:

Post by iamdeath »

To change host to *!*@host.here modify these lines:

Original:

Code: Select all

set newop [lindex $a 0] 
set newhost [maskhost [getchanhost $newop $c]]
To:

Code: Select all

set newop [lindex $a 0]
set newhosts [getchanhost $newop $c]
set newhost "*!*@[lindex [split $newhost @] 1]"
d
diMension
Voice
Posts: 11
Joined: Fri Mar 23, 2007 10:52 pm

Post by diMension »

Thanks guys :D :D

Code: Select all

set newop [lindex $a 0]
set newhosts [getchanhost $newop $c]
set newhost "*!*@[lindex [split $newhost @] 1]"
set newhost "*!*@[lindex [split $newhost @] 1]"

shouldnt the $newhost be $newhosts
Last edited by diMension on Sat Mar 24, 2007 5:56 pm, edited 1 time in total.
d
diMension
Voice
Posts: 11
Joined: Fri Mar 23, 2007 10:52 pm

Post by diMension »

Callisto wrote:you need to edit the eggdrop.h file (usually eggdropx.x.xx/src/eggdrop.h)

Line 63 - change to read
#define HANDLEN 32 /* valid values 9->NICKMAX */

Then recompile the bot and restart

as for your other questions, sorry a bit beyond my abilities
i dont have that file...

im using a windrop if that helps
User avatar
iamdeath
Master
Posts: 323
Joined: Fri Feb 11, 2005 2:32 pm
Location: *HeLL*
Contact:

Post by iamdeath »

use this:

Code: Select all

set newop [lindex $a 0] 
set newhosts [getchanhost $newop $c] 
set newhost "*!*@[lindex [split $newhosts @] 1]"
d
diMension
Voice
Posts: 11
Joined: Fri Mar 23, 2007 10:52 pm

Post by diMension »

yea thanks :) i got it :D

<3 to da max
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

You shouldn't use list commands on strings, [split] $a before applying [lindex] on it.
C
Callisto
Halfop
Posts: 86
Joined: Sun Mar 13, 2005 11:04 am

Post by Callisto »

diMension wrote:
Callisto wrote:you need to edit the eggdrop.h file (usually eggdropx.x.xx/src/eggdrop.h)

Line 63 - change to read
#define HANDLEN 32 /* valid values 9->NICKMAX */

Then recompile the bot and restart

as for your other questions, sorry a bit beyond my abilities
i dont have that file...

im using a windrop if that helps
Isnt there a windrop just for extended handle length?
Eggdrop v1.6.18 Handlen32 (12.08.2006)
For networks which allow nicknames long than 9 characters in length (e.g. DALnet, QuakeNet)
http://windrop.sourceforge.net/downloads.html

there we go google is our friend
Post Reply