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 

Adding Users - Host Mask - Flags

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
diMension
Voice


Joined: 23 Mar 2007
Posts: 11

PostPosted: Fri Mar 23, 2007 11:04 pm    Post subject: Adding Users - Host Mask - Flags Reply with quote

Hello, my name is "diMension". First off, let me tell you that the eggdrop is a sweet bot and nothing else is better Wink. 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. Smile

Code:

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

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 Smile

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 Smile
Code:

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


Back to top
View user's profile Send private message
Callisto
Halfop


Joined: 13 Mar 2005
Posts: 86

PostPosted: Sat Mar 24, 2007 3:15 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
iamdeath
Master


Joined: 11 Feb 2005
Posts: 323
Location: *HeLL*

PostPosted: Sat Mar 24, 2007 7:37 am    Post subject: Reply with quote

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

Original:

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


To:

Code:
set newop [lindex $a 0]
set newhosts [getchanhost $newop $c]
set newhost "*!*@[lindex [split $newhost @] 1]"
Back to top
View user's profile Send private message Visit poster's website
diMension
Voice


Joined: 23 Mar 2007
Posts: 11

PostPosted: Sat Mar 24, 2007 2:04 pm    Post subject: Reply with quote

Thanks guys Very Happy Very Happy

Code:

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
Back to top
View user's profile Send private message
diMension
Voice


Joined: 23 Mar 2007
Posts: 11

PostPosted: Sat Mar 24, 2007 5:37 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
iamdeath
Master


Joined: 11 Feb 2005
Posts: 323
Location: *HeLL*

PostPosted: Sat Mar 24, 2007 7:52 pm    Post subject: Reply with quote

use this:

Code:
set newop [lindex $a 0]
set newhosts [getchanhost $newop $c]
set newhost "*!*@[lindex [split $newhosts @] 1]"
Back to top
View user's profile Send private message Visit poster's website
diMension
Voice


Joined: 23 Mar 2007
Posts: 11

PostPosted: Sat Mar 24, 2007 8:05 pm    Post subject: Reply with quote

yea thanks Smile i got it Very Happy

<3 to da max
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sat Mar 24, 2007 9:49 pm    Post subject: Reply with quote

You shouldn't use list commands on strings, [split] $a before applying [lindex] on it.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
Callisto
Halfop


Joined: 13 Mar 2005
Posts: 86

PostPosted: Sun Mar 25, 2007 4:02 am    Post subject: Reply with quote

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?
Quote:
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
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help 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