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 

Repair horoscope tcl
Goto page 1, 2  Next
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
Nor7on
Op


Joined: 03 Mar 2007
Posts: 185
Location: Spain - Barcelona

PostPosted: Sat Mar 03, 2007 8:18 am    Post subject: Repair horoscope tcl Reply with quote

hi, i need repair this TCL, when put "!horoscopo Libra" no send me nothing.
but when put "!Horoscopo bluoblue.." send me this message: "SIGNO NO VÁLIDO!. Válidos: aries, tauro, geminis, cancer, leo, virgo, libra, escorpion, sagitario, capricornio, acuario y piscis."

i think the wrong is the website www.terra.cl.

can helpme in repair this wrong ?

thxs =)

Quote:

bind pub - !horoscopo signo

proc signo {nick uhost hand chan text} {
set conexion [socket www.terra.cl 80]
set flag 0
set encabezado "Host: www.terra.cl\r\nUser-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; es-ES; rv:1.7.12) Gecko/20050919 Firefox/1.0.7"
set text [string toupper $text]
if {$text == ""} {
set flag 2
putserv "NOTICE $nick :Uso: !horoscopo <signo>, Ej: !horoscopo aries"}
if {$text == "ARIES"} {
set flag 1
puts $conexion "GET /astrologia/include/pop_h_diario.cfm?signo=2\r\n$encabezado"}
if {$text == "TAURO"} {
set flag 1
puts $conexion "GET /astrologia/include/pop_h_diario.cfm?signo=19\r\n$encabezado"}
if {$text == "GEMINIS"} {
set flag 1
puts $conexion "GET /astrologia/include/pop_h_diario.cfm?signo=7\r\n$encabezado"}
if {$text == "CANCER"} {
set flag 1
puts $conexion "GET /astrologia/include/pop_h_diario.cfm?signo=3\r\n$encabezado"}
if {$text == "LEO"} {
set flag 1
puts $conexion "GET /astrologia/include/pop_h_diario.cfm?signo=10\r\n$encabezado"}
if {$text == "VIRGO"} {
set flag 1
puts $conexion "GET /astrologia/include/pop_h_diario.cfm?signo=22\r\n$encabezado"}
if {$text == "LIBRA"} {
set flag 1
puts $conexion "GET /astrologia/include/pop_h_diario.cfm?signo=11\r\n$encabezado"}
if {$text == "ESCORPION"} {
set flag 1
puts $conexion "GET /astrologia/include/pop_h_diario.cfm?signo=6\r\n$encabezado"}
if {$text == "SAGITARIO"} {
set flag 1
puts $conexion "GET /astrologia/include/pop_h_diario.cfm?signo=16\r\n$encabezado"}
if {$text == "CAPRICORNIO"} {
set flag 1
puts $conexion "GET /astrologia/include/pop_h_diario.cfm?signo=4\r\n$encabezado"}
if {$text == "ACUARIO"} {
set flag 1
puts $conexion "GET /astrologia/include/pop_h_diario.cfm?signo=1\r\n$encabezado"}
if {$text == "PISCIS"} {
set flag 1
puts $conexion "GET /astrologia/include/pop_h_diario.cfm?signo=14\r\n$encabezado"}



if {$flag == 1} {

flush $conexion

while {![eof $conexion]} {
set linea [gets $conexion]
if {[string match "*txt_2_10*" $linea]} {
set largo [string length $linea]
set inicio [string range $linea 0 [expr $largo-13]]
set final [string range $linea 31 [expr $largo-13]]
set horoscopo [string map [list "</b>" "."] $final]
set horoscopo [string map [list "<br>" " "] $horoscopo]
putserv "privmsg $chan :$text: $horoscopo"
}
}
}
if {$flag == 0} {
putserv "NOTICE $nick :SIGNO NO VÁLIDO!. Válidos: aries, tauro, geminis, cancer, leo, virgo, libra, escorpion, sagitario, capricornio, acuario y piscis."
}
}
putlog "Horoscopo.tcl"


Edit: Changed topic's subject to be clear and by rules. (Sir_Fz)
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Sat Mar 03, 2007 9:36 am    Post subject: Reply with quote

That website appears to no longer support any functions referred to by that script.
_________________
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Back to top
View user's profile Send private message Visit poster's website
Nor7on
Op


Joined: 03 Mar 2007
Posts: 185
Location: Spain - Barcelona

PostPosted: Sat Mar 03, 2007 10:07 am    Post subject: Reply with quote

and you can fix, but no with www.terra.cl. now with this website -> http://www.horoscopofree.com

Example from here.
Quote:

http://www.horoscopofree.com/misc/partnership/iframe/aries_st.html
http://www.horoscopofree.com/misc/partnership/iframe/taurus_st.html
http://www.horoscopofree.com/misc/partnership/iframe/gemini_st.html
http://www.horoscopofree.com/misc/partnership/iframe/cancer_st.html
http://www.horoscopofree.com/misc/partnership/iframe/leo_st.html
http://www.horoscopofree.com/misc/partnership/iframe/virgo_st.html
http://www.horoscopofree.com/misc/partnership/iframe/libra_st.html
http://www.horoscopofree.com/misc/partnership/iframe/scorpio_st.html
http://www.horoscopofree.com/misc/partnership/iframe/sagittarius_st.html
http://www.horoscopofree.com/misc/partnership/iframe/capricorn_st.html
http://www.horoscopofree.com/misc/partnership/iframe/aquarius_st.html
http://www.horoscopofree.com/misc/partnership/iframe/pisces_st.html


but i want the eggdrop no read this line-> "¡Inscríbete al Horóscopo gratis en email!".

can change all this? pls..

Thxs. =)
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Sun Mar 04, 2007 2:07 pm    Post subject: Reply with quote

http://members.dandy.net/~fbn/spanish.horoscope.tcl.txt
Back to top
View user's profile Send private message
Nor7on
Op


Joined: 03 Mar 2007
Posts: 185
Location: Spain - Barcelona

PostPosted: Sun Mar 04, 2007 5:15 pm    Post subject: Reply with quote

epss rosc2112 =)

this tcl no found =( i tested with my bot, but no send nothing.

pls help me =(
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Sun Mar 04, 2007 5:23 pm    Post subject: Reply with quote

Worked for me. Did you configure the script for what channels you want it to work on? Does it say its loaded when you rehash the bot? etc.. Can't help you if you don't do the simple stuff.
Back to top
View user's profile Send private message
Nor7on
Op


Joined: 03 Mar 2007
Posts: 185
Location: Spain - Barcelona

PostPosted: Sun Mar 04, 2007 5:36 pm    Post subject: Reply with quote

i cofig the tcl, channels, etc.

but when write in the channel: .shoro, my eggdrop no send me nothing.

In dcc chat.
Quote:

*** Nor7on joined the party line.
.rehash
Rehashing.


in the channel:
Quote:

<Nor7on> .shoro Libra
-> *Alaska^* .shoro Libra
<Nor7on> .shoro Scorpio
<Nor7on> .shoro cancer


see no send me nothing... my cofig is this:

Quote:

##############################################################################################################
#Configs:
##########

# Channels to allow public use in (Space-seperated list)
set shorochans "#Irclima"

# Out of the above channels, these will ONLY respond via PRIVMSG:
set shoroquiet "#Madrid"

# geturl timeout:
set shtout "30000"


see my config is OK, but no send me nothing =(, what's the problem?
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Sun Mar 04, 2007 5:43 pm    Post subject: Reply with quote

Does the script load? You should see the line in your eggdrop when the script loads:

spanish horoscopes 1.0.1b by rosc loaded.

Also, make the channel names lower case in the config and see if that makes a difference.

I made a very minor update in the script to rename some vars leftover from the funny horoscope script, although I doubt that would make the script not work for you. Same url as above.

Edit: Made channel configs case-insensitive too..
Back to top
View user's profile Send private message
Nor7on
Op


Joined: 03 Mar 2007
Posts: 185
Location: Spain - Barcelona

PostPosted: Sun Mar 04, 2007 5:58 pm    Post subject: Reply with quote

Quote:

[15:50] spanish horoscopes 1.0.1a by rosc loaded.
[15:50] Horoscopo.tcl
[15:50] Userfile loaded, unpacking...


Quote:

<Nor7on> .shoro cancer


nothing my friend...

i have one question... what is the problem in this tcl edited for me, but no found xDDD you can check this?

Quote:

##############################################################

bind pub - !horoscopo signo

proc signo {nick uhost hand chan text} {
set conexion [socket www.horoscopofree.com 80]
set flag 0
set encabezado "Host: www.horoscopofree.com"
set text [string toupper $text]
if {$text == ""} {
set flag 2
putserv "NOTICE $nick :Uso: !horoscopo <signo>, Ej: !horoscopo aries"}
if {$text == "ARIES"} {
set flag 1
puts $conexion "GET /misc/partnership/iframe/aries_st.html\r\n$encabezado"}
if {$text == "TAURO"} {
set flag 1
puts $conexion "GET /misc/partnership/iframe/taurus_st.html\r\n$encabezado"}
if {$text == "GEMINIS"} {
set flag 1
puts $conexion "GET /misc/partnership/iframe/gemini_st.html\r\n$encabezado"}
if {$text == "CANCER"} {
set flag 1
puts $conexion "GET /misc/partnership/iframe/cancer_st.html\r\n$encabezado"}
if {$text == "LEO"} {
set flag 1
puts $conexion "GET /misc/partnership/iframe/leo_st.html\r\n$encabezado"}
if {$text == "VIRGO"} {
set flag 1
puts $conexion "GET /misc/partnership/iframe/virgo_st.html\r\n$encabezado"}
if {$text == "LIBRA"} {
set flag 1
puts $conexion "GET /misc/partnership/iframe/libra_st.html\r\n$encabezado"}
if {$text == "ESCORPION"} {
set flag 1
puts $conexion "GET /misc/partnership/iframe/scorpio_st.html\r\n$encabezado"}
if {$text == "SAGITARIO"} {
set flag 1
puts $conexion "GET /misc/partnership/iframe/sagittarius_st.html\r\n$encabezado"}
if {$text == "CAPRICORNIO"} {
set flag 1
puts $conexion "GET /misc/partnership/iframe/capricorn_st.html\r\n$encabezado"}
if {$text == "ACUARIO"} {
set flag 1
puts $conexion "GET /misc/partnership/iframe/aquarius_st.html\r\n$encabezado"}
if {$text == "PISCIS"} {
set flag 1
puts $conexion "GET /misc/partnership/iframe/pisces_st.html\r\n$encabezado"}



if {$flag == 1} {

flush $conexion

while {![eof $conexion]} {
set linea [gets $conexion]
if {[string match "*txt_2_10*" $linea]} {
set largo [string length $linea]
set inicio [string range $linea 0 [expr $largo-13]]
set final [string range $linea 31 [expr $largo-13]]
set horoscopo [string map [list "</b>" "."] $final]
set horoscopo [string map [list "<br>" " "] $horoscopo]
putserv "privmsg $chan :$text: $horoscopo"
}
}
}
if {$flag == 0} {
putserv "NOTICE $nick :SIGNO NO VÁLIDO!. Válidos: aries, tauro, geminis, cancer, leo, virgo, libra, escorpion, sagitario, capricornio, acuario y piscis."
}
}
putlog "Horoscopo.tcl"


i don't know hehehe.... can you check this? pls =((
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Sun Mar 04, 2007 6:00 pm    Post subject: Reply with quote

No.
Back to top
View user's profile Send private message
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Sun Mar 04, 2007 6:07 pm    Post subject: Reply with quote

Remove this line from my script:

if {([lsearch -exact $::shorochans $chan] == -1) && ($chan != "privmsg")} {return}


Then it'll work with all channels and won't bother checking if you configured it.
Back to top
View user's profile Send private message
Nor7on
Op


Joined: 03 Mar 2007
Posts: 185
Location: Spain - Barcelona

PostPosted: Sun Mar 04, 2007 6:25 pm    Post subject: Reply with quote

i remove this from your script:

Quote:

if {([lsearch -exact $::shorochans $chan] == -1) && ($chan != "privmsg")} {return}


and now, save, rehash. and:

Quote:

<Nor7on> .shoro Libra
-> *Alaska^* shoro Libra
-> *Alaska^* shoro libra
<Nor7on> .shoro libra


nothing =/
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Sun Mar 04, 2007 6:30 pm    Post subject: Reply with quote

Can't help ya then, it works for me and everyone else who's tested it.
Back to top
View user's profile Send private message
Chino
Voice


Joined: 31 Dec 2007
Posts: 2

PostPosted: Thu Feb 28, 2008 1:26 am    Post subject: TCL Horoscopo Spanish Reply with quote

Code:

#Requiere http.tcl

bind pub - !signo pub:horoscopo

proc pub:horoscopo {nick host hand chan arg} {

  set arg [lindex $arg 0]
  if {$arg==""} {
    putserv "NOTICE $nick :Usa: !signo <signo>"
    return 0
  }
  switch [string tolower $arg] {
    "aries" {
      set pagina "www.terra.cl/astrologia/include/pop_h_diario.cfm?signo=2"
    } "tauro" {
      set pagina "www.terra.cl/astrologia/include/pop_h_diario.cfm?signo=19"
    } "geminis" {
      set pagina "www.terra.cl/astrologia/include/pop_h_diario.cfm?signo=7"
    } "cancer" {
      set pagina "www.terra.cl/astrologia/include/pop_h_diario.cfm?signo=3"
    } "leo" {
      set pagina "www.terra.cl/astrologia/include/pop_h_diario.cfm?signo=10"
    } "virgo" {
      set pagina "www.terra.cl/astrologia/include/pop_h_diario.cfm?signo=22"
    } "libra" {
      set pagina "www.terra.cl/astrologia/include/pop_h_diario.cfm?signo=11"
    } "escorpion" {
      set pagina "www.terra.cl/astrologia/include/pop_h_diario.cfm?signo=6"
    } "sagitario" {
      set pagina "www.terra.cl/astrologia/include/pop_h_diario.cfm?signo=16"
    } "capricornio" {
      set pagina "www.terra.cl/astrologia/include/pop_h_diario.cfm?signo=4"
    } "acuario" {
      set pagina "www.terra.cl/astrologia/include/pop_h_diario.cfm?signo=1"
    } "piscis" {
      set pagina "www.terra.cl/astrologia/include/pop_h_diario.cfm?signo=14"
    } default {
      putserv "PRIVMSG $chan :Signos existentes: aries, tauro, geminis, cancer, leo, virgo,\
              libra, escorpion, sagitario, capricornio, acuario y piscis."
    }
  }
  set http [http::config -useragent mozilla]
  set http [http::geturl $pagina -timeout [expr 1000 * 10]]
  set html [http::data $http]
  http::cleanup $http ;
  regexp {<span class="txt_2_10"><b></b><br>(.*)} $html horoscopo
  regsub -all "<span class=\"txt_2_10\"><b></b><br>" $horoscopo "" horoscopo
  regsub -all "<br></span>" $horoscopo "" horoscopo
  putserv "PRIVMSG $nick :[string toupper $arg]: $horoscopo"
}

putlog "Cargado horoscopo.tcl  #Ayuda-Eggdrop"



Use this TCL horoscopo.tcl

Usa este TCl que tal queda...

Chino - Chino_^
#Ayuda-Eggdrop
Back to top
View user's profile Send private message
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Thu Feb 28, 2008 3:23 am    Post subject: Re: TCL Horoscopo Spanish Reply with quote

Code:

#Requiere http.tcl       ;# incorrect
package require http 2.5 ;# correct

This is the exact type of scripting that is causing confusion lately. http is a tcl provided package. It should never be required to be sourced (require http.tcl) or you will see conflicting version errors pop up. It's better to go with whats packaged, than to source from outside the box (if you know what I mean) Wink ...
Code:
  regexp {<span class="txt_2_10"><b></b><br>(.*)} $html horoscopo
  regsub -all "<span class=\"txt_2_10\"><b></b><br>" $horoscopo "" horoscopo
  regsub -all "<br></span>" $horoscopo "" horoscopo

And you can trim all that above down to just one regexp
Code:
  regexp {<span class="txt_2_10">.*?<br>(.+?)<br>} $html - horoscopo

... and was this your script, or did you just rip it off (aka, spam your channel) with your putlog at the end denying any credit to the original author?
Code:
putlog "Cargado horoscopo.tcl  #Ayuda-Eggdrop"
Now sure, you ported it to http package or someone did (as originally it was socketed), but really now.. why add putlog spam advertising a channel?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Goto page 1, 2  Next
Page 1 of 2

 
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