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.

I need help with TCL script

Old posts that have not been replied to for several years.
Locked
D
DeiViS

I need help with TCL script

Post by DeiViS »

I have a horoscope script... and when i put into script directory and load it i can wiew just 4 horoscopes can someone help and repair it ?or say whats wrong with it ? :-?

There is a Script:

###############################################################################################
# 4. HOROSKOPAI: #
###############################################################################################

proc horosNukreiptiIMsg {nickas hostas flagas kanalas tekstas} {
if {[lsearch -glob [channel info $kanalas] "+serv"]>-1} {
horosParuosti $kanalas $nickas $hostas $flagas $tekstas
}
}

proc horosParuosti {kanalas nickas hostas flagas {tekstas ""}} {
global {serv-horos-list} {serv-horos}
pridetiLoga "${serv-horos}"
if {$tekstas==""} {
horosRodytiInfo $nickas
} else {
set _zenklas ""
set _indeksas -1
set _data ""
for {set i 0} {$i<[llength ${serv-horos-list}]} {incr i} {
if {[strlwr $tekstas]==[strlwr [lindex ${serv-horos-list} $i]]} {
set _zenklas [strupr [lindex ${serv-horos-list} $i]]
set _indeksas $i
set _data [horosGautiData $_indeksas]
}
}
if {$_zenklas!=""&&$_data!=""&&$_indeksas!=-1} {
set sock [egghttp:geturl www.delfi.lt/horoscope/ [list horosGautiSuEgg $kanalas $nickas $_zenklas $_data $_indeksas]]
} else {
horosRodytiInfo $nickas
}
}
}

proc horosGautiSuEgg {kanalas nickas zenklas data indeksas sock} {
set buffer [egghttp:data $sock]
egghttp:cleanup $sock
set _kur 0
for {set i 278} {$i<292} {incr i} {
set _eilute [nuimtiHtmlKoda [lindex [split $buffer "\n"] $i]]
if {[lindex $_eilute 0]=="Avinas"} {
set _kur [expr $i +1]
}
}
set _horoskopas ""
set i [expr $_kur - 1]
set i [expr $i + ($indeksas*12)]
set _rasta 0
set _all ""
set _yra 0
set _pradzia [horosGauti $indeksas]
set _pabaiga [horosGauti [expr $indeksas + 1]]
set _in 0
while {$_rasta==0&&$i<440} {
set _eilute [nuimtiHtmlKoda [lindex [split $buffer "\n"] $i]]
set _test [strlwr [lindex $_eilute 0]]
if {$_test==$_pabaiga} {
set _yra 0
set _rasta 1
}
if {$_yra==1} {
append _horoskopas $_eilute
incr _in
}
if {$_in==3} {
set _rasta 1
}
if {$_test==$_pradzia} {
set _yra 1
set _in 0
}
incr i
}
set _horoskopas [nuimtiHtmlKoda $_horoskopas]
if {$_horoskopas!=""} {
horosPranesimas $kanalas $nickas $zenklas $data $_horoskopas
} else {
proceduros "NOTICE $nickas :Šiuo metu negaliu nustatyti \002$zenklas\002 horoskopo."
}
}

proc horosGauti {sk} {
set _list "avinas jautis dvyniai vėžys liūtas mergelė svarstyklės skorpionas šaulys ožiaragis vandenis žuvys null"
set _gr [lindex $_list $sk]
return $_gr
}

proc horosPranesimas {kanalas nickas zenklas data horoskopas} {
global {serv-kur-pub} {serv-kur-msg}
if {$kanalas!=""} {
if {[lsearch -glob [channel info $kanalas] "+servcl"]>-1} {
set zenklas "\00308,02 $zenklas \00399,99"
}
} else {
set zenklas "\00308,02 $zenklas \00399,99"
}
if {$kanalas==""} {
set _kaip ${serv-kur-msg}
} else {
set _kaip ${serv-kur-pub}
}
set _antraste "--== \002Ženklas $zenklas $data\002 ==--"
set _tekstas "\002Horoskopas:\002 $horoskopas"
if {$_kaip==1} {
proceduros "NOTICE $nickas :$_antraste"
proceduros "NOTICE $nickas :$_tekstas"
}
if {$_kaip==2} {
proceduros "PRIVMSG $nickas :$_antraste"
proceduros "PRIVMSG $nickas :$_tekstas"
}
if {$_kaip==3&&$kanalas!=""} {
proceduros "PRIVMSG $kanalas :$_antraste"
proceduros "PRIVMSG $kanalas :$_tekstas"
}
}

proc horosGautiData {indeksas} {
switch $indeksas {
0 {return "(kovo21 d. - balandžio18 d.)"}
1 {return "(balandžio19 d. - gegužės19 d.)"}
2 {return "(gegužės20 d. - birželio20 d.)"}
3 {return "(birželio21 d. - liepos21 d.)"}
4 {return "(liepos22 d. - rugpjūčio21 d.)"}
5 {return "(rugpjūčio22 d. - rugsėjo21 d.)"}
6 {return "(rugsėjo22 d. - spalio21 d.)"}
7 {return "(spalio22 d. - lapkričio20 d.)"}
8 {return "(lapkričio21 d. - gruodžio20 d.)"}
9 {return "(gruodžio22 d. - sausio20 d.)"}
10 {return "(sausio20 d. - vasario18 d.)"}
11 {return "(vasario19 d. - kovo20 d.)"}
}
return ""
}

proc horosRodytiInfo {nickas} {
global {serv-horos-list} {serv-horos} {serv-pries} botnick
proceduros "NOTICE $nickas :Šiuo metu jums pateikiami horoskopai: [strupr ${serv-horos-list}]."
proceduros "NOTICE $nickas :Rašykite: \002${serv-pries}[strupr ${serv-horos}] ŽENKLAS\002 arba \002/MSG $botnick [strupr ${serv-horos}] ŽENKLAS\002 (pvz.: ${serv-pries}${serv-horos} avinas)."
}

if {[llength ${serv-horos-list}]==12} {
bind PUB ${serv-flag} "${serv-pries}${serv-horos}" horosNukreiptiIMsg
bind MSG ${serv-flag} "${serv-horos}" [list horosParuosti ""]
putlog "Horoskopu modulis uzkrautas."
set horosLoaded 1
} else {
putlog "Horoskopu modulis neuzkrautas. Nera zodiako zenklu."
}

---------------------------------------------------------------------
PLEASE HELP
p
pollar
Voice
Posts: 18
Joined: Thu Jan 09, 2003 12:20 pm
Location: Lithuania

Post by pollar »

:))

Well...
When you'll start writing your own scripts and will stop ripping you will be able to repair scripts and make your own ones.

:evil: I hate [censored]' ripperzzz!!! :evil:
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Also, if it's possible, on the future please try to put your script on a free web page or something and just paste the link of it.
Once the game is over, the king and the pawn go back in the same box.
User avatar
arcane
Master
Posts: 280
Joined: Thu Jan 30, 2003 9:18 am
Location: Germany
Contact:

Post by arcane »

or at least use code-tags. i _hate_ looking through unformatted code.
aVote page back online!
Check out the most popular voting script for eggdrop bots.

Join the metal tavern!
Locked