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.

Help with using setudef and if {[channel get

Help for those learning Tcl or writing their own scripts.
Post Reply
m
monie089
Halfop
Posts: 76
Joined: Sat Jul 29, 2006 11:13 pm

Help with using setudef and if {[channel get

Post by monie089 »

I tried doing

setudef flag nofriendcode
in this script

Code: Select all

proc NintendoXG:code {nick uhost hand chan arg} {
global nxg
if {[channel get $chan nofriendcode]} {
putserv "NOTICE $nick :\002\037Error: This command is disabled for $chan\002\037"
return
}
   ## change this a bit...make sure we have 2 elements
   if {[llength [split $arg]] != 2} { 
      putserv "NOTICE $nick :\002SYNTAX:\002 [string trim $nxg(char)]Help Code"; return
   }
   foreach {name game} [split $arg] {break}
   set list [split [read [set fd [open $::nxg(gamefile) r]]] \n]; close $fd
  if {![llength [set matches [lsearch -all -inline -glob $list [md5 [string tolower $name]]*]]]} {
      putserv "NOTICE $nick :The user: $name couldn't be found in the NintendoXG Database."; return
   }
  foreach match $matches {
     foreach {x gm code} $match {
         if {[string equal -nocase $gm $game]} {
             putserv "NOTICE $nick :--- $name's Friendcode ---"
             putserv "NOTICE $nick :Game: $gm -- Code: $code"
         }
     }
  }  
}
But that isnt working
New server irc.NintendoXG.com come and visit
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

did you do

.chanset #channelname +nofriendcode
m
monie089
Halfop
Posts: 76
Joined: Sat Jul 29, 2006 11:13 pm

Post by monie089 »

It still doesnt work yes I have done that.
New server irc.NintendoXG.com come and visit
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

Code: Select all

bind pub - .crap crapcode
setudef flag crapcode
proc crapcode {nick uhost hand chan arg} {
if {[channel get $chan crapcode]} {
putserv "NOTICE $nick :\002\037Error: This command is disabled for $chan\002\037"
return
}
}
[dcc(bot)] .chanset #crapchan +crapcode
[bot(dcc)] Successfully set modes { +crapcode } on #crapchan.

/msg #crapchan .crap
[NOTICE: bot- Error: This command is disabled for #crapchan


Worked for me.
Post Reply