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
S
Sydneybabe
Op
Posts: 106
Joined: Fri Apr 27, 2007 3:31 am
Location: Philippines

Post by Sydneybabe »

Hello can i request the Incith-FML v1.0 script has a featured that will trigger on the channel every xx minutes without typing !fml thanks in advance :)
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

Sydneybabe wrote:Hello can i request the Incith-FML v1.0 script has a featured that will trigger on the channel every xx minutes without typing !fml thanks in advance :)
You add the code below at the very bottom of the script.

Code: Select all

namespace eval incith {
	namespace eval fml {
		# Set the timestring to automate requests here
		# default is every 5 minutes.
		variable timestring [list "?0*" "?5*"]

		# channels to announce automated queries to
		# use one channel of "*" if you want it relayed to all.
		variable channels [string tolower [list "#yourchan" "#chan2" "#etc"]]

		# attach time binds to the timestring list
		# which will call the procedure below
		foreach bind $::incith::fml::timestring {
			bind time - "$bind" ::incith::fml::timer
		}

		# invoke automatic fml, using default manner with privmsg
		# this will reply as if a user had typed "!fml" with no parameters.
		proc timer {args} {
			foreach chan [channels] {
				if {[lsearch -exact $::incith::fml::channels [string tolower $chan]]} {
					::incith::fml::fml "" $chan
				}
			}
		}
	}
}
If you need help constructing time-strings, let me know what interval you want.

Edit: Fixed missing bracket issue mentioned below.
Last edited by speechles on Tue Jul 19, 2011 3:54 am, edited 1 time in total.
S
Sydneybabe
Op
Posts: 106
Joined: Fri Apr 27, 2007 3:31 am
Location: Philippines

Post by Sydneybabe »

Hello sir speechles i added the script and there is an error on partyline and:
<bot> [14:00:00] Tcl error [::incith::fml::timer]: missing close-bracket
<bot> in expression "[lsearch -exact $::inci..."
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

Sydneybabe wrote:Hello sir speechles i added the script and there is an error on partyline and:
<bot> [14:00:00] Tcl error [::incith::fml::timer]: missing close-bracket
<bot> in expression "[lsearch -exact $::inci..."
Try the edited code above. My mistake.. Not yours.
S
Sydneybabe
Op
Posts: 106
Joined: Fri Apr 27, 2007 3:31 am
Location: Philippines

Post by Sydneybabe »

Workin' now sir speechles but one thing more is there a way only the quotes will show on channel can you exclude the #366410 (130) I agree, your life sucks blah blah and trim the FML on the last part of quotes thanks in advance sir :D

Code: Select all

<+bot> Today, my daughter was telling everyone at her elementry school about my gay partner. Yes, I have a gay partner. He is my work partner and he happens to be gay. FML
<+bot> #3663410 (130) I agree, your life sucks (41898) - you deserved it (3021) - On 07/11/2009 at 9:14am - misc - by charma (man) - United States (Florida) @ www.fmylife.com/miscellaneous/3663410 (entry 1) www.fmylife.com/miscellaneous?page=0 
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

Sure, change this part of the script:

Code: Select all

          foreach l [split $out "|"] {
            putserv "privmsg $where :$l"
          }
To look like this:

Code: Select all

          putserv "privmsg $where :[string trimright [lindex [split $out "|"] 0] "FML "]"
g
goalie204
Halfop
Posts: 44
Joined: Thu Apr 28, 2011 7:31 pm

Post by goalie204 »

i loaded the script and .restart 'd the bot, set channel to +fml and it's not responding to !fml (i have http.tcl) - no response, and no output on the party line when i try it, so i'm not sure what to do? I'm pretty novice
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

goalie204 wrote:i loaded the script and .restart 'd the bot, set channel to +fml and it's not responding to !fml (i have http.tcl) - no response, and no output on the party line when i try it, so i'm not sure what to do? I'm pretty novice
Mainly because I had poor error detection in this one. I've since done a little bit more, incorporated all the above edits into the code. And here is the new config for version 1.1 found below.

