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.

Auto Voice To Those Who Are Register NICK.

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
User avatar
Fahad
Op
Posts: 127
Joined: Mon Aug 29, 2016 9:40 am

Auto Voice To Those Who Are Register NICK.

Post by Fahad »

Hello, I am looking for a TCL who can Auto Voice users who have register nick not who are Unregister. I want my bot will give +V (VOICE) to those who are Registered/ As you see "Auditorium" Bot In Server DALnet. Do you understand what I mean?
User avatar
Get_A_Fix
Master
Posts: 206
Joined: Sat May 07, 2005 6:11 pm
Location: New Zealand

Post by Get_A_Fix »

Edited: is_reg string for this script changed to work properly on DALnet.

Code: Select all

# SYNTAX (on PartyLine/DCC/CTCP/TELnet): .chanset #channel -/+checkisauth
# ----------
# PUBCMD:
# !checkisreg on|off
# ----------
# MSGCMD:
# /msg botnick checkisreg #channel on|off

# ---------- SETTINGS ----------
# Set your global trigger (default: !)
set checkisregtrig "!"

# Set global|channel access flags to enable/disable authcheck (default: o|o)
set regsetflags o|o

# Set here the string used to match registered/authenticated user's
set verifieduser "*has identified for*"

# ----- NO EDIT -----
# You may have to change the RAW numeric below to match your IRCd.
bind raw - 307 check:isreg
bind join - * join:checkisreg
bind pub - ${checkisregtrig}checkisreg authcheck:pub
bind msg - checkisreg authcheck:msg

proc isregTrigger {} {
  global checkisregtrig
  return $checkisregtrig
}

setudef flag checkisauth

proc join:checkisreg {nick uhost hand chan} {
  if {![channel get $chan checkisauth]} {return}
  if {![isbotnick $nick] && ![validuser [nick2hand $nick]]} {
    putserv "WHOIS $nick"
  }
}

proc check:isreg {from keyword args} {
  global verifieduser
  if {![string match $verifieduser $args]} {return}
  set nick [lindex [split $args] 1]
   foreach chan [channels] {
    if {![onchan $nick $chan] || ![channel get $chan checkisauth] || [validuser [nick2hand $nick]] || [isop $nick $chan] || [isvoice $nick $chan]} {return}
    putquick "MODE $chan +v $nick"
  }
}

proc authcheck:pub {nick uhost hand chan arg} {
  global regsetflags
  if {[matchattr [nick2hand $nick] $regsetflags $chan]} {
    if {[lindex [split $arg] 0] == ""} {putquick "PRIVMSG $chan :\037ERROR\037: Incorrect Parameters. \037SYNTAX\037: [isregTrigger]checkisreg on|off"; return}

    if {[lindex [split $arg] 0] == "on"} {
      if {[channel get $chan checkisauth]} {putquick "PRIVMSG $chan :\037ERROR\037: This setting is already enabled."; return}
      channel set $chan +checkisauth
      puthelp "PRIVMSG $chan :Enabled Automatic Register Checking for $chan"
      return 0
    }

    if {[lindex [split $arg] 0] == "off"} {
      if {![channel get $chan checkisauth]} {putquick "PRIVMSG $chan :\037ERROR\037: This setting is already disabled."; return}
      channel set $chan -checkisauth
      puthelp "PRIVMSG $chan :Disabled Automatic Register Checking for $chan"
      return 0
    }
  }
}

proc authcheck:msg {nick uhost hand arg} {
  global botnick regsetflags
  set chan [strlwr [lindex [split $arg] 0]]
  if {[matchattr [nick2hand $nick] $regsetflags $chan]} {
    if {[lindex [split $arg] 0] == ""} {putquick "NOTICE $nick :\037ERROR\037: Incorrect Parameters. \037SYNTAX\037: /msg $botnick checkisreg #channel on|off"; return}
    if {([lindex [split $arg] 1] == "") && ([string match "*#*" $arg])} {putquick "NOTICE $nick :\037ERROR\037: Incorrect Parameters. \037SYNTAX\037: /msg $botnick checkisreg $chan on|off"; return}

    if {[lindex [split $arg] 1] == "on"} {
      if {[channel get $chan checkisauth]} {putquick "NOTICE $nick :\037ERROR\037: This setting is already enabled."; return}
      channel set $chan +checkisauth
      putquick "NOTICE $nick :Enabled Automatic Register Checking for $chan"
      return 0
    }

    if {[lindex [split $arg] 1] == "off"} {
      if {![channel get $chan checkisauth]} {putquick "NOTICE $nick :\037ERROR\037: This setting is already disabled."; return}
      channel set $chan -checkisauth
      putquick "NOTICE $nick :Disabled Automatic Register Checking for $chan"
      return 0
    }
  }
}
Last edited by Get_A_Fix on Fri Dec 09, 2016 9:00 pm, edited 3 times in total.
We explore.. and you call us criminals. We seek after knowledge.. and you call us criminals. We exist without skin color, without nationality, without religious bias.. and you call us criminals.
User avatar
Fahad
Op
Posts: 127
Joined: Mon Aug 29, 2016 9:40 am

