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 

Random kick msg

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


Joined: 09 Mar 2020
Posts: 25

PostPosted: Fri Jul 17, 2020 9:09 pm    Post subject: Random kick msg Reply with quote

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
View user's profile Send private message
SpiKe^^
Owner


Joined: 12 May 2006
Posts: 792
Location: Tennessee, USA

PostPosted: Fri Jul 17, 2020 11:28 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
illusionist
Voice


Joined: 09 Mar 2020
Posts: 25

PostPosted: Sat Jul 18, 2020 7:11 am    Post subject: Reply with quote

Thanks Spike^^

It works fine ...
Thanks once again...!!
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