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.

fmylife.com eggdrop tcl script request

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
S
Sane
Voice
Posts: 19
Joined: Sun Nov 17, 2013 12:38 am
Location: #kl-channel@Rizon.net

fmylife.com eggdrop tcl script request

Post by Sane »

Hi,

I was wondering if anyone had a working version of any of the FML scripts out there?

Or if if anyone can provide a fix for any of the fml scripts already out there? I can provide a few fml TCL pastes of code for someone to look at if need be; maybe they could fiddle with them and get them working.

Failing that, it would be amazing if someone could write a new script to fetch random FML quotes from fmylife.com

Many thanks in advance.

P.S I have searched Google of course and all the tcl/eggdrop repositories and archives that I could find, including Hawkee and some other sites but all the ones that I've tried out, and ones that I have used in the past, no longer work. Obviously due the site and layout changes overtime.

I have asked in a few IRC channels as well -- #eggdrop, #tcl, #egghelp, #script-help etc... on various servers, but I think people were away and some weren't able to help unfortunately; but I appreciate them trying though.
s
silentziler
Voice
Posts: 11
Joined: Wed Sep 09, 2015 10:57 am

fml script

Post by silentziler »

Code: Select all

############################################
#  Command for random fml quote = !fml     #
############################################

bind pub - !fml pub_FML

proc pub_FML {nick uhost handle chan text} {


        package require http
 ## UNCOMMENT FOR HTTPS ##     package require tls       
 ## UNCOMMENT FOR HTTPS ##     http::register https 443 [list ::tls::socket -tls1 1]
        set agent "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko"
        set token [http::config -useragent $agent]
        set token [http::geturl "http://www.fmylife.com/random"]
        set html [http::data $token]
        http::cleanup $token
 ## UNCOMMENT FOR HTTPS ##      http::unregister https

regexp {<p class="block hidden-xs">(.*?)</a>} $html - a
regsub -all {<[^>]*>} $a {} a
regsub -all {[\r\t\n]+} $a "" a
putserv "PRIVMSG $chan : $a"
}

putlog "Random FML loaded!"
Run !fml for random quote.
Let me know if you have any issues.
S
SVD
Voice
Posts: 9
Joined: Mon Mar 13, 2006 6:52 pm

Post by SVD »

I get the following error on Windrop 1.8.3:

Code: Select all

Tcl error [pub_FML]: can't read "a": no such variable
can't read "a": no such variable
    while executing
"regsub -all {<[^>]*>} $a {} a"
    (procedure "pub_FML" line 15)
    invoked from within
"pub_FML $_pub1 $_pub2 $_pub3 $_pub4 $_pub5"
I'm sure it's a simple fix - any ideas? Thanks in advance!
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

You get that error because the normal http page doesn't return any content and actually redirects to the https one. Load the https part of the code and should work.

Btw, I tried the code and returns the same quote every time. So much for random...
Once the game is over, the king and the pawn go back in the same box.
User avatar
Dominatez
Halfop
Posts: 50
Joined: Mon Jan 14, 2019 5:08 pm
Location: United Kingdom

Post by Dominatez »

This was never gonna work caesar.

There is something missing.

He closes a tag </a> but never actually opens one which i assume to be where he is grabbing the data from.

And i keep getting the following error no matter what i do.
And that includes using https

Tcl error [pub_FML]: can't read "a": no such variable
Post Reply