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 

Does anyone could help me

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


Joined: 02 Jan 2010
Posts: 20

PostPosted: Mon Jan 04, 2010 1:20 pm    Post subject: Does anyone could help me Reply with quote

Does anyone could help me

Code:
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 )
Back to top
View user's profile Send private message
antsukka
Voice


Joined: 03 Jan 2010
Posts: 2

PostPosted: Mon Jan 04, 2010 8:04 pm    Post subject: Reply with quote

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

Code:
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.
Back to top
View user's profile Send private message
sattam
Voice


Joined: 02 Jan 2010
Posts: 20

PostPosted: Tue Jan 05, 2010 1:24 am    Post subject: Reply with quote

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

Code:
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
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