| View previous topic :: View next topic |
| Author |
Message |
Fahad Op

Joined: 29 Aug 2016 Posts: 127
|
Posted: Sun Dec 04, 2016 2:49 pm Post subject: Auto Voice To Those Who Are Register NICK. |
|
|
| 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? |
|
| Back to top |
|
 |
Get_A_Fix Master

Joined: 07 May 2005 Posts: 206 Location: New Zealand
|
Posted: Sun Dec 04, 2016 9:15 pm Post subject: |
|
|
Edited: is_reg string for this script changed to work properly on DALnet.
| Code: |
# 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
}
}
}
|
_________________ 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.
Last edited by Get_A_Fix on Fri Dec 09, 2016 9:00 pm; edited 3 times in total |
|
| Back to top |
|
 |
Fahad Op

Joined: 29 Aug 2016 Posts: 127
|
Posted: Mon Dec 05, 2016 4:34 am Post subject: |
|
|
| 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 ? |
|
| Back to top |
|
 |
Get_A_Fix Master

Joined: 07 May 2005 Posts: 206 Location: New Zealand
|
Posted: Mon Dec 05, 2016 4:59 am Post subject: |
|
|
| 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: |
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: |
# 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. _________________ 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.
Last edited by Get_A_Fix on Mon Dec 05, 2016 12:20 pm; edited 1 time in total |
|
| Back to top |
|
 |
Fahad Op

Joined: 29 Aug 2016 Posts: 127
|
Posted: Mon Dec 05, 2016 5:25 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
Get_A_Fix Master

Joined: 07 May 2005 Posts: 206 Location: New Zealand
|
Posted: Mon Dec 05, 2016 5:34 am Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
Fahad Op

Joined: 29 Aug 2016 Posts: 127
|
Posted: Mon Dec 05, 2016 6:17 am Post subject: |
|
|
| OK I give it a try now, If anything... I will tell you... |
|
| Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Mon Dec 05, 2016 11:54 am Post subject: |
|
|
on dalnet network the whois will return:
using raw numeric 307
| Quote: | | has identified for this nick |
|
|
| Back to top |
|
 |
Fahad Op

Joined: 29 Aug 2016 Posts: 127
|
Posted: Fri Dec 09, 2016 6:33 am Post subject: |
|
|
<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" |
|
| Back to top |
|
 |
Get_A_Fix Master

Joined: 07 May 2005 Posts: 206 Location: New Zealand
|
Posted: Fri Dec 09, 2016 8:53 pm Post subject: |
|
|
| 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: |
.chattr yourhandle |v #channel
.chanset #channel +autovoice
|
Alternatively, without the user-defined autovoice setting, you can just:
| Code: |
.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: |
[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. |
|
| Back to top |
|
 |
Fahad Op

Joined: 29 Aug 2016 Posts: 127
|
Posted: Sat Dec 10, 2016 2:38 pm Post subject: |
|
|
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
???? |
|
| Back to top |
|
 |
Get_A_Fix Master

Joined: 07 May 2005 Posts: 206 Location: New Zealand
|
Posted: Sat Dec 10, 2016 6:13 pm Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
Fahad Op

Joined: 29 Aug 2016 Posts: 127
|
Posted: Sat Dec 10, 2016 6:24 pm Post subject: |
|
|
| Then how it will works ? |
|
| Back to top |
|
 |
Get_A_Fix Master

Joined: 07 May 2005 Posts: 206 Location: New Zealand
|
Posted: Sat Dec 10, 2016 11:15 pm Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
Fahad Op

Joined: 29 Aug 2016 Posts: 127
|
Posted: Sun Dec 11, 2016 4:54 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
|