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
Get_A_Fix
Master
Posts: 206
Joined: Sat May 07, 2005 6:11 pm
Location: New Zealand

Post by Get_A_Fix »

anotherrace wrote:Sorry, but this script is not working for me. It always says:
[part_auth]: wrong # args: should be "part_auth nick host hand chan"
Could it be because of the other protection scripts that are loaded?
It must be. The procedure name is part_auth which is not even part of my autovoice script. Use an editor to view your protections and search for that procedure. This script shouldn't conflict with any code though, it's very strange it doesn't work (if you have indeed enabled it).

Update: I asked google, it said the part_auth procedure it part of ccs.tcl, so I don't know why this script isn't working for you, it works fine for everyone else.
Last edited by Get_A_Fix on Sun Mar 05, 2017 12:32 am, 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.
Online
s
simo
Revered One
Posts: 1070
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

ìt works fine for me
a
anotherrace
Voice
Posts: 17
Joined: Wed May 14, 2014 8:10 pm

Post by anotherrace »

I still have yet to do further testing. And if there was any miscommunication I apologize for that. I was wondering if there could be a function that would scan the existing users on chan for registered nicks and voice them. Not only those who join
User avatar
Get_A_Fix
Master
Posts: 206
Joined: Sat May 07, 2005 6:11 pm
Location: New Zealand

Post by Get_A_Fix »

anotherrace wrote:I still have yet to do further testing. And if there was any miscommunication I apologize for that. I was wondering if there could be a function that would scan the existing users on chan for registered nicks and voice them. Not only those who join
This is a bit trickier. It would have to be done via two procedures. One to perform a whois on every user not voiced or opped, and one to pushmode them voice if matched registered. I say pushmode because doing it any other way would have line after line of a single voice, which looks horrible and floods the channel. This isn't something I personally want/need, but someone else may take the time to make it, unless you wish to pursue it yourself.
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.
a
anotherrace
Voice
Posts: 17
Joined: Wed May 14, 2014 8:10 pm

Post by anotherrace »

In BlackVIP.tcl it scans the users on the channel to voice those with nickname on the list after a given time. Maybe this could be applied but with whois
User avatar
Fahad
Op
Posts: 127
Joined: Mon Aug 29, 2016 9:40 am

Post by Fahad »

Get_A_Fix wrote:People want what they want. I tend to only question it when it doesn't make a lot of sense. As I had already written a script for this request, I didn't mind sharing.
This TCL only working in one channel... However I have activated in ALL channels. WHY ?
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:This TCL only working in one channel... However I have activated in ALL channels. WHY ?
I don't know why, the code is very simple and it works on all channel's for me and other people. Either you've edited it and something went wrong, or another script is causing conflicts (the first statement is usually correct in this instance).
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 have no edit, I put same like you gave me. It only works for only one channel. I tested myself.
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 have no edit, I put same like you gave me. It only works for only one channel. I tested myself.
Strange, this is a script I run on a bot and it works fine across several channels. You can check your binds, to see if another script may be interfering:

Code: Select all

.binds check*
Other than that, I don't see what would cause it to only function on one channel. It was written to work across any/all.
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 »

I get this when
<SilentTwilight> Command bindings:
<SilentTwilight> TYPE FLAGS COMMAND HITS BINDING (TCL)
<SilentTwilight> msg -|- checkisreg 3 authcheck:msg
<SilentTwilight> raw -|- 307 366 check:isreg
User avatar
Fahad
Op
Posts: 127
Joined: Mon Aug 29, 2016 9:40 am

Post by Fahad »

Re-Check TCL just in case this is what I put in my Eggy

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 
    } 
  } 
}
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Avoid using args as it has a special meaning in TCL.

I would also replace this loop:

Code: Select all

   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"
  } 
with something that would make sense. First don't use return inside a loop, instead use continue or a break.

Since the validuser check isn't tied to the list of channels you loop on it would be a good idea to take it outside the loop since the first result would be the same for every channel in the channels list.

