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.

Snotice shun

Help for those learning Tcl or writing their own scripts.
b
bwkzb
Voice
Posts: 16
Joined: Sun Mar 12, 2017 4:26 am

Post by bwkzb »

thanks a lot to everybody who help me :D
Y
Yusif
Voice
Posts: 34
Joined: Fri Aug 18, 2023 11:08 am

Post by Yusif »

hello guys, can anyone please do some edit here:

Code: Select all

bind raw - notice shun-snotice

proc shun-snotice {from keyword arg} {
 if {![string match -nocase "*shun added*" $arg]} { return }
   set shun [lrange $arg 1 end]
   putserv "privmsg #shuned :$shun"
}


bind pub o !shun pub:shun

proc pub:shun {nick host hand chan text} {
  set text [regsub -all -- {\s{2,}} [string trim [stripcodes * $text]] { }]
  set text [split $text]
  if {![llength $text]} { putnow "NOTICE $nick :Syntax\: !shun nick" ; return 0 }

  set target [lindex $text 0]
  if {![onchan $target $chan]} { putnow "NOTICE $nick :$target is not on $chan" ; return 0 }

  if {[isbotnick $target] || [isop $target $chan] || [ishalfop $target $chan]} { return 0 }
  if {[matchattr [nick2hand $target $chan] o|o $chan]} { return 0 }

  set tiempo [lindex $text 1]
  set reason [join [lrange $text 2 end]]

  if {$tiempo ne "" && ![regexp -nocase {^[1-9][0-9]*[dhms]$} $tiempo] && $tiempo != 0} {
    set reason [string trim "$tiempo $reason"]
    set tiempo ""
  }

  if {$tiempo eq ""} { set tiempo "1h"  }
  if {$reason eq ""} { set reason "$tiempo shun for abuse/behaviour"  }

  putquick "shun $target $tiempo $reason"
  return 0
}
first: need it work from #botop rooms only for opers/globalops
second: send confirm msg. to #botop channel the shun added
third: add option to remove shun with confirm msg to #botop the shun removed

thanks
s
simo
Revered One
Posts: 1107
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

see if this works :

Code: Select all



set monchan #botop

bind raw - notice shun-snotice

proc shun-snotice {from keyword arg} {
 if {[string match -nocase "*shun*" $arg]} { 
   set shun [lrange $arg 1 end]
   putserv "privmsg $::monchan :$shun"
  }
}

bind pub -|- !shun pub:shun


proc pub:shun {nick host hand chan text} {
 if {![string equal -nocase $chan "$::monchan"]} { return 0 }
  if {![isbotnick $nick] && ![isop $nick $chan] && ![ishalfop $nick $chan] && ![matchattr [nick2hand $nick $chan] o|- $chan]} { return 0 }
  set text [regsub -all -- {\s{2,}} [string trim [stripcodes * $text]] { }]
  set text [split $text]
  if {![llength $text]} { putnow "NOTICE $nick :Syntax\: !shun nick" ; return 0 }

  set target [lindex $text 0]


  if {[isbotnick $target] || [isop $target $chan] || [ishalfop $target $chan]} { return 0 }
  if {[matchattr [nick2hand $target $chan] o|o $chan]} { return 0 }

  set duration [lindex $text 1]
  set reason [join [lrange $text 2 end]]

  if {$duration ne "" && ![regexp -nocase {^[1-9][0-9]$} $duration] && $duration != 0} {
    set reason [string trim "$duration $reason"]
    set duration ""
  }

  if {$duration eq ""} { set duration "3600"  }
  if {$reason eq ""} { set reason "$duration shun for abuse/behaviour"  }

  putquick "shun $target $duration :$reason"
  return 0
}





bind pub -|- !remshun pub:remove-shun

