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.

Repair horoscope tcl

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
User avatar
Nor7on
Op
Posts: 185
Joined: Sat Mar 03, 2007 8:05 am
Location: Spain - Barcelona
Contact:

Repair horoscope tcl

Post by Nor7on »

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 =)
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)
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

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
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

User avatar
Nor7on
Op
Posts: 185
Joined: Sat Mar 03, 2007 8:05 am
Location: Spain - Barcelona
Contact:

Post by Nor7on »

epss rosc2112 =)

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

pls help me =(
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

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.
User avatar
Nor7on
Op
Posts: 185
Joined: Sat Mar 03, 2007 8:05 am
Location: Spain - Barcelona
Contact:

Post by Nor7on »

i cofig the tcl, channels, etc.

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

In dcc chat.
*** Nor7on joined the party line.
.rehash
Rehashing.
in the channel:
<Nor7on> .shoro Libra
-> *Alaska^* .shoro Libra
<Nor7on> .shoro Scorpio
<Nor7on> .shoro cancer
see no send me nothing... my cofig is this:
##############################################################################################################
#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?
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

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..
User avatar
Nor7on
Op
Posts: 185
Joined: Sat Mar 03, 2007 8:05 am
Location: Spain - Barcelona
Contact:

Post by Nor7on »

[15:50] spanish horoscopes 1.0.1a by rosc loaded.
[15:50] Horoscopo.tcl
[15:50] Userfile loaded, unpacking...
<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?
##############################################################

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 =((
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

No.
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

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.
User avatar
Nor7on
Op
Posts: 185
Joined: Sat Mar 03, 2007 8:05 am
Location: Spain - Barcelona
Contact:

Post by Nor7on »

i remove this from your script:
if {([lsearch -exact $::shorochans $chan] == -1) && ($chan != "privmsg")} {return}
and now, save, rehash. and:
<Nor7on> .shoro Libra
-> *Alaska^* shoro Libra
-> *Alaska^* shoro libra
<Nor7on> .shoro libra
nothing =/
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

Can't help ya then, it works for me and everyone else who's tested it.
C
Chino
Voice
Posts: 2
Joined: Mon Dec 31, 2007 10:29 pm

TCL Horoscopo Spanish

Post by Chino »

Code: Select all

#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
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Re: TCL Horoscopo Spanish

Post by speechles »

Code: Select all

#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) ;) ...

Code: Select all

  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: Select all

  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: Select all

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?
Post Reply