I would put the check of checkisauth channel flag first since that's the fist mandatory check, then continue with onchan because if the given nick isn't on the channel the the other two (isop and isvoice) would fail anyway. I would also opt with a slower queue like pushmode.

Code: Select all

if ([validuser [nick2hand $nick]]) return
foreach chan [channels] {
	if (![channel get $chan checkisauth] || ![onchan $nick $chan] || [isop $nick $chan] || [isvoice $nick $chan]} continue
	pushmode $chan +v $nick
}
Your authcheck:pub is a mess as well. There's no need for [nick2hand $nick] since you already got this information in $hand in if {[matchattr [nick2hand $nick] $regsetflags $chan]} { line.

You execute [lindex [split $arg] 0] 3 times when can set it to a variable and access that variable as many times you wish. Same goes with [channel get $chan checkisauth] but is only called 2 times.

Code: Select all

if {[lindex [split $arg] 0] == "on"} {
will fail if the user input is ON, oN or On for instance. Either use a string equal -nocase or go with a string tolower.

There's no need for this:

Code: Select all

  global regsetflags
  if {[matchattr [nick2hand $nick] $regsetflags $chan]} {
When you can alter the bind line to make it trigger only for the $regsetflags you set, so instead of:

Code: Select all

bind pub - ${checkisregtrig}checkisreg authcheck:pub
go with:

Code: Select all

bind pub $regsetflags ${checkisregtrig}checkisreg authcheck:pub
Here is how I would do this:

Code: Select all

proc authcheck:pub {nick uhost hand chan text} {
	if {[scan $text {%s} mode] != 1} {
		puthelp "PRIVMSG $chan :\037ERROR\037: Incorrect Parameters. \037SYNTAX\037: [isregTrigger]checkisreg on|off"
		return
	}
	set status [channel get $chan checkisauth]
	switch -- [string tolower $mode] {
		"on" {
			if {$status} {
				puthelp "PRIVMSG $chan :\037ERROR\037: This setting is already enabled."
			} else {
				channel set $chan +checkisauth
				puthelp "PRIVMSG $chan :Enabled Automatic Register Checking for $chan"
			}
		}
		"off" {
			if {!$status} {
				puthelp "PRIVMSG $chan :\037ERROR\037: This setting is already disabled."
			} else {
				channel set $chan -checkisauth
				puthelp "PRIVMSG $chan :Disabled Automatic Register Checking for $chan"
			}
		}
		default {
			puthelp "PRIVMSG $chan :\037ERROR\037: $mode is not an accepted parameter. \037SYNTAX\037: [isregTrigger]checkisreg on|off"
		}
	}
}
I opted for switch as it gives me a default option where if any of the available isn't triggered will have the default one kick in.

Based on above code you can easily make the same adjustments for authcheck:msg function with two changes:

Code: Select all

if {[scan $text {%s%s} mode channel] != 2} {
and instead of the silly:

Code: Select all

string match "*#*" $arg
where I take it you want to see if the given $channel starts with a # then go with:

Code: Select all

if {![string first # $channel]} {
# all good, at least channel name starts with an #
} else {
# the result should be 0, but in our case is either -1 if not present or 1+ then alert or whatever you wish
}
and can also throw in a valid channel check:

Code: Select all

if {![validchan $chan]} {
	# channel not valid
} else {
	# channel is valid, all is ok proceed as you wish
}
Once the game is over, the king and the pawn go back in the same box.
User avatar
Fahad
Op
Posts: 127
Joined: Mon Aug 29, 2016 9:40 am

Post by Fahad »

Can you give the new tcl here after fix ?
User avatar
Fahad
Op
Posts: 127
Joined: Mon Aug 29, 2016 9:40 am

Post by Fahad »

@caesar Please EDIT TCL and Paste it here, So i can copy
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Too lazy to follow some example or what part you haven't understood?
Once the game is over, the king and the pawn go back in the same box.
Post Reply