mIRC Home    About    Download    Register    News    Help

Print Thread
#13511 28/02/03 01:05 AM
Joined: Feb 2003
Posts: 20
D
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Feb 2003
Posts: 20
i'm making auto kick script...
it works cept it kicks the person even if he is opped whats wrong?

__________________________________________________
on *:JOIN:#:/timer $+ $nick 1 60 TIMERALIAS | /msg $nick you have one min to OP or be kicked! | set %nick $nick | set % chan $chan
alias TIMERALIAS { if (%nick isop $chan) { halt } | else { kick %chan %nick You failed to Op within 1 minute } }
__________________________________________________

Joined: Dec 2002
Posts: 83
A
Babel fish
Offline
Babel fish
A
Joined: Dec 2002
Posts: 83
You might try this:
Code:
on *:JOIN:#: {
   /timer $+ $nick 1 60 TIMERALIAS
   /msg $nick you have one min to OP or be kicked! 
   set %nick $nick 
   set %chan $chan
}
alias TIMERALIAS { 
   if (%nick isop %chan) { 
      halt 
   } 
   elseif (%nick !isop %chan) { 
      kick %chan %nick You failed to Op within 1 minute 
   }
}

Last edited by acemiles_ed; 28/02/03 02:12 AM.
Joined: Feb 2003
Posts: 9
A
Nutrimatic drinks dispenser
Offline
Nutrimatic drinks dispenser
A
Joined: Feb 2003
Posts: 9
Well sure...that whould work and all but when TWO people joins un under 1min... the first one gets to stay even if he doesn't have op...


Improved version ... 1.02
Code:
on *:JOIN:#: {
   timer $+ $nick 1 60 TIMERALIAS $chan $nick
   msg $nick you have one min to OP or be kicked!
}

alias TIMERALIAS {
    if ($2 !isop $1) {
       kick $1 $2 You failed to Op within 1 minute
    }
}


Sure ... there are some problems in this too... like when the user changes nick under the MINUTE it won't work.

Joined: Dec 2002
Posts: 83
A
Babel fish
Offline
Babel fish
A
Joined: Dec 2002
Posts: 83
That would be true, forgot about that one wink

Joined: Feb 2003
Posts: 20
D
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Feb 2003
Posts: 20
both of those don't work....

* /timeralias: invalid parameters
-
* Timer [ps|sniperchat] halted
-
* You're not on a channel
-
* Timer [ps|sniperchat] activated
-
* /timeralias: invalid parameters
-
* Timer [ps|sniperchat] halted
-

Joined: Dec 2002
Posts: 699
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 699
You can't name an alias "timer<anythingatall>"
Change the name of the alias, and all should be well.

Joined: Mar 2003
Posts: 612
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Mar 2003
Posts: 612
on *:join:#: {
.timer $+ $nick 1 60 checkops $nick $chan
.notice $nick The countdown is on! Op or be kicked
}
alias checkops {
if ($1 isin $2) && ($1 !isop $2) {
kick $2 $1 Warned!
}
}

I think that should work, hope so wink


billythekid
Joined: Feb 2003
Posts: 20
D
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Feb 2003
Posts: 20
err not working either

* You're not on a channel
-
[PS|SniperBoi] Nickname is already in use.
-

Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
Just my attempt at it >:D

Code:
; Nick joins the channel
on 1:JOIN:#: {
  ; make sure we have power.  If we don't, why bother threatening them
  ; that could just get us into further trouble :\
  if ($me isop $chan) {
    ; Add them to the list of users we are checking up on...
    /set % [ $+ [ $chan ] $+ ] .noop $addtok(% [ $+ [ $chan ] $+ ] .noop, $nick, 124)

    ; Set a timer to check them a minute from now..
    .timer [ $+ [ $nick ] ] 1 60 /check.noop $chan $nick

    ; notify them to gain op
    /msg $nick You have one minute to OP or be kicked!
  }
}

; What abaout changing names?
on 1:NICK: {
  ; Go through all of our common chans..
  /set -u0 %a 1
  while (%a &lt;= $comchan($newnick, 0)) {
    ; Save me from retyping $comchan(...)
    /set -u0 %comchan $comchan($newnick, %a)

    ; We found the user in the list..
    if ($findtok(% [ $+ [ %comchan ] $+ ] .noop, $nick, 1, 124)) {
      ;update their name
      /set % [ $+ [ %comchan ] $+ ] .noop $reptok(% [ $+ [ %comchan ] $+ ] .nop, $nick, 1, 124)
    }
    /inc -u0 %a
  }
}

alias check.noop {
  ; Make variables for easier-to-understand alias
  /set -u0 %nick $1
  /set -u0 %chan $2

  ; Now, check their status

  ; They are still in the channel
  if (%nick ison %chan) {
    ; They do not have power, but we do
    if ((%nick !isop %chan) &amp;&amp; ($me isop %chan)) {
      /kick %chan %nick You have failed to OP within 1 minute.
    }
  }
}


Please be aware i did not test this, as I am at school behind several routers and a mean proxy.. This should work, as it takes care of the nick change problem. Everything is commented. If it does have bugs, please feel free to debug it.. >:D


-KingTomato
Joined: Dec 2002
Posts: 1,541
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Dec 2002
Posts: 1,541
Just a thought - why use the comparison if ($me isop $chan) when you can use the @ switch?


on @1:JOIN:#: {
/set % [ $+ [ $chan ] $+ ] .noop $addtok(% [ $+ [ $chan ] $+ ] .noop, $nick, 124)
.timer [ $+ [ $nick ] ] 1 60 /check.noop $chan $nick
/msg $nick You have one minute to OP or be kicked!
}

Granted I removed all the comments, but the @ is the same as saying if ($me isop $chan) and it will only trigger when you're (the script runner) opped


Those who fail history are doomed to repeat it

Link Copied to Clipboard