A Question For Scripters!

An area for those working on addons and mods for Invision and/or mIRC.

Moderators: L|B, cryoa, Riamus, XMog

A Question For Scripters!

Postby DeMoN » Sat Sep 03, 2005 12:58 pm

If i want to add an alias like this in the remote of mIRC how can i do?
alias kk {
if ($me !isop $chan)
cs op $chan $me
mode $chan +b $address($1, 2)
kick $chan $1 $2-
}
Do i Need a Timer? or is there Another Way?
DeMoN
Member
Member
 
Posts: 19
Joined: Sat Mar 05, 2005 12:49 pm

Postby Riamus » Mon Sep 05, 2005 2:50 pm

Just press Alt-R, then File > New. Put it there and press OK. To use, type /kk nick reason

Code: Select all
alias kk {
  if ($me !isop $chan)
  cs op $chan $me
  mode $chan +b $address($1, 2)
  kick $chan $1 $2-
}
You can find me at #Invision on irc.irchighway.net or #OldGames on irc.undernet.org if you need me for anything.
User avatar
Riamus
Global Moderator
Global Moderator
 
Posts: 1783
Joined: Fri May 03, 2002 9:01 pm
Location: North Carolina, USA

Postby DeMoN » Mon Sep 05, 2005 3:06 pm

it says i'm not OP
DeMoN
Member
Member
 
Posts: 19
Joined: Sat Mar 05, 2005 12:49 pm

Re: A Question For Scripters!

Postby Madcap » Tue Nov 13, 2012 4:31 am

There is no problem with this if you are already an Op. The problem comes from having the script Op you so you can do the kick/ban. It can be accomplished with a short timer if you like, but just shooting down that code it executes the ban and kick too fast for iRC itself to catch up. Is that your problem? It's Opping you but then saying you aren't an Op? I'd go with a short timer myself. Something like:

Code: Select all
alias kk {
  if ($me !isop $chan) { cs op $chan $me }
  .timer 1 2 kb $1 $2-
}


Gives it 2 seconds to recognize your operator status and then does as ordered. works opped or deoped.
Madcap
Member
Member
 
Posts: 1
Joined: Tue Nov 13, 2012 3:46 am

Re: A Question For Scripters!

Postby Riamus » Tue Nov 13, 2012 4:04 pm

Although we appreciate help with questions, there is no need to reply to a topic that is 7 years old. The best answer to that question would have been to have the ban/kick happen inside an on op event instead of immediately after or by using a timer. Back at the time, it looks like I just left it as the original code was rather that look at how to make it better. And for whatever reason, I never noticed the reply back on that topic. But either way, the topic is 7 years old, so there's no need to reply to it.
You can find me at #Invision on irc.irchighway.net or #OldGames on irc.undernet.org if you need me for anything.
User avatar
Riamus
Global Moderator
Global Moderator
 
Posts: 1783
Joined: Fri May 03, 2002 9:01 pm
Location: North Carolina, USA


Return to Developers Corner

Who is online

Users browsing this forum: No registered users and 2 guests

cron