Random FML

By knoeki on Mar 17, 2009

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,&nbsp;)
  return %x
}

Comments

Sign in to comment.
dma   -  Mar 19, 2016

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 } }

 Respond  
cptpan   -  Sep 22, 2012

var d=document.location;var t=new Date;document.write("\x3C/script>")» Navigation : FMyLife → Random FMLsToday, I was trying to go.....

 Respond  
b0sse   -  May 06, 2011

none of the fml scripts posted in here works anymore.

 Respond  
Vegitha   -  Mar 27, 2011

i agree with cold fussion

dma  -  Dec 18, 2015

I Agree

Sign in to comment

david08   -  Apr 08, 2010

Its working perfect now

thanks Jethro_ for your reply !!!

:D

 Respond  
Jethro   -  Apr 05, 2010

There are several variations here. Which one are you referring to?

As far as I can see, everybody will see the message triggered by the script.

 Respond  
david08   -  Apr 05, 2010

thanks alot, this working great !!!

Only problem is that fml is only show up for people type !fml. How can make it show up to the channel so everyone can see it together?

Many thanks.

 Respond  
VinX   -  Mar 22, 2010

<3 lg84 , kickass bro .. ty

 Respond  
bugboy1028   -  Dec 31, 2009

Can you make me a script that allow user to look at FML once per HOUR?

 Respond  
dakotam0813   -  Dec 21, 2009

Awesomeness. Thanks :)

 Respond  
Cold_Fussion   -  Nov 12, 2009
 Respond  
Cold_Fussion   -  Nov 12, 2009

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!

 Respond  
Cold_Fussion   -  Nov 12, 2009

crap code... doesnt work one bit...

0/10... Nice Day... ill make my own rather

lol

  • /msg: insufficient parameters (line 21, FML.mrc)
  • /msg: insufficient parameters (line 21, FML.mrc)
  • /msg: insufficient parameters (line 21, FML.mrc)
  • /msg: insufficient parameters (line 21, FML.mrc)
  • /msg: insufficient parameters (line 21, FML.mrc)
  • /msg: insufficient parameters (line 20, FML.mrc)
  • /msg: insufficient parameters (line 20, FML.mrc)
 Respond  
knoeki   -  Oct 11, 2009

I might give it a shot later tomorrow. it shouldn't be too hard. :_)

 Respond  
Purplebeard   -  Oct 11, 2009

please do =)

 Respond  
knoeki   -  Oct 09, 2009

you do realize it's much easier to do this to make random colours, right?

msg %fmltarg $+(,$rand(2,15)) %fml_output

just an example, but you get the point. makes it so much shorter ;_)

...I should really make a proper FML/MLIA/MLIG script.

 Respond  
lg84   -  Oct 09, 2009
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,&nbsp;)
  return %x
}

on *:text:!cleanfml:*: {
  msg $chan 14Cleaning up !fml variables and sockets... done!
  unset %fmltarg
  unset %fml* %t
  unset %fmltemp
  sockclose fml 
}
 Respond  
RicJames   -  Sep 08, 2009

@napa182 sorry didn't realize that. How do i change that ? Also is their a way to add colour to the FML at the end?

Thanks In Advance

 Respond  
Spanky   -  Aug 29, 2009

yea, it could be, i dont know i just found it and posted if its yours i will, credit you sorry man lol

 Respond  
napa182   -  Aug 29, 2009

@RicJames
the one i made still works just fine.
just remember the one i made the bot has to have +o to use it.

@Spanky that mla script looks like the one i posted on www.ezzychat.com Jun 03, 2009 just changed abit

 Respond  
Ghost-writer   -  Aug 28, 2009

good for a short code :O

 Respond  
RicJames   -  Aug 28, 2009

napa's fml snippet has stopped working. as for the scakk and torrentialstorm ones can anyone tell me how i might be able to add a bit of colour to them. Thanks in Advance.

 Respond  
Purplebeard   -  Aug 03, 2009

the MLIA one works great

is there a way to turn that into a FML one?

 Respond  
VinX   -  Aug 03, 2009

thanks Spanky

 Respond  
Spanky   -  Aug 02, 2009

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.

 Respond  
VinX   -  Aug 02, 2009

sweet ...

@Soltitude ... dude , mlia doesnt work .. thanks for the effort though

GMH doesnt work too

FML and FWM work sweeet

 Respond  
Spanky   -  Aug 01, 2009

all of the givesmehope ones dont work but anyway fwhyme epic win.

 Respond  
Purplebeard   -  Jul 18, 2009

all of the things start with Close the Advertisment

and for quotes it says " instead of "

 Respond  
Solitude   -  Jul 17, 2009

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 }
}
 Respond  
Solitude   -  Jul 16, 2009

( 03:09:06 ) ( Simplicity ) .fml
( 03:09:12 ) ( JustaBot ) Close the advertisementToday, my mother called to say that my 11 year old nephew found my secret stash of nipple tassles, furry hand cuffs, and a bottle of lube. He doesn't want to visit me anymore. FML

 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.