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.

voice trigger

Old posts that have not been replied to for several years.
Locked
User avatar
Stealthx
Halfop
Posts: 68
Joined: Fri Oct 01, 2004 3:37 am
Location: StealthBox

voice trigger

Post by Stealthx »

Is there any available voice tcl that have this function? The user will doa "!voice" and the bot will scan a particular channel nicks for their ending domain (etc. *!*@*.au) and den give all users with ISP domain ending with .au with a voice. It must be able to voice 5 users per trigger.

P.S. I know nuts about TCL coding/scripting!

Please help! Thank you... :mrgreen:
+ Stealth Box +
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Here something like this should do it. :mrgreen:

Code: Select all

bind pub - "!voice" scan:and:voice

proc scan:and:voice {nick uhost hand chan text} {
 if {([botisop $chan])} {; set oplist [list]
 putserv "PRIVMSG $chan :Scanning $chan for *!*@*.au users..."
 foreach user [chanlist $chan] {
  if {([string match "*.au" [lindex [split [getchanhost $user $chan] "@"] 1]])} {
   lappend oplist $user }
   }
   putserv "PRIVMSG $chan :Scanning complete."
   if {([llength $oplist] == 0)} { putserv "PRIVMSG $chan :No users matching *!*@.au found"; return 0 }
   if {([llength $oplist] > 5])} { set oplist [lrange $oplist 0 4] }
    putserv "PRIVMSG $chan :Found '5' or more users matching *!*@.au. Voicing the first 5 found."
    putserv "MODE $chan +vvvvv [join $oplist]"; return 0
    }
}
Last edited by awyeah on Thu Oct 07, 2004 12:30 am, edited 2 times in total.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
User avatar
Stealthx
Halfop
Posts: 68
Joined: Fri Oct 01, 2004 3:37 am
Location: StealthBox

Post by Stealthx »

Code: Select all

putserv "MODE $chan +ooooo [join $oplist]"; return 0
It's +ooooo and not +vvvvv?

When I use the script and type .tcl set errorInfo in my bot DCC chat, it's shows...

Code: Select all

