| View previous topic :: View next topic |
| Author |
Message |
BIF Voice
Joined: 31 Jul 2006 Posts: 12
|
Posted: Sun Jul 01, 2007 3:04 am Post subject: Need help converting to a pushmode =\ |
|
|
qban { if ($1 ison $chan) { /mode # +b ~q: $+ $address($$1,2) } }
deqban { if ($1 ison $chan) { /mode # -b ~q: $+ $address($$1,2) } }
Cannot figure out how to get this to work in my bot
I have the rest of the script already written but this is stumping me
i thought like pushmode $chan +b ~q: $+ $host or something lol
pls help |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Sun Jul 01, 2007 8:12 am Post subject: |
|
|
| doc/tcl-commands.doc wrote: | pushmode <channel> <mode> [arg]
Description: sends out a channel mode change (ex: pushmode #lame +o
goober) through the bot's queuing system. All the mode changes will
be sent out at once (combined into one line as much as possible) after
the script finishes, or when 'flushmode' is called.
Returns: nothing
Module: irc |
So basically, to add the ban "*!*@badhost" on channel "#mychannel", you'd do something like this:
| Code: | | pushmode #mychannel +b "*!*@badhost" |
Be aware that some of the ugly hacks in mirc-scripts are'nt nessecary (or available) in tcl (such as the "remove-space" token $+).
It would seem you're trying to add a ban such as this: "~q:*!*user@host", which would probably be something like this, depending on your code:
| Code: | | pushmode $channel +b "~q:*!*${host}" |
_________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
BIF Voice
Joined: 31 Jul 2006 Posts: 12
|
Posted: Mon Jul 02, 2007 12:51 am Post subject: Ok thx I have figured it out and this is working |
|
|
| Code: |
proc pub:sban {nick uhost hand chan txt} {
set txt [split $txt]
set who [lindex $txt 0]
if {[isbotnick $who]} { return }
append ban "~q:*!*@" [lindex [split [getchanhost $who $chan] "@"] 1]
if {[llength $txt] > 1} {
set reason [join [lrange $txt 1 "end"]]
} else {
set reason "Requested"
}
if {[isvoice $who $chan]} {
pushmode $chan "-v" $who
}
pushmode $chan +b $ban
puthelp "NOTICE $who :You Have been Placed on Silent Ban For bad Behavior."
flushmode $chan
return 1
} |
|
|
| Back to top |
|
 |
BIF Voice
Joined: 31 Jul 2006 Posts: 12
|
Posted: Mon Jul 02, 2007 12:52 am Post subject: |
|
|
| However When you just type !sban without any nick it will set +b ~q:*!*@* anyway i can stop that from happening.. Like make it not do anything if no nick is supplied ? |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Mon Jul 02, 2007 1:34 am Post subject: |
|
|
| BIF wrote: | | However When you just type !sban without any nick it will set +b ~q:*!*@* anyway i can stop that from happening.. Like make it not do anything if no nick is supplied ? |
| Code: | change this:
if {[isbotnick $who]} { return }
to this:
if {$who == "" || [isbotnick $who]} { return } |
|
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Mon Jul 02, 2007 8:58 am Post subject: |
|
|
I'd rather suggest replacing that line with this:
| Code: | | if {[isbotnick $who] || ![onchan $who $chan]} {return} |
Checks wether the specified nick is present on the current channel, and aborts if not. _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
|