Post by Fahad »

Thanks so much, What kind of Logged? How I check ? and I also see when there Auto Voice bot is there they put channel +A ?
User avatar
Get_A_Fix
Master
Posts: 206
Joined: Sat May 07, 2005 6:11 pm
Location: New Zealand

Post by Get_A_Fix »

Fahad wrote:Thanks so much, What kind of Logged? How I check ? and I also see when there Auto Voice bot is there they put channel +A ?
Edited: Changed the is_reg string to match DALnet

This script does not check channel modes, so even if the channel is NOT +A it will still voice, unless turned off/disabled. This script only does a /whois and checks if the user is registered. If they are, it will voice.

If you really want it to check +A you will need to edit the check:isreg procedure like so

Code: Select all

proc check:isreg {from keyword args} {
  global verifieduser
  if {![string match $verifieduser $args]} {return}
  set nick [lindex [split $args] 1]
   foreach chan [channels] {
    if {![onchan $nick $chan] || ![channel get $chan checkisauth] || [validuser [nick2hand $nick]] || [isop $nick $chan] || [isvoice $nick $chan] || ![regexp A [getchanmode $chan]]} {return}
    putquick "MODE $chan +v $nick"
  }
} 
As for Syntax:

Code: Select all

# SYNTAX (on PartyLine/DCC/CTCP/TELnet): .chanset #channel -/+checkisauth
# ----------
# PUBCMD:
# !checkisreg on|off
# ----------
# MSGCMD:
# /msg botnick checkisreg #channel on|off 
The above syntax is pretty straight forward. If you telnet/dcc the bot a lot, then it's easy to use .chanset to enable the userdefined flag.
For faster enable/disable, there is a public command or a message command. Use one of the methods, only once, you don't need to use all 3.
You could just type !checkisreg on with bot on channel and it will enable.
Last edited by Get_A_Fix on Mon Dec 05, 2016 12:20 pm, edited 1 time in total.
We explore.. and you call us criminals. We seek after knowledge.. and you call us criminals. We exist without skin color, without nationality, without religious bias.. and you call us criminals.
User avatar
Fahad
Op
Posts: 127
Joined: Mon Aug 29, 2016 9:40 am

Post by Fahad »

That's fine. I don't know much about A+ mode and DALnet has only ChanServ register nicks. In UnderNet we have to Logged our selfs.

So I just have to Put this tcl in bot and running? everything is perfect here. ?

If this does /whois and voice register nicks then i no have to make changes.
User avatar
Get_A_Fix
Master
Posts: 206
Joined: Sat May 07, 2005 6:11 pm
Location: New Zealand

Post by Get_A_Fix »

Fahad wrote:That's fine. I don't know much about A+ mode and DALnet has only ChanServ register nicks. In UnderNet we have to Logged our selfs.

So I just have to Put this tcl in bot and running? everything is perfect here. ?

If this does /whois and voice register nicks then i no have to make changes.
DALnet uses ChanServ for channel registrations, it uses NickServ for nicknames, but this code doesn't care what service is used, it performs a /whois and checks the nickname has identified/authenticated.

I changed the raw numeric to 307 for DALnet, but other IRCd like Undernet may use 330 for registered user. If you want to run this on Undernet you may have to change the numeric.
If you have added the code from here to your DALnet bot, then yes everything is perfect and you just need to enable on the channel you want by typing !checkisreg on

I originally made this script for a channel I am on, we have channel-mode +m set to stop botnets from flooding (as they very rarely register their nicknames).
We explore.. and you call us criminals. We seek after knowledge.. and you call us criminals. We exist without skin color, without nationality, without religious bias.. and you call us criminals.
User avatar
Fahad
Op
Posts: 127
Joined: Mon Aug 29, 2016 9:40 am

Post by Fahad »

OK I give it a try now, If anything... I will tell you...
s
simo
Revered One
Posts: 1072
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

on dalnet network the whois will return:
using raw numeric 307
has identified for this nick
User avatar
Fahad
Op
Posts: 127
Joined: Mon Aug 29, 2016 9:40 am

Post by Fahad »

<Fahad> !checkisreg on
<@Deadite> ERROR: This setting is already enabled.

