This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Ramdom quote from fmylife.com

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
A
Andreoli
Voice
Posts: 4
Joined: Mon Jul 12, 2010 10:15 pm

Post by Andreoli »

Ok, i got it working, but it has so much lag once I issue the command !fmylife, is anyone able to fix this by editing the script? Appreciate the help, got the script working but takes it 4 minutes to answer one command. :?
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

Andreoli wrote:Ok, i got it working, but it has so much lag once I issue the command !fmylife, is anyone able to fix this by editing the script? Appreciate the help, got the script working but takes it 4 minutes to answer one command. :?
If you meant, tommek's script, then yes it has serious parsing issues that will cause it to take forever to finish. It runs a huge series of scrubbers over the entire html, this will take forever.

Instead it should pluck things from the html (regexp) into variables, and then use scrubbers (regsub) to remove undesireable elements from these variables. This method would be near instantaneous. This is how most scripts parsers are written. I have no idea why tommek made such a radical change with his parsers to make them so slow.
[10:34am] <speechles> !webby http://www.fmylife.com/random --regexp class="fmllink">(.*?)</p>--
[10:34am] <sp33chy> regexp: capture1 ( Today, I was taking a nap on the couch when my 2 year old daughter decided that daddy needed an ear cleaning. With all the grace of toddlerhood, she proceeded to stab me in the eardrum with a Q-tip. Now I can't hear her coming. FML )
Webby did this within 10 seconds. It uses regexp and regsub to scrub out excessive html elements. His script can do the same thing.
Last edited by speechles on Sun Jul 18, 2010 1:36 pm, edited 1 time in total.
User avatar
Trixar_za
Op
Posts: 143
Joined: Wed Nov 18, 2009 1:44 pm
Location: South Africa
Contact:

Post by Trixar_za »

There might always be a little lag when it comes to fmylife quotes. The website is actually pretty busy, which is why it lags or times out. It might also have something to do with you eggdrop host's connection.

My eggdrop is hosted on a T1 connection and sometimes takes up to 10 seconds to get the quote. Other days it just times out. Mostly it's about ~2 second delays though. Seems a bit more serious for you however. Maybe check with your host and see what's up.
A
Andreoli
Voice
Posts: 4
Joined: Mon Jul 12, 2010 10:15 pm

Post by Andreoli »

Ah well I host it from internet server provider. I have a great connection, and it is just that the script takes soo much time getting the quote, if it got the Fmylife quotes, not randomly but in order from newest to oldest perhaps that would reduce lag, seeing it is more orderly? One last thing, what is the whole script that doesn't include it to randomly announce a quote every let's say 10 minutes? I have a very vague understanding of Tcl scripting so sorry for my lack of knowledge towards all of this.:P
User avatar
username
Op
Posts: 196
Joined: Thu Oct 06, 2005 9:20 am
Location: Russian Federation, Podolsk
Contact:

Post by username »

Andreoli wrote:... One last thing, what is the whole script that doesn't include it to randomly announce a quote every let's say 10 minutes? ...
Set

Code: Select all

# auto query
# 0 - off, 1 - on
set fmylife_auto_query 1

# set auto query interval (minutes)
set fmylife_auto_interval 10
in the head of the script.

And about the time
[23:27:24] <@tvrsh> !load fmylife.tcl
[23:27:24] <+bionic> -(Load)- Script: fmylife.tcl - Size: 5.73046875 Kb - Status: OK -(Info)-
[23:27:25] <@tvrsh> !fmylife
[23:27:26] <+bionic> Today, at ...
~1 second.
Архив TCL скриптов для ботов Eggdrop/Windrop:
http://egghelp.ru/
h
holycrap
Op
Posts: 152
Joined: Mon Jan 21, 2008 11:19 pm

Post by holycrap »

Add an option to be able to PM the bot and use the command...? Thanks! :D
User avatar
username
Op
Posts: 196
Joined: Thu Oct 06, 2005 9:20 am
Location: Russian Federation, Podolsk
Contact:

Post by username »

holycrap wrote:Add an option to be able to PM the bot and use the command...? Thanks! :D
Find

Code: Select all

bind pub - !fmylife fm_main_proc
and change to

Code: Select all

bind pub - !fmylife fm_main_pub
After that add

Code: Select all

bind msg - !fmylife fm_main_msg

proc fm_main_pub { nick uhost hand chan arg } {
global fmylife_channels

    if {[lsearch $fmylife_channels $chan] == -1} {
       return 0
    }
    fm_main_proc $nick $uhost $hand $chan $arg
}

proc fm_main_msg { nick uhost hand arg } {
    fm_main_proc $nick $uhost $hand $nick $arg
}
And in proc fm_main_proc delete this lines

Code: Select all

    if {[lsearch $fmylife_channels $chan] == -1} {
       return 0
    }
Архив TCL скриптов для ботов Eggdrop/Windrop:
http://egghelp.ru/
h
holycrap
Op
Posts: 152
Joined: Mon Jan 21, 2008 11:19 pm

Post by holycrap »

Works like a charm.

Thanks! :D
User avatar
username
Op
Posts: 196
Joined: Thu Oct 06, 2005 9:20 am
Location: Russian Federation, Podolsk
Contact:

Post by username »

You can download latest version from this page.
Архив TCL скриптов для ботов Eggdrop/Windrop:
http://egghelp.ru/
User avatar
username
Op
Posts: 196
Joined: Thu Oct 06, 2005 9:20 am
Location: Russian Federation, Podolsk
Contact:

Post by username »

Ive tried to add search function to this script and I cannot understant word decoding in this site. I thought it was Base64 but I was wrong.
For example it decode 'beer' to '4ca835d26b004'.
Архив TCL скриптов для ботов Eggdrop/Windrop:
http://egghelp.ru/
F
FightingNavyman
Voice
Posts: 35
Joined: Tue Jan 18, 2011 12:39 pm

Fmlife.tcl

Post by FightingNavyman »

When can we see a 2011 version :)
S
Sydneybabe
Op
Posts: 106
Joined: Fri Apr 27, 2007 3:31 am
Location: Philippines

