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.

Random kick msg

Help for those learning Tcl or writing their own scripts.
Post Reply
i
illusionist
Voice
Posts: 25
Joined: Mon Mar 09, 2020 11:22 am

Random kick msg

Post by illusionist »

Hello Everyone ....!!

I have added random kick msg in this script, But i want random kick msg to be saved in a separate text file. I would be grateful if anyone could help.

Here is the Code

Code: Select all

set jCrX "."
set jCrXCsNick "ChanServ@services.dal.net"
set jCrXLogo "\002\037\0037(\017\00312\u00bb \0031\002j\002a\0034\002D\002u\0031\u00ae \00312\u00ab\0037\002\037)\017"

set RndmKckMsg {
{A day without smiling is a day wasted.}
{I am silent but not blind}
{You Don't Know me, You onLy know what i aLLow You to Know}
{Don't judge me for my choices when you don't understand my reasons.}
{your stupidity outweighs my inteligence} 
{would have been yo daddy but the dog beat me over the fence }  
{get -+@#$&!&$@+-}
{apparently you don't learn.... do you? } 
{thankyou please come again }
{that word's a no no, ya do do }
{This is a beauty parlour... you appear to have hit all 7 branches on the ugly tree... there is nothing we can do for you. Try the shop next door }
{Do you actually think about the **** that falls outta your mouth? Or is is all just random? }
{this rom is an all welcome room, but i guess your the exception}  
{Have a ride on the short bus?}
{don't say i never gave you nothin (swift kick) }
{its along walk home so grab your coat , your leaving }
{insert own kick message cos your not worht the effort }
{Come on in, take a look and enjoy yourself}
{Try That One again I'll Make Your SandLe}
{my mother gave me life, i gave her the blues, my wife gave me hell i gave her herpies, youve given me nothing so consider this a gift }
{I'm reading a book about anti-gravity. It's impossible to put down.}
{Where there's a will, there's a relative.}
{The worst time to have a heart attack is during a TCL Script Test}
{A computer once beat me at PUBG, but it was no match for me at kick}
{i Have No Idea How To Convincing Them So I'm trying to confuse them :)}
  }


bind pub o|o ${jCrX}kb kickban
proc kickban {nick host hand chan rest} {
	global jCrX botnick jCrXCsNick jCrXLogo RndmKckMsg
	
	proc randomline {rest} {
 return [lindex $rest [rand [llength $rest]]]
}
	
set kbnick [lindex $rest 0]
set kbhost "*!*@[lindex [split [getchanhost $kbnick $chan] @] 1]"
set reason [lrange $rest 1 end]
if {$reason == ""} {
set reason [randomline $RndmKckMsg]
}
if {![botisop $chan]} {putquick "NOTICE $nick :I appologize, but I am not an Operator on channel: $chan. Your command cannot be perform." ; return 0}
if {$kbnick == ""} {
putquick "NOTICE $nick :!kb <nick> \[reason\]" ; return 0}
if {[matchattr [nick2hand $kbnick] n]} {
putquick "NOTICE $nick :Sorry, you cann't \0034kick \00312$kbnick\017, $kbnick is an Official Bot Owner, Bot Administrator & Global Operator.)"
} elseif {[matchattr [nick2hand $kbnick] m]} {
putquick "NOTICE $nick :Sorry, you cann't \0034kick \00312$kbnick\017, $kbnick is an Official Bot Administrator & Global Operator.)"
} elseif {[matchattr [nick2hand $kbnick] o]} {
putquick "NOTICE $nick :Sorry, you cann't \0034kick \00312$kbnick\017, $kbnick is an Global Operator.)"
} elseif {[isop $kbnick $chan]} {
putquick "MODE $chan -o+b $kbnick $kbhost"
putquick "KICK $chan $kbnick : $reason $jCrXLogo"
  } else {
putquick "MODE $chan +b $kbhost"
putquick "KICK $chan $kbnick :$reason $jCrXLogo"
  }
}
Thanks in Advane !!
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

Try this...

Code: Select all

set jCrX "."
set jCrXCsNick "ChanServ@services.dal.net"
set jCrXLogo "\002\037\0037(\017\00312\u00bb \0031\002j\002a\0034\002D\002u\0031\u00ae \00312\u00ab\0037\002\037)\017"

set jCrXkReasonFile "scripts/kReasons.txt"


proc getRandomReason {} {
  global jCrXkReasonFile

  if {![file exists $jCrXkReasonFile]} { return "Go away, your feet stink." }

  set openfile [open $jCrXkReasonFile]
  set reasons [split [read -nonewline $openfile] \n]
  close $openfile

  set output [lindex $reasons [rand [llength $reasons]]]
  return $output
}


bind pub o|o ${jCrX}kb kickban

proc kickban {nick host hand chan rest} {
  global jCrX jCrXCsNick jCrXLogo

  set kbnick [lindex [split $rest] 0]
  set kbhost "*!*@[lindex [split [getchanhost $kbnick $chan] @] 1]"
  set reason [join [lrange [split $rest] 1 end]]

  if {$reason == ""} {  set reason [getRandomReason]  }

  if {![botisop $chan]} {
    putquick "NOTICE $nick :I appologize, but I am not an Operator on channel: $chan. Your command cannot be perform." ; return 0
  }
  if {$kbnick == ""} { putquick "NOTICE $nick :${jCrX}kb <nick> \[reason\]" ; return 0 }

  if {[matchattr [nick2hand $kbnick] n]} {
putquick "NOTICE $nick :Sorry, you cann't \0034kick \00312$kbnick\017, $kbnick is an Official Bot Owner, Bot Administrator & Global Operator.)"
  } elseif {[matchattr [nick2hand $kbnick] m]} {
putquick "NOTICE $nick :Sorry, you cann't \0034kick \00312$kbnick\017, $kbnick is an Official Bot Administrator & Global Operator.)"
  } elseif {[matchattr [nick2hand $kbnick] o]} {
putquick "NOTICE $nick :Sorry, you cann't \0034kick \00312$kbnick\017, $kbnick is an Global Operator.)"
  } elseif {[isop $kbnick $chan]} {
putquick "MODE $chan -o+b $kbnick $kbhost"
putquick "KICK $chan $kbnick : $reason $jCrXLogo"
  } else {
putquick "MODE $chan +b $kbhost"
putquick "KICK $chan $kbnick :$reason $jCrXLogo"
  }
}

SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
i
illusionist
Voice
Posts: 25
Joined: Mon Mar 09, 2020 11:22 am

Post by illusionist »

Thanks Spike^^

It works fine ...
Thanks once again...!!
Post Reply