Apr 30, 2012
SwiftIRC #mSL

Activity Stream

Yawhatnever commented on a Page, Phishing/malware Link Detection  -  Nov 16, 2016

Updated to use v3.1 of google's api. New keys being generated weren't working with v3.0.

v3.x will only work until early 2017, so be aware of that. If it breaks send me a message, because I probably won't update it unless I know someone is actually using it.

Yawhatnever commented on a Page, twitch.tv basic commands for mIRC  -  Jul 04, 2015

Updated due to recent changes by twitch:

  • Joins, parts, and mods are now requested via CAP negotiation
  • twitch.tv/commands capability is now requested to get NOTICEs (messages no longer come from jtv)
  • Extra commands are hidden
Yawhatnever   -  Jan 10, 2015

@Hawkee it seems like the spam bots are returning

Is that last event on line 23 where variables are cleaned up meant to be on *:sockclose: instead of sockread?

Yawhatnever commented on a Page, Page Title  -  Dec 26, 2014

Line 5 is missing one $gettok(

Yawhatnever commented on a Page, Twitch !watch command(s)  -  Oct 11, 2014

I would use $+([, $nick, ]:) to surround $nick with brackets because you will be less likely to accidentally introduce a ] bracket somewhere. Since [ ] are eval brackets in mSL, it could potentially lead to risky code in some cases. Perhaps not for twitch, but it's one of those things that's good to get in the habit of watching out for.

Is there a reason you didn't just reply to the original thread on the mIRC forums instead of posting here? This is only half of a script; it's missing the part where user data is stored. That makes it kind of useless for anyone who views it here.

!watchnicks will easily reach Twitch spam limits if more than 20 (or 100 if the bot is a mod) nicks are in the list, causing the bot to be locked out of chat for 8 hours. There is also no flood protection limit that I can see, so even if there are only 10 users in the list somebody could use the command 2-10 times in a row to get the bot banned for 8 hours.

Since the part where points/time are increased is missing I can't tell if this tracks every viewer or just specific ones, but I would assume it tracks all viewers. The system should really use something besides an ini file to store the data, because many twitch channels are VERY large and storing everything in points.ini will eventually start causing mIRC to freeze. I guarantee this will happen much more frequently than you think. You should at least use a hash table, and perhaps set up a system that periodically either removes users after a period of inactivity or archives their data to speed up operations on the table of active users.

Yawhatnever   -  Sep 06, 2014

There appears to be a slight spam problem @Hawkee

Yawhatnever commented on a Page, Mirc simple mass mode script  -  Sep 03, 2014

Why are you using eval brackets everywhere?

Yawhatnever commented on a Page, twitch.tv basic commands for mIRC  -  Aug 14, 2014

Updated to use $servertarget (introduced in mIRC 7.34) for identifying the twitch connection. The old methods for identifying the twitch connection have been removed.

I also updated the script so that passwords for multiple nicknames can be saved. You can switch between nicknames using /twitch_nick (you will also need to reconnect). Only one can be connected at a time (this is by design).

For a while a few of the IP addresses hosting twitch chat didn't have port 6667 available, so the port can also be changed more easily in the script now. Twitch chat listens on ports 80, 443, and 6667.

Yawhatnever commented on a Page, digimon mIRC script  -  Apr 01, 2014

Only the first matching event per script file will be triggered. You'll need to combine your on *:start: events and any others that overlap in that way.

Yawhatnever commented on a Page, "Bop" Command [Twitch.TV]  -  Mar 10, 2014

A few issues:

if (ismod) { }

is ALWAYS true because 'ismod' has no special meaning (it's just a normal string). Since it's not $null, $false, or 0 the condition evaluates as $true. This means that anybody can use the !bop command, not just mods. Consider replacing with the following:

if ($nick isop $chan) { }

This is not a perfect fix because mIRC will sometimes see mods deopped due to the order in which twitch sends +o/-o messages and joins. It will, however, prevent non-mods from using the command. The only way to keep an accurate list of mods currently in the channel on twitch is to track the +o/-o messages independently and store the list separately.

msg $chan .timeout $2 1 $2-

This actually breaks the intended function of the script. The [./]timeout command doesn't accept a third parameter (the $2- after '1' is the third parameter you're sending), and sending a third parameter breaks the command for whatever reason and it defaults back to a 600 second timeout.