Post by Sydneybabe »

Hi why the message on the channel every xx minutes only like this?
<+bot> "Virginia)
<+bot> "Massachusetts)
<+bot> "Delaware)
This script is working before and i don't why this happen :(
g
goalie204
Halfop
Posts: 44
Joined: Thu Apr 28, 2011 7:31 pm

Post by goalie204 »

me too, just not working anymore


<nostalgic> !fml
<secksy> "Virginia)
<nostalgic> !fml
<secksy> "Stockport)
User avatar
Trixar_za
Op
Posts: 143
Joined: Wed Nov 18, 2009 1:44 pm
Location: South Africa
Contact:

Post by Trixar_za »

This is because the layout changed again...

Basically the div class got changed from "post" to "post article". Here's an example of how it looks after it's cleaned up:

Code: Select all

<div class="post article" id="7966871"><p>Today, my seven-year-old sister came to stay at my house for the night. She usually just sleepwalks. But tonight she sleep-peed in my clean clothes basket. FML</p>
There is also a new (<span>number</span>) in the above code that isn't show. Just add a regex scrub for it and it should disappear. All this has been added to my script and uploaded. I had a look at username's script, but I'm unsure how to fix it. He grabs more information that mine does, so more changes might be needed for his version. Anybody that's willing, please help out these people :)
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

<speechles> !fml
<sp33chy> Today, as I woke up early to do my physics homework, I heard my parents talk about how big a disappointment I am for them. They discussed how stupid, immature and how big a burden I was. They knew I was listening. FML
<sp33chy> #6403187 (91) I agree, your life sucks (25084) - you deserved it (2792) - On 11/22/2009 at 10:39am - misc - by Cerezo (man) - Guatemala (Guatemala) @ http://www.fmylife.com/miscellaneous/6403187

