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.

custom hello/pass routine

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
s
simo
Revered One
Posts: 1107
Joined: Sun Mar 22, 2015 2:41 pm

custom hello/pass routine

Post by simo »

hey there,

ive modify a small tcl i found somewhere to have it function as a custom hello/ pass routine without the built in one wich takes the current used nick as user while we want to customize that to fill in our own

this is what i have so far:

Code: Select all

bind msg - helloo hello:routine

proc hello:routine {nick host hand  text} {
	global botnick
	set user1 [lindex [split $text] 0]
   set password [lindex [split $text] 1]
   adduser $user1 [maskhost $host 2]
	chattr $user1 +jlmnoptx
	putserv "NOTICE $nick :Hi $nick  I'm $botnick, an eggdrop bot."
	putserv "NOTICE $nick :I'll recognize you by hostmask '[maskhost $host 2]' with password $password from now on  ."
	putserv "NOTICE $nick :YOU ARE THE OWNER ON THIS BOT NOW"
	putserv "NOTICE $nick :All major commands are used from DCC chat. From now on, you don't need to use the -m option when starting the bot.  Enjoy !!!"
	return 0
}


 
what im missing is the password setting
User avatar
CrazyCat
Revered One
Posts: 1306
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

Something like:

Code: Select all

setuser $user1 PASS $password
Put that after the adduser line

And you can just do a chattr $user1 +n, other flags are included in it.
s
simo
Revered One
Posts: 1107
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

Thanks Crazycat
s
simo
Revered One
Posts: 1107
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

could this be used only once and then disabled like the built in regular hello ?
User avatar
CrazyCat
Revered One
Posts: 1306
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

simo wrote:could this be used only once and then disabled like the built in regular hello ?
The only way to do that is to activate the bind only if the userlist is empty, so something like:

Code: Select all

if {[countusers]==0} {
   bind msg - helloo hello:routine
}
And indeed, unbind at the end of the hello:routine.

But I don't really understand why you're trying to create this script as the /msg hello function works well. If you do that only to not have 2 commands to register to your eggdrop, I think it's a waste of time
s
simo
Revered One
Posts: 1107
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

Thanks crazycat, its to decide what user to use as i dont always want to use the nick im currently connected with and dont want to include ident in the host but rather use *!*@host
User avatar
CrazyCat
Revered One
Posts: 1306
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

using telnet with user "NEW" is the best way to create a new owner, more secure than the /msg botnick hello or any IRC command.
Post Reply