Tcl: syntax error in expression "([llength $oplist] > 5])"
Tcl:     ("if" test expression)
Tcl:     while compiling
Tcl: "if {([llength $oplist] > 5])} { set oplist [lrange $oplist 0 4] } "
Tcl:     ("if" then script line 9)
Tcl:     while compiling
Tcl: "if {([botisop $chan])} {; set oplist [list] 
Tcl:  putserv "PRIVMSG $chan :Scanning $chan for *!*@*.sg users..." 
Tcl:  foreach user [chanlist $chan] { 
Tcl:   if {(..."
Tcl:     (compiling body of proc "scan:and:voice", line 2)
Tcl:     invoked from within
Tcl: "scan:and:voice $_pub1 $_pub2 $_pub3 $_pub4 $_pub5"
+ Stealth Box +
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Oops, sorry yeah missed a square bracket.
Try this:

Code: Select all

bind pub - "!voice" scan:and:voice

proc scan:and:voice {nick uhost hand chan text} {
 if {([botisop $chan])} {; set oplist [list]
 putserv "PRIVMSG $chan :Scanning $chan for *!*@*.au users..."
 foreach user [chanlist $chan] {
  if {([string match "*.au" [lindex [split [getchanhost $user $chan] "@"] 1]])} {
   lappend oplist $user }
   }
   putserv "PRIVMSG $chan :Scanning complete."
   if {([llength $oplist] == 0)} { putserv "PRIVMSG $chan :No users matching *!*@.au found"; return 0 }
   if {([llength $oplist] > 5)} { putserv "PRIVMSG $chan :Found '5' or more users matching *!*@.au. Voicing the first 5 found."
    set oplist [lrange $oplist 0 4] }
    putserv "MODE $chan +vvvvv [join $oplist]"; return 0
    }
}
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
User avatar
Stealthx
Halfop
Posts: 68
Joined: Fri Oct 01, 2004 3:37 am
Location: StealthBox

Post by Stealthx »

awyeah wrote:Oops, sorry yeah missed a square bracket.
Try this:

Code: Select all

bind pub - "!voice" scan:and:voice

proc scan:and:voice {nick uhost hand chan text} {
 if {([botisop $chan])} {; set oplist [list]
 putserv "PRIVMSG $chan :Scanning $chan for *!*@*.au users..."
 foreach user [chanlist $chan] {
  if {([string match "*.au" [lindex [split [getchanhost $user $chan] "@"] 1]])} {
   lappend oplist $user }
   }
   putserv "PRIVMSG $chan :Scanning complete."
   if {([llength $oplist] == 0)} { putserv "PRIVMSG $chan :No users matching *!*@.au found"; return 0 }
   if {([llength $oplist] > 5)} { putserv "PRIVMSG $chan :Found '5' or more users matching *!*@.au. Voicing the first 5 found."
    set oplist [lrange $oplist 0 4] }
    putserv "MODE $chan +vvvvv [join $oplist]"; return 0
    }
}
Thanks awyeah. It's work perfectly fine now. But what's make the TCL uncomplete is that I notice the bot only voice the first 5 of the channel nicklist, and the other users (nick below the first 5) which have *!*@*.au ISP doesn't get a voice after I did a second round of "!voice".
+ Stealth Box +
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Well, yeah then you would have to check those users, if they aren't already voiced then go ahead make a list, and voice the users in the list. Otherwise it will keep voicing the previous users untill another new user with the same IP joins in the channel and is amongst the first five.

To make it work like that,

replace:

Code: Select all

 if {([string match "*.au" [lindex [split [getchanhost $user $chan] "@"] 1]])} { 
with:

Code: Select all

 if {([string match "*.au" [lindex [split [getchanhost $user $chan] "@"] 1]]) && (![isvoice $user $chan])} { 
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
User avatar
Stealthx
Halfop
Posts: 68
Joined: Fri Oct 01, 2004 3:37 am
Location: StealthBox

Post by Stealthx »

Thank you, awyeah! It's working perfectly now.
Cheers.
+ Stealth Box +
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Not a problem. However if you just want to voice users with a certain ips.
You can make a script to perform:

Code: Select all

!voice *!*@.isp.com
Which would be more easier and you woudn't need to edit the script everytime. Plus if you want to voicing all users it is better than voicing 5 users each time, when you type !voice, !voice uptill all users are voiced.

It can be noted that, !voiceall *!*@*.isp.com will voice all people with the matching host, !voice *!*@.isp.com 8 will only voice 8 users matching that host and so on you can make a script according to your needs.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
User avatar
Stealthx
Halfop
Posts: 68
Joined: Fri Oct 01, 2004 3:37 am
Location: StealthBox

Post by Stealthx »

awyeah wrote:Plus if you want to voicing all users it is better than voicing 5 users each time, when you type !voice, !voice uptill all users are voiced.

It can be noted that, !voiceall *!*@*.isp.com will voice all people with the matching host, !voice *!*@.isp.com 8 will only voice 8 users matching that host and so on you can make a script according to your needs.
That's a great idea. But how do I edit it from the previous code if I want it to scan the entire channel and voice all within 1 time?
+ Stealth Box +
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Well you can do that and you would only need to remove some lines in the script.

Code: Select all

bind pub - "!voice" scan:and:voice

proc scan:and:voice {nick uhost hand chan text} {
 if {([botisop $chan])} {; set oplist [list]
 putserv "PRIVMSG $chan :Scanning $chan for *!*@*.au users..."
 foreach user [chanlist $chan] {
  if {([string match "*.au" [lindex [split [getchanhost $user $chan] "@"] 1]]) && (![isvoice $user $chan])} { 
   lappend oplist $user } }
   putserv "PRIVMSG $chan :Scanning complete."
    if {([llength $oplist] == 0)} { putserv "PRIVMSG $chan :No users matching *!*@.au found in $chan."; return 0 }
    if {([llength $oplist] >= 1)} {
    putserv "PRIVMSG $chan :Found '[llength $oplist] users' matching *!*@.au found in $chan."
     foreach person $oplist {
      pushmode "MODE $chan +v $person"
      }; flushmode $chan
    }; return 0
  }
} 
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
User avatar
Stealthx
Halfop
Posts: 68
Joined: Fri Oct 01, 2004 3:37 am
Location: StealthBox

Post by Stealthx »

Ok, try out the latest coding and got this when I typed .tcl set errorInfo
Tcl: wrong # args: should be "pushmode channel mode ?arg?"
Tcl: while executing
Tcl: "pushmode "MODE $chan +v $person" "
Tcl: (procedure "scan:and:voice" line 12)
Tcl: invoked from within
Tcl: "scan:and:voice $_pub1 $_pub2 $_pub3 $_pub4 $_pub5"
+ Stealth Box +
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

My bad.
/me *whacks* himself with a trout.

Replace:

Code: Select all

     pushmode "MODE $chan +v $person" 
with:

Code: Select all

     pushmode $chan +v $person
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
User avatar
Stealthx
Halfop
Posts: 68
Joined: Fri Oct 01, 2004 3:37 am
Location: StealthBox

Post by Stealthx »

awyeah wrote:My bad.
/me *whacks* himself with a trout.

Replace:

Code: Select all

     pushmode "MODE $chan +v $person" 
with:

Code: Select all

     pushmode $chan +v $person
Cool, it's working perfectly well again! :mrgreen: A million thanks to you for ya great help. :lol:
+ Stealth Box +
Locked