<speechles> !fml kids
<sp33chy> Today, I surprised my four year old daughter with a stuffed dinosaur. She named it 'Horny.' FML
<sp33chy> #17145702 (116) I agree, your life sucks (3993) - you deserved it (807) - On 07/17/2011 at 3:14am - kids - by douglas - United States (Washington) @ http://www.fmylife.com/kids/17145702

<speechles> !fml kids 4
<sp33chy> Today, I was invited over to a dinner with the CEOs of my company, along with my two children. My 3 year-old asked loudly why we have two "nose holes", to which my 4 year-old son replied "So you can pick your nose and still breathe!" He then demonstrated. FML
<sp33chy> #17088457 (119) I agree, your life sucks (7833) - you deserved it (1725) - On 07/13/2011 at 12:43am - kids - by ohno - United States (Colorado) @ http://www.fmylife.com/kids/17088457

<speechles> !fml love 4-6
<sp33chy> Today, I was video chatting with my boyfriend of two years. He randomly asked me to turn off my webcam. I asked why, and he said to just trust him. Turns out it was because he didn't want to see my face as he broke up with me. FML
<sp33chy> #17125458 (121) I agree, your life sucks (7530) - you deserved it (470) - On 07/15/2011 at 6:21pm - love - by emily - United States (Massachusetts) @ http://www.fmylife.com/love/17125458
<sp33chy> Today, I learned why my boyfriend of 10 months and I never hang out at his place. He still lives at home with his mother. He's 38. FML
<sp33chy> #17116757 (159) I agree, your life sucks (5933) - you deserved it (1036) - On 07/15/2011 at 1:51am - love - by brsoxgirl - United States (New Jersey) @ http://www.fmylife.com/love/17116757
<sp33chy> Max-results of 2 reached, refine search to see more...
Another one for people to experiment with. This one is using Incith's layout as it's base. Have fun, dance like an robot. It supports ranges, categories, and other stuff. It displays verbatim as would appear on the webpage without rewording a thing. Experiment with it. It's simply another choice for an FML script amongst the withering vines that are FML scripts.

Download it here: Incith-FML v1.0

Now supports paging.. see below..
<speechles> !fml mi-page 7sc 5
<sp33chy> Today, I was so hungover, I started yelling at inanimate objects. My mom walked in on me calling my cereal a "worthless piece of [censored] sent from the bowels of Hell." FML
<sp33chy> #16950938 (245) I agree, your life sucks (2618) - you deserved it (12157) - On 07/02/2011 at 4:54pm - misc - by Cowgirl_Up37 (woman) - United States (Texas) @ www.fmylife.com/miscellaneous/16950938 (entry 5) www.fmylife.com/miscellaneous?page=7

<speechles> !fml work -page 2 4
<sp33chy> Today, my boss gave me a speech about my "motivation issues". I've been working for him for 2 months, the commissions I've made for him paid off his bills, so what are my motivation issues? I turned down his offer of a date. I have a boyfriend. He keeps asking. FML
<sp33chy> #16827644 (88) I agree, your life sucks (9673) - you deserved it (612) - On 06/24/2011 at 1:11am - work - by Leah (woman) - United States @ www.fmylife.com/work/16827644 (entry 4) www.fmylife.com/work?page=2
Paging is done with the -page switch. You can embed this as I did above in the first request and it still works perfectly fine. Enjoy :P

The categories you can use in your !fml requests are:
love, money, kids, work, health, intimacy, misc, random

Try for example: !fml intimacy
then.. !fml intimacy 2
and 3, 4, 5, 6, 7, 8, 9, 10
once you hit 10, start to page
!fml intimacy -page 1
!fml intimacy 2 -page 1
!fml intimacy -page 1 3
etc etc etc
it literally does not matter where you place the paging switch. Paging is allowed up to 9 pages. It can go higher, if you need it to let me know. The page switching is also off by 1. This is normal. As using -page 1 gets you the page _after_ using no page switch, aka, page 2. -page 2 would get you page 3. Etc etc. Hopefully you understand.
Post Reply