Code: Select all

    # set this to the command character you want to use for the binds
    variable command_char "!"

    # set these to your preferred binds ("one two")
    variable binds "fml fmyl [censored]"

    # set this to your default category
    # 1 - love
    # 2 - money
    # 3 - kids
    # 4 - work
    # 5 - health
    # 6 - intimacy
    # 7 - miscellaneous
    # 8 - random
    variable default 8

    # if you want to allow users to search via /msg, enable this
    variable private_messages 1

    # ** this is not an optional setting, if a string is too long to send, it won't be sent! **
    # It should be set to the max amount of characters that will be received in a public
    #   message by your IRC server.  If you find you aren't receiving results, try lowering this.
    variable split_length 440

    # set your default amount, and maximum amount to show.
    variable def 1
    variable max 2

    # Set the timestring to automate requests here when channel is set +fmlauto
    # default is every 5 minutes.
    variable timestring [list "?0*" "?5*"]

    # set the arguments to pass for automated requests. To use the default action
    # as if a user types simply !fml with no arguments, use "" here
    variable autoarg ""

    # Which version to display:
    # 0 - short - just the FML line
    # 1 - long - FML line + all that extra crap
    variable display 1

    # Strip "Today," at front.
    # (0 no/1 yes)
    variable striptoday 0

    # Strip "FML" at end.
    # (0 no/1 yes)
    variable stripfml 0

    # number of minute(s) to ignore flooders, 0 to disable flood protection
    variable ignore 1

    # how many requests in how many seconds is considered flooding?
    # by default, this allows 10 queries in 60 seconds, the 11th being ignored
    # and ignoring the flooder for 'variable ignore' minutes
    variable flood 10:60
Get it here: Incith:FML v1.1

If you need help explaining how to use certain things, let me know... ;)
S
Sydneybabe
Op
Posts: 106
Joined: Fri Apr 27, 2007 3:31 am
Location: Philippines

Post by Sydneybabe »

Hello sir the new version works fine but there's a bit problem when the quotes trigger it says 2 quotes at a time:
[16:30] <+chatter> sample numbr 1
[16:31] <+bot> Today, I went with my girlfriend to her parents' house. They told me I smelled of cheap vodka. When I told them I worked in a bio lab and used ethanol a lot, they said I was too stupid to do anything like that. My girlfriend broke up with me because her parents think I'm a drunk.
[16:31] <+bot> Today, I got a parking ticket while standing beside my car.
[16:31] <+chatter> lol
User avatar
Trixar_za
Op
Posts: 143
Joined: Wed Nov 18, 2009 1:44 pm
Location: South Africa
Contact:

Post by Trixar_za »

Dammit speechless - you did it again! My poor scripts just can't keep up :(
S
Sydneybabe
Op
Posts: 106
Joined: Fri Apr 27, 2007 3:31 am
Location: Philippines

Post by Sydneybabe »

How can i set the timestring to 30 minutes? I don't know how to set this part:

Code: Select all

variable timestring [list "?0*" "?5*"] 
Thanks in advance.
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

Sydneybabe wrote:How can i set the timestring to 30 minutes? I don't know how to set this part:

Code: Select all

variable timestring [list "?0*" "?5*"] 
Thanks in advance.
Let me first explain, how those work.

"?0*" .. Anthing in the first position, 2nd is zero, and anything beyond. This will matched again a time string passed. Eggdrop will pass "minutes hours day month year". So it matches that "0?*" against minutes. Meaning every minute that ends in zero. Every 10 minutes this would happen.

"?5*" ..After reading above this one is obvious. It calls itself every minute that ends in five. Every 10 minutes this would happen by itself, but combined with the "?0*" above is has the effect of making things happen now, every 5 minutes.

To get every 30 minutes is easy. Simply use "30*" as the only element in your timestring list.

Let's also say, instead of the normal random. You wished during its automation it would poll intimacy and display the 5th page with the 7th and 8th item on that page. You can also do that easily. Change this part -> variable autoarg "" --> to look like this --> variable autoarg "intimacy 7-8 -page 5" .

