mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2015
Posts: 168
P
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
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.

Joined: Aug 2016
Posts: 36
Ameglian cow
Offline
Ameglian cow
Joined: Aug 2016
Posts: 36
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.

Joined: Aug 2008
Posts: 4
V
Self-satisified door
Offline
Self-satisified door
V
Joined: Aug 2008
Posts: 4
Shouldn't there be a check, who can issue command to a bot?
eg.
Code:
if (($chan isin %botchans)&&($nick isop $chan))

Joined: May 2015
Posts: 249
Fjord artisan
Offline
Fjord artisan
Joined: May 2015
Posts: 249
or
Code:
if ($nick == $right($chan,-1))


Dont give a fish - teach to fish!

Link Copied to Clipboard