egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

mute

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
Ecimo
Voice


Joined: 27 Dec 2005
Posts: 5

PostPosted: Sat Mar 11, 2006 3:53 pm    Post subject: mute Reply with quote

Code:
set mutedhosts ""

bind join -|- * myavoice
bind PUB -|- !mute mymute
bind PUB -|- !demute demute2

proc myavoice {n u h c} {
  if {![string equal -nocase $c "#game-fair.dk"]} {return}
  global mutedhosts
  if {[lsearch -exact $mutedhosts $u] == 1} {
    puthelp "PRIVMSG $c :\002$n\002 (\002*!*$u\002) have been a bad boy, You have to wait 2 mins."
  } else { pushmode $c +v $n }
}

proc mymute {n u h c a} {
  if {![string equal -nocase $c "#game-fair.dk"] || ![isop $n $c]} {return}
  global mutedhosts
  foreach v [split $a] {
    if {[onchan $v $c]} {
      lappend mutedhosts [set uh [getchanhost $v $c]]
      pushmode $c -v $v
      utimer 120 [list demute $v $uh $c]
    }
  }
}

proc demute2 {n u h c a} {
  if {![string equal -nocase $c "#game-fair.dk"] || ![isop $n $c] || ![onchan $a $c]} {return}
  foreach v [split $a] {
  demute $v [getchanhost $v $c] $c
  }
}

proc demute {n h c} {
  global mutedhosts
  if {[set pos [lsearch -exact $mutedhosts $h]] == -1} {return}
  while {[set pos [lsearch -exact $mutedhosts $h]] != -1} {
    set mutedhosts [lreplace $mutedhosts $pos $pos]]
  }
  if {[onchan $n $c]} {
    pushmode $c +v $n
    } {
    foreach curuser [chanlist $c] {
      if {[getchanhost $curuser] == $h && ![isvoice $curuser $c]} {pushmode $c +v $curuser}
    }
  }
}


Bug 1:
«20:49:00» {@Mulle^:#game-fair.dk} !mute fishbot
«20:49:01» « Mode » {[Game-Fair]} sets {-v fishbot}
«20:49:04» « Kick » {fishbot} was kicked by {Mulle^} {{me off is one of your skills @ 27th}}
«20:49:07» « {fishbot} has been invited to join {#game-fair.dk}
«20:49:07» « Join » {fishbot} {fish@go.moo.oh.yes.they.do} {Clones: 0 @ n/a}
«20:49:07» » fishbot:#game-fair.dk m00s contentedly at Mulle^.
«20:49:14» « Mode » {[Game-Fair]} sets {+v fishbot}

it didnt msg the channel it sould do

Bug 2:
«20:11:53» {@Mulle^:#game-fair.dk} !mute [S]CZukini`bnc fishbot
«20:12:02» « GM highlighted you in #tcl: loc-: i was talking to Mulle^
«20:12:15» « Mode » {[Game-Fair]} sets {-vv [S]CZukini`bnc fishbot}
«20:13:54» « Mode » {[Game-Fair]} sets {+v [S]CZukini`bnc}

why dont it voice both?

now i looked over it for like 7-8 hours cant find the bug!
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sat Mar 11, 2006 7:55 pm    Post subject: Reply with quote

Code:
if {[lsearch -exact $mutedhosts $u] == 1} {

This means if $u is the 2nd element in the list $mutedhosts then perform... I guess you mean
Code:
if {[lsearch -exact $mutedhosts $u] != -1} {

this means if $u exists in $mutedhosts then ...
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
Ecimo
Voice


Joined: 27 Dec 2005
Posts: 5

PostPosted: Sun Mar 12, 2006 6:20 am    Post subject: Reply with quote

Code:
proc myavoice {n u h c} {
  if {![string equal -nocase $c "#game-fair.dk"]} {return}
  global mutedhosts
  if {[lsearch -exact $mutedhosts $u] == -1} {
    pushmode $c +v $n
  } else { puthelp "PRIVMSG $c :\002$n\002 (\002*!*$u\002) have been a bad boy, You have to wait 2 mins." }
}

somehow it just started to work (i had tryed that one befor)

but i still wish to sold Bug 2:
«11:15:43» {@Mulle^:#game-fair.dk} !mute l0rn|Mortar^off l0rn|RR^Off
«11:15:44» « Mode » {[Game-Fair]} sets {-vv l0rn|Mortar^off l0rn|RR^Off}
«11:17:43» « Mode » {[Game-Fair]} sets {+v l0rn|Mortar^off}
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber