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.

how adduser + access + level ?

Help for those learning Tcl or writing their own scripts.
Post Reply
M
MasterScript
Halfop
Posts: 41
Joined: Tue Apr 26, 2005 1:44 am

how adduser + access + level ?

Post by MasterScript »

Hi,

Can anyone give me some guide to make like this:

bind MSG - adduser msg:adduser
bind MSG - access msg:access

ADDUSER
Step 1:
IRC command:
/msg botnick adduser #channel somenick access-level

Level:
"badmin" = Botnet Administrator
"cadmin" = Channel Administrator
"ccadmin" = Channel Co Administrator
"members" = Channel Members

Step 2: after adding
somenick will ask to set there password :
"Please set your password with /msg botnick pass <your password>"

Step 3:
after somenick set there password, bots notices:
"Successfully added you into my channel partition as Botnet Administrator"
"You may do so by typing /msg botnick pass <password> now to access"


CHECK ACCESS
IRC Command:
/msg botnick access #channel somenick

Bots will notices:

Nickname: somenick
Handle : somenick
Channel : #Channel
Level : Botnet Administrator

or

Nickname: somenick
Handle : somenick
Channel : #Channel
Level : Dont have any access

or simple notices : "somenick does not have access in #channel"

Thank you very much for your help
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

First off, you'd probably like to use a different command name for adduser, as this is already in use by eggdrop (you could, of course, rename eggdrop's command - though this could lead to confusions amongst admins later on).

Next step, separate each bit of info provided by the user. split and lindex (tcl manual) is your friend here. You'll also have to get the user@host of the nickname, see the getchanhost command for this (documented in doc/tcl-commands.doc).

Once we have all the info needed, use the adduser command (doc/tcl-commands.doc) to create the new handle.

Next, use the chattr command (doc/tcl-commands.doc) to assign the handle the appropriate flags depending on their "level".

Finally, use the puthelp command (doc/tcl-commands.doc) to send the user a PRIVMSG or NOTICE that (s)he needs to set his/her password.


The access-command is pretty much the same as above, other than instead of adding a new handle or changing flags, you use the matchattr command (doc/tcl-commands.doc) to test whether the handle has this or that flag for this or that channel. If the user is visible in the channel, you could probably also use the nick2hand command (doc/tcl-commands.doc) to get one channel member's handle as identified by your eggdrop.
NML_375
M
MasterScript
Halfop
Posts: 41
Joined: Tue Apr 26, 2005 1:44 am

Post by MasterScript »

Tq.. i will check it
Post Reply