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.

script for multivoice

Old posts that have not been replied to for several years.
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

ceasar... read the FAQ.......

You should NOT do list commands on a string. $arg is a string.. llength is a list-command. This means you have to do [llength [split $arg]] to make it correct..

this is basic tcl-coding and you should have understood this by now ;)
.. if not maybe you should take a second look at some of the tcl-tutorials online?

string tolwer is used ... ie when you want to make a match without upper/lowercase difference.
bLa == bla <-- false
[string tolower bLa] == bla <-- true
Elen sila lúmenn' omentielvo
j
jam

Post by jam »

thanks for everything but for me doesn't work, i get a notice in which there is " Usage: !v nick1 nick2 nick3" but nothing happens on the chan.
i hope you will go on helping me , thank you again :wink:
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

hehe of course you do :)

Code: Select all

if {[llength $arg] > 0} {
should be

Code: Select all

if {[llength [split $arg]] == 0} {
Elen sila lúmenn' omentielvo
j
jam

Post by jam »

sorry but it still doesn't work. i have this message in the party-line

Code: Select all

Tcl error [pub:v]: can't set "botnick": read-only variable
:cry:
User avatar
GodOfSuicide
Master
Posts: 463
Joined: Mon Jun 17, 2002 8:00 pm
Location: Austria

Post by GodOfSuicide »

Code: Select all

set botnick [string tolower $botnick] 
would overwrite the global var $botnick with it's lowercase version..

change it to

Code: Select all

set botnick2 [string tolower $botnick]
and replace every following $botnick with $botnick2

i have no running eggie atm, but i think that will work.
j
jam

Post by jam »

i don't have a mistake message anymore but it still doesn't work :cry:
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Actualy I've said earlyer that there is no need for the 'botnick' thing. Here is the *bug free* version that should work fine:

Code: Select all

bind pub o|o !v pub:v 

proc pub:v {nick host handle channel arg} { 
  if {[llength [split $arg]] == 0} {
    putserv "NOTICE $nick :\002Usage:\002 !v <nick1> \[nick2\] \[nick3\] .. etc." 
  return 0 }
  if {![botisop $channel]} { 
    putserv "NOTICE $nick :I'm not oped in $channel." 
  return 0 } 
  foreach user [split $arg] {
    if {![onchan $user $channel] || [isop $user $channel] || [isvoice $user $channel]} { continue } 
    pushmode $channel +v $user 
  } 
}
I'm a bit rusty.. :) Got to consult again the manual..
Once the game is over, the king and the pawn go back in the same box.
j
jam

Post by jam »

it works !! :D :D :D :D :D thank you caesar and everybody else for your help and your patience
see you :wink: :D :D
Locked