egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

fmylife.tcl remove colors?

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
bLzR
Voice


Joined: 28 Feb 2010
Posts: 15

PostPosted: Fri Apr 09, 2010 1:25 pm    Post subject: fmylife.tcl remove colors? Reply with quote

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?
Back to top
View user's profile Send private message
username
Op


Joined: 06 Oct 2005
Posts: 196
Location: Russian Federation, Podolsk

PostPosted: Fri Apr 09, 2010 4:41 pm    Post subject: Reply with quote

Show link to this script.
_________________
Архив TCL скриптов для ботов Eggdrop/Windrop:
http://egghelp.ru/
Back to top
View user's profile Send private message Send e-mail Visit poster's website
bLzR
Voice


Joined: 28 Feb 2010
Posts: 15

PostPosted: Mon Apr 12, 2010 1:11 pm    Post subject: Reply with quote

It's this one, it's yours modified Smile

Code:

# 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.!
Back to top
View user's profile Send private message
username
Op


Joined: 06 Oct 2005
Posts: 196
Location: Russian Federation, Podolsk

PostPosted: Mon Apr 12, 2010 3:26 pm    Post subject: Reply with quote

No colours and no link to quote:
Code:
# 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/
Back to top
View user's profile Send private message Send e-mail Visit poster's website
bLzR
Voice


Joined: 28 Feb 2010
Posts: 15

PostPosted: Mon Apr 12, 2010 4:43 pm    Post subject: Reply with quote

Thanks!
Back to top
View user's profile Send private message
br_brutal
Voice


Joined: 20 Apr 2010
Posts: 6
Location: baluwatar-4, Nepal

PostPosted: Fri Jun 04, 2010 5:56 am    Post subject: Reply with quote

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??
Back to top
View user's profile Send private message MSN Messenger
username
Op


Joined: 06 Oct 2005
Posts: 196
Location: Russian Federation, Podolsk

PostPosted: Sat Jun 05, 2010 3:09 am    Post subject: Reply with quote

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

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

_________________
Архив TCL скриптов для ботов Eggdrop/Windrop:
http://egghelp.ru/
Back to top
View user's profile Send private message Send e-mail Visit poster's website
br_brutal
Voice


Joined: 20 Apr 2010
Posts: 6
Location: baluwatar-4, Nepal

PostPosted: Sat Jun 05, 2010 3:36 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message MSN Messenger
username
Op


Joined: 06 Oct 2005
Posts: 196
Location: Russian Federation, Podolsk

PostPosted: Sat Jun 05, 2010 4:25 am    Post subject: Reply with quote

Comment this two lines with voting result and link:
Code:
#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/
Back to top
View user's profile Send private message Send e-mail Visit poster's website
br_brutal
Voice


Joined: 20 Apr 2010
Posts: 6
Location: baluwatar-4, Nepal

PostPosted: Sat Jun 05, 2010 5:20 am    Post subject: Reply with quote

oh yeah it worked
Thanks Bro
Thanks a LOT!!
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber