Heart Thunder

Platform:  mIRC
Published  Jun 06, 2012
Updated  Jun 27, 2012
Hawkee's sort of becoming my depository for whatever script I write, no matter how stupid or frivolous. This is one of those. Move along. Nothing to see here. alias thunder {
if %thunderon {
set %thunderon 0
echo 1 <3 thunder off
}
else {
set %thunderon $chan
echo 1 <3 thunder $chan 
}
}

on *:INPUT:*: {
if (%thunderon == $chan) && !$regex($1-,^/) {
var %tnick 1
var %tlength 0
var %thunder <3 thunder
while $nick($chan,%tnick) {
if $len($nick($chan,%tnick)) > %tlength {
var %tlength $len($nick($chan,%tnick))
}
if ($nick($chan,%tnick) !isop $chan) && ($nick($chan,%tnick) !ishop $chan) && ($nick($chan,%tnick) !isvoice $chan) {
dec %tlength 1
}
inc %tnick 1
}
if ($me !isop $chan) && ($me !ishop $chan) && ($me !isvoice $chan) {
inc %tlength 1
}
while %tlength > $len($me) {
var %thunder  %thunder
dec %tlength 1
}
msg $chan %thunder $1-
halt
}
}

on *:TEXT:#: {
if (%thunderon == $chan) && ($me isop $chan) && !$istok($1-,<3,32) || ($gettok($1-,$calc($gettok($1-,<3,32) + 1),32) != thunder) {
kick $chan $nick <3 thunder
}
}

Comments

Sign in to comment.
Geckat   -  Jun 10, 2012
Thanks much; I'll try all that and see how it goes. Cheers.
 Respond  
Yawhatnever   -  Jun 10, 2012
Yes it would, and if you wanted to take it a step further you could use

Code

 
$nick(#,%tnick,r) would return $null if %tnick was not a regular user on the channel. (use /help $nick for detailed information)

Negated identifiers and variables are true if the value is 0, $null, or $false.

# is interchangeable with $chan, but not $chan(). I prefer # because it's easier to type.

mIRC also lets you define and assign multiple variables at once, so

Code

 
could be turned into

Code

 
if you wanted to.

Also, I personally would change

Code

 
to

Code

 
out of habit and hopefully to ensure correct parsing, but if your way works then it's just personal preference.

Keep it up!
 Respond  
Geckat   -  Jun 09, 2012
Actually, will that work for

Code

 

as well?
ie

Code

 
 Respond  
Geckat   -  Jun 09, 2012
Will do, thank you. :)
 Respond  
Yawhatnever   -  Jun 09, 2012

Code

 


You could shorten this to

Code

 
 Respond  
Geckat   -  Jun 06, 2012
It's adding a space in there. Unfortunately doesn't show up in the new code window.
 Respond  
SunnyD   -  Jun 06, 2012
What I don't get is why on line 18 you set %thunder to itself repeatedly?
 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.