| View previous topic :: View next topic |
| Author |
Message |
illusionist Voice
Joined: 09 Mar 2020 Posts: 25
|
Posted: Fri Jul 17, 2020 9:09 pm Post subject: Random kick msg |
|
|
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: | 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 !! |
|
| Back to top |
|
 |
SpiKe^^ Owner

Joined: 12 May 2006 Posts: 792 Location: Tennessee, USA
|
Posted: Fri Jul 17, 2020 11:28 pm Post subject: |
|
|
Try this...
| Code: |
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
. |
|
| Back to top |
|
 |
illusionist Voice
Joined: 09 Mar 2020 Posts: 25
|
Posted: Sat Jul 18, 2020 7:11 am Post subject: |
|
|
Thanks Spike^^
It works fine ...
Thanks once again...!! |
|
| Back to top |
|
 |
|
|
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
|
|