Fun for bots... this pulls a random 'fml' from fmylife.com...
Most of this was written by Scakk, and small modification by TorrentialStorm to strip the last bit away, which isn't really relevant imho.
therefor: THIS IS NOT MY CODE. I just wanted to make it available here in the snippet-section so everyone can enjoy this nice little script.
also see this thread for the origins.
I hope I credited everyone properly ;_)
on *:text:!fml:#: {
sockopen fml www.fmylife.com 80
set %fmltarg $chan
}
on *:sockopen:fml: {
sockwrite -n $sockname GET /random HTTP/2.0
sockwrite -n $sockname Host: www.fmylife.com
sockwrite -n $sockname Connection: close
sockwrite -n $sockname $crlf
}
on *:sockread:fml: {
sockread %fmltemp
if (class="fmllink"> isin %fmltemp) {
inc %t 1
set %fml $+ %t $nohtml(%fmltemp)
}
}
on *:sockclose:fml: {
var %fmlstrip $left(%fml1, $calc($pos(%fml1, FML#) + 2))
msg %fmltarg %fmlstrip
unset %fml* %t
}
alias -l nohtml {
var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x, )
return %x
}
I made a script for this but my timers are off it sts a random FML ever two mins i would like it every 4 mins or 10 mins i can post the code..
here is mine -
on :sockopen:fml-:{
tokenize 94 $sock(fml-).mark
if $sockerr { $5 Connection Error has Persisted! | return }
$1-2 | $1 $3 | $1 $4 | $1
}
on :sockread:fml-:{
tokenize 94 $sock(fml-).mark
if $sockerr { $5 Reading Error has Persisted! | return }
var %fml | sockread %fml
if $regex(%fml,/(Today.?)FML<\/a>/i) {
$5 $regsubex($regml(1),/<[^>]>|"/g,) 14[4 $+ FML $+ 14]
sockclose fml-
}
}
on :text:$($iif(!fml = $strip($1),$1))::{
if !%ffml { inc -u3 %ffml | set -u3 %fml- $+(fml,.,$ticks,.)
if $sock(fml-) { sockclose $v1 }
sockopen fml- www.fmylife.com 80
sockmark fml- $+(sockwrite -nt fml-,^,$&
GET /random HTTP/1.0,^,Host: $sock(fml-).addr,$&
^,Connection: clos,^,.msg $iif(#,#,$nick)) 14,1[4Fuck My Life14]15
}
}
alias timerfml {
if !%ffml { inc -u3 %ffml | set -u3 %fml- $+(fml,.,$ticks,.)
if $sock(fml-) { sockclose $v1 }
sockopen fml- www.fmylife.com 80
sockmark fml- $+(sockwrite -nt fml-,^,$&
GET /random HTTP/1.0,^,Host: $sock(fml-).addr,$&
^,Connection: close,^,.msg $iif(#,#,$nick)) #irc 14,1[4Fuck My Life14]15
}
}
on :TEXT:!CFML:#:{
if ($2 == $null) {
if ($($+(%,FMLTimer,$network),2) == on) { msg $Chan FML Timer is already on! If you want to clear the timer and variables type: !CFML Clear | halt }
if ($($+(%,FMLTimer,$network),2) == $null) { set %FMLTimer $+ $network on | timer $+ $network 0 480 timerfml | msg $Chan 4,1Auto-FML Quotes every0 2 4Minutes0. 4Enjoy them hosted by 0dma | halt }
}
if ($2 == Clear) { timers off | unset %FMLTimer $+ $network | msg $Chan All timers and variables are now cleared. Please Type !cfml again to Start Auto-FML | halt }
}
ON *:JOIN:#irc:{ if ($nick == $me) { .timer $+ $network $+ fml 0 120 timerfml } }
wow it actually does something
[16:08:33] !fml
[16:08:34] 14,112
[16:08:42] !cleanfml
[16:08:43] 14Cleaning up !fml variables and sockets... done!
[16:08:46] !fml
[16:08:59] !fml
[16:09:00] 14,112
[16:09:02] !fml
[16:09:03] 07,15
[16:09:09] !cleanfml
[16:09:09] 14Cleaning up !fml variables and sockets... done!
[16:09:11] !fml
[16:09:12] 07,15
[16:10:14] !fml
[16:10:15] 14,112
[16:10:17] !cleanfml
[16:10:18] 14Cleaning up !fml variables and sockets... done!
crap code... doesnt work one bit...
0/10... Nice Day... ill make my own rather
lol
on *:text:!fml:*: {
if ($nick == noob) { msg $chan www.fmylife.com - it really is that hard isnt it? | halt }
else {
set %fmltarg $chan
sockopen fml www.fmylife.com 80
}
}
on *:sockopen:fml: {
sockwrite -n $sockname GET /random HTTP/2.0
sockwrite -n $sockname Host: www.fmylife.com
sockwrite -n $sockname Connection: close
sockwrite -n $sockname $crlf
}
on *:sockread:fml: {
sockread %fmltemp
if (class="fmllink"> isin %fmltemp) {
inc %t 1
set %fml $+ %t $remove($nohtml(%fmltemp),$(Net Avenir : gestion publicitaireClose the advertisement))
}
}
on *:sockclose:fml: {
var %fmml $rand(1,$var(%fml*,0))
var %fmlcolour = $rand(1,12)
if (%fmlcolour = 1) msg %fmltarg 03,1 $+ $remove($gettok($var(%fml*,%fmml).value,1,35),$(FML))
if (%fmlcolour = 2) msg %fmltarg 04,1 $+ $remove($gettok($var(%fml*,%fmml).value,1,35),$(FML))
if (%fmlcolour = 3) msg %fmltarg 05,1 $+ $remove($gettok($var(%fml*,%fmml).value,1,35),$(FML))
if (%fmlcolour = 4) msg %fmltarg 06,1 $+ $remove($gettok($var(%fml*,%fmml).value,1,35),$(FML))
if (%fmlcolour = 5) msg %fmltarg 07,1 $+ $remove($gettok($var(%fml*,%fmml).value,1,35),$(FML))
if (%fmlcolour = 6) msg %fmltarg 08,1 $+ $remove($gettok($var(%fml*,%fmml).value,1,35),$(FML))
if (%fmlcolour = 7) msg %fmltarg 09,1 $+ $remove($gettok($var(%fml*,%fmml).value,1,35),$(FML))
if (%fmlcolour = 8) msg %fmltarg 10,1 $+ $remove($gettok($var(%fml*,%fmml).value,1,35),$(FML))
if (%fmlcolour = 9) msg %fmltarg 11,1 $+ $remove($gettok($var(%fml*,%fmml).value,1,35),$(FML))
if (%fmlcolour = 11) msg %fmltarg 13,1 $+ $remove($gettok($var(%fml*,%fmml).value,1,35),$(FML))
if (%fmlcolour = 12) msg %fmltarg 14,1 $+ $remove($gettok($var(%fml*,%fmml).value,1,35),$(FML))
}
alias -l nohtml {
var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x, )
return %x
}
on *:text:!cleanfml:*: {
msg $chan 14Cleaning up !fml variables and sockets... done!
unset %fmltarg
unset %fml* %t
unset %fmltemp
sockclose fml
}
mlia does work >_>
on $*:text:/^!mla$/iS:#: {
if (!$($+(%,mlaflood,$nick),2)) { set -u3 $+(%,mlaflood,$nick) on | if ($sock(mla)) .sockclose mla | unset %mla.* | set %mla.chan $chan | set %mla.number $r(1,15) | sockopen mla mylifeisaverage.com 80 } }
on *:sockopen:mla: { sockwrite -nt $sockname GET /index.html HTTP/1.1 | sockwrite -nt $sockname Host: mylifeisaverage.com | sockwrite -nt $sockname $crlf }
on *:sockread:mla: {
var %mla | sockread %mla
if ($regex(%mla,/\x09{11}(.+)MLIA/)) { set %mla.outcome $regml(1) | inc %mla.ms }
if (%mla.ms == %mla.number) { msg %mla.chan 14[04 My Life Is Average 14] %mla.outcome MLIA | unset %mla.* | sockclose mla }
}
made by napa182.
Heh.
if you like FML, you are going to love MLIA:
http://mylifeisaverage.com/index.html
I decided to see if it'd work if I editted napa182's code for FML to work with MLIA. It works for me.
on $*:text:/^@mlia$/iS:#: { if (!$($+(%,mliaflood,$nick),2)) { set -u3 $+(%,mlia,$nick) on | if ($sock(mlia)) .sockclose mlia | unset %mlia.* | sockopen mlia mylifeisaverage.com 80 | sockmark mlia $r(1,10) $r(2,30) # } }
on *:sockopen:mlia: { sockwrite -nt $sockname GET $+(/page/,$gettok($sock(mlia).mark,2,32),/) HTTP/1.1 | sockwrite -nt $sockname Host: $+(mylifeisaverage.com,$str($crlf,2)) }
on *:sockread:mlia: {
var %mlia | sockread %mlia
if ($regex(%mlia,/\x09(.+\sMLIA)/)) { set %mlia.outcome $regml(1) | inc %mlia.ms }
if (%mlia.ms == $gettok($sock(mlia).mark,1,32)) { msg $gettok($sock(mlia).mark,3,32) 14[04My Life Is Average 14] %mlia.outcome | unset %mlia.* | sockclose mlia }
}
I Agree