proc pub:remove-shun {nick host hand chan text} {
 if {![string equal -nocase $chan "$::monchan"]} { return 0 }
 if {![isbotnick $nick] && ![isop $nick $chan] && ![ishalfop $nick $chan] && ![matchattr [nick2hand $nick $chan] o|- $chan]} { return 0 }
  set text [regsub -all -- {\s{2,}} [string trim [stripcodes * $text]] { }]
  set text [split $text]
  if {![llength $text]} { putnow "NOTICE $nick :Syntax\: !shun nick" ; return 0 }

  set target [lindex $text 0]


  if {[isbotnick $target] || [isop $target $chan] || [ishalfop $target $chan]} { return 0 }
  if {[matchattr [nick2hand $target $chan] o|o $chan]} { return 0 }

  putquick "shun -$target"
  return 0
}


 

about the : first: need it work from #botop rooms only for opers/globalops

its best to set channel to +O to make sure only opers are in it to use it as eggdrop wouldnt have a way to check who is oper and who isnt besides some over-complex method perhaps also the nick u want to set shun on or off should be online on the ircd else it wont work as the ircd uses the nick to lookup the host to set shun on or off.
Y
Yusif
Voice
Posts: 34
Joined: Fri Aug 18, 2023 11:08 am

Post by Yusif »

thank you simo
simo wrote:see if this works :
works perfect but the issue confirm msg came from irc not from the script by botnet and it reveal usre's real ip

Code: Select all

<!Autobot> :tkl.TKL_ADD {[info]} Shun added: '*@x.xx.xx.xxx' {[reason:} 3600 shun for abuse/behaviour\] {[by:} Autobot!Autobot@bot.xxxxx.com\] {[duration:} 1h\]

Code: Select all

<!Autobot> :tkl.TKL_DEL {[info]} Shun removed: '*@x.xx.xx.xxx' {[reason:} 3600 shun for abuse/behaviour\] {[by:} Autobot!Autobot@bot.xxxxx.com\] {[set} at: Wed Sep 27 13:19:49 2023 GMT\]
the confirm msg just need it like :

<!Autobot> Shun added on nick for 1h by Yusif ,... instead showen ip
<!Autobot> Shun removed on nick by Yusif

i need it show which (opers/globalop) made shun/remshun over Autobot not Autobot itself

thanks again
s
simo
Revered One
Posts: 1107
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »


the confirm msg just need it like :

<!Autobot> Shun added on nick for 1h by Yusif ,... instead showen ip
<!Autobot> Shun removed on nick by Yusif
the reason i use the output from the IRCD is so u can see what the actuall shun that is set and also to confirm that its actually set.
Y
Yusif
Voice
Posts: 34
Joined: Fri Aug 18, 2023 11:08 am

Post by Yusif »

simo wrote: the reason i use the output from the IRCD is so u can see what the actuall shun that is set and also to confirm that its actually set.
output already from ircd showen in #netlog , but in #botops where we do all commands over botnet , for that i hope the confirm msg. from the shun script in #botops atleast not showen real ip if not possible to make it like:

<!Autobot> Shun added on nick for 1h by Yusif



thanks again
s
simo
Revered One
Posts: 1107
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

you could try this :

Code: Select all


set monchan #botop


bind pub -|- !shun pub:shun


proc pub:shun {nick host hand chan text} {

 if {![string equal -nocase $chan "$::monchan"]} { return 0 }
 if {![isbotnick $nick] && ![isop $nick $chan] && ![ishalfop $nick $chan] && ![matchattr [nick2hand $nick $chan] o|- $chan]} { return 0 }

  set text [regsub -all -- {\s{2,}} [string trim [stripcodes * $text]] { }]
  set text [split $text]

 if {![llength $text]} { putnow "NOTICE $nick :Syntax\: !shun nick" ; return 0 }

  set target [lindex $text 0]

  if {[isbotnick $target] || [isop $target $chan] || [ishalfop $target $chan]} { return 0 }
  if {[matchattr [nick2hand $target $chan] o|o $chan]} { return 0 }

  set duration [lindex $text 1]
  set reason [join [lrange $text 2 end]]

  if {$duration ne "" && ![regexp -nocase {^[1-9][0-9]$} $duration] && $duration != 0} {
    set reason [string trim "$duration $reason"]
    set duration ""
  }

  if {$duration eq ""} { set duration "3600"  }
  if {$reason eq ""} { set reason "$duration shun for abuse/behaviour"  }

  putquick "privmsg $chan :Shun added on $target for $duration by $nick"
  putquick "shun $target $duration :$reason"

  return 0
}





