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.

setuser / email

Old posts that have not been replied to for several years.
Locked
s
simonbell
Halfop
Posts: 68
Joined: Mon Aug 05, 2002 8:07 pm
Location: Washington, England
Contact:

setuser / email

Post by simonbell »

Hi

Im trying to set some user information at the same time as adding them to the bot.

im using the code:

setuser $newhand EMAIL $email

but when the user tries to register with the bot i see the error:

<H4> [02:31] Tcl error [handle_reg]: No such info type: EMAIL

i took the command out of tcl-commands.dos which says

EMAIL - returns the user's e-mail address

setuser <handle> <entry-type> [extra info]
Description: this is the counterpart of getuser. It lets you set the
various values. Other then the ones listed below, the entry-types are
the same as getuser's.

so i cant really see what im doing wrong. The same syntax worked to add the users password.

Any ideas?

thanks
Simon
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

The email type only appears when you have a certain module loaded, I think (I forget which). You're best off using the XTRA field since it's always available.
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

The EMAIL field is allways based on the XTRA feild.

You should use
setuser $hand XTRA "EMAIL email@address.test"
s
simonbell
Halfop
Posts: 68
Joined: Mon Aug 05, 2002 8:07 pm
Location: Washington, England
Contact:

Post by simonbell »

Thanks, that worked. Following on from that, is there any way to make the bot check the formatting of the email address.

such as:
if { $regmail != "*@*.*" }
tell the user its the wrong format and to enter it properly

thanks
Simon
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

You can use the string command to do a match like that, however, using regexp will give better results.

With this, you can use one of the readily available reg expressions available. They will check for the use of valid characters, and format, not just the requirmen of the @ and .
s
simonbell
Halfop
Posts: 68
Joined: Mon Aug 05, 2002 8:07 pm
Location: Washington, England
Contact:

Post by simonbell »

thanks, could someone point me in the direction of a regexp tutorial or something similar as i havnt come across it in any of the tcl tutiorials ive looked through yet.

thanks.
t
tainted
Master
Posts: 239
Joined: Sun May 12, 2002 8:00 pm
Location: chicago
Contact:

Post by tainted »

s
simonbell
Halfop
Posts: 68
Joined: Mon Aug 05, 2002 8:07 pm
Location: Washington, England
Contact:

Post by simonbell »

Ive read through that. Cant say it made a great deal of sense heh.

Ive worked out simple matching such as
regexp {[0,1]} $blah
matching just those 2 numbers etc, but i cant work out how to get it to match an email address, so it would only accept blah@blah.blah, and check for invalid characters at the same time.

has anyone got an example?

thanks
Simon
Locked