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.

Completely blocked with sending message on join

Old posts that have not been replied to for several years.
Locked
Z
Zariffa
Voice
Posts: 22
Joined: Sat Jan 03, 2004 12:13 am

Completely blocked with sending message on join

Post by Zariffa »

Hello all,

I'm posting here beaucause I don't know how to get out of this problem, maybe some of you should help me, I think so.

What this script is supposed to do ? It's simple :

When Y or Z JOINs the channel the BOT will send him an AUTH, and when the BOT itself JOINs then channel it will send a send to Y or Z.
The problem is that the bot sends only :
CSAUTH me Zarifa pass1
when Y joins... the three other possibilities (send to X, send to Y when BOT join, send to W when BOT join) don't work... I hope you'll help me, thanks !!!

Code: Select all

### What is the name of the bot to identify to on join (CSAUTH)? 
set bot(csauthbot) "Me" 

### What is the name of the bot you want to do the channel identify (AUTH)? 
set bot(authbot) "Me" 

### Set the username / password of the Eggdrop that will use for CSAUTH 
set bot(csauthuserpass) "Zarifa pass1" 

### Set the username / password of the Eggdrop that will use for AUTH 
set bot(authuserpass) "Zarifa pass2" 

### Set this to 1 if you want the script enabled by default, otherwise 0 
set bot(enable) 1 

# stuff 
setudef flag auth 
bind join - * join:csauth 
#bind dcc - csauth x:csauth 
bind dcc - auth x:csauth:on_off 


proc join:csauth {nick uhost handle chan} { 
    global bot 

    if {![isbotnick $nick] || $bot(enable) != "1" } {return 0} 

    putserv "PRIVMSG $bot(csauthbot) :CSAUTH $bot(authbot) $bot(csauthuserpass)" 
#    foreach chan [channels] { 
        if {[channel get $chan auth]} { 
            putserv "PRIVMSG $bot(authbot) :AUTH $chan $bot(authbot) $bot(authuserpass)" 
        } 
#    } 

    return 0 
} 

proc x:csauth:on_off {hand idx arg} { 
  global bot 
  switch -- [lindex [split $arg] 0] { 
    "on" { set bot(enable) 1; putdcc $idx "Authing turned on" } 
    "off" { set bot(enable) 0; putdcc $idx "Authing turned off" } 
  } 
} 

# suite tant attendue 
proc join:do_auth {nick uhost hand chan} { 
    global bot 
    switch -- [string tolower $nick] { 
        [string tolower $bot(csauthbot)] { 
           putserv "PRIVMSG $bot(csauthbot) :CSAUTH $bot(csauthuserpass)" 
        } 
        [string tolower $bot(authbot)] { 
            if {[channel get $chan auth]} { 
                putserv "PRIVMSG $bot(authbot) :AUTH $chan $bot(authuserpass)" 
            } 
        } 
    } 
    return 0 
} 

bind join - * join:do_auth
Last edited by Zariffa on Sun Feb 08, 2004 3:02 pm, edited 1 time in total.
User avatar
CrazyCat
Revered One
Posts: 1257
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

well, I'm affraid that you never give the names of X, Y or Z:

Code: Select all

set bot(csauthbot) "Me"
might be

Code: Select all

set bot(csauthbot) "X Y Z"
and thent you may modify your script:

Code: Select all

proc join:do_auth {nick uhost hand chan} {
   global bot
      if {[lsearch -exact $bot(csauthbot) [string tolower $nick]]} {
           putserv "PRIVMSG $nick :CSAUTH $bot(csauthuserpass)"
      }
   }
   return 0
}
This procedure will make your bot send is password if the joining nick is in your bot(csauthbot) variable.
The previous version of script you use was for only 1 auth bot.
You have to modify the join:csauth procedure
Z
Zariffa
Voice
Posts: 22
Joined: Sat Jan 03, 2004 12:13 am

Post by Zariffa »

well, I'm affraid that you never give the names of X, Y or Z:
Code:
set bot(csauthbot) "Me"
might be Code:
set bot(csauthbot) "X Y Z"
Yes I know, it was just for example...

And so what would I really modifiy ?
Z
Zariffa
Voice
Posts: 22
Joined: Sat Jan 03, 2004 12:13 am

Post by Zariffa »

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

Post by Sir_Fz »

if {[lsearch -exact $bot(csauthbot) [string tolower $nick]]} {
this should be:

Code: Select all

if {[lsearch -exact [string tolower $bot(csauthbot)] [string tolower $nick]] != -1} {
if nick matches one of the nicks in bot(csauthbot) then the bot will message it for auth.
Z
Zariffa
Voice
Posts: 22
Joined: Sat Jan 03, 2004 12:13 am

Post by Zariffa »

I have still ne same problem... is it this code so difficult ?!

Code: Select all

### What is the name of the bot to identify to on join (CSAUTH)? 
set bot(csauthbot) "me" 

### What is the name of the bot you want to do the channel identify (AUTH)? 
set bot(authbot) "me" 

### Set the username / password of the Eggdrop that will use for CSAUTH 
set bot(csauthuserpass) "Zarifa pass1" 

### Set the username / password of the Eggdrop that will use for AUTH 
set bot(authuserpass) "Zarifa pass2" 

### Set this to 1 if you want the script enabled by default, otherwise 0 
set bot(enable) 1 

# stuff 
setudef flag auth 
bind join - * join:csauth 
#bind dcc - csauth x:csauth 
bind dcc - auth x:csauth:on_off 


proc join:csauth {nick uhost handle chan} { 
    global bot 

    if {![isbotnick $nick] || $bot(enable) != "1" } {return 0} 

    putserv "PRIVMSG $bot(csauthbot) :CSAUTH $bot(authbot) $bot(csauthuserpass)" 
#    foreach chan [channels] { 
        if {[channel get $chan auth]} { 
            putserv "PRIVMSG $bot(authbot) :AUTH $chan $bot(authbot) $bot(authuserpass)" 
        } 
#    } 

    return 0 
} 

proc x:csauth:on_off {hand idx arg} { 
  global bot 
  switch -- [lindex [split $arg] 0] { 
    "on" { set bot(enable) 1; putdcc $idx "Authing turned on" } 
    "off" { set bot(enable) 0; putdcc $idx "Authing turned off" } 
  } 
} 

# suite tant attendue 
proc join:do_auth {nick uhost hand chan} { 
   global bot 
     if {[lsearch -exact [string tolower $bot(csauthbot)] [string tolower $nick]] != -1} { 
           putserv "PRIVMSG $nick :CSAUTH $bot(csauthuserpass)" 
      } 
   } 
   return 0 
}

bind join - * join:do_auth
Locked