If you need more help explaining features, or understanding them let me know. ;)
Trixar_za wrote:Dammit speechless - you did it again! My poor scripts just can't keep up :(
Only wrote this because users in my channel asked for one and none of the public ones could convey all of the site. They stuck to either one category, "random", or had other problems. So the net effect of what you see, isn't really much. It's just a short script I had the time to write, use it myself, and chose to only POST here in this thread. Notice, it's not archived, it doesn't have it's own release thread. It shall always just exist here, where not many may find it. An easter egg, if you will, of this forum.
User avatar
Trixar_za
Op
Posts: 143
Joined: Wed Nov 18, 2009 1:44 pm
Location: South Africa
Contact:

Post by Trixar_za »

Don't worry, I'm only joking ;) Your scripts are by far better than those that came before it. I'm amazed how you can create them so quickly and with so many features built in. I guess you've been doing this a while, so you know how to give the users what they want. I'm not too worried though. I'll use your script and maybe borrow your paging code for my urban dictionary script. ;)
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

Eugene wrote:I have tried this but its invalid .. :(
Eugene, why are you spamming california insurance in your signature? You are invalid. Go back to irrelevancy. Eugene goes poof and disappears..

okay, now onto the real question...
Trixar_za wrote:Don't worry, I'm only joking ;) Your scripts are by far better than those that came before it. I'm amazed how you can create them so quickly and with so many features built in. I guess you've been doing this a while, so you know how to give the users what they want. I'm not too worried though. I'll use your script and maybe borrow your paging code for my urban dictionary script. ;)
I shall give away the secret. Some script authors might get mad at me for showing this. This is how you can speed your development 20x faster. I shall explain the exact steps I took creating this script.

1) Download Incith:DsScene
This will be used as our foundation base. This one includes a range checking method already included. It only lacks the paging method.

2) Use the replace feature of your editor: Replace "dsscene" with "fml".

3) Now find "setudef flag ds" change to "setudef flag fml"

4) find this:

Code: Select all

if {[lsearch -exact [channel info $chan] +ds] != -1} {
Change it to:

Code: Select all

if {[lsearch -exact [channel info $chan] +fml] != -1} {
Okay, now we are 90% finished, now let's link to our main scraper, and give it a name. Instead of "releases" let's call it "fml".

5) find this:

Code: Select all

foreach line [incith::fml::parse_output [releases $input $where]] {
Change it to:

Code: Select all

foreach line [incith::fml::parse_output [fml $input $where]] {
6) find this:

Code: Select all

    proc releases {input where} {
Change it to:

Code: Select all

    proc fml {input where} {
Okay, easy part is over. For step 7 is the hard part, it's a huge step...You will need to know tcl and programming logic to complete this part. To me this is the fun part, the other rudimentary parts of scripts are boring. The foundation method of building a script, let's you skip the boring part and get right to the fun part.

7) Modify "proc fml" to scrape fmylife.com ... Which I wont explain because how to do so, is clearly inside the script. ;)

You complete step 8 if you have time, and care. Usually you leave this to others, they can do step 8 themselves. But sometimes, you can create a wider audience for your script by creating 8 yourself.

8) Add features users request: Dropping leading "Today, " and ending " FML". Adding an automation feature. Include paging. Bug checking.

Step 9 isn't required. All this does is give other users a chance to see how you've done what you've done.

9) Post the script to forum.egghelp.org.

If you are fast enough when doing steps 1 thru 9, you can move onto step 10. :)

10) Make a post, explaining how you did what you did so fast. :)

Note: I've obviously skipped parts such as building a new config section, linking variables to namespaces and other such details. This is a rough sketch of how to speed up partial construction, so that the framework of a sturdy tcl script can be constructed on top of it.

Now about the name, Incith:FML, this is no way implies Incith wrote this. This is there because most of the code, the foundation, is using his script. It would be theft to me, to just steal all credit from him. Therefore, as a token of appreciation, any scripts I've written that use his scripts as foundations, will include "Incith-" at the front of them.

