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.

Does anyone could help me

Help for those learning Tcl or writing their own scripts.
Post Reply
s
sattam
Voice
Posts: 20
Joined: Sat Jan 02, 2010 8:42 am

Does anyone could help me

Post by sattam »

Does anyone could help me

Code: Select all

bind pub m|m !akill akill_proc
proc akill_proc { nick uhost hand chan arg } {
  set time [lindex [split $arg] 0]
  set ip [lindex [split $arg] 1]
  set reason [join [lrange [split $arg] 2 end]]
  putserv "PRIVMSG OperServ :akill $time $ip $reason"
}

Thank you works great

Is it possible
Start a reason from a file txt

like
!akill time 10 *@t123st.te44st2.tea flood

flood = Banned from the network: Flooding Is Not Allowed In dal.net NetWork. http://chat.dal.net/download )
and

!akill time 10 *@t123st.te44st2.tea (spam)

spam = Banned from the network: Spam Is Not Allowed In dal.net NetWork.
http://chat.dal.net/download )
a
antsukka
Voice
Posts: 2
Joined: Sun Jan 03, 2010 11:26 am

Post by antsukka »

Not sure if I understood correctly but how about string mapping those reasons like this:

Code: Select all

set reason [string map {spam "spam is not allowed" flood "flooding causes drowning"} [join [lrange [split $arg] 2 end]]]
If you want a separate file, just read the mapping pattern from a file into a list.
s
sattam
Voice
Posts: 20
Joined: Sat Jan 02, 2010 8:42 am

Post by sattam »

antsukka wrote:Not sure if I understood correctly but how about string mapping those reasons like this:

Code: Select all

set reason [string map {spam "spam is not allowed" flood "flooding causes drowning"} [join [lrange [split $arg] 2 end]]]
If you want a separate file, just read the mapping pattern from a file into a list.

Thank you very much
Excellent work
Post Reply