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.

Help me please kn1ght: .newdj pepito

Help for those learning Tcl or writing their own scripts.
Post Reply
k
kn1ghtt
Voice
Posts: 10
Joined: Mon Aug 01, 2022 12:54 am

Help me please kn1ght: .newdj pepito

Post by kn1ghtt »

help me ples code and add command --> kn1ght: .newdj pepito

botradio: ok! kn1ght, new dj change a pepito

please code streaming example:

Code: Select all

### comando  .newdj en creacion

bind pub -|- .newdj setdj
proc setdj {nickname djnickname } {
if {$djnickname == "" } { set djnickname $nickname }
global streamip streamport streampass
global dj ctodjc CanalDjs CanalAdmins nick
putlog "shoutcast: new dj: $djnickname ($nickname)"
set temp [open "dj" w+]
puts $temp $djnickname
close $temp
set temp [open "djnick" w+]
puts $temp $nickname
close $temp
putserv "privmsg $nickname :your are now dj of this radio"
if {[catch {set sock [socket $streamip $streamport] } sockerror]} {
putlog "error: $sockerror"
return 0 } else {
puts $sock "GET /admin.cgi?pass=$streampass&mode=viewxml&page=0 HTTP/1.0"
puts $sock "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9)"
puts $sock "Host: $streamip"
puts $sock "Connection: close"
puts $sock ""
flush $sock
while {[eof $sock] != 1} {
set bl [gets $sock]
if { [string first "standalone" $bl] != -1 } {
set streamstatus [string range $bl [shrink + 14 "" 0 $bl] [shrink - 1 "" 0 $bl]]
}}
if { $streamstatus == "1" } { poststuff privmsg "$djnickname is now rocking the turntables, enjoy." } else {
putserv "privmsg $nickname :this has not been announced because the radio is currentlfy offline." }
}}
Post Reply