Cacao7w7

shoutcast2.tcl

Jul 1st, 2018
285
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 30.90 KB | None | 0 0
  1. set radiochans "#RadioLatina"
  2. set adminchans "#djs_radiolatina"
  3. set adminchans1 "#djs_radiolatina"
  4. set streamip "malvadooo.xyz
  5. set streamport "8000"
  6. set streampass "13102004"
  7. set scstatstrigger "!estado"
  8. set scstreamtrigger "!enlace"
  9. set scplayingtrigger "!radio"
  10. set sclistenertrigger "!oyentes"
  11. set scdjtrigger "!dj"
  12. set scsetdjtrigger "!emite"
  13. set scunsetdjtrigger "!auto"
  14. set scwishtrigger "!peticion"
  15. set scgreettrigger "!saludos"
  16. set sclastsongstrigger "!ultimas"
  17. set schelptrigger "!comandos"
  18.  
  19. set alertadmin ""
  20. set doalertadmin "1"
  21.  
  22. set announce "1"
  23.  
  24. set urltopic "0"
  25. set ctodjc "1"
  26. set tellsongs "1"
  27. set tellusers "1"
  28. set tellbitrate "1"
  29.  
  30. set advertise "1"
  31. set advertiseonlyifonline "1"
  32.  
  33. set offlinetext "1 La Radio Se Encuentra 7APAGADA"
  34. set offlinetopic ""
  35.  
  36. #set onlinetext "1Radio IRC 6TRANSMITIENDO a 4 /bitrate/ kbits 1Sitonizanos en -> 12http://www.lc-lesbianas.tk/"
  37. #set onlinetext "1Radio IRC 6TRANSMITIENDO a 4 /bitrate/ kbits 1Sitonizanos en -> 12http://$streamip:$streamport/listen.pls"
  38.  
  39. #set onlinetext "10.::@4 RADIOENIGMA10 @::.1 Sintonízanos en 4 http://www.lc-lesbianas.tk/ 1Facebook del canal:4 https://www.facebook.com/radioenigmaonair 1Para ver comandos de la radio, teclea:4 !radio"
  40.  
  41. set onlinetopic ""
  42.  
  43. #set streamtext "Sintoniza Radio IRC en http://$streamip:$streamport/listen.pls"
  44. #set streamtext "10.::@4 RADIOENIGMA10 @::.1 Sintonízanos en 4 http://www.lc-lesbianas.tk/ 1Facebook del canal:4 https://www.facebook.com/radioenigmaonair 1Para ver comandos de la radio, teclea:4 !radio"
  45.  
  46. #set advertisetext "Radio IRC 4TRANSMITIENDO ---> 2 http://$streamip:$streamport/listen.pls - ... Para Ver Comandos de la Radio Teclea 2!radio "
  47. #set advertisetext "10.::@4 RADIOENIGMA10 @::.1 Sintonízanos en 4 http://www.lc-lesbianas.tk/ 1Facebook del canal:4 https://www.facebook.com/radioenigmaonair 1Para ver comandos de la radio, teclea:4 !radio"
  48. #set advertisetext "1»10R1« 1Emitiendo: 1»6¤1«110 GUZ 1»6¤1«1 Desde -_ chan _- Sintoniza 1En: 10www6.lc-lesbianas.10tk 11 La Radio Que Prende Tus Sentidos 10 Peticiones 1!pido Tema Artista 10Comandos 1Escribe 6!RL 1»10L1«"
  49.  
  50. # end of config #####################
  51.  
  52. bind pub - $scstatstrigger pub_scstat
  53. bind msg - $scstatstrigger msg_scstat
  54.  
  55. bind pub - $scplayingtrigger pub_playing
  56. bind msg - $scplayingtrigger msg_playing
  57.  
  58. bind pub - $scdjtrigger pub_dj
  59. bind msg - $scdjtrigger msg_dj
  60.  
  61. bind pub - $scsetdjtrigger pub_setdj
  62. bind msg - $scsetdjtrigger msg_setdj
  63.  
  64. bind pub - $scunsetdjtrigger pub_unsetdj
  65. bind msg - $scunsetdjtrigger msg_unsetdj
  66.  
  67. bind pub - $scwishtrigger pub_wish
  68. bind msg - $scwishtrigger msg_wish
  69.  
  70. bind pub - $scgreettrigger pub_greet
  71. bind msg - $scgreettrigger msg_greet
  72.  
  73. bind pub - $scstreamtrigger pub_stream
  74. bind msg - $scstreamtrigger msg_stream
  75.  
  76. bind pub - $sclastsongstrigger pub_lastsongs
  77. bind msg - $sclastsongstrigger msg_lastsongs
  78.  
  79. bind pub - $sclistenertrigger pub_listener
  80. bind msg - $sclistenertrigger msg_listener
  81.  
  82. bind pub - $schelptrigger pub_help
  83. bind msg - $schelptrigger msg_help
  84.  
  85. #bind time - "* * * * *" isonline
  86. bind time - "*5 * * * *" isonline
  87. bind time - "*0 * * * *" isonline
  88. bind time - "00 * * * *" advertise
  89. bind time - "20 * * * *" advertise
  90. bind time - "40 * * * *" advertise
  91. bind nick - * djnickchange
  92.  
  93. bind pub - !facebook pub_facebook
  94. bind pub - !xiialive pub_xiialive
  95. bind pub - !tunein pub_tunein
  96. bind pub - !winamp pub_winamp
  97. bind pub - !reproductor pub_reproductor
  98. bind pub - !abre pub_abrepeticiones
  99. bind pub - !cierra pub_cierrapeticiones
  100. bind pub - !status.peticiones pub_statuspeticiones
  101. bind pub - !adminchan proc_adminchan
  102. bind pub - !adminchandj proc_adminchandj
  103. bind pub - !canales proc_canales
  104.  
  105. set dj ""
  106. set surl ""
  107. set bitrate ""
  108. set stitle ""
  109. set djciudad ""
  110.  
  111. if {[file exists dj]} {
  112. set temp [open "dj" r]
  113. set dj [gets $temp]
  114. close $temp
  115. }
  116.  
  117. ####prueba
  118.  
  119. proc cl_chanlist { } {
  120. global botnick
  121. set chanlist ""
  122. foreach chan [channels] {
  123. append chanlist "$chan "
  124. }
  125. return $chanlist
  126. }
  127.  
  128. proc proc_canales { nick uhost hand chan arg } {
  129. global adminchans
  130. if {([lsearch -exact [string tolower $adminchans] [string tolower $chan]] != -1) || ($adminchans == "")} {
  131. putserv "privmsg $chan : 1Locutores 1entrar: 7#djs_enigmaticas"
  132.  
  133. }
  134. }
  135.  
  136. proc proc_adminchan { nick uhost hand chan arg } {
  137. global adminchans
  138. putserv "privmsg $chan : El canal de la administracion es $adminchans "
  139. }
  140. proc proc_adminchandj { nick uhost hand chan arg } {
  141. global adminchans1
  142. putserv "privmsg $chan : El canal de la administracion es $adminchans1 "
  143. }
  144.  
  145. proc pub_xiialive { nick uhost hand chan arg } {
  146. putserv "privmsg $chan : 1 Sonando: 7 $songtitle"
  147. }
  148.  
  149. proc pub_facebook { nick uhost hand chan arg } {
  150. putserv "privmsg $chan : 7$nick 1 Seguinos en 7 Facebook: http://facebook.com/radioenigmaonair"
  151. }
  152.  
  153. proc pub_tunein { nick uhost hand chan arg } {
  154. putserv "privmsg $chan : 7 $nick Tunein: 1Lo Siento Tunein Fuera De Linea"
  155. }
  156.  
  157. proc pub_winamp { nick uhost hand chan arg } {
  158. putserv "privmsg $chan : 1 Esta Emitiendo: 7 $dj 1 Winamp: 7 http://91.134.241.109:8000 1 WEB: 7 www.lc-lesbianas.tk"
  159. }
  160.  
  161. proc pub_reproductor { nick uhost hand chan arg } {
  162. putserv "privmsg $chan : 7 $nick 1 Reproductor: 7 http://http://91.134.241.109:8000"
  163. }
  164.  
  165. proc pub_abrepeticiones { nick uhost hand chan arg } {
  166. global adminchans1
  167.  
  168. if {([lsearch -exact [string tolower $adminchans1] [string tolower $chan]] != -1) || ($adminchans1 == "")} {
  169. set temp [open "djnick" r]
  170. set djnick [gets $temp]
  171. close $temp
  172. putserv "privmsg $adminchans1 :PETICIONES: Las Peticiones han sido abierta"
  173. poststuff privmsg "1Peticiones 3ABIERTAS 1. Usa: 7!peticion Artista-Cancion 1para solicitar un tema."
  174. set temp [open "peticiones" w+]
  175. puts $temp "Abiertas"
  176. close $temp
  177. }
  178. }
  179. proc pub_cierrapeticiones { nick uhost hand chan arg } {
  180. global adminchans1
  181. if {([lsearch -exact [string tolower $adminchans1] [string tolower $chan]] != -1) || ($adminchans1 == "")} {
  182. set temp [open "djnick" r]
  183. set djnick [gets $temp]
  184. close $temp
  185. putserv "privmsg $adminchans1 :PETICIONES: Las Peticiones han sido cerradas"
  186. poststuff privmsg "1Peticiones 4CERRADAS 1. Gracias por preferir 7 Radio Enigma "
  187. set temp [open "peticiones" w+]
  188. puts $temp "Cerradas"
  189. close $temp
  190. }
  191. }
  192.  
  193. proc pub_statuspeticiones { nick uhost hand chan arg } {
  194. set temp [open "peticiones" r]
  195. set peticiones [gets $temp]
  196. close $temp
  197. putserv "privmsg $chan :PETICIONES: Las Peticiones estan $peticiones"
  198. }
  199.  
  200. ###Modulo para agregar ciudad
  201.  
  202. bind pub D !ciudad pub_setciudad
  203.  
  204. proc pub_setciudad { nick uhost hand chan arg } { global adminchans1; if {([lsearch -exact [string tolower $adminchans1] [string tolower $chan]] != -1) || ($adminchans1 == "")} { setciudad $arg }}
  205.  
  206. proc setciudad { djciudad } {
  207. putlog "shoutcast: $djciudad "
  208. if {$djciudad == "" } { set djciudad $djciudad }
  209. global streamip streamport streampass dj
  210. putlog "shoutcast: Nuevo Ciudad agregada para $dj ( $djciudad )"
  211. set temp [open "ciudad" w+]
  212. puts $temp $djciudad
  213. close $temp
  214. rehash
  215. }
  216.  
  217. ### Fin Modulo
  218.  
  219. bind pub - !siguiente pub_siguiente
  220. proc pub_siguiente { nick uhost hand chan arg } {
  221. exec killall sc_trans_linux -WINCH
  222. putlog "shoutcast: Cambio de canción pedido por $nick"
  223. }
  224.  
  225. bind pub - !playlist pub_playlist
  226. proc pub_playlist { nick uhost hand chan arg } {
  227. exec killall sc_trans_linux -USR1
  228. putlog "shoutcast: $nick pidio recargar el playlist"
  229. }
  230.  
  231.  
  232.  
  233. proc shrink { calc number string start bl} { return [expr [string first "$string" $bl $start] $calc $number] }
  234.  
  235.  
  236. proc status { } {
  237. global streamip streamport streampass
  238. if {[catch {set sock [socket $streamip $streamport] } sockerror]} {
  239. putlog "error: $sockerror"
  240. return 0 } else {
  241. puts $sock "GET /admin.cgi?pass=$streampass&mode=viewxml&page=0 HTTP/1.0"
  242. puts $sock "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9)"
  243. puts $sock "Host: $streamip"
  244. puts $sock "Connection: close"
  245. puts $sock ""
  246. flush $sock
  247. while {[eof $sock] != 1} {
  248. set bl [gets $sock]
  249. if { [string first "standalone" $bl] != -1 } {
  250. set streamstatus [string range $bl [shrink + 14 "<STREAMSTATUS>" 0 $bl] [shrink - 1 "</STREAMSTATUS>" 0 $bl]]
  251. }}
  252. close $sock
  253. }
  254. if { $streamstatus == "1" } { return 1 } else { return 0 }
  255. }
  256.  
  257.  
  258.  
  259.  
  260. proc poststuff { mode text } {
  261. global radiochans dj
  262. set curlist "0"
  263. set curhigh "0"
  264. set surl ""
  265. set cursong ""
  266. set sgenre ""
  267. set bitrate "0"
  268. set stitle ""
  269.  
  270. set temp [open "isonline" r]
  271. while {[eof $temp] != 1} {
  272. set zeile [gets $temp]
  273. if {[string first "curlist:" $zeile] != -1 } { set curlist $zeile }
  274. if {[string first "curhigh:" $zeile] != -1 } { set curhigh $zeile }
  275. if {[string first "cursong:" $zeile] != -1 } { set cursong [lrange $zeile 1 [llength $zeile]]] }
  276. if {[string first "sgenre:" $zeile] != -1 } { set sgenre [lrange $zeile 1 [llength $zeile]]}
  277. if {[string first "serverurl:" $zeile] != -1 } { set surl [lindex $zeile 1] }
  278. if {[string first "bitrate:" $zeile] != -1 } { set bitrate [lindex $zeile 1] }
  279. if {[string first "stitle:" $zeile] != -1 } { set stitle [lindex $zeile 1] }
  280. }
  281. close $temp
  282.  
  283. regsub -all "/stitle/" $text "$stitle" text
  284. regsub -all "/curlist/" $text "$curlist" text
  285. regsub -all "/curhigh/" $text "$curhigh" text
  286. regsub -all "/cursong/" $text "$cursong" text
  287. regsub -all "/sgenre/" $text "$sgenre" text
  288. regsub -all "/surl/" $text "$surl" text
  289. regsub -all "/bitrate/" $text "$bitrate" text
  290. regsub -all "/dj/" $text "$dj" text
  291.  
  292. foreach chan [channels] {
  293. if {$radiochans == "" } { putserv "$mode $chan :$text" }
  294. if {$radiochans != "" } {
  295. if {([lsearch -exact [string tolower $radiochans] [string tolower $chan]] != -1)} {putserv "$mode $chan :$text"}
  296. }}}
  297.  
  298.  
  299. proc schelp { target chan } {
  300. global scstatstrigger scstreamtrigger scplayingtrigger scdjtrigger sclastsongstrigger scwishtrigger scgreettrigger sclistenertrigger radiochans
  301. putserv "privmsg $chan : 1 $target Los Comandos de la Radio: 7!Enlace 1Para Ver Nuestro Link: 7!Radio 1Conoces La Cancion Que Está Sonando 7!Dj 1Nuestro Dj En Emision 7!Peticion Tema Artista 1Para Pedir Temas 7!Facebook 1- 7!Tunein1 - 7!Winamp 1 - Gracias 1 Por Sintonizar"
  302. }
  303.  
  304. proc pub_help {nick uhost hand chan arg} {
  305. global radiochans
  306. if {$radiochans == "" } { schelp $nick $chan }
  307. if {$radiochans != "" } {
  308. if {([lsearch -exact [string tolower $radiochans] [string tolower $chan]] != -1) || ($radiochans == "")} { schelp $nick $chan }
  309. }}
  310.  
  311. proc advertise { nick uhost hand chan arg } {
  312. global advertisetext advertise advertiseonlyifonline dj djciudad ciud
  313. set temp [open "ciudad" r]
  314. set ciud [gets $temp]
  315. close $temp
  316. if {$advertise == "1" && $advertiseonlyifonline == "0"} { poststuff privmsg "$advertisetext" }
  317. if {$advertise == "1" && $advertiseonlyifonline == "1" && [status] == 1} {
  318. #poststuff privmsg "$advertisetext"
  319. poststuff privmsg "7 E1n Controles: 7 $dj 1 Sintonizanos En: 7 www.lc-lesbianas.tk 1 La Radio 7 Mas Prendida 1 Peticiones: 7 !Peticion 1 Tema-7 Artista 1 Sonando: 7 $songtitle"
  320. }
  321. }
  322.  
  323.  
  324. proc setdj {nickname djnickname } {
  325. set acmd [lindex $djnickname 0]
  326. set ciud [lrange $djnickname 1 end]
  327. putlog "prueba $ciud"
  328. if {$djnickname == ""} { set djnickname $ciud }
  329. global streamip streamport streampass dj ctodjc
  330. putquick "MODE #djs_enigma -o $dj"
  331. putquick "MODE #djs_enigma +v $dj"
  332. poststuff privmsg "1Emite ahora:7 $nickname"
  333. putquick "MODE #djs_enigma +o $nickname"
  334. putlog "shoutcast: Nuevo Dj: $djnickname ($nickname)"
  335. set temp [open "dj" w+]
  336. puts $temp $nickname
  337. close $temp
  338. set temp [open "djnick" w+]
  339. puts $temp $nickname
  340. close $temp
  341.  
  342. set temp [open "ciudad" w+]
  343. puts $temp $djnickname
  344. close $temp
  345. rehash
  346. if { [status] == "1" } { poststuff privmsg ""
  347. if { $ctodjc == "1" } {
  348. set temp [open "isonline" r]
  349. while {[eof $temp] != 1} {
  350. set zeile [gets $temp]
  351. if {[string first "isonline:" $zeile] != -1 } { set oldisonline $zeile }
  352. if {[string first "curlist:" $zeile] != -1 } { set oldcurlist $zeile }
  353. if {[string first "curhigh:" $zeile] != -1 } { set oldcurhigh $zeile }
  354. if {[string first "cursong:" $zeile] != -1 } { set oldsong $zeile }
  355. if {[string first "bitrate:" $zeile] != -1 } { set oldbitrate $zeile }
  356. }
  357. close $temp
  358. }
  359. } else {
  360. putserv "privmsg $nickname :Comando Invalido Por Motivo de tener Nuestra radio fuera de Línea (APAGADA)" }
  361. }
  362.  
  363.  
  364. proc msg_setdj { nick uhost hand arg } { setdj $nick $arg }
  365. proc pub_setdj { nick uhost hand chan arg } { global adminchans1; if {([lsearch -exact [string tolower $adminchans1] [string tolower $chan]] != -1) || ($adminchans1 == "")} { setdj $nick $arg }}
  366.  
  367. proc unsetdj { nick } {
  368. global dj adminchans1
  369. poststuff privmsg "7 Fin 1 Emision 7 .::. $dj .::. 1 Emitiendo Ahora 7 .::. AutoDJmix .::. 1 Sintoniza En 7 www.lc-lesbianas.tk"
  370. set temp [open "dj" w+]
  371. puts $temp "AutoDJ"
  372. close $temp
  373. set temp [open "djnick" w+]
  374. puts $temp "AutoDJ"
  375. close $temp
  376. set temp [open "ciudad" w+]
  377. puts $temp "Mexico"
  378. close $temp
  379. set temp [open "peticiones" w+]
  380. puts $temp "Cerradas"
  381. close $temp
  382. #putserv "privmsg $adminchans1 :Dj Puesto en Automatico .."
  383. rehash
  384. }
  385.  
  386.  
  387. proc msg_unsetdj { nick uhost hand arg } { unsetdj $nick }
  388. proc pub_unsetdj { nick uhost hand chan arg } { global adminchans1; if {([lsearch -exact [string tolower $adminchans1] [string tolower $chan]] != -1) || ($adminchans1 == "")} { unsetdj $nick }}
  389.  
  390.  
  391. proc listener { target } {
  392. global streamip streamport streampass adminchans
  393. putlog "shoutcast: $target cuenta solicitada del oyente"
  394. if {[catch {set sock [socket $streamip $streamport] } sockerror]} {
  395. putlog "error: $sockerror"
  396. return 0 } else {
  397. puts $sock "GET /admin.cgi?pass=$streampass&mode=viewxml&page=0 HTTP/1.0"
  398. puts $sock "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9)"
  399. puts $sock "Host: $streamip"
  400. puts $sock "Connection: close"
  401. puts $sock ""
  402. flush $sock
  403. while {[eof $sock] != 1} {
  404. set bl [gets $sock]
  405. if { [string first "standalone" $bl] != -1 } {
  406. set repl [string range $bl [shrink + 18 "<CURRENTLISTENERS>" 0 $bl] [shrink - 1 "</CURRENTLISTENERS>" 0 $bl]]
  407. set curhigh [string range $bl [shrink + 15 "<PEAKLISTENERS>" 0 $bl] [shrink - 1 "</PEAKLISTENERS>" 0 $bl]]
  408. set maxl [string range $bl [shrink + 14 "<MAXLISTENERS>" 0 $bl] [shrink - 1 "</MAXLISTENERS>" 0 $bl]]
  409. set avgtime [string range $bl [shrink + 13 "<AVERAGETIME>" 0 $bl] [shrink - 1 "</AVERAGETIME>" 0 $bl]]
  410. }}
  411. close $sock
  412. #putserv "notice $target :Actualmente hay $repl Oyente(s), La Radio Tiene Capacidad para $maxl Oyentes, el número máximo de Oyentes Hasta Ahora es de $curhigh Oyentes, el promedio de escucha es a $avgtime"
  413. putserv "notice $target : 10$target 1Actualmente hay 10 $repl 1Oyente(s), La Radio Tiene Capacidad para 10 $maxl 1Oyentes, el número máximo de Oyentes Hasta Ahora es de 10 $curhigh 1Oyentes, el promedio de escucha es:10 $avgtime "
  414. }}
  415.  
  416. proc msg_listener { nick uhost hand arg } { listener $nick }
  417. proc pub_listener { nick uhost hand chan arg } { global adminchans; if {([lsearch -exact [string tolower $adminchans] [string tolower $chan]] != -1) || ($adminchans == "")} { listener $nick }}
  418.  
  419. proc wish { nick chan arg } {
  420. global radiochans adminchans1
  421. if {$arg == ""} { putserv "privmsg $chan : 1$nick Por Favor Especifica El Tema Que Deseas Pedir 7!peticion Tema Artista 1Gracias Por Sintonizar return 0}
  422. if { [status] == "1" } {
  423. set temp [open "djnick" r]
  424. set djnick [gets $temp]
  425. close $temp
  426. putserv "privmsg $radiochans1 :1PEDIDO MUSICAL: 14$arg 1de Parte de 7$nick"
  427. putserv "privmsg $adminchans1 :14.:7 PETICION 14:. 1 $djnick 1el nick 7$nick 1pidio 10$arg 1Desde 10$chan"
  428. putserv "privmsg $djnick :7$djnick 1el nick 7$nick 1 Pide 7$arg 1Desde 7$chan "
  429. putserv "privmsg $chan : 7$nick 1Tu 7Peticion 1Ha Sido Registrada."
  430. } else {
  431. putserv "notice $nick :Lo Siento la Radio Esta Apagada :(" }
  432. }
  433.  
  434.  
  435. proc msg_wish { nick uhost hand arg } { wish $nick $arg }
  436. proc pub_wish { nick uhost hand chan arg } { global radiochans; if {([lsearch -exact [string tolower $radiochans] [string tolower $chan]] != -1) || ($radiochans == "")} { wish $nick $arg }}
  437. proc pub_wish { nick uhost hand chan arg } {
  438. global radiochans
  439. set temp [open "peticiones" r]
  440. set peticiones [gets $temp]
  441. close $temp
  442. if {$peticiones == "Abiertas"} {
  443. if {([lsearch -exact [string tolower $radiochans] [string tolower $chan]] != -1) || ($radiochans == "") } {
  444. #wish $nick $arg
  445. wish $nick $chan $arg
  446. }
  447. } else
  448. putserv "privmsg $chan : 7$nick 1En Este Momento Las Peticiones Estan 4CERRADAS 1, 1Espera Que Nuestro Dj Vuelva Abrir Peticiones. Gracias Por Sintonizar"
  449. }
  450.  
  451.  
  452.  
  453.  
  454. proc sclastsongs { target } {
  455. global streamip streamport streampass
  456. putlog "shoutcast: $target Historia solicitada de la canción"
  457. if {[catch {set sock [socket $streamip $streamport] } sockerror]} {
  458. putlog "error: $sockerror"
  459. return 0 } else {
  460. puts $sock "GET /admin.cgi?pass=$streampass&mode=viewxml&page=0 HTTP/1.0"
  461. puts $sock "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9)"
  462. puts $sock "Host: $streamip"
  463. puts $sock "Connection: close"
  464. puts $sock ""
  465. flush $sock
  466. while {[eof $sock] != 1} {
  467. set bl [gets $sock]
  468. if { [string first "standalone" $bl] != -1 } {
  469. set songs [string range $bl [string first "<TITLE>" $bl] [expr [string last "</TITLE>" $bl] + 7]]
  470.  
  471. regsub -all "&#x3C;" $songs "<" songs
  472. regsub -all "&#x3E;" $songs ">" songs
  473. regsub -all "&#x26;" $songs "+" songs
  474. regsub -all "&#x22;" $songs "\"" songs
  475. regsub -all "&#x27;" $songs "'" songs
  476. regsub -all "&#xFF;" $songs "" songs
  477. regsub -all "<TITLE>" $songs "(" songs
  478. regsub -all "</TITLE>" $songs ")" songs
  479. regsub -all "<SONG>" $songs "" songs
  480. regsub -all "</SONG>" $songs " - " songs
  481. regsub -all "<PLAYEDAT>" $songs "" songs
  482. regsub -all "</PLAYEDAT>" $songs "" songs
  483. regsub -all {\d} $songs "" songs
  484.  
  485. regsub -all "&#xB4;" $songs "´" songs
  486. regsub -all "&#x96;" $songs "-" songs
  487. regsub -all "&#xF6;" $songs "ö" songs
  488. regsub -all "&#xE4;" $songs "ä" songs
  489. regsub -all "&#xFC;" $songs "ü" songs
  490. regsub -all "&#xD6;" $songs "Ö" songs
  491. regsub -all "&#xC4;" $songs "Ä" songs
  492. regsub -all "&#xDC;" $songs "Ü" songs
  493. regsub -all "&#xDF;" $songs "ß" songs
  494.  
  495.  
  496.  
  497. }}
  498. close $sock
  499. putserv "notice $target :$songs"
  500. }}
  501.  
  502.  
  503. proc msg_lastsongs { nick uhost hand arg } { sclastsongs $nick }
  504. proc pub_lastsongs { nick uhost hand chan arg } { global radiochans; if {([lsearch -exact [string tolower $radiochans] [string tolower $chan]] != -1) || ($radiochans == "")} { sclastsongs $nick }}
  505.  
  506.  
  507.  
  508. proc scstream { target } {
  509. global streamip streamport streamtext radiochans
  510. putlog "shoutcast: Enlace de Informacion solicitada por $target"
  511. putserv "privmsg $radiochans : aa "
  512. }
  513.  
  514. proc msg_stream { nick uhost hand arg } { scstream $nick }
  515. proc pub_stream { nick uhost hand chan arg } { global radiochans; if {([lsearch -exact [string tolower $radiochans] [string tolower $chan]] != -1) || ($radiochans == "")} {
  516. putlog "shoutcast: Enlace de Informacion solicitada por $nick"
  517. putserv "privmsg $chan : 7 $nick 1Sintoniza En: 7http://www.lc-lesbianas.tk"
  518. }
  519. }
  520.  
  521. proc scgreet { nick arg } {
  522. if {$arg == ""} { putserv "notice $nick :Olvidó de agregar su Saludos Ej:(!saludos <Tus Saludos>)"; return 0}
  523. if { [status] == "1" } {
  524. set temp [open "djnick" r]
  525. set djnick [gets $temp]
  526. close $temp
  527. putserv "privmsg $djnick :Enviar unos Saludos: $arg de Parte de $nick"
  528. } else {
  529. putserv "notice $nick :Lo Siento la Radio Esta Apagada :(" }
  530. }
  531.  
  532.  
  533. proc msg_greet { nick uhost hand arg } { scgreet $nick $arg }
  534. proc pub_greet { nick uhost hand chan arg } { global radiochans; if {([lsearch -exact [string tolower $radiochans] [string tolower $chan]] != -1) || ($radiochans == "")} { scgreet $nick $arg }}
  535.  
  536.  
  537.  
  538. proc djnickchange { oldnick uhost hand chan newnick } {
  539. set temp [open "djnick" r]
  540. set djnick [gets $temp]
  541. close $temp
  542. if {$oldnick == $djnick} {
  543. putlog "shoutcast: Cambio de Nick del Dj de $oldnick a $newnick"
  544. set temp [open "djnick" w+]
  545. puts $temp $newnick
  546. close $temp
  547. }}
  548.  
  549.  
  550.  
  551.  
  552.  
  553. proc dj { target chan } {
  554. global streamip streamport streampass dj
  555. putlog "shoutcast: $target pedido La informacion del DJ"
  556. if {[status] == 1} {
  557. if {[file exists dj]} {
  558. set temp [open "dj" r]
  559. set dj [gets $temp]
  560. close $temp
  561. putserv "privmsg $chan :10$target 1Emitiendo: 7 $dj 1Sintoniza En: 7 www.lc-lesbianas.tk"
  562. } else { putserv "notice $target :Lo Siento, Por el momento no hay ningun dj emitiendo" }
  563. } else { putserv "notice $target :Lo Siento la Radio Esta Apagada :(" }
  564. }
  565.  
  566.  
  567.  
  568. proc msg_dj { nick uhost hand arg } { dj $nick"}
  569. proc pub_dj { nick uhost hand chan arg } { global radiochans; if {([lsearch -exact [string tolower $radiochans] [string tolower $chan]] != -1) || ($radiochans == "")} { dj $nick $chan }}
  570.  
  571.  
  572.  
  573. proc scstat {target} {
  574. global streamip streamport streampass
  575. putlog "shoutcast: $target pedido del Estado del servidor"
  576. if {[catch {set sock [socket $streamip $streamport] } sockerror]} {
  577. putlog "error: $sockerror"
  578. return 0 } else {
  579. puts $sock "GET /admin.cgi?pass=$streampass&mode=viewxml&page=0 HTTP/1.0"
  580. puts $sock "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9)"
  581. puts $sock "Host: $streamip"
  582. puts $sock "Connection: close"
  583. puts $sock ""
  584. flush $sock
  585. while {[eof $sock] != 1} {
  586. set bl [gets $sock]
  587. if { [string first "standalone" $bl] != -1 } {
  588. set streamstatus [string range $bl [shrink + 14 "<STREAMSTATUS>" 0 $bl] [shrink - 1 "</STREAMSTATUS>" 0 $bl]]
  589. set repl [string range $bl [shrink + 18 "<CURRENTLISTENERS>" 0 $bl] [shrink - 1 "</CURRENTLISTENERS>" 0 $bl]]
  590. set curhigh [string range $bl [shrink + 15 "<PEAKLISTENERS>" 0 $bl] [shrink - 1 "</PEAKLISTENERS>" 0 $bl]]
  591. set currentl [string range $bl [shrink + 18 "<CURRENTLISTENERS>" 0 $bl] [shrink - 1 "</CURRENTLISTENERS>" 0 $bl]]
  592. set surl [string range $bl [shrink + 11 "<SERVERURL>" 0 $bl] [shrink - 1 "</SERVERURL>" 0 $bl]]
  593. set maxl [string range $bl [shrink + 14 "<MAXLISTENERS>" 0 $bl] [shrink - 1 "</MAXLISTENERS>" 0 $bl]]
  594. set bitrate [string range $bl [shrink + 9 "<BITRATE>" 0 $bl] [shrink - 1 "</BITRATE>" 0 $bl]]
  595. set stitle [string range $bl [shrink + 13 "<SERVERTITLE>" 0 $bl] [shrink - 1 "</SERVERTITLE>" 0 $bl]]
  596. set sgenre [string range $bl [shrink + 13 "<SERVERGENRE>" 0 $bl] [shrink - 1 "</SERVERGENRE>" 0 $bl]]
  597. if {$sgenre != ""} {set sgenre " ($sgenre)"}
  598. set avgtime [string range $bl [shrink + 13 "<AVERAGETIME>" 0 $bl] [shrink - 1 "</AVERAGETIME>" 0 $bl]]
  599. set irc [string range $bl [shrink + 5 "<IRC>" 0 $bl] [shrink - 1 "</IRC>" 0 $bl]]
  600. set icq [string range $bl [shrink + 5 "<ICQ>" 0 $bl] [shrink - 1 "</ICQ>" 0 $bl]]
  601. if {$icq == 0} { set icq "N/A" }
  602. set aim [string range $bl [shrink + 5 "<AIM>" 0 $bl] [shrink - 1 "</AIM>" 0 $bl]]
  603. set webhits [string range $bl [shrink + 9 "<WEBHITS>" 0 $bl] [shrink - 1 "</WEBHITS>" 0 $bl]]
  604. set streamhits [string range $bl [shrink + 12 "<STREAMHITS>" 0 $bl] [shrink - 1 "</STREAMHITS>" 0 $bl]]
  605. set version [string range $bl [shrink + 9 "<VERSION>" 0 $bl] [shrink - 1 "</VERSION>" 0 $bl]]
  606. if {$streamstatus == 1} {
  607. if {[file exists dj]} {
  608. set temp [open "dj" r]
  609. set dj [gets $temp]
  610. close $temp
  611. } else { set dj "Automático" }
  612. putserv ""
  613. } else {
  614. putserv "notice $target :1$stitle$sgenre Actualmente 4ESTA APAGADA, en shoutcast $version y Transmitiendo a $bitrate kbps, Mas información en $surl" }
  615. putserv "notice $target :Actualmente hay $repl Oyentes, La Capacidad maxima es $maxl, Total de Oyentes En la Radio fue de $curhigh oyentes."
  616. putserv "notice $target :El tiempo promedio de escucha es de $avgtime segundos, La Radio tiene $webhits webhits y $streamhits streamhits."
  617. putserv "notice $target :Si Nuestra Radio 1ESTA EN LINEA, Use 4!dj Para ver quien es actualmente el DJ."
  618.  
  619. }}
  620. close $sock
  621. }}
  622.  
  623.  
  624. proc msg_scstat { nick uhost hand arg } { scstat $nick}
  625. proc pub_scstat { nick uhost hand chan arg } { global radiochans; if {([lsearch -exact [string tolower $radiochans] [string tolower $chan]] != -1) || ($radiochans == "")} { scstat $nick }}
  626.  
  627.  
  628. proc playing {target chan} {
  629. global streamip streamport streampass dj
  630. putlog "shoutcast: $target pedido la canción actual"
  631. if {[catch {set sock [socket $streamip $streamport] } sockerror]} {
  632. putlog "error: $sockerror"
  633. return 0 } else {
  634. puts $sock "GET /admin.cgi?pass=$streampass&mode=viewxml&page=0 HTTP/1.0"
  635. puts $sock "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9)"
  636. puts $sock "Host: $streamip"
  637. puts $sock "Connection: close"
  638. puts $sock ""
  639. flush $sock
  640. while {[eof $sock] != 1} {
  641. set bl [gets $sock]
  642. if { [string first "standalone" $bl] != -1 } {
  643. set streamstatus [string range $bl [shrink + 14 "<STREAMSTATUS>" 0 $bl] [shrink - 1 "</STREAMSTATUS>" 0 $bl]]
  644. set songtitle [string range $bl [shrink + 11 "<SONGTITLE" 0 $bl] [shrink - 1 "</SONGTITLE>" 0 $bl]]
  645. set songurl [string range $bl [shrink + 9 "<SONGURL>" 0 $bl] [shrink - 1 "</SONGURL>" 0 $bl]]
  646. if {$songurl != ""} { set songurl " ($songurl)"}
  647. regsub -all "&#x3C;" $songtitle "<" songtitle
  648. regsub -all "&#x3E;" $songtitle ">" songtitle
  649. regsub -all "&#x26;" $songtitle "+" songtitle
  650. regsub -all "&#x22;" $songtitle "\"" songtitle
  651. regsub -all "&#x27;" $songtitle "'" songtitle
  652. regsub -all "&#xFF;" $songtitle "" songtitle
  653. regsub -all "&#xB4;" $songtitle "´" songtitle
  654. regsub -all "&#x96;" $songtitle "-" songtitle
  655. regsub -all "&#xF6;" $songtitle "ö" songtitle
  656. regsub -all "&#xE4;" $songtitle "ä" songtitle
  657. regsub -all "&#xFC;" $songtitle "ü" songtitle
  658. regsub -all "&#xD6;" $songtitle "Ö" songtitle
  659. regsub -all "&#xC4;" $songtitle "Ä" songtitle
  660. regsub -all "&#xDC;" $songtitle "Ü" songtitle
  661. regsub -all "&#xDF;" $songtitle "ß" songtitle
  662.  
  663. if {$streamstatus == 1} {
  664. putserv "privmsg $chan :7 E1n Cabina 7 $dj 1 Sintonizanos En: 7 www.lc-lesbianas.tk 1 La Radio 7 Mas Prendida 1 Peticiones: 7 !Peticion Tema- 7Artista 1 Sonando: 7 $songtitle"
  665. #putserv "notice $target :Canción que suena es: 5$songtitle"
  666. } else {
  667. putserv "notice $target :El servidor es Actualmente Fuera de Línea *4APAGADO*, Lo Siento"
  668. }}}
  669. close $sock
  670. }}
  671.  
  672. proc msg_playing { nick uhost hand arg } { playing $nick}
  673. proc pub_playing { nick uhost hand chan arg } { global radiochans; if {([lsearch -exact [string tolower $radiochans] [string tolower $chan]] != -1) || ($radiochans == "")} { playing $nick $chan }}
  674.  
  675.  
  676.  
  677. proc isonline { nick uhost hand chan arg } {
  678. global radiochans announce tellusers tellsongs tellbitrate urltopic dj
  679. global offlinetext offlinetopic onlinetext onlinetopic
  680. global streamip streampass streamport dj
  681. global doalertadmin alertadmin
  682.  
  683. if {$announce == 1 || $tellsongs == 1 || $tellusers == 1 || $tellbitrate == 1} {
  684. set isonlinefile "isonline"
  685. set oldisonline "isonline: 0"
  686. set oldcurlist "curlist: 0"
  687. set oldcurhigh "curhigh: 0"
  688. set oldsong "cursong: 0"
  689. set oldbitrate "bitrate: 0"
  690. if {[file exists $isonlinefile]} {
  691. putlog "shoutcast: Comprobando si El Enlace está en LINEA"
  692. set temp [open "isonline" r]
  693. while {[eof $temp] != 1} {
  694. set zeile [gets $temp]
  695. if {[string first "isonline:" $zeile] != -1 } { set oldisonline $zeile }
  696. if {[string first "curlist:" $zeile] != -1 } { set oldcurlist $zeile }
  697. if {[string first "curhigh:" $zeile] != -1 } { set oldcurhigh $zeile }
  698. if {[string first "cursong:" $zeile] != -1 } { set oldsong $zeile }
  699. if {[string first "bitrate:" $zeile] != -1 } { set oldbitrate $zeile }
  700. }
  701. close $temp
  702. }
  703.  
  704.  
  705. if {[catch {set sock [socket $streamip $streamport] } sockerror]} {
  706. putlog "error: $sockerror"
  707. return 0} else {
  708. puts $sock "GET /admin.cgi?pass=$streampass&mode=viewxml&page=0 HTTP/1.0"
  709. puts $sock "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9)"
  710. puts $sock "Host: $streamip"
  711. puts $sock "Connection: close"
  712. puts $sock ""
  713. flush $sock
  714. while {[eof $sock] != 1} {
  715. set bl [gets $sock]
  716. if { [string first "standalone" $bl] != -1 } {
  717. set streamstatus "isonline: [string range $bl [shrink + 14 "<STREAMSTATUS>" 0 $bl] [shrink - 1 "</STREAMSTATUS>" 0 $bl]]"
  718. set repl "curlist: [string range $bl [shrink + 18 "<CURRENTLISTENERS>" 0 $bl] [shrink - 1 "</CURRENTLISTENERS>" 0 $bl]]"
  719. set curhigh "curhigh: [string range $bl [shrink + 15 "<PEAKLISTENERS>" 0 $bl] [shrink - 1 "</PEAKLISTENERS>" 0 $bl]]"
  720. set currentl [string range $bl [shrink + 18 "<CURRENTLISTENERS>" 0 $bl] [shrink - 1 "</CURRENTLISTENERS>" 0 $bl]]
  721. set surl "serverurl: [string range $bl [shrink + 11 "<SERVERURL>" 0 $bl] [shrink - 1 "</SERVERURL>" 0 $bl]]"
  722. set cursong "cursong: [string range $bl [shrink + 11 "<SONGTITLE" 0 $bl] [shrink - 1 "</SONGTITLE>" 0 $bl]]"
  723. set songurl [string range $bl [shrink + 9 "<SONGURL>" 0 $bl] [shrink - 1 "</SONGURL>" 0 $bl]]
  724. set bitrate "bitrate: [string range $bl [shrink + 9 "<BITRATE>" 0 $bl] [shrink - 1 "</BITRATE>" 0 $bl]]"
  725. set stitle "stitle: [string range $bl [shrink + 13 "<SERVERTITLE>" 0 $bl] [shrink - 1 "</SERVERTITLE>" 0 $bl]]"
  726. set sgenre "sgenre: [string range $bl [shrink + 13 "<SERVERGENRE>" 0 $bl] [shrink - 1 "</SERVERGENRE>" 0 $bl]]"
  727. }}
  728. close $sock
  729. }
  730.  
  731. set temp [open "isonline" w+]
  732. puts $temp "$streamstatus\n$repl\n$curhigh\n$cursong\n$bitrate\n$stitle\n$sgenre\n$surl"
  733. close $temp
  734. if {$announce == 1 } {
  735. if {$streamstatus == "isonline: 0" && $oldisonline == "isonline: 1"} {
  736. poststuff privmsg $offlinetext
  737. if {$doalertadmin == "1"} { sendnote domsen $alertadmin "La radio Esta Ahora APAGADA" }
  738. if {$urltopic == 1} { poststuff topic $offlinetopic }
  739. }
  740. if {$streamstatus == "isonline: 1" && $oldisonline == "isonline: 0" } {
  741. if {$sgenre != ""} {
  742. set sgenre " ([lrange $sgenre 1 [llength $sgenre]] )"
  743. }
  744. poststuff privmsg "$onlinetext"
  745. if {$urltopic == 1} { poststuff topic "$onlinetopic" }
  746. }}
  747. if {($tellusers == 1) && ($streamstatus == "isonline: 1") && ($oldcurhigh != "curhigh: 0") } {
  748. if {$oldcurhigh != $curhigh} {
  749. poststuff privmsg ""
  750. #poststuff privmsg "Posibles Oyentes: [lindex $curhigh 1]"
  751. }
  752. if {$oldcurlist != $repl} {
  753. poststuff privmsg ""
  754. #poststuff privmsg " Actualmente hay : 4 [lindex $repl 1] ($currentl) Oyentes"
  755. }}
  756. if {($tellsongs == 1) && ($oldsong != $cursong) && ($streamstatus == "isonline: 1") } {
  757. if {$songurl != ""} { set songurl " ($songurl)"}
  758. regsub -all "&#x3C;" $cursong "<" cursong
  759. regsub -all "&#x3E;" $cursong ">" cursong
  760. regsub -all "&#x26;" $cursong "+" cursong
  761. regsub -all "&#x22;" $cursong "\"" cursong
  762. regsub -all "&#x27;" $cursong "'" cursong
  763. regsub -all "&#xFF;" $cursong "" cursong
  764. regsub -all "&#xB4;" $cursong "´" cursong
  765. regsub -all "&#x96;" $cursong "-" cursong
  766. regsub -all "&#xF6;" $cursong "ö" cursong
  767. regsub -all "&#xE4;" $cursong "ä" cursong
  768. regsub -all "&#xFC;" $cursong "ü" cursong
  769. regsub -all "&#xD6;" $cursong "Ö" cursong
  770. regsub -all "&#xC4;" $cursong "Ä" cursong
  771. regsub -all "&#xDC;" $cursong "Ü" cursong
  772. regsub -all "&#xDF;" $cursong "ß" cursong
  773. putlog $cursong
  774. #poststuff privmsg "3***2 Radio 3*** 10 @@@ 4 #LC-LESBIANAS IRC-HISPANO 10@@@ 1Escuchanos entrando a4 http://www.lc-lesbianas.tk/ 6 el DJ es $dj2 Cancion Actual: [lrange $cursong 1 [llength $cursong]] 1/Facebook del canal: 4 https://www.facebook.com/radioenigmaonair"
  775.  
  776. #poststuff privmsg "1Quieres Escuchar La Radio IRC Haz Doble Click en ->> 12 http://194.110.67.155:7500/listen.pls ... La Actual Canción es: 4 [lrange $cursong 1 [llength $cursong]] .. Para Ver Comandos de la Radio Teclea 6!radio "
  777. }
  778.  
  779. if {($tellbitrate == 1) && ($oldbitrate != $bitrate) && ($streamstatus == "isonline: 1") && ($oldbitrate != "bitrate: 0")} {
  780. poststuff privmsg "Calidad Sonido a [lindex $bitrate 1]kbps"
  781. }}}
  782.  
  783. putlog "-= Cargado: shoutcast.tcl Por *#Ayuda-eggdrop* =-"
Add Comment
Please, Sign In to add comment