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 

how to get the reason from trigger command

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
Gulio
Halfop


Joined: 01 Nov 2020
Posts: 73

PostPosted: Sat Jul 17, 2021 10:10 am    Post subject: how to get the reason from trigger command Reply with quote

I want to get on notice new reason i added like the first command .shun Dorian 2 . relax also and to shun multi nick like default .shun Dorian Emilia Jolee and .shun Dorian Emilia Jolee 20 . reason
in first notice msg reason is come as default reason not the reason "relax"
If someone can help thx in advance



Triiger Command:

Code:

[16:43:48] <Giulio> .shun Dorian 2 . relax
[16:44:05] <Giulio> .shun Emilia
[16:45:18] <Giulio> .shun Jolee 3


how need to be the reason for this comand <Giulio> .shun Dorian 2 . relax

Code:

Shun added for *@72.221.164.34 on Sat Jul 17 13:43:51 2021 GMT (from Bot to expire at Sat Jul 17 13:45:51 2021 GMT: SHUN for Dorian - Reson: relax - Time: 2 min. )



Notice action shun:

Code:

Shun added for *@72.221.164.34 on Sat Jul 17 13:43:51 2021 GMT (from Bot to expire at Sat Jul 17 13:45:51 2021 GMT: SHUN for Dorian - Reson: Abusers - Time: 2 min. )
Shun added for *@72.195.114.184 on Sat Jul 17 13:44:08 2021 GMT (from Bot to expire at Sat Jul 17 13:49:08 2021 GMT: SHUN for Emilia - Reson: Abusers - Time: 5 min. )
Shun added for *@98.162.25.7 on Sat Jul 17 13:45:21 2021 GMT (from Bot to expire at Sat Jul 17 13:48:21 2021 GMT: SHUN for Jolee - Reson: Abusers - Time: 3 min. )


Script:

Code:

bind pub -|- .shun proc_shun

proc proc_shun {nick host hand chan text} {
   if {![onchan $nick #Oper ]} { return }
   set nick [lindex [split $text] 0]
   set reason [join [lrange [split $text "."] 1 end] "."]
   set text  [lindex [split $text "."] 0]
   set last_el [lindex $text end]

   ## determine if last element is a number. If it is,  use it as ban time in minutes.  If it is not, then default bant time is 5 minutes.
   if {[string is digit $last_el]} {
      set text [lrange $text 0 end-1]
      set ban_time_min $last_el
   } else {
      set ban_time_min 5
   }
   set ban_time [expr {$ban_time_min * 60}]
   set nick [split [string trim $text]]

   if {$reason eq ""} { set reason " SHUN for $nick - Reason: $reason - Time: $last_el min. "
   } else { set reason " SHUN for $nick - Reason: Abuser -Time: $ban_time_min min. " }
   set nick [split [string trim [lindex [split $text "."] 0]]]

   if {[set chost [getchanhost $nick]] ne ""} {
      switch -glob -- $chost {
         {*.irccloud.com} - {*.mibbit.com} - {*.kiwiirc.com} {
            scan $chost {%[^@]} ident
            putnow "SHUN [string trimleft $ident@*] $ban_time $reason"
         }
         {default} {
            putnow "SHUN $nick2 $ban_time $reason"
         }
      }
   }
}

Back to top
View user's profile Send private message
Gulio
Halfop


Joined: 01 Nov 2020
Posts: 73

PostPosted: Sat Jul 17, 2021 11:17 am    Post subject: Hello Reply with quote

i fixed reason command but how to make multi nick shun ?

this

Code:

if {$reason eq ""}


with

Code:

if {$reason ne ""}


is this good ?

Code:


bind pub -|- .shun proc_shun


proc proc_shun {nick host hand chan text} {
   if {![onchan $nick #shqiperia ]} { return }
   set nick [lindex [split $text] 0]
   set reason [join [lrange [split $text "."] 1 end] "."]
   set text  [lindex [split $text "."] 0]
   set last_el [lindex $text end]

   ## determine if last element is a number. If it is,  use it as ban time in minutes.  If it is not, then default bant time is 5 minutes.
   if {[string is digit $last_el]} {
      set text [lrange $text 0 end-1]
      set ban_time_min $last_el
   } else {
      set ban_time_min 5
   }
   set ban_time [expr {$ban_time_min * 60}]
   set nick [split [string trim $text]]

            if {$reason ne ""} { set reason " SHUN for $nick - Reason: $reason - Time: $last_el min. "
   } else { set reason " SHUN for $nick - Reason: Abuser -Time: $ban_time_min min. " }
         set nick [split [string trim [lindex [split $text "."] 0]]]

   foreach user $text {

      if {![onchan $user $chan]} {
         putserv "NOTICE $nick $user is not on channel $chan"
      } else {

         if {[set chost [getchanhost $nick]] ne ""} {
            switch -glob -- $chost {
               {*.irccloud.com} - {*.mibbit.com} - {*.kiwiirc.com} {
                  scan $chost {%[^@]} ident
                  putnow "SHUN [string trimleft $ident@*] $ban_time $reason"
               }
               {default} {
                  putnow "SHUN $nick $ban_time $reason"
               }
            }
         }
      }
   }
}
Back to top
View user's profile Send private message
Gulio
Halfop


Joined: 01 Nov 2020
Posts: 73

PostPosted: Sat Jul 17, 2021 12:31 pm    Post subject: hi Reply with quote

Is fixed now can shun multi nicks

Code:

bind pub -|- .shun proc_shun


proc proc_shun {nick host hand chan text} {
   if {![onchan $nick #shqiperia ]} { return }
   set nick2 [lindex [split $text] 0]
   set reason [join [lrange [split $text "."] 1 end] "."]
   set text  [lindex [split $text "."] 0]
   set last_el [lindex $text end]

   ## determine if last element is a number. If it is,  use it as ban time in minutes.  If it is not, then default bant time is 5 minutes.
   if {[string is digit $last_el]} {
      set text [lrange $text 0 end-1]
      set ban_time_min $last_el
   } else {
      set ban_time_min 5
   }
   set ban_time [expr {$ban_time_min * 60}]
   set nick2 [split [string trim $text]]

   if {$reason ne ""} { set reason " SHUN for $nick2 - Reason: $reason - Time: $last_el min. "
   } else { set reason " SHUN for $nick2 - Reason: Abuser -Time: $ban_time_min min. " }
   set nick2 [split [string trim [lindex [split $text "."] 0]]]

   foreach nick2 $text {

      if {![onchan $nick2 $chan]} {
         putserv "NOTICE $nick $nick2 is not on channel $chan"
      } else {

         if {[set chost [getchanhost $nick]] ne ""} {
            switch -glob -- $chost {
               {*.irccloud.com} - {*.mibbit.com} - {*.kiwiirc.com} {
                  scan $chost {%[^@]} ident
                  putnow "SHUN [string trimleft $ident@*] $ban_time $reason"
               }
               {default} {
                  putnow "SHUN $nick2 $ban_time $reason"
               }
            }
         }
      }
   }
}
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 -> Script Requests 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