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.

Help me With editing this script !!

Old posts that have not been replied to for several years.
e
egghead
Master
Posts: 481
Joined: Mon Oct 29, 2001 8:00 pm
Contact:

Post by egghead »

caesar wrote:So, finaly it should look like:

Code: Select all

proc pub:kick {nick host hand chan text} { 
  global botnick
  if {![llength $text] > 0 || ![botisop $chan]} { return }
  set whom [string tolower [lindex $text 0]]
  set chan [string tolower $chan]
  if {$whom == $botnick || [matchattr $whom f|f] || ![onchan $whom $chan]} { return }
  set reason [lrange $text 1 end] 
  putserv "KICK $chan $whom :$reason" 
  putlog "#$hand# has kicked $whom from $chan" 
}
Sorry to say, but it certainly should not look like that.
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

What you mean? If you are talking about the fact that I haven't added a bind to it, yah, she haven't added it in the first place.
Once the game is over, the king and the pawn go back in the same box.
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

1. you should split the $text before using list-commands on it
2. you are making $whom to lowercase ...but you forgot to make $botnick lowercase....
3. [matchattr $whom f|f] should be [matchattr $whom f|f $chan]
Elen sila lúmenn' omentielvo
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

cut set chan [string tolower $chan] out, i say it can cause more problems, then it should solve. and [matchattr $whom f|f] is meant to be [matchattr [nick2hand $whom] f|f $chan] :).

PS: Papillon you were a few seconds faster, but your 3rd is still wrong :).
e
egghead
Master
Posts: 481
Joined: Mon Oct 29, 2001 8:00 pm
Contact:

Post by egghead »

Hurray!!!

(posting nr. 200 :) )
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Guess I have rushed a bit..
Once the game is over, the king and the pawn go back in the same box.
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Code: Select all

proc pub:kick {nick host hand chan text} { 
  global botnick 
  set text [split $text] 
  if {![llength $text] > 0 || ![botisop $chan]} { return } 
  set whom [string tolower [lindex $text 0]] 
  if {$whom == [string tolower $botnick] || [matchattr [nick2hand $whom $chan] f|f $chan] || ![onchan $whom $chan]} { return } 
  set reason [lrange $text 1 end] 
  putserv "KICK $chan $whom :$reason" 
  putlog "#$hand# has kicked $whom from $chan" 
}
Also, a quote from tcl-commands.doc: matchattr <handle> <flags> [channel]..

There.. happy now? Btw, congrats egghead for the 2oo'st post :]
Last edited by caesar on Thu Feb 20, 2003 3:20 pm, edited 1 time in total.
Once the game is over, the king and the pawn go back in the same box.
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

hihi

Post by De Kus »

still not perfect, a typo in line 6 by tlower which should be tolower :).
and just edit your post :).

Edit: now i dont see any errors any more :D.
I
Insectora
Voice
Posts: 16
Joined: Thu Feb 20, 2003 2:51 am
Location: Germany

Thank yoy realy guys :)))

Post by Insectora »

One big Thank you from me :))!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Stealth
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Your welcome.

Also, I've noticed that you haven't said nothing about the matchattr after my last post. Cat eat your tangue? :P
Once the game is over, the king and the pawn go back in the same box.
Locked