Everyday, I am abused by many Hawkee users on IRC (cough Eugene cough Nemesis cough NIGathan), so I have decided to take their idea and use it against them - a protection script to ward off these evil people.
- @Nemesis sends his legion OF KILLER WERERATS after Kirby »~(,,^-> »~(,,^-> »~(,,^->
- @KublaiKhan sends his legion OF KILLER WERERATS after Kirby »~(,,^-> »~(,,^-> »~(,,^->
- @NIGathan sends his legion OF KILLER WERERATS after Kirby »~(,,^-> »~(,,^-> »~(,,^->
- @NIGathan sends his legion OF KILLER WERERATS after Kirby »~(,,^-> »~(,,^-> »~(,,^->
- @KublaiKhan sends his legion OF KILLER WEREMICE after Kirby »~(,,^-> »~(,,^-> »~(,,^->
- @NIGathan sends his legion OF KILLER WEREMICE after Kirby »~(,,^-> »~(,,^-> »~(,,^->
- @KublaiKhan sends his legion OF KILLER WEREMICE after Kirby »~(,,^-> »~(,,^-> »~(,,^->
- @NIGathan sends his legion OF KILLER WEREMICE after Kirby »~(,,^-> »~(,,^-> »~(,,^-> :(
Behold! /animal!
- @Kirby sends his KILLER WEREWOODCHUCK after KublaiKhan
- @Kirby sends his KILLER WEREFROG after NIGathan
- @Kirby sends his KILLER WEREKOALA after NIGathan
- @Kirby sends his KILLER WEREIBEX after Nemesis
- @Kirby sends his KILLER WEREORYX after KublaiKhan
- @Kirby sends his KILLER WEREIGUANA after KublaiKhan
- @Kirby sends his KILLER WEREELK after Nemesis
- @Kirby sends his KILLER WEREALPACA after Nemesis
This script basically takes a random animal from http://www.rickwalton.com/curricul/lanimals.htm and then basically capitalizes it and adds 'WERE' to it.
Then, the script either takes a random nick from an active channel, the nick from an active query, or a nick that you desire by adding a second parameter to the alias.
Syntax: /animal <nick (optional)>
Enjoy attacking your Nemesis.
alias animal { if (!$sock(animals)) { sockopen animals www.rickwalton.com 80 | sockmark animals $active $iif($1,$1,$iif($chan,$nick($v1,$r(1,$nick($v1,0))),$active)) $r(1,183) } }
alias -l htmlfree { var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x, ) | return %x }
on *:sockopen:animals: { sockwrite -n $sockname GET /curricul/lanimals.htm HTTP/1.0 | sockwrite -n $sockname Host: www.rickwalton.com $+ $crlf $+ $crlf }
on *:sockread:animals: { if ($sockerr) { echo -a * There was a problem retrieving data from the website. Please try again. } | else { sockread %animals | tokenize 32 $sock($sockname).mark | if (<td width=25%> isin %animals) { inc %animal } | if (%animal == $3) { describe $1 sends a KILLER $+(WERE,$upper($htmlfree(%animals))) after $+($2,!) | unset %animal* | sockclose animals } } }
This script is no longer working due to the site "http://rickcreation.com/rickwalton/index.htm/curricul/lanimals.htm" not existing anymore.
knoeki, here is an expanded version of the script if you are interested. :>
http://nopaste.com/p/a7YxCd7Wb
Well knoeki, I thought that this was a real compact snippet, so I didn't feel the need to "stretch" it out too much; of course, if it's a huge piece of code, then I would just lay it out normally.
isn't part of the purpose of the snippets here learning? ...I think readable code is easier to understand... and it makes sure you learn good coding practices (such as indenting).Well, reading and interpreting already-made scripts can help the learning process of mIRC scripting, but you shouldn't 100% rely on them. Although, non-compressed code does make it softer on the eyes to debug and everything.
I have to agree with Jonesey44 here... imho it's better to have readable code rather than compact code, unless you have extremely timing critcal stuff where 1% speed gain matters...
It's also fine if you still prefer compressed code, but... isn't part of the purpose of the snippets here learning? ...I think readable code is easier to understand... and it makes sure you learn good coding practices (such as indenting). I'm not saying you have to, but it's still important to know.
tl;dr: compact code is cool, as long as you can also write readable code ;_)