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.

a little statistics problem

Old posts that have not been replied to for several years.
Locked
S
S0nnY
Voice
Posts: 8
Joined: Tue Sep 07, 2004 9:52 am
Location: Germany

a little statistics problem

Post by S0nnY »

hi i have written an script but now i have a little problem

Code: Select all

bind pub - "!mofa" mofaproc
proc mofaproc {nick host hand chan arg} {
  set cmd [split $arg]
  set cmd0 [lindex $cmd 0]
  set cmd1 [lindex $cmd 1]
  set cmd2 [lindex $cmd 2]
    if {$cmd0 == "stats"} {
      if { $cmd1 == "" } { 
        putserv "NOTICE $nick :statsglobal notice" 
      } elseif { $cmd1 == "+c" } { 
         putserv "PRIVMSG $chan :statsglobal privmsg" 
      } elseif { $cmd1 == "[string match "#*" $cmd1]" && $cmd2 == "+c" } { 
        putserv "PRIVMSG $chan :chanstats privmsg " 
      } elseif { $cmd1 == "[string match "#*" $cmd1] " && $cmd2 == "" } { 
        putserv "NOTICE $nick :chanstats notice" 
      } elseif { $cmd1 != "[string match "#*" $cmd1]" && $cmd2 == "+c" } { 
        putserv "PRIVMSG $chan :nickstats privmsg" 
      } elseif { $cmd1 != "[string match "#*" $cmd1]" && $cmd2 == "" } { 
        puterv "NOTICE $nick :nickstats notice" 
      } else { 
        putserv "PRIVMSG $chan :just type a typ" 
    }
  }
}
when i type noting or the nick everything works but when i type the channel (including # as first sign) he will give me the nickstats.
my script is only a little example because my script is to big to post it all but the if clauses are the same.
thx 4 help
S0nnY


whet i give him
S
Schlaefer
Voice
Posts: 1
Joined: Tue Jul 05, 2005 4:25 pm

Post by Schlaefer »

... $cmd1 == "[string match "#*" $cmd1] ...

hier ist der fehler

in der var "$cmd1" steht denk ich mal "#channel" und "[string match "#*" $cmd1]" steht dann entweder "1" oder "0".

1 - für ja da ist eine # in der var
0 - für nein da ist keine # in der fahr

"$cmd1 == "[string match "#*" $cmd1]" verglicht die beiden sachen-

ist "#channel" = "1"/ "0" dann mache ... } else {
oder das }

} elseif {[string match "#*" $cmd1] " && $cmd2 == "" } {
währe dann richtig weil er sagt "ist eine # in der variable dann mache ...."

ich hoffe ich konnte dir es ein bischen erklähren

Cu Schlaefer

PS: ich wei das s0nny deutscher is deswegen in deutsch :D
g
greenbear
Owner
Posts: 733
Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway

Post by greenbear »

keke?
Locked