But the BOT Does not +V me when I joins.

<Deadite> [10:33:26] Tcl error [join:checkisreg]: wrong # args: should be "join:checkisreg nick uhost hand chan arg"
User avatar
Get_A_Fix
Master
Posts: 206
Joined: Sat May 07, 2005 6:11 pm
Location: New Zealand

Post by Get_A_Fix »

Fahad wrote:<Fahad> !checkisreg on
<@Deadite> ERROR: This setting is already enabled.

But the BOT Does not +V me when I joins.
This does not autovoice everyone. I made this code to not voice users already added to the bot. If you want the bot to autovoice you, then you can use:

Code: Select all

.chattr yourhandle |v #channel
.chanset #channel +autovoice
Alternatively, without the user-defined autovoice setting, you can just:

Code: Select all

.chattr yourhandle |g #channel
By doing this, it will voice everyone NOT added to channel or bot. Those with channel/bot access allow their ACL or flags to do the work of this script function.
If you want the bot to voice you just remove:

Code: Select all

[validuser [nick2hand $nick]]
Fahad wrote: <Deadite> [10:33:26] Tcl error [join:checkisreg]: wrong # args: should be "join:checkisreg nick uhost hand chan arg"
The above error seems to be due to an extra argument being included in the code, when it shouldn't have been. It has been edited and should be fine now, if you want to check the original post to reference the join:checkisreg
We explore.. and you call us criminals. We seek after knowledge.. and you call us criminals. We exist without skin color, without nationality, without religious bias.. and you call us criminals.
User avatar
Fahad
Op
Posts: 127
Joined: Mon Aug 29, 2016 9:40 am

Post by Fahad »

No, I don't want bot to Auto Voice me, I am channel Founder i only sit on my channels and I have all famous channels on DALnet... I want my register users get voice. But i see one register user who never get voice. Even bot was on...

<@Fahad> !checkisreg on
&#139;@Deadite&#155; ERROR: This setting is already enabled.

* JAZI (Elite12490@ipv6.8.omega.elitebnc.org) has joined #ChatWorld
????
User avatar
Get_A_Fix
Master
Posts: 206
Joined: Sat May 07, 2005 6:11 pm
Location: New Zealand

Post by Get_A_Fix »

Fahad wrote:No, I don't want bot to Auto Voice me, I am channel Founder i only sit on my channels and I have all famous channels on DALnet... I want my register users get voice. But i see one register user who never get voice. Even bot was on...

<@Fahad> !checkisreg on
‹@Deadite› ERROR: This setting is already enabled.

* JAZI (Elite12490@ipv6.8.omega.elitebnc.org) has joined #ChatWorld
????
Yes, that is how I made it. If you have channel access or access to bot, it won't voice.

If the user has not identified before they join the channel, or before the /whois, then they won't be voiced. If they identify before joining, they will.
Check you have the current join:checkisreg procedure, I noticed there was an extra argument being called that isn't required in join bind.
Make sure that JAZI is identified before they join, or have them cycle the channel once identified, it should work unless they have an ignore by bot.
We explore.. and you call us criminals. We seek after knowledge.. and you call us criminals. We exist without skin color, without nationality, without religious bias.. and you call us criminals.
User avatar
Fahad
Op
Posts: 127
Joined: Mon Aug 29, 2016 9:40 am

Post by Fahad »

Then how it will works ?
User avatar
Get_A_Fix
Master
Posts: 206
Joined: Sat May 07, 2005 6:11 pm
Location: New Zealand

Post by Get_A_Fix »

Fahad wrote:Then how it will works ?
Huh? I can't explain it any more simpler than I already have. It does exactly what you wanted..

Make sure they have identified BEFORE they join your channel. If they do NOT identify, they will NOT be voiced.
We explore.. and you call us criminals. We seek after knowledge.. and you call us criminals. We exist without skin color, without nationality, without religious bias.. and you call us criminals.
User avatar
Fahad
Op
Posts: 127
Joined: Mon Aug 29, 2016 9:40 am

Post by Fahad »

In DALnet you cannot use nick if you don't Identify... OR maybe I am wrong. Just remind me. Have I put this command correct when Enable

.chanset #channel -/+checkisauth

.chanset #chatworld +checkisauth <---- Correct like this ?


This not even +VOICE to normal Register Users...

Tcl error [join:checkisreg]: wrong # args: should be "join:checkisreg nick uhost hand chan arg"

I am not TESTING this bot on myself... It does not +VOICE to anyone and I told you on DALnet you cannot use a nick if you don't Identify... So Off course who join my channel is IDENTIFIED.
Post Reply