Yawhatnever commented on a Page, Make your bot Talk  -  Dec 14, 2013


ALWAYS USE THE n SWITCH for $read() and $readini()!!!!!!!!!!!!!!!!

Yawhatnever commented on a Page, twitch.tv basic commands for mIRC  -  Nov 21, 2013

This link explains many of the technical differences between Twitch chat and a normal IRC server:

Some of them I've already mentioned responding to comments here.

Yawhatnever commented on a Page, Rock Paper Scissors Game  -  Nov 09, 2013

$result is already a built-in identifier for mIRC. You'll want to be careful when creating aliases that use an existing name.

Yawhatnever commented on a Page, Binary Calculator - Sockets  -  Oct 31, 2013

$base() can convert numbers between arbitrary bases.
For example:

on $*:text:/^!base +[01]+\b/Si:#:msg # Decimal: $base($2, 2, 10)
Yawhatnever created a Page  -  Oct 21, 2013


Yawhatnever commented on a Page, twitch.tv basic commands for mIRC  -  Sep 23, 2013

Twitch now requires using an OAuth token to connect. When connecting using this script, set your password as 'oauth:token'.
You can generate a token here for now:

Yawhatnever commented on a Page, 10 minute Ban  -  Jul 31, 2013

mIRC's /ban command supports kicking and timed unbanning.

menu nicklist {
  ..Ban $1:ban -ku600 $1 2 10 Minute Ban
Yawhatnever commented on a Page, Bot About Script  -  Jun 25, 2013

I think you mean

alias -l config.source ...

Either that, or

msg $chan Lines of Code: $lines($$$config.source) ...
Yawhatnever commented on a Page, twitch.tv basic commands for mIRC  -  Jun 24, 2013

Made a small change to make sure channel names are always lowercase (you'll have problems if they're not). Just to be sure, use /twitch instead of /join.

As a side note, mIRC's built in ignore functions work fine for Twitch.

Yawhatnever commented on a Page, Money Variations  -  Jun 23, 2013

Nice little snippet. A few things to note:

It doesn't actually work. You have a comma inside the expression which is causing the match to fail because mIRC sees it as an argument separator. You should save the expression to a %var and then use $regex(%a, %var). Escaping dots and commas inside a character class also isn't necessary. e.g. [.\,] == [.,]

Inside $util.sanitizeNum() this is kind of difficult to read:

if (%a !isnum 48-57 && %a !isnum $iif($2 == dec,44-46,48)) {

For starters, you've used the ascii values instead of the literal characters. The conditional is also a bit confusing, because you've essentially got something like if (%a !isnum 48... && ... !isnum 48). Not to mention looping through 255 times is going to be really slow if it's used frequently (such as inside another loop).

I'm also not really sure it accomplishes the goal of sanitizing a number. If the 'dec' argument is given, it simply leaves all commas and dots regardless of the number system used. mIRC won't properly parse and calc a numbering system using dots as separators (e.g. 4.000.000) nor will it be able to do $calc(4,000,000). Commas are seen as argument separators, and even if it's inside a variable it won't be calculated properly. I'm not sure if the sanitizeNum alias was meant to work with dot separator numbering systems or not, but either way the commas should always be stripped for mIRC.

You can do the same thing with a simple $regsubex() replace:

alias util.sanitizeNum {
  var %expression $iif($2 == dec, /[^\d.]/g, /[^\d]/g)
  return $regsubex($1, %expression, $null)

which removes everything that's not a digit, or if 'dec' is specified everything that's not a digit or a dot.

$money.variations() uses the same slightly changed command three times, so it could be shortened. It also uses $regex() to check the format before anything is done, so there's really no reason to use $util.sanitizeNum() at all because you already know your numbers are in a specific format. This means you could simply $remove() the commas.

Line 6 also removes "m" when it should be removing "million", although using $util.sanitizeNum() makes all of the $remove() and all of line 6 redundant because it would strip all of the characters anyway.

alias money.variation return $regsubex($remove($1, $chr(44)), /^\$?([\d.]+)(?:(k)|([mb])(?:illion)?|(t)(?:rillion)?)?$/Si, $ $+ $bytes($calc(\1 * 10 ^ (3 * $pos(kmbt, \2))), b))
Yawhatnever commented on a Page, Seen System - Help Needed!  -  Jun 22, 2013

Yes, using a loop to read through hundreds of lines will be slow. You should use $read()'s built in search functions. (/help $read)

if ($nick ison $chan) {
      var %relay notice $nick
      var %relay2 msg $chan
      goto seen
    if ($nick !ison $chan) {
      var %relay msg $nick
      var %relat2 msg $nick
      goto seen

Could be changed to something like:

if (#) {
  var %relay notice $nick
  var %relay2 msg $chan
else {
  var %relay msg $nick
  var %relay2 msg $nick
  ;I'm assuming "relat2" was a typo here.
  ;There's no reason to use 'goto seen'.

'goto seen_true' should really just be 'break' to exit the loop.

You can get rid of a lot of variables here:

    var %hostname_seen $address($nick,2)
    var %hostname-minus-front_seen $remove(%hostname_seen,*!*@)
    var %hostname-minus-back_seen $remove(%hostname-minus-front_seen,.users.netgamers.org)
    var %access_seen $readini(adata.ini,%hostname-minus-back_seen,access)


    var %access_seen $remove($address($nick,2),*!*@,.users.netgamers.org)
    var %access_seen $readini(adata.ini,%access_seen,access)

$chr(19) in the hostmask is strange, I don't think I've seen that before.

    if (%access_seen == hc || %access_seen == bc || %access_seen == scanner || %access_seen == member) {
;could be
    if ($istok(hc bc scanner member, %access_seen, 32)) {

Rather than using a bunch of halts in the main body, just use elseif (). (syntax: /help if then else)

Yawhatnever created a Page  -  Jun 21, 2013

Common request: Simple dice games.

 Respond   mIRC  
Yawhatnever commented on a Page, Blacklist Script v1.0  -  Jun 15, 2013

Not bad!

Why do you use this? -

set %var $(%othervar)
var %new $2 $+ $chr(32) $+ $(%old)

instead of

set %var %othervar
var %new $2 %old
Yawhatnever created a Page  -  Jun 15, 2013

This script allows you to more easily connect to twitch through mIRC and provides the basic moderation commands from http://help.twitch.tv/customer/portal/articles/659095-chat-moderation-commands via right click popup menus.

Yawhatnever commented on a Page, Twitch bot - Ban cmd  -  Jun 11, 2013

Here's a script I wrote: http://www.hawkee.com/snippet/9960/

I'll start by saying that it's probably not what you're looking for. However, you could re-use many of the aliases I've written for it to detect links in your twitch chat. I'd suggest opening it in another tab and then using ctrl+f to find the aliases I'm about to reference.

For example:

on $*:text:$($catchURLex):#:{

This event would trigger when any URL was posted. However, it would also trigger for text like 'o.o'
To remove false matches, you would do the following:

var %urls $extractURL($1-)
if (!%urls) return

Inside $extractURL() I use an alias called $parseDomain(), which uses Mozilla's public suffix list to determine if the suffix used (such as .co.uk or .net) was valid or not. This means only valid domains are returned by $extractURL().

From there, you have the URLs posted inside %urls. You'd just need to loop through them and determine if the domain is whitelisted or not. For that, I have an alias called $trusted(). If $trusted(example.com) == $true, then the site is whitelisted.

It may be overkill for what you want, but if you're interested everything you'd need is in that script.

Yawhatnever commented on a Page, Save/Read Script  -  Jun 11, 2013

Using 'read' as an alias name is an ABSOLUTELY HORRIBLE IDEA because mIRC already has an identifier $read().
The same is true of /save. Just be glad you didn't call one of them /dec and then try to use it in another script inside a loop to decrease a variable (I've seen that before).

Checking if $1 is $null inside alias 'save' is redundant, because if $2 is not $null then $1 cannot be $null. Since the only valid format you have requires two parameters, you only need to check if $2 exists to know that they both exist.


could be


because 'save' and '.' are both literal text. There's no reason to $+() them together.

Yawhatnever commented on a Page, writing backwards  -  Jun 11, 2013

Isn't /unload -rs $script inside an on *:unload: event redundant?

Yawhatnever created a Page  -  Jun 10, 2013

;Some assembly required. ;More instructions are in the leading script comments.

Yawhatnever commented on a Page, Levenshtein Distance alias  -  Jun 08, 2013

There seems to be a problem when I edit with some variables (mainly %del_cost and %below) being url decoded. If there are any problems there's a raw version here: http://pastebin.com/raw.php?i=Pd5624y2

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.