mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: May 2004
Posts: 11
D
Pikka bird
OP Offline
Pikka bird
D
Joined: May 2004
Posts: 11
ok, I've got this script:

Code:
on *:op:#spam,#bots: {
  if ($opnick == $me) {
    msg $chan I'm opped. kicking $iif(% [ $+ kick. $+ [ $cid ] $+ . $+ [ $chan ] ],% [ $+ kick. $+ [ $cid ] $+ . $+ [ $chan ] ],$false)
    kick $chan % [ $+ kick. $+ [ $cid ] $+ . $+ [ $chan ] ] don't keck the bek
    msg $chan passed kick
    ;unset % [ $+ kick. $+ [ $cid ] $+ . $+ [ $chan ] ]
    ;msg $chan unset $iif(% [ $+ kick. $+ [ $cid ] $+ . $+ [ $chan ] ] == $null,failed,succeeded)
    msg $chan chanserv, deop
  }
  elseif ($opnick == % [ $+ kick. $+ [ $cid ] $+ . $+ [ $chan ] ]) {
    msg $chan chanserv deop $opnick
    mode -o $opnick
  }
}
along with this script
Code:
on *:kick:#: {
  if ($nick == Bekbot) {
    msg $chan chanserv deop $nick
  }
  if (($chan == #spam) || ($chan == #bots)) {
    if ($knick == $me) {
      msg $chan chanserv, op
      set -eu120 [ %kick. $+ [ $cid ] $+ . $+ [ $chan ] ] $nick
      ; msg $chan kicker is [ % $+ kick. $+ [ $cid ] $+ . $+ [ $chan ] ]
    }
  }
}
that script performs this when I'm kicked:
Quote:
20100611183144 * You were kicked by Gjs (this is for all CAPS)
20100611183144 * Attempting to rejoin channel #spam
20100611183144 <@Bekarfel> chanserv, op
20100611183144 * Rejoined channel #spam
20100611183144 * ChanServ sets mode: +v Bekarfel
20100611183144 * ChanServ sets mode: +o Bekarfel
20100611183144 <@Bekarfel> I'm opped. kicking Gjs
20100611183145 * Gjs was kicked by Bekarfel (don't keck the bek)
the messages after the kick don't get sent, what am I doing wrong, why won't the messages after the kick get printed? am I denser than depleted uranium, or is it a bug? any help would be greatly appreciated

Joined: Sep 2009
Posts: 52
Z
ziv Offline
Babel fish
Offline
Babel fish
Z
Joined: Sep 2009
Posts: 52
Well, if your sending it from the client kicked, make sure the channel isn't set to "+n".

I'd change the script though...too messy for something so simple.

Code:
;To be placed in the bot
on 1:kick:#spam,#bots:{
  if $knick == $me { ;If the one kicked is the bot.
    j $chan          ;Rejoins.
    timer 1 2 msg $chan chanserv, op           ;After rejoin, op.
    timer 1 4 kick $chan $nick Don't kick bek! ;-""-, kick.
  }
  elseif $knick == bekarfel { ;If the one kicked is you.
    kick $chan $nick Don't kick bek! ;kicking the offender.
  }
}


What you did with the vars and an odd $kick, isn't needed for something so simple.
If this doesn't work with your network, let me know.

(obviously, don't add the stuff after the ";"s to your code...)

ziv.

Last edited by ziv; 12/06/10 12:22 PM.
Joined: May 2004
Posts: 11
D
Pikka bird
OP Offline
Pikka bird
D
Joined: May 2004
Posts: 11
well, it's supposed to be a war defense script, so it needs to work as fast as possible, without failing

the if ($nick == bekbot) {} is extra stuff that is related to my bot, and not related to what I'm trying to achieve here.

on the channel, I have access to cs op/deop, but I'm not automatically opped on join

Joined: Sep 2009
Posts: 52
Z
ziv Offline
Babel fish
Offline
Babel fish
Z
Joined: Sep 2009
Posts: 52
Well, if you're out side of the channel, and have no access to the CS kick command, you have to get back in before you can kick.
To make sure your back in, you can do one of two things:

1) Make it timed, like in my solution. Not idle for quickness, I was only aiming for simplicity.

2) Make it store the nick to be kicked, and kick in an on join+op event. Idle for quick reaction.

The fallowing code will show the second way:
Code:
on 1:kick:#bots,#spam:{
  if $knick == $me {
    set %kick = $nick
    join $chan
  }
  elseif $knick == [u]Enter your nick here[/u] {
    kick $chan $nick Do not kick $knick $+ !
  }
}

on 1:join:#bots,#spam:{
  if $nick == $me { msg $chan Chanserv, op     ;<-W/e you need to op yourself. }
}

on 1:op:#bots,#spam:{
  if $opnick == $me && %kick != $null {
    kick $chan %kick Do not kick $me $+ !
    unset %kick
  }
}


Hope that helps,
ziv.

Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
Code:
set %kick = $nick
While it's good habit to put the "=" at /var commands, The content of your variable will include the equal sign if you use it with the /set command. smile

Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Well, as a bad habit, if you don't include anything, other than the equals sign, and just put it as
Quote:
%knick = $nick
it'll be set as a global variable.

Joined: Jul 2006
Posts: 4,149
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,149
Yes, and ?


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Wims, I'm not trying to incite this topic into some sort of an argument, so please don't you "Yes, and?" me. Thank you. I was just posting it as a harmless opinion.

Joined: Jul 2006
Posts: 4,149
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,149
I'm not trying anything either, you just answered to someone with a completely unrelated stuff and I was asking why smile


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
"Why?" you asked. Because evidently, as you shall see, my opinion was responding to Horstls'. Yes, I admit that was off-topic, but it was merely an opinion and nothing more.

Joined: Sep 2009
Posts: 52
Z
ziv Offline
Babel fish
Offline
Babel fish
Z
Joined: Sep 2009
Posts: 52
Alright, alright, calm down :>

I thank him for pointing that out and it was, imo, important, now let it be :>

ziv.


Link Copied to Clipboard