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.

Modifying authname + autovoice script

Old posts that have not been replied to for several years.
Locked
d
dmt
Voice
Posts: 2
Joined: Sat Jan 08, 2005 5:29 pm

Modifying authname + autovoice script

Post by dmt »

I've been trying to modify a few scripts together so that my bot will let users add themselves for autovoice. It will add their authname to a list, and when they join the channel it will then whois them, and if their authname is found in the file, they will be voiced.

Heres the part of my script that matters for this question

Code: Select all

bind msg - @add adduser

proc adduser { nick uhost hand args } {
   global usernick
   global authname
   set usernick $nick
   whois:nick $nick
	set up $authname
	set wfile [open $userlist a+]
	puts $wfile $up
	close $wfile
}

proc whois:nick { target } {
	global whois
	global usernick
   set target $usernick
	putquick "WHOIS $target $target"
	set ::whoistarget $target
	bind RAW - 330 whois:auth
}

proc whois:auth { from keyword arguments } {
	global authname
	set target $::whoistarget
	set authname [lindex [split $arguments] 2]
	unbind RAW - 330 whois:auth
}
The problem is whenever I test adding someone, it says "Tcl error [adduser]: can't read "authname": no such variable" eventhough I have it as global. Also I'm not sure if I'm calling the whois:nick proc the right way, although I can't test it so I can't get the authname var working. Any help would be appreciated, thanks.

Note: I removed some unimportant stuff from the code like msgs.
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

What is an authname? I am not sure. And what has it got todo with /whois?

Is it something like, autovoice on join?
Authname is apart of the user's hostmask?

A user's mask is added to a file, and on join to a channel the host is matched against by the file through whois, and if it matches the user is voiced? Is that it?
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
User avatar
^DooM^
Owner
Posts: 772
Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:

Post by ^DooM^ »

It would be easier to add users to the bots userlist. when they @add themselves to the bot. whoising everyone on join in a script is pointless if i have understood you correctly as the bot already looks at the users host to decide what it has to do with that user depending on what flags if any they have in the userfile or to match any bans..

So to clarify make the bot add the users to its own userfile with the flags +vg Also make it channel specific else it will be added to global flags and the user will get voice in every channel unless that is what you want.

hope this helps. :wink:
The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born
d
dmt
Voice
Posts: 2
Joined: Sat Jan 08, 2005 5:29 pm

Post by dmt »

A user's mask is added to a file, and on join to a channel the host is matched against by the file through whois, and if it matches the user is voiced? Is that it?
Yes, that's what I wanted to accomplish.

The problem is a lot of people dont set mode +x. So their authname can only be found in a whois.

Ideally, identifying them by authname would end up being the best way in the end, because it would never change like their hostmask might. It also identifies them by name.

But you're probably right that I should just use the bots userfile. It will be easier and I won't have to deal with these problems. Thanks for the help.
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Yes using the bots userfile is easier, not messy and the best situation. Plus you would be able to add lots of different flags, locally for channels as well as globally.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Locked