Http://ereader.kiczek.com/scripts

As you can see, quite alot of the scripts I've written have used Incith's code as it's foundation and they are quite solid.
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 eggdrop
<sp33chy> There are no fml's at all for "eggdrop".

<speechles> !fml egg
<sp33chy> I went to a Japanese restaurant, where the chefs cook the food right in front of you. Our chef tossed an egg in the air, but sadly didn't catch it. Don't worry though, my hair got it instead.

<speechles> !fml egg 3-5
<sp33chy> For breakfast, there were scrambled eggs, boiled eggs, bacon, sausages, fresh bread, croissants, brownies, donuts, fruit smoothie, coffee, tea and orange juice. Too bad no one bothered wake me up.
<sp33chy> I was walking through town when a rough looking woman asked me for a cigarette. I don't smoke but I offered her some apples, and she took two. As I continued on past her, she pegged both of them at me, hitting the back of my head.
<sp33chy> I ate some hardboiled eggs for breakfast, not knowing they were practically rotten. My whole day has consisted of vomit-inducing sulfuric farts and diarrhea.

<speechles> !fml egg 1-5 -page 2
<sp33chy> As I was working at my babysitting job, I was watching a 3.5 year old girl. She begged and begged me to come in the jacuzzi with her, and when I put on my 2-piece bathing suit on, the young girl asked me why my stomach looked like a bagel. I looked down just to realize she was right.
<sp33chy> I was putting groceries into my car, and I put the eggs on the driver's seat while I arranged my other bags. I was frustrated because the dome light was acting up, which drives me crazy. Once I got everything in, I crankily plopped into the car. I had never moved the eggs off my seat.
<sp33chy> I logged onto Facebook and saw that I had a message from my ex boyfriend. It's only been two weeks since we broke up and I assumed he sent me a message begging for me to take him back. He wanted to apologize for sleeping with my sister last night.
<sp33chy> I went to egg my ex-boyfriend's house, after finding out he cheated on me. I covered his house and car with eggs, toilet paper, and silly string. When I went to get back in my car, my keys were locked inside, the alarm went off, and my ex walked outside, with his new girlfriend.
<sp33chy> My boyfriend and I were laying in his bed. I was watching the Terminator on T.V. A commercial came on in the middle of the movie. We just started having sex when the movie came back on he said "I'll be back." in the Arnold Schwartzenegger accent and rolled over to watch the movie.

<speechles> !fml eggdrop -page 7
<sp33chy> There are no fml's at all for "eggdrop" on page 7.

<speechles> !fml -intimacy 2-3
<sp33chy> I woke up to my mom washing the dishes completely naked. Sadly, I was more surprised by the fact she was doing the dishes than the fact that that she was strutting about in her birthday suit.
<sp33chy> I was feeling a little naughty, so I put on a sexy outfit, laid down on the hood of my boyfriend's car, and waited for him to find me. When he came into the garage and saw me, he freaked out and bitched at me, because I "could have dented the chassis".

<speechles> !fml -kids 2-5 -page 4
<sp33chy> My son's homework was to write a story about what he wants to be when he grows up. He wrote that he plans on being unemployed and living at home until we throw him out, then he'll live under a bridge. He's only 12, but already planning for a future as an unemployed bum.
<sp33chy> I had to be the one to break it to my daughter that WWE fighting was staged. She began crying. However, last month she didn't shed a single tear at her grandmother's funeral.
<sp33chy> I had to explain to my little brother that my tampons weren't ear plugs.
<sp33chy> I fell asleep as my family drove to church. No one bothered to say anything about the drawings my siblings drew on my face until after church ended.
New script, want to try it out... Look below :P

Incith:FML v1.2

As always, there may be issues.. things that go wrong. When those happen shout about it right here and let's fix em. Most of how to use this script should be self explanatory. The examples above demonstrate some common usage. If you need more examples, or help using it let me know here. ;D
Post Reply