bind pub -|- !remshun pub:remove-shun

proc pub:remove-shun {nick host hand chan text} {

 if {![string equal -nocase $chan "$::monchan"]} { return 0 }
 if {![isbotnick $nick] && ![isop $nick $chan] && ![ishalfop $nick $chan] && ![matchattr [nick2hand $nick $chan] o|- $chan]} { return 0 }

  set text [regsub -all -- {\s{2,}} [string trim [stripcodes * $text]] { }]
  set text [split $text]

 if {![llength $text]} { putnow "NOTICE $nick :Syntax\: !shun nick" ; return 0 }
  set target [lindex $text 0]

   putquick "privmsg $chan :Shun removed on $target by $nick"
   putquick "shun -$target"
   return 0
}


Y
Yusif
Voice
Posts: 34
Joined: Fri Aug 18, 2023 11:08 am

Post by Yusif »

thank you simo , it gives duplicate confirm msg

Code: Select all

<!Autobot> Shun added on Just4U for 3600 by Yusif
what exactly needed

also still give msg from ircd which show real ip

Code: Select all

<!Autobot> :tkl.TKL_ADD {[info]} Shun added: '*@x.xx.xx.xxx' {[reason:} 3600 shun for abuse/behaviour\] {[by:} Autobot!Autobot@bot.xxxxx.com\] {[duration:} 1h\]
what need to to be prevent in #botop
same way for remove shun


thanks again
s
simo
Revered One
Posts: 1107
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

im not sure i understand what you mean
Y
Yusif
Voice
Posts: 34
Joined: Fri Aug 18, 2023 11:08 am

Post by Yusif »

simo wrote:im not sure i understand what you mean
sorry simo

what i mean , we want stop this msg in #botop when one do !shun nick

Code: Select all

<!Autobot> :tkl.TKL_ADD {[info]} Shun added: '*@x.xx.xx.xxx' {[reason:} 3600 shun for abuse/behaviour\] {[by:} Autobot!Autobot@bot.xxxxx.com\] {[duration:} 1h\]
need to prevent the output from the IRCD
s
simo
Revered One
Posts: 1107
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

remove :

Code: Select all


bind raw - notice shun-snotice

proc shun-snotice {from keyword arg} {
 if {[string match -nocase "*shun*" $arg]} {
   set shun [lrange $arg 1 end]
   putserv "privmsg $::monchan :$shun"
  }
}

Y
Yusif
Voice
Posts: 34
Joined: Fri Aug 18, 2023 11:08 am

Post by Yusif »

simo wrote:remove :

Code: Select all


bind raw - notice shun-snotice

proc shun-snotice {from keyword arg} {
 if {[string match -nocase "*shun*" $arg]} {
   set shun [lrange $arg 1 end]
   putserv "privmsg $::monchan :$shun"
  }
}

g'evening simo , that part removed but msg still coming from ircd
s
simo
Revered One
Posts: 1107
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

g'evening simo , that part removed but msg still coming from ircd

that has nothing to do with eggdrop but with ircd settings and the snomasks set for opers.
Y
Yusif
Voice
Posts: 34
Joined: Fri Aug 18, 2023 11:08 am

Post by Yusif »

simo wrote:
g'evening simo , that part removed but msg still coming from ircd

that has nothing to do with eggdrop but with ircd settings and the snomasks set for opers.
though of that if not from eggdrop config setting


thank you simo, much appreciated
s
simo
Revered One
Posts: 1107
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

heres some info on it: https://www.unrealircd.org/docs/Snomasks

snomask b seems responsible for the output of set shuns if you are running unrealircd 6
Post Reply