mIRC Homepage
Posted By: powerade661 Any idea what is wrong with this script? - 18/10/16 06:59 PM
on *:text:!leave:#: {
These two are the parts that aren't working.
---> $remtok(%botchans, #, 1, 32)

if ($nick isin %botchans) {
msg $chan Leaving channel: $nick

---> elseif (%chan !isin %botchans) {
msg $chan I have already left your channel.
.part $chr(35) $+ $nick

Thank you for any help you can give me with this.
This script isn't fixable as it doesn't make sense. There are syntax errors, and the code in the elseif section will never execute as the bot won't see the text if it's not in the channel. This is a rewrite based on what I believe you require:
Code:
on *:text:!leave:#: {
  if ($chan isin %botchans) {
    %botchans = $remtok(%botchans, $chan, 1, 32)
    msg $chan Leaving channel: Requested by $nick
    .timer 1 1 part $chan
  }
}


When someone types !leave in a channel if the channel is in the %botchans list the bot will remove the channel from the list and leave the channel.
Shouldn't there be a check, who can issue command to a bot?
eg.
Code:
if (($chan isin %botchans)&&($nick isop $chan))
Posted By: splinny Re: Any idea what is wrong with this script? - 03/11/16 02:16 AM
or
Code:
if ($nick == $right($chan,-1))
© mIRC Discussion Forums