mIRC Home    About    Download    Register    News    Help

Print Thread
#87913 23/06/04 04:31 PM
Joined: Mar 2004
Posts: 45
D
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Mar 2004
Posts: 45
I got this script which will show the users address in a popup:
Code:
 menu nicklist {
  Dae's Kick/Ban Script
  .Kick/Ban (own reason)
  ..0. $address($1,0) : { ban -k $$1 0 $$input(Enter reason for kick/ban of  " $+ $1 $+ ":,egqyq,Dae's Ban Script) }
  ..1. $address($1,1) : { ban -k $$1 1 $$input(Enter reason for kick/ban of  " $+ $1 $+ ":,egqyq,Dae's Ban Script) }
  ..2. $address($1,2) : { ban -k $$1 2 $$input(Enter reason for kick/ban of  " $+ $1 $+ ":,egqyq,Dae's Ban Script) }
  ..3. $address($1,3) : { ban -k $$1 3 $$input(Enter reason for kick/ban of  " $+ $1 $+ ":,egqyq,Dae's Ban Script) }
  ..4. $address($1,4) : { ban -k $$1 4 $$input(Enter reason for kick/ban of  " $+ $1 $+ ":,egqyq,Dae's Ban Script) }
  ..5. $address($1,5) : { ban -k $$1 5 $$input(Enter reason for kick/ban of  " $+ $1 $+ ":,egqyq,Dae's Ban Script) }
  ..6. $address($1,6) : { ban -k $$1 6 $$input(Enter reason for kick/ban of  " $+ $1 $+ ":,egqyq,Dae's Ban Script) }
  ..7. $address($1,7) : { ban -k $$1 7 $$input(Enter reason for kick/ban of  " $+ $1 $+ ":,egqyq,Dae's Ban Script) }
  ..8. $address($1,8) : { ban -k $$1 8 $$input(Enter reason for kick/ban of  " $+ $1 $+ ":,egqyq,Dae's Ban Script) }
  ..9. $address($1,9) : { ban -k $$1 9 $$input(Enter reason for kick/ban of  " $+ $1 $+ ":,egqyq,Dae's Ban Script) }
 


but I would also like to add this mask : *!*@halfhost.*
how?

#87914 23/06/04 05:38 PM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
Hi,

put this alias into your remotes:
Code:
 
alias halfhost return $gettok($address($$1,2),1,46) $+ .* 


Usage: $halfhost(nick)

Note that $address is depending on your Internal Address List. A user's address is added to the list either when they join the channel, send a message to a channel, or make a mode change. So that means that your script won't work on idling nicks that were there before you joined the channel. To see what I mean, do a /hop and then right click on your own nick. Then /whois yourself, and right click again to see the difference. I'm not too familiar with how to keep the ial updated, but I think a /who #channel will do.

Greets


Gone.
#87915 23/06/04 05:48 PM
Joined: Mar 2004
Posts: 45
D
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Mar 2004
Posts: 45
My script always does a /who on join, so the IAL is always updated...it worked thank you very much smile

#87916 23/06/04 09:53 PM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
Hehe ok.

If I may make a suggestion for your script. You can really save a lot of redundant code by making stuff modular. For example:
Code:
  
alias banuser {
  if ($me isop $active) { ban -k $1 $2 $$input(Enter reason for kick/ban of " $+ $1 $+ ":,egqyq,Dae's Ban Script) }
}
 [color:red]  [/color] 
menu nicklist {
  Dae's Kick/Ban Script
  .Kick/Ban (own reason)
  ..0. $address($1,0) : banuser $1 0
  ..1. $address($1,1) : banuser $1 1
  ..2. $address($1,2) : banuser $1 2
  ..3. $address($1,3) : banuser $1 3
  ..4. $address($1,4) : banuser $1 4
  ..5. $address($1,5) : banuser $1 5
  ..6. $address($1,6) : banuser $1 6
  ..7. $address($1,7) : banuser $1 7
  ..8. $address($1,8) : banuser $1 8
  ..9. $address($1,9) : banuser $1 9
}

What it does is pass the parameters $1 (nickname) and the mask number (e.g. 2) to the alias banuser, which takes care of the rest. That way you don't have to repeat that long line of code every time, but you can simply call that 1 alias. Also added a check for op status before banning.


Greets

Last edited by FiberOPtics; 23/06/04 10:08 PM.

Gone.

Link Copied to Clipboard