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 in scripting tcl

Old posts that have not been replied to for several years.
Locked
c
crazy-nic
Voice
Posts: 19
Joined: Wed Jul 02, 2003 12:44 am

Help in scripting tcl

Post by crazy-nic »

i've got a problem in scripting this. If u wan to ban someone in channel rite? but u dun wan it to be public so u msg bot and type a command so it will excute a command. the commands i having trouble is kick, kickban and ban and unban i hope your would give me a help.
User avatar
z_one
Master
Posts: 269
Joined: Mon Jan 14, 2002 8:00 pm
Location: Canada

Post by z_one »

In the bot's pvt type: cmd kick #channel nick
where #channel is the channel you want to kick nick from.
You must have master (m) or owner (n) flags for this to work.

Code: Select all

bind msg m "cmd" mypvtcommand

proc mypvtcommand {nick host hand arg} {
   if {$arg == ""} { return }

   set theaction [string tolower [lindex $arg 0]]
   set thechan [string tolower [lindex $arg 1]]
   set thenick [string tolower [lindex $arg 2]]

   switch -exact $theaction {
     kick {
       if {[onchan $thenick $thechan]} {
         putkick $thechan $thenick
       }
     }
   }
}
I'm sure you can figure out the rest (how to ban or kick ban) :wink:
Hint: use getchanhost to get the host of the nick you need to ban.

z_one
c
crazy-nic
Voice
Posts: 19
Joined: Wed Jul 02, 2003 12:44 am

Post by crazy-nic »

hmm.. okie.. i got it working.. but then how to make a stick ban? i'm not quite sure.... sorry... to trouble... you all...
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

### stick [ban/exempt/invite] <hostmask/number> [channel]
Makes a ban, exempt, or invite "sticky". This means that the bot will always try to keep it active on the channel, even if the channel is using dynamic bans. Obviously, if the channel isn't using dynamic bans, this has no effect.

See also: bans, exempts, invites, unstick, +ban, +exempt, +invite
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

also u can do it like this:
newchanban <channel> <ban> <creator> <comment> [lifetime] [options]
in your case [option] would be sticky.

for example:
newchanban $chan $ban cmdscript "$reason" 10 sticky
this would create a 10 minutes sticky ban.
Options:
sticky: forces the ban to be always active on a channel, even
with dynamicbans on
none: no effect
c
crazy-nic
Voice
Posts: 19
Joined: Wed Jul 02, 2003 12:44 am

Post by crazy-nic »

i tried but it wont work i make something like this:

bind msg m "!cmd" mypvtcommand

proc mypvtcommand {nick host hand arg} {
if {$arg == ""} { return }

set theaction [string tolower [lindex $arg 0]]
set thechan [string tolower [lindex $arg 1]]
set thenick [string tolower [lindex $arg 2]]
set reasons [string tolower [lindex $arg 3]]

switch -exact $theaction {
kick {
if {[onchan $thenick $thechan]} {
putkick $thechan $thenick $reasons
}
}
ban {
if {[onchan $thenick $thechan]} {
set gethost [ getchanhost $thenick $thechan ]
newchanban $thechan $gethost $nick - 10 sticky
putkick $thechan $thenick $reasons
}
}
}
}
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

try:
newchanban $thechan $gethost cmdcript "-" 10 sticky
c
crazy-nic
Voice
Posts: 19
Joined: Wed Jul 02, 2003 12:44 am

Post by crazy-nic »

hmm.. tried that it cant work
Locked