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.

i wonder if ..........

Old posts that have not been replied to for several years.
Locked
P
Pitchat
Op
Posts: 122
Joined: Tue Feb 18, 2003 11:24 pm
Location: Hebertville Quebec Canada
Contact:

i wonder if ..........

Post by Pitchat »

Hi

i wonder if it is possible to do a command like .chut (handle) and it cuts the ability for this person to say something in partyline until i type .chut (handle ) off ??

thanks for all advice that may be handy

Pitchat
User avatar
duofruo
Halfop
Posts: 94
Joined: Thu Oct 23, 2003 3:17 pm
Location: Ploiesti@.ro
Contact:

Post by duofruo »

I think u may remove the +p ability of that person

It`s an idea i dont know for user, i am new in eggdrop.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Use the bind filt and a certain flag (in this case M) like this:

Code: Select all

bind filt - ".status *" dcc:allow

proc dcc:allow {idx args} { 
  set usernick [idx2hand $idx]
  if {[lindex $args 1] == ""} { 
    set icmd [lindex $args 0]
    set args "$icmd "
  }
  if {![matchattr $usernick M]} {
    putdcc $idx "What? You need '.help'"
    } else {
    return $args
  }
}
Once the game is over, the king and the pawn go back in the same box.
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Re: i wonder if ..........

Post by user »

This will make the user defined flag P required to speak on the partyline (or any other botnet channel):

Code: Select all

bind filt - * chatChk
proc chatChk {i t} {
  if {[catch {getchan $i}]||[string match .* $t]||[matchattr [idx2hand $i] P]} {set t}
}
Have you ever read "The Manual"?
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

It would be more practical to make it so chattr'ing a user with a flag would mean that they can't speak on the partyline.. As if you have 300 users, you wouldn't want to chattr each one with +P just so they can speak on the partyline, when all you want to do is mute a few select users...
ie.

Code: Select all

bind filt - * chatChk 
proc chatChk {i t} { 
  if {[catch {getchan $i}]||[string match .* $t]||![matchattr [idx2hand $i] M]} {set t} 
} 
So this would mean +M users would not be able to speak on the partyline.
P
Pitchat
Op
Posts: 122
Joined: Tue Feb 18, 2003 11:24 pm
Location: Hebertville Quebec Canada
Contact:

Post by Pitchat »

so is it possible tu bind this to a command like .chut (nick ) and it will put the +m flag to the (nick) and remove ihis ability to speak on the partyline ?
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

all you need to do is .chattr <handle> +M

but, yes, you can make an alias for doing this, for use with the previous mentioned code:

Code: Select all

bind dcc n chut dcc:chut
proc dcc:chut {hand idx text} {
  if {[set chuthand [lindex [split $text] 0]] == ""} {
    putdcc $idx "Usage: .chut <handle>"
    return 0
  } elseif {![validuser $chuthand]} {
    putdcc $idx "Invalid user ${chuthand}!"
    return 0
  } elseif {[set onoff [string tolower [lindex [split $text] 1]]] == "on"} {
    if {[matchattr $chuthand M]} {
      putdcc $idx "User $chuthand is already muted."
      return 0
    }
    chattr $chuthand +M
    putdcc $idx "User $chuthand is now muted."
  } elseif {$onoff == "off"} {
    if {![matchattr $chuthand M]} {
      putdcc "$idx "User $chuthand is not muted."
      return 0
    }
    chattr $chuthand -M
    putdcc $idx "User $chuthand is no longer muted."
  }
  set res 1  
}
Last edited by strikelight on Sat Oct 25, 2003 8:50 pm, edited 1 time in total.
P
Pitchat
Op
Posts: 122
Joined: Tue Feb 18, 2003 11:24 pm
Location: Hebertville Quebec Canada
Contact:

Post by Pitchat »

great it works but to remove the "chut" what i have to do is .chattr nick -M is it right ? ( cause .-chut nick doesnt work)
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

Pitchat wrote:great it works but to remove the "chut" what i have to do is .chattr nick -M is it right ? ( cause .-chut nick doesnt work)
i modified the code to reflect this..

you do '.chut <handle> on' to mute and '.chut <handle> off' to unmute.
P
Pitchat
Op
Posts: 122
Joined: Tue Feb 18, 2003 11:24 pm
Location: Hebertville Quebec Canada
Contact:

Post by Pitchat »

great ! sorry not to have read carefully the last time i have one more simple request , when i do .chut (handle) on i`d like the user to be warn that he is currently under the ".chut " but a putdcc $chuthand doesnt work how can i do that ?

thanks
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

If you mean do notice the user IF they are on the partyline when .chut is called upon them, then you would make the code:

Code: Select all

bind dcc n chut dcc:chut 
proc dcc:chut {hand idx text} { 
  if {([set chuthand [lindex [split $text] 0]] == "") || (([set onoff [string tolower [lindex [split $text] 1]]] != "on") && ($onoff != "off"))} { 
    putdcc $idx "Usage: .chut <handle> <on|off>" 
    return 0 
  } elseif {![validuser $chuthand]} { 
    putdcc $idx "Invalid user ${chuthand}!" 
    return 0 
  } elseif {$onoff == "on"} { 
    if {[matchattr $chuthand M]} { 
      putdcc $idx "User $chuthand is already muted." 
      return 0 
    } 
    chattr $chuthand +M
    if {[set chidx [hand2idx $chuthand]] > -1} {
      putdcc $chidx "You have now been muted at request of $hand."
    }
    putdcc $idx "User $chuthand is now muted." 
  } elseif {$onoff == "off"} { 
    if {![matchattr $chuthand M]} { 
      putdcc "$idx "User $chuthand is not muted." 
      return 0 
    } 
    chattr $chuthand -M 
    if {[set chidx [hand2idx $chuthand]] > -1} {
      putdcc $chidx "You have been unmuted at request of $hand."
    }
    putdcc $idx "User $chuthand is no longer muted." 
  } 
  set res 1  
} 
If you mean they get a notice whenever they try to type on the partyline:

Code: Select all

bind filt - * chatChk 
proc chatChk {i t} { 
  if {[catch {getchan $i}]||[string match .* $t]||![matchattr [idx2hand $i] M]} {
    set t
  } else {
    putdcc $i "You are currently muted and not allowed to speak on the partyline."
    set res ""
  }
} 
Locked