mIRC Homepage

Need help with scripting

Posted By: llVIU

Need help with scripting - 12/04/07 02:08 PM

Hello.

I need to know what I need to put in aliases.ini to have:

1. a "mass kick" script (the way I call it) that first sets mode +i then kicks all unvoiced users in a channel and then sets mode -i, this would be triggered when I type /mk smile

2. a script that sends a notice to all unvoiced users, I curently have a scrip that sends the notice only to 1 user that I chose, this is what it is..heh:

/n /notice $$1 *text here*

so when I type "/n *user name*" ,it will send the given text to him...

Any help is apreciated laugh
Posted By: learn3r

Re: Need help with scripting - 12/04/07 02:20 PM

Code:
alias mk {
  if (!$chan && !$1) { echo -a ERROR: You need to type this in a channel, or else include a channel with it. | return }
  var %chan = $iif($chan,$chan,$1)
  if ($me !isop %chan) { echo -a ERROR: You need to be an op in the channel. | return }
  var %total = $nick(%chan,0,r)
  var %cnt = 1
  while (%cnt <= %total) {
    var %unvoiced = %unvoiced $nick(%chan,%cnt,r)
    if ($gettok(%unvoiced,0,32) == 4) {
      mode %chan +i
      kick %chan %unvoiced
      unset %unvoiced
    }
    inc %cnt
  }
  mode %chan -i
  unset %chan
}


Posted By: llVIU

Re: Need help with scripting - 12/04/07 02:46 PM

thank you very much for trying to help, but it doesn't seem to work... it says "MK Unknown command" at the status window..
Posted By: xDaeMoN

Re: Need help with scripting - 12/04/07 05:49 PM

Maybe you pasted the code in your ALIASES section. Try putting it on the REMOTES section.
Posted By: llVIU

Re: Need help with scripting - 14/04/07 12:11 PM

Never mind, whatever you guys were trying to say was harder to understand than making a script for myself.

Works perfectly the way I wanted except that it works for 10 users max.

/mk /mode #Pest +i | /kick #Pest $nick(#Pest,1,r) 4,1 Please message Liviu31 in RuneScape for voice  | /kick #Pest $nick(#Pest,2,r) 4,1 Please message Liviu31 in RuneScape for voice  | /kick #Pest $nick(#Pest,3,r) 4,1 Please message Liviu31 in RuneScape for voice  | /kick #Pest $nick(#Pest,4,r) 4,1 Please message Liviu31 in RuneScape for voice  | /kick #Pest $nick(#Pest,5,r) 4,1 Please message Liviu31 in RuneScape for voice  | /kick #Pest $nick(#Pest,6,r) 4,1 Please message Liviu31 in RuneScape for voice  | /kick #Pest $nick(#Pest,7,r) 4,1 Please message Liviu31 in RuneScape for voice  | /kick #Pest $nick(#Pest,8,r) 4,1 Please message Liviu31 in RuneScape for voice  | /kick #Pest $nick(#Pest,9,r) 4,1 Please message Liviu31 in RuneScape for voice  | /kick #Pest $nick(#Pest,10,r) 4,1 Please message Liviu31 in RuneScape for voice  | /mode #Pest -i

/mn /notice $nick(#Pest,1,r) 4,1 Please message Liviu31 in RuneScape for voice  | /notice $nick(#Pest,2,r) 4,1 Please message Liviu31 in RuneScape for voice  | /notice $nick(#Pest,3,r) 4,1 Please message Liviu31 in RuneScape for voice  | /notice $nick(#Pest,4,r) 4,1 Please message Liviu31 in RuneScape for voice  | /notice $nick(#Pest,5,r) 4,1 Please message Liviu31 in RuneScape for voice  | /notice $nick(#Pest,6,r) 4,1 Please message Liviu31 in RuneScape for voice  | /notice $nick(#Pest,7,r) 4,1 Please message Liviu31 in RuneScape for voice  | /notice $nick(#Pest,8,r) 4,1 Please message Liviu31 in RuneScape for voice  | /notice $nick(#Pest,9,r) 4,1 Please message Liviu31 in RuneScape for voice  | /notice $nick(#Pest,10,r) 4,1 Please message Liviu31 in RuneScape for voice 

Thank you very much anyway. smile
Posted By: Riamus2

Re: Need help with scripting - 14/04/07 02:36 PM

All you had to do was put that code into the REMOTES tab instead of the ALIASES tab (or remove "alias" from the first line of it and then put it into the ALIASES tab). Nothing really hard about that.

Your code, no offense, is a messy nightmare. You should *never* overuse pipes (|) like that.
© 2021 mIRC Discussion Forums