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.

Two scripts brought together - .chattr + .adduser

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
P
Puck
Voice
Posts: 10
Joined: Sat Mar 08, 2008 8:05 am
Location: Budapest, Hungary
Contact:

Two scripts brought together - .chattr + .adduser

Post by Puck »

Hi everyone.

Once again i need help from you guys too make a simple command out of two, that is, if i type .chattr nickname +flags the eggdrop adds the user to the userlist with the host *!*@vhost.domain.com and adds too him the +flags too the channel userlist. After these two commands are performed the eggdrop messages the nickname that has gained access that he has been succesfully added.

Here are the two scripts that i found, i hope it helps somehow, it`s from botcontrol3.2.tcl by Prince_of_the_net, so these codes arent mine at all.

Adduser:

Code: Select all

proc bctrl:add_user {nick uhost hand chan text} {
    global logo botnick
    set person [lindex [split $text] 0]
    if {$person == ""} {
	puthelp "NOTICE $nick :You did not tell me the nick to be added :-(. The correct syntax is !adduser <nick_to_be_added>  $logo"
	return 0
    }
    set per_ip [getchanhost $person]
    set per_host [maskhost $person!$per_ip]
    set host [lindex [split $text] 1]
    if {$host == ""} {
	set host $per_host 
    }
    set kadd [adduser $person $host]
    if {$kadd == 1} {
 	putserv "NOTICE $nick :Successfully added $person with host $host  $logo"
 	putserv "NOTICE $person :You were added to my user list by $nick with host $host.Please set up your password with /msg $botnick pass <ur_chosen_password>  $logo"
    } {
 	putserv "NOTICE $nick :Error, could not add user $person, he already exists!!  $logo"
    }
}
Chattr:

Code: Select all

proc bctrl:chatt_r {nick uhost hand chan text} {
    global logo
    set person [nick2hand [lindex [split $text] 0]]
    if {$person == ""} {
	puthelp "NOTICE $nick :You did not tell me the nick for whom the user flags are to be changed :-(. The correct syntax is !chattr <nick_to_be_modified> <flags> \[channel\]"
	puthelp "NOTICE $nick :The channel is optional.  $logo"
	return 0
    }
    set change [lindex [split $text] 1]
    set channel [lindex [split $text] 2]
    if {$channel == ""} {
	set chattz [chattr $person $change]
	putserv "NOTICE $nick :The global flags for $person are now: $chattz"
	putlog "Changing global"
	putserv "NOTICE $person :Your global flags are now: $chattz"
    } {
	set chattz [chattr $person |$change $channel]
	putserv "NOTICE $nick :The global flags, and channel flags in the format of global|channel for $person are now: $chattz  $logo"
    }
}
If you need the whole code it`s Here

P.S.: I removed the "$logo" from everywhere since it gives an error that the $logo variable is not found.
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

Have you tried to contact the author on DALnet or EFnet (as per details in the header)?
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Post Reply