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.

error mass tcl

Help for those learning Tcl or writing their own scripts.
Post Reply
p
pilouuu
Halfop
Posts: 82
Joined: Mon Dec 26, 2005 8:03 pm

error mass tcl

Post by pilouuu »

Hi :)

Script:

Code: Select all

##########################################################################
# mass.tcl by ShakE <shake@abv.bg>		                         #
##########################################################################
# Dobavq na bota funkcii ot roda: !mass <deop/op/voice/devoice>		 #
##########################################################################
# Ako imate nqkakvi vaprosi, predlojenia ili kritiki posetete foruma na	 #
# http://shake.hit.bg i pi6ete tam!                                      #
##########################################################################
###################### Ottuk nadolu ne butaite nishto! ###################

bind pub n !mass pub_mass
proc pub_mass {nick uhost hand chan txt} {
 global botnick
 set $opc_cmd [lindex $txt 0]
 if {$opc_cmd == deop} {
  putserv "notice $nick :Making mass deop in $chan..."
  foreach muser [chanlist $chan] {
   if {$muser != $botnick || ![matchattr $muser b] || [isop $muser $chan]} {
   }
  }
 }
 if {$opc_cmd == op} {
  putserv "notice $nick :Making mass op in $chan..."
  foreach muser [chanlist $chan] {
   if {$muser != $botnick || ![matchattr $muser b] || ![isop $muser $chan]} {
    putserv "mode $chan +o $muser"
   }
  }
 }
 if {$opc_cmd == voice} {
  putserv "notice $nick :Making mass voice in $chan..."
  foreach muser [chanlist $chan] {
   if {$muser != $botnick || ![matchattr $muser b] || ![isvoice $muser $chan]} {
    putserv "mode $chan +v $muser"
   }
  }
 }
 if {$opc_cmd == devoice} {
  putserv "notice $nick :Making mass devoice in $chan..."
  foreach muser [chanlist $chan] {
   if {$muser != $botnick || ![matchattr $muser b] || ![isvoice $muser $chan]} {
    putserv "mode $chan -v $muser"
   }
  }
 }
 if {$opc_cmd == ""} {
  putserv "notice $nick :Syntax error: !mass <op/deop/voice/devoice>"
  return 0
 }
}
putlog "mass.tcl by ShakE (more tcls at http://shake.hit.bg)"


error on command !mass op or deop ...
Tcl error [pub_mass]: syntax error in expression "$opc_cmd == deop": variable references require preceding $


Please help me :) THX for all help
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

include comparison strings in quotes, like this:

Code: Select all

if {$foo == "bar"} {
...
and don't use scripts whose authors didn't even bother to test

needless to say, this particular script should not be used at all, it's too lame for any sane purpose
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use

Code: Select all

 tag when posting logs, code
p
pilouuu
Halfop
Posts: 82
Joined: Mon Dec 26, 2005 8:03 pm

Post by pilouuu »

thx for help!!!! (k)
Post Reply