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.tcl remove colors?

Support & discussion of released scripts, and announcements of new releases.
Post Reply
b
bLzR
Voice
Posts: 15
Joined: Sun Feb 28, 2010 4:40 pm

fmylife.tcl remove colors?

Post by bLzR »

So i found this script but i don't wanna use coloring when i sends the quotes to the channel?
And i just want to have the quote no link to the specific quote.
Anyhelp would be nice?
User avatar
username
Op
Posts: 196
Joined: Thu Oct 06, 2005 9:20 am
Location: Russian Federation, Podolsk
Contact:

Post by username »

Show link to this script.
Архив TCL скриптов для ботов Eggdrop/Windrop:
http://egghelp.ru/
b
bLzR
Voice
Posts: 15
Joined: Sun Feb 28, 2010 4:40 pm

Post by bLzR »

It's this one, it's yours modified :)

Code: Select all

# Author: tomekk
# e-mail:  tomekk/@/oswiecim/./eu/./org
# home page: http://tomekk.oswiecim.eu.org/
#
# Version 0.3.1
#
# 16.07.09 - changed parsing code and added country and city to quote info.
#
# New html tag by username@forum.egghelp.org 
# Wordwrap proc from this post by user http://forum.egghelp.org/viewtopic.php?p=81741#81741
#
# This file is Copyrighted under the GNU Public License.
# http://www.gnu.org/copyleft/gpl.html

# channels for !fmylife
set fmylife_channels {#egghelp #erotic}

# time between use !fmylife (seconds)
set fmylife_reuse_time 20

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

# set auto query interval (minutes)
set fmylife_auto_interval 10

###########################################################
bind pub - !fmylife fm_main_proc

package require http

proc get_fmylife { } {
   set f_http_uagent "Opera/9.61 (Windows i686; U; en) Presto/2.1.1"
   set f_http_token [http::config -useragent $f_http_uagent]
   if {[catch {set f_http_token [::http::geturl "http://www.fmylife.com/random" -timeout 15000]}]} {
      return "error"
   } {
      return [http::data $f_http_token]
   }
}

set fmylife_reuse 1

proc fmylife_timer { } {
   global fmylife_auto_interval
   fm_auto_proc

   if {[string match *fmylife_timer* [timers]] != 1} {
      timer $fmylife_auto_interval fmylife_timer
   }
}

proc fm_auto_proc { } {
   global fmylife_channels

   set fm_quote ""
        set fm_quote [get_fmylife]

   if {($fm_quote == "error") || ($fm_quote == "")} {
      putlog "auto-quote-fmylife: problem with connection"
      return
   }

   foreach fm_each_chan [split $fmylife_channels] {
      if {$fm_each_chan != ""} {
         set fm_each_chan [string trim $fm_each_chan]

         if {[botonchan $fm_each_chan]} {
             fmylife_print $fm_quote $fm_each_chan
         }
      }
   }
}

proc fm_main_proc { nick uhost hand chan arg } {
   global fmylife_channels fmylife_reuse fmylife_reuse_time

   if {[expr [clock seconds] - $fmylife_reuse] <= $fmylife_reuse_time} {
      putquick "PRIVMSG $chan :$nick: to fast, sorry"
      return
   }

   if {[lsearch $fmylife_channels $chan] == -1} {
      return
   }

   set fm_quote ""
   set fm_quote [get_fmylife]

   if {($fm_quote == "error") || ($fm_quote == "")} {
      putquick "PRIVMSG $chan :problem with connection, try again later, sorry"
      return
        }

   fmylife_print $fm_quote $chan
}

proc fmylife_print { fm_data fm_chan } {
   global fmylife_reuse

   set fm_link ""

   regsub -all -nocase "\n" $fm_data "" fm_data
   regsub -all -nocase "\r" $fm_data "" fm_data
   regsub -all -nocase "\t" $fm_data "" fm_data

   # 1st quote
   regsub -nocase {.*<div\s+class=\"clear\"><\/div><\/div>(.+)<div\s+class=\"more\">.*} $fm_data {\1} fm_data

   # 1st link
   regsub -nocase {.*<a\s+href=\"([a-z0-9\/ ]+)\"\s+class="fmllink">.*} $fm_data {\1} fm_link

   # del rest of links from quote
   regsub -all -nocase {<a\s+href=\"[a-z0-9\/ ]+\"\s+class=\"fmllink\">} $fm_data "" fm_data

   # voting result
   regsub -nocase {.*sucks<\/a>\s+(.+)<\/span>\s+-.*} $fm_data {\1} fm_fckd
   regsub -nocase {.*it<\/a>\s+(.+)<\/span>.*} $fm_data {\1} fm_dsrv

   # date and name
   regsub -nocase {.*<p\s+style=\"margin-top\:2px\;\">(.+)\s+-\s+<a\s+class=\"liencat\".*} $fm_data {\1} fm_date
   regsub -nocase {.*<a\s+class=\"liencat\"\s+href="/[a-z0-9\/ ]+\">[a-z0-9\/ ]+<\/a>\s+-\s+by\s+(.*?)\s+-\s+<a\s+href=\"\/country\/.*} $fm_data {\1} fm_name
   regsub -all -nocase {<a href="/gender/woman" class="light">} $fm_name "" fm_name
   regsub -all -nocase {<a href="/gender/man" class="light">} $fm_name "" fm_name
   regsub -all -nocase {</a>} $fm_name "" fm_name

   # country and city
   regsub -nocase {.*<a\s+href=\"\/country\/(.*?)\"\s+class=\"liencat\">.*} $fm_data {\1} fm_coun
   regsub -nocase {.*<a\s+href=\"\/region\/(.*?)"\s+class=\"light\">.*} $fm_data {\1} fm_city

   # fml text
   regsub -nocase {.*<div\s+class=\"post\"><p>(.*?)<div\s+class=\"date\">.*} $fm_data {\1} fm_data

   # the rest of useless tags
   regsub -all -nocase "<\/a>" $fm_data "" fm_data
   regsub -all -nocase "<\/p>" $fm_data "" fm_data
   regsub -all -nocase "<\/div>" $fm_data "" fm_data
   regsub -all -nocase "&quote;" $fm_data "\"" fm_data
   regsub -all -nocase "<div.*>" $fm_data "\"" fm_data
   regsub -all -nocase "&quot" $fm_data "\"" fm_data

   set fm_link "http://www.fmylife.com$fm_link"

   if {[regexp -nocase {http:\/\/www\.fmylife\.com[a-z0-9\/ ]+} $fm_link]} {
      fm_msg $fm_chan \00310$fm_data
      putquick "PRIVMSG $fm_chan :\00314I agree, your life sucks \00303$fm_fckd \00314- you totally deserved it \00303$fm_dsrv\00314. Added \00303$fm_date \00314by \00303$fm_name\00314, \00303$fm_coun \00314(\00303$fm_city\00314)."
      putquick "PRIVMSG $fm_chan :\00304--| \00312\037$fm_link\037\003"
      set fmylife_reuse [clock seconds]
   } {
      putquick "PRIVMSG $fm_chan :some problem with data, try again later, sorry"
   }
}

if {$fmylife_auto_query != 0} {
   if {[string match *fmylife_timer* [timers]] != 1} {
      timer $fmylife_auto_interval fmylife_timer
   }
}

    proc fm_msg {dest data} {
       set len [expr {512-[string len ":$::botname PRIVMSG $dest :\r\n"]}]
       foreach line [fm_wordwrap $data $len] {
          puthelp "PRIVMSG $dest :$line"
       }
    }

    proc fm_wordwrap {data len} {
       set out {}
       foreach line [split [string trim $data] \n] {
          set curr {}
          set i 0
          foreach word [split [string trim $line]] {
             if {[incr i [string len $word]]>$len} {
                lappend out [join $curr]
                set curr [list $word]
                set i [string len $word]
             } {
                lappend curr $word
             }
             incr i
          }
          if {[llength $curr]} {
             lappend out [join $curr]
          }
       }
       set out
    }

putlog "fmylife-quote.tcl ver 0.3.1 by tomekk and username loaded" 
I just want the quote without anything else no link no color just the plain quote.!
User avatar
username
Op
Posts: 196
Joined: Thu Oct 06, 2005 9:20 am
Location: Russian Federation, Podolsk
Contact:

Post by username »

No colours and no link to quote:

Code: Select all

# Author: tomekk
# e-mail:  tomekk/@/oswiecim/./eu/./org
# home page: http://tomekk.oswiecim.eu.org/
#
# Version 0.3.1
#
# 16.07.09 - changed parsing code and added country and city to quote info.
#
# New html tag by username@forum.egghelp.org
# Wordwrap proc from this post by user http://forum.egghelp.org/viewtopic.php?p=81741#81741
#
# This file is Copyrighted under the GNU Public License.
# http://www.gnu.org/copyleft/gpl.html

# channels for !fmylife
set fmylife_channels {#egghelp #erotic}

# time between use !fmylife (seconds)
set fmylife_reuse_time 20

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

# set auto query interval (minutes)
set fmylife_auto_interval 10

###########################################################
bind pub - !fmylife fm_main_proc

package require http

proc get_fmylife { } {
   set f_http_uagent "Opera/9.61 (Windows i686; U; en) Presto/2.1.1"
   set f_http_token [http::config -useragent $f_http_uagent]
   if {[catch {set f_http_token [::http::geturl "http://www.fmylife.com/random" -timeout 15000]}]} {
      return "error"
   } {
      return [http::data $f_http_token]
   }
}

set fmylife_reuse 1

proc fmylife_timer { } {
   global fmylife_auto_interval
   fm_auto_proc

   if {[string match *fmylife_timer* [timers]] != 1} {
      timer $fmylife_auto_interval fmylife_timer
   }
}

proc fm_auto_proc { } {
   global fmylife_channels

   set fm_quote ""
        set fm_quote [get_fmylife]

   if {($fm_quote == "error") || ($fm_quote == "")} {
      putlog "auto-quote-fmylife: problem with connection"
      return
   }

   foreach fm_each_chan [split $fmylife_channels] {
      if {$fm_each_chan != ""} {
         set fm_each_chan [string trim $fm_each_chan]

         if {[botonchan $fm_each_chan]} {
             fmylife_print $fm_quote $fm_each_chan
         }
      }
   }
}

proc fm_main_proc { nick uhost hand chan arg } {
   global fmylife_channels fmylife_reuse fmylife_reuse_time

   if {[expr [clock seconds] - $fmylife_reuse] <= $fmylife_reuse_time} {
      putquick "PRIVMSG $chan :$nick: to fast, sorry"
      return
   }

   if {[lsearch $fmylife_channels $chan] == -1} {
      return
   }

   set fm_quote ""
   set fm_quote [get_fmylife]

   if {($fm_quote == "error") || ($fm_quote == "")} {
      putquick "PRIVMSG $chan :problem with connection, try again later, sorry"
      return
        }

   fmylife_print $fm_quote $chan
}

proc fmylife_print { fm_data fm_chan } {
   global fmylife_reuse

   set fm_link ""

   regsub -all -nocase "\n" $fm_data "" fm_data
   regsub -all -nocase "\r" $fm_data "" fm_data
   regsub -all -nocase "\t" $fm_data "" fm_data

   # 1st quote
   regsub -nocase {.*<div\s+class=\"clear\"><\/div><\/div>(.+)<div\s+class=\"more\">.*} $fm_data {\1} fm_data

   # 1st link
   regsub -nocase {.*<a\s+href=\"([a-z0-9\/ ]+)\"\s+class="fmllink">.*} $fm_data {\1} fm_link

   # del rest of links from quote
   regsub -all -nocase {<a\s+href=\"[a-z0-9\/ ]+\"\s+class=\"fmllink\">} $fm_data "" fm_data

   # voting result
   regsub -nocase {.*sucks<\/a>\s+(.+)<\/span>\s+-.*} $fm_data {\1} fm_fckd
   regsub -nocase {.*it<\/a>\s+(.+)<\/span>.*} $fm_data {\1} fm_dsrv

   # date and name
   regsub -nocase {.*<p\s+style=\"margin-top\:2px\;\">(.+)\s+-\s+<a\s+class=\"liencat\".*} $fm_data {\1} fm_date
   regsub -nocase {.*<a\s+class=\"liencat\"\s+href="/[a-z0-9\/ ]+\">[a-z0-9\/ ]+<\/a>\s+-\s+by\s+(.*?)\s+-\s+<a\s+href=\"\/country\/.*} $fm_data {\1} fm_name
   regsub -all -nocase {<a href="/gender/woman" class="light">} $fm_name "" fm_name
   regsub -all -nocase {<a href="/gender/man" class="light">} $fm_name "" fm_name
   regsub -all -nocase {</a>} $fm_name "" fm_name

   # country and city
   regsub -nocase {.*<a\s+href=\"\/country\/(.*?)\"\s+class=\"liencat\">.*} $fm_data {\1} fm_coun
   regsub -nocase {.*<a\s+href=\"\/region\/(.*?)"\s+class=\"light\">.*} $fm_data {\1} fm_city

   # fml text
   regsub -nocase {.*<div\s+class=\"post\"><p>(.*?)<div\s+class=\"date\">.*} $fm_data {\1} fm_data

   # the rest of useless tags
   regsub -all -nocase "<\/a>" $fm_data "" fm_data
   regsub -all -nocase "<\/p>" $fm_data "" fm_data
   regsub -all -nocase "<\/div>" $fm_data "" fm_data
   regsub -all -nocase "&quote;" $fm_data "\"" fm_data
   regsub -all -nocase "<div.*>" $fm_data "\"" fm_data
   regsub -all -nocase "&quot" $fm_data "\"" fm_data

   set fm_link "http://www.fmylife.com$fm_link"

   if {[regexp -nocase {http:\/\/www\.fmylife\.com[a-z0-9\/ ]+} $fm_link]} {
      fm_msg $fm_chan $fm_data
      putquick "PRIVMSG $fm_chan :I agree, your life sucks $fm_fckd - you totally deserved it $fm_dsrv. Added $fm_date by $fm_name, $fm_coun ($fm_city)."
      #putquick "PRIVMSG $fm_chan :--| $fm_link"
      set fmylife_reuse [clock seconds]
   } {
      putquick "PRIVMSG $fm_chan :some problem with data, try again later, sorry"
   }
}

if {$fmylife_auto_query != 0} {
   if {[string match *fmylife_timer* [timers]] != 1} {
      timer $fmylife_auto_interval fmylife_timer
   }
}

    proc fm_msg {dest data} {
       set len [expr {512-[string len ":$::botname PRIVMSG $dest :\r\n"]}]
       foreach line [fm_wordwrap $data $len] {
          puthelp "PRIVMSG $dest :$line"
       }
    }

    proc fm_wordwrap {data len} {
       set out {}
       foreach line [split [string trim $data] \n] {
          set curr {}
          set i 0
          foreach word [split [string trim $line]] {
             if {[incr i [string len $word]]>$len} {
                lappend out [join $curr]
                set curr [list $word]
                set i [string len $word]
             } {
                lappend curr $word
             }
             incr i
          }
          if {[llength $curr]} {
             lappend out [join $curr]
          }
       }
       set out
    }

putlog "fmylife-quote.tcl ver 0.3.1 by tomekk and username loaded"
Архив TCL скриптов для ботов Eggdrop/Windrop:
http://egghelp.ru/
b
bLzR
Voice
Posts: 15
Joined: Sun Feb 28, 2010 4:40 pm

Post by bLzR »

Thanks!
b
br_brutal
Voice
Posts: 6
Joined: Tue Apr 20, 2010 11:02 am
Location: baluwatar-4, Nepal

Post by br_brutal »

I tried this tcl but still i m experiencing problem
i got like this

@MaxBOT ¦ I agree, your life sucks (26367) - you totally deserved it (4249)</span></p><p style="margin-top:2px;">On 02/22/2009 at 4:45am - <a class="liencat" href="/miscellaneous">misc</a> - by highlycontagious - <a href="/country/United States" class="liencat">United States</a> (<a href="/region/Illinois" class="light">Illinois</a>)</p></div></div><div class="more" id="more102493"><a href="javascript:;" onclick="location.href='/apps
@MaxBOT ¦ Today, while walking through the fragrance area in a shopping center a women behind me asked; "Excuse me miss, would you like to sample our new fragrance line." I'm a 19 year old male. I turned around expecting her to correct herself. She didn't. FML


what may be the problem??
can i get any fixed solution for this??
User avatar
username
Op
Posts: 196
Joined: Thu Oct 06, 2005 9:20 am
Location: Russian Federation, Podolsk
Contact:

Post by username »

In line

Code: Select all

# 1st quote
   regsub -nocase {.*<div\s+class=\"clear\"><\/div><\/div>(.+)<div\s+class=\"more\">.*} $fm_data {\1} fm_data 
change

Code: Select all

<div\s+class=\"more\">.*
to

Code: Select all

<div\s+class=\"more\".*
Архив TCL скриптов для ботов Eggdrop/Windrop:
http://egghelp.ru/
b
br_brutal
Voice
Posts: 6
Joined: Tue Apr 20, 2010 11:02 am
Location: baluwatar-4, Nepal

Post by br_brutal »

It works some how but still i got like this

@MaxBOT ¦ I agree, your life sucks (6403) - you totally deserved it (15586). Added On 10/29/2009 at 12:07am by Anonymous (woman), United States (Georgia).
@MaxBOT ¦ --| http://www.fmylife.com/health/6049425
@MaxBOT ¦ Today, I went running for the first time in a few months. I had what I thought was an asthma attack. When I got home, I realized that it was not asthma, but instead I have gained so much weight that my running bra restricted my breathing. FML


I actually wants the bot to display only

@MaxBOT ¦ Today, I went running for the first time in a few months. I had what I thought was an asthma attack. When I got home, I realized that it was not asthma, but instead I have gained so much weight that my running bra restricted my breathing. FML

I hope ill be getting the reply ASAP.
Thanks
User avatar
username
Op
Posts: 196
Joined: Thu Oct 06, 2005 9:20 am
Location: Russian Federation, Podolsk
Contact:

Post by username »

Comment this two lines with voting result and link:

Code: Select all

#putquick "PRIVMSG $fm_chan :I agree, your life sucks $fm_fckd - you totally deserved it $fm_dsrv. Added $fm_date by $fm_name, $fm_coun ($fm_city)."
      #putquick "PRIVMSG $fm_chan :--| $fm_link" 
Архив TCL скриптов для ботов Eggdrop/Windrop:
http://egghelp.ru/
b
br_brutal
Voice
Posts: 6
Joined: Tue Apr 20, 2010 11:02 am
Location: baluwatar-4, Nepal

Post by br_brutal »

oh yeah it worked
Thanks Bro
Thanks a LOT!!
Post Reply