A friend wanted this. Took less than 5 minutes to make after he found a site I could socket to.
(+) It has a 10 second spam protection
(+) Has an On Load script to set the bot's name the script will run on
(+) Sockets to www.thesurrealist.co.uk
on *:load:{ set %name.slogan $?="Enter the name of the bot you wish to have the Slogan Script run." }
on *:text:*:#:{ if (slogan isin $1) && ($left($1,1) isin .`!@) { if ($me == %name.slogan) { if (!$sock(slogan)) && (!%slogan.spam [ $+ [ $Nick ] ]) { set -u10 %slogan.type $left($1,1) | set -u10 %slogan.spam [ $+ [ $Nick ] ] 1 | tokenize 32 $remove($strip($1-),$chr(124),$chr(36)) | set %slogan.nick $nick | set %sloganName $2- | sockopen slogan www.thesurrealist.co.uk 80 | set %slogan.chan $chan } } } }
on *:sockopen:slogan:{ tokenize 62 $sock(slogan).mark | sockwrite -nt $sockname GET $+(/slogan.cgi?word=,%sloganName) HTTP/1.0 | sockwrite -nt $sockname Host: www.thesurrealist.co.uk $+ $crlf $+ $crlf }
on *:sockread:slogan:{ sockread %slogan | tokenize 62 $sock(slogan).mark | if (*<p class="mov">Paste <b>* iswm %slogan) { set %slogan.end $remove(%slogan,<p class="mov">Paste <b>,</b> into a web) | $iif(@ == %slogan.type,$iif(c isincs $chan(%slogan.chan).mode,msg %slogan.chan [Slogan] %slogan.end,msg %slogan.chan $+($chr(3),00,$chr(44),01[,$chr(3),4,$chr(44),1,Slogan,$chr(3),0,$chr(44),1],$chr(3),04,$chr(44),01,$chr(32),%slogan.end)),notice %slogan.nick $+($chr(3),00,$chr(44),01[,$chr(3),4,$chr(44),1,Slogan,$chr(3),0,$chr(44),1],$chr(3),04,$chr(44),01,$chr(32),%slogan.end)) | unset %slogan* | sockclose $sockname } }
lol sunslayer, I know that word is not popularly used (though I've heard and seen people converse in that word), but it's in the dictionary. And it simply means: >
Also, Phoenix, it's always a best practice to include parenthesis in your regex. Believe it or not, sometimes a regex fails to work without them...or when you have more than one matching range on the same line.
By the way, nice script you've posted.
Oh wait a minute. I feel pretty stupid right now LOL.
I normally do a regex match like that with /i but I completely forgot about /S
The only reason I did it like that was because people use the scripts to talk in color (which is incredibly annoying and retarded) so I made it like that to prevent it.
So yes, I could do /^[.`!@]slogan/Si
after probably close to a minute of spacing the code out...
using * as the only matchtext uses much more cpu compared to using a regex match like
/^[.`!@]slogan/i
and also allows you to remove
if (slogan isin $1) && ($left($1,1) isin .`!@) {
tokenize 62 $sock(slogan).mark
is unnecisary(i think thats correct spelling?) as you dont use a token identifier nor do you even use the sockmark command
this is probably one of my longest comments ever.
but either way it works and serves some fun for a lil while