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 with this script

Old posts that have not been replied to for several years.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Touche! :)
Once the game is over, the king and the pawn go back in the same box.
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

ok, how can I make these list... or arrays, I don't have any experiance in them. It would realy be good if I learn them :D
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

Code: Select all

bind kick - * channel:kick 
  
proc channel:kick {nick uhost hand chan targ rsn} { 
  if {![string match -nocase "$targ" $::botnick]} { return }
  global revengebans
  set chan [string tolower $chan]
  putquick "PRIVMSG chanserv@services.dal.net :deop $chan $nick" -next 
  putquick "PRIVMSG chanserv@services.dal.net :unban $chan"
  if {![info exists revengebans($chan)]} { set revengebans($chan) {} }
  lappend revengebans($chan) [list $nick *!*@[lindex [split $uhost @] 1]]
}  

bind mode - "* +o" lamer:remove 

proc lamer:remove {nick uhost hand chan mc vict} { 
  global revengebans 
  if {[string tolower $vict] != [string tolower $::botnick]} { return }
  set chan [string tolower $chan]
  if {![info exists revengebans($chan)]} { return }
  foreach element $revengebans($chan) {
    set revenge_nick [lindex $element 0]
    set revenge_banmask [lindex $element 1]
    if {[onchan $revenge_nick $chan]} { 
      putserv "mode $chan +b $revenge_banmask"  
      putkick $chan $revenge_nick "Lamer Removed." 
    } 
  }
  unset revengebans($chan)  
}
Try that..
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

worked prefectly :) thanx alot.

may I ask why do u do a [string tolower $chan\$nick] ? (like what does string tolower do ?)

and also what does lappend do ? (gathers variables or what ?)
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

Sir_Fz wrote:worked prefectly :) thanx alot.

may I ask why do u do a [string tolower $chan\$nick] ? (like what does string tolower do ?)

and also what does lappend do ? (gathers variables or what ?)
'string tolower' converts a string all to lowercase
'lappend' is a list operator that appends elements on to a list variable.

For a listing of commands, and their descriptions, I suggest taking a look at the TCL manpages:
http://www.tcl.tk/man/tcl8.4/TclCmd/contents.htm
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

thanx alot :)
Locked