egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Auto Voice To Those Who Are Register NICK.
Goto page Previous  1, 2, 3, 4, 5, 6  Next
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
Get_A_Fix
Master


Joined: 07 May 2005
Posts: 206
Location: New Zealand

PostPosted: Fri Mar 03, 2017 3:01 am    Post subject: Reply with quote

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.
_________________
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 Sun Mar 05, 2017 12:32 am; edited 1 time in total
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
simo
Owner


Joined: 22 Mar 2015
Posts: 941

PostPosted: Sat Mar 04, 2017 3:13 pm    Post subject: Reply with quote

ět works fine for me
Back to top
View user's profile Send private message
anotherrace
Voice


Joined: 14 May 2014
Posts: 17

PostPosted: Mon Mar 06, 2017 2:51 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Get_A_Fix
Master


Joined: 07 May 2005
Posts: 206
Location: New Zealand

PostPosted: Mon Mar 06, 2017 3:21 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
anotherrace
Voice


Joined: 14 May 2014
Posts: 17

PostPosted: Tue Mar 07, 2017 3:55 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Fahad
Op


Joined: 29 Aug 2016
Posts: 127

PostPosted: Fri Mar 17, 2017 7:22 am    Post subject: Reply with quote

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 ?
Back to top
View user's profile Send private message
Get_A_Fix
Master


Joined: 07 May 2005
Posts: 206
Location: New Zealand

PostPosted: Wed Mar 22, 2017 12:03 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Fahad
Op


Joined: 29 Aug 2016
Posts: 127

PostPosted: Wed Mar 22, 2017 1:15 pm    Post subject: Reply with quote

No, I have no edit, I put same like you gave me. It only works for only one channel. I tested myself.
Back to top
View user's profile Send private message
Get_A_Fix
Master


Joined: 07 May 2005
Posts: 206
Location: New Zealand

PostPosted: Wed Mar 22, 2017 5:08 pm    Post subject: Reply with quote

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:
.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.
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Fahad
Op


Joined: 29 Aug 2016
Posts: 127

PostPosted: Thu Mar 23, 2017 4:06 am    Post subject: Reply with quote

I get this when
Quote:

<SilentTwilight> Command bindings:
<SilentTwilight> TYPE FLAGS COMMAND HITS BINDING (TCL)
<SilentTwilight> msg -|- checkisreg 3 authcheck:msg
<SilentTwilight> raw -|- 307 366 check:isreg
Back to top
View user's profile Send private message
Fahad
Op


Joined: 29 Aug 2016
Posts: 127

PostPosted: Thu Mar 23, 2017 6:29 am    Post subject: Reply with quote

Re-Check TCL just in case this is what I put in my Eggy
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
    }
  }
}
Back to top
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Thu Mar 23, 2017 9:18 am    Post subject: Reply with quote

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

I would also replace this loop:
Code:

   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:

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:

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:

  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:

bind pub - ${checkisregtrig}checkisreg authcheck:pub

go with:
Code:

bind pub $regsetflags ${checkisregtrig}checkisreg authcheck:pub

Here is how I would do this:
Code:

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:

if {[scan $text {%s%s} mode channel] != 2} {

and instead of the silly:
Code:

string match "*#*" $arg

where I take it you want to see if the given $channel starts with a # then go with:
Code:

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:

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.
Back to top
View user's profile Send private message
Fahad
Op


Joined: 29 Aug 2016
Posts: 127

PostPosted: Thu Mar 23, 2017 10:20 am    Post subject: Reply with quote

Can you give the new tcl here after fix ?
Back to top
View user's profile Send private message
Fahad
Op


Joined: 29 Aug 2016
Posts: 127

PostPosted: Fri Mar 24, 2017 6:24 am    Post subject: Reply with quote

@caesar Please EDIT TCL and Paste it here, So i can copy
Back to top
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Fri Mar 24, 2017 6:28 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Goto page Previous  1, 2, 3, 4, 5, 6  Next
Page 3 of 6

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber