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.

help with adduser script

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
c
cache
Master
Posts: 306
Joined: Tue Jan 10, 2006 4:59 am
Location: Mass

help with adduser script

Post by cache »

Code: Select all

# Process AddUser

proc proc_adduser { nick uhost hand chan text } {
  set addusernick [nick2hand $text]
  if {[validuser $addusernick]} {
   putserv "PRIVMSG $chan :\002$text\002 Is Already In User Database As \002$addusernick\002"
  } else  {
   unset addusernick
   set addusermask [maskhost $text![getchanhost $text $chan]]
   adduser $text $addusermask
   set addusernick [nick2hand $text]
   putlog "\002$nick\002 Added \002$addusernick\($text\)\002 To User Database"
   putserv "PRIVMSG $chan :$text Has Been Added To The Database."
}
When I use it.. it adds them to the userfile like this:

Code: Select all

cache      - a                       
--HOSTS *!*@cache !
--XTRA created 1145459622
I want it to add like this:

Code: Select all

cache   - a                       
--HOSTS *!cache@cache
--LASTON 1143185765 #Trivia
--XTRA created 1125183441
So I need it to add as usernick@hostmask

Can anyone help me?

thanks
Last edited by cache on Wed Apr 19, 2006 7:14 pm, edited 1 time in total.
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Change

Code: Select all

[maskhost $text![getchanhost $text $chan]]
to

Code: Select all

*![getchanhost $text $chan]
c
cache
Master
Posts: 306
Joined: Tue Jan 10, 2006 4:59 am
Location: Mass

Post by cache »

Thanks very much Sir :)
c
cache
Master
Posts: 306
Joined: Tue Jan 10, 2006 4:59 am
Location: Mass

Post by cache »

Code: Select all

# Process DelUser

proc proc_deluser { nick uhost hand chan text } {
  set delusernick [nick2hand $text]
  if {[validuser $delusernick]} {
    deluser $delusernick
Trying to figure out why I can't delete a user unless their on the channel?

thanks
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Because if nick is not on any channel the bot's on, then [nick2hand] will be useless (will not return nick's handle).
c
cache
Master
Posts: 306
Joined: Tue Jan 10, 2006 4:59 am
Location: Mass

Post by cache »

So there is no other option? :twisted:
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

Match a known handle and/or address to delete a user possibly but this idea is flawed if you have no idea what handle they were added under or address used.
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
c
cache
Master
Posts: 306
Joined: Tue Jan 10, 2006 4:59 am
Location: Mass

Post by cache »

Hey Alchera,

The hostmasks are the same as the nicknames Nick@Nick

When I add them it shows them added like this in user file:

cache - a
--HOSTS *!cache@*

Even tho im not sure why it don't add like this:

cache - a
--HOSTS *!cache@cache*

I'm not worried if theres any flaws b/c the flags it sets will not make them gain any ops.

thanks
Post Reply