<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/20972" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2021-05-12T15:00:26-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/20972</id>

		<entry>
		<author><name><![CDATA[AdmiraL]]></name></author>
		<updated>2021-05-12T15:00:26-04:00</updated>

		<published>2021-05-12T15:00:26-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109888#p109888</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109888#p109888"/>
		<title type="html"><![CDATA[Shoutcast Sbot help (Erorr)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109888#p109888"><![CDATA[
<blockquote class="uncited"><div>Looks like your shoutcast is offline, or redirecting too much</div></blockquote>i only took from github to see what is the problem..<br><br>I have tested and i have this erorrs..<br><br>this IP its not my radio, i can put my radio shoutcast in this code and u can see what is problem..<br><br>Best Regards.<br><br>AdmiraL<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12900">AdmiraL</a> — Wed May 12, 2021 3:00 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2021-05-11T06:31:57-04:00</updated>

		<published>2021-05-11T06:31:57-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109886#p109886</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109886#p109886"/>
		<title type="html"><![CDATA[Shoutcast Sbot help (Erorr)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109886#p109886"><![CDATA[
Looks like your shoutcast is offline, or redirecting too much<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Tue May 11, 2021 6:31 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[AdmiraL]]></name></author>
		<updated>2021-05-10T16:38:47-04:00</updated>

		<published>2021-05-10T16:38:47-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109883#p109883</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109883#p109883"/>
		<title type="html"><![CDATA[Shoutcast Sbot help (Erorr)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109883#p109883"><![CDATA[
Hello all..<br><br><strong class="text-strong">I need a help, i have a script for shoutcast-radio and its perfect this script but i have make before 1 years on my eggdrop and now its deleted, i have just script and i have proved to install on my eggdrop and i have some erorrs..<br><br>here its the erorr..</strong><br><div class="codebox"><p>Code: </p><pre><code>Radio Script loaded..        | 1Tcl error [circumvent_queues]: too many nested evaluations (infinite loop?)too many nested evaluations (infinite loop?)    while executing"putnow $text"    (procedure "circumvent_queues" line 2)    invoked from within"circumvent_queues $_out1 $_out2 $_out3"Tcl error in file 'radio.conf':connect failed connection refused    while executing"::http::geturl $siteurl -timeout 2000"    (procedure "maxlisteners" line 4)    invoked from within"maxlisteners"    (procedure "start" line 8)    invoked from within"start"    (file "scripts/Sbot/shoutcast.tcl" line 945)    invoked from within"source scripts/Sbot/shoutcast.tcl"    (file "radio.conf" line 333)* CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)ircd@v83951:~/eggdrop$ nano scripts/Sbot/shoutcast.tcl</code></pre></div><strong class="text-strong">and here its the tcl script..<br></strong><div class="codebox"><p>Code: </p><pre><code>##################################Shoutcast Radio Bot by Sky#################################                                                                   # We need to grab stuff from the internetpackage require http# Set Variables to Shoutcast Webpagesset siteurl "http://216.104.37.26:9005"set listenurl "http://216.104.37.26:9005/listen.pls"set lastplayed "http://216.104.37.26:9005/played.html"# Channels Names (Log Channel, DJ Channel, Radio Channel, Main Channel)set djchan "#dj"set mainchan "#main"set logchan "#log"set radiochan "#radio"# Set Variables to Database Infoset dbhost "localhost"set dbuser "user"set dbpass "password"set dbname "db"# AutoDJ's Nameset autodj "AutoDj"sset song 0# Binding ! commands to fucntionsbind pub -|- !lst lastsessionsbind pub -|- !start starttimers bind pub -|- !lp songlistbind pub -|- !server serverinfobind pub -|- !clearlist clearlistbind pub -|- !reqlist requestlistbind pub -|- !np nowplayingbind pub -|- !request requestbind pub -|- !peak peakbind pub -|- !dj deejaybind pub -|- !genre genrebind pub -|- !listen plsbind pub -|- !log getlogbind pub -|- !topdj toplogbind pub -|- !url sitebind pub -|- !commands commands# Functions: Start and Stop Timerproc hasTimers {} {set timerList [timers];return [llength $timerList];}proc stop {} {set timerList [timers];foreach timer $timerList {killtimer [lindex $timer 2];}}## Functions for if DJ is Onlineproc djonline {} {global djreturn [info exists dj]}proc djauto {} {global djif {![djonline]} { return 0 }return [isautodj $dj]}proc isautodj {string} {global autodjexpr {$string == $autodj}}## Refreshing bot resets timersproc start {} {global logchanif {[hasTimers] == 0} {putnow "PRIVMSG $logchan :No Timers Active. Activating Timer Now."#Starting Check DJ Timercheckdj#Starting Check Peak Timermaxlisteners#Starting Advertisment Timer#run_periodically #TI-Radio#Starting Advertisement Timer#run_periodically ##Starting Delete Request Timerdeletereqset firstad 0} else {putnow "PRIVMSG $logchan :Timer Active Already. Killing Active Timer Now."# Stop All Timers 2stopputnow "PRIVMSG $logchan :Activating Timer Now"#Starting Check DJ Timercheckdj#Starting Check Peak Timermaxlisteners#Starting Advertisment Timer#run_periodically ##Starting Advertisement Timer#run_periodically #TI-Radio#Starting Delete Request Timerdeletereqset firstad 0}}## Advertisments for who is !NP# proc run_periodically {chan} {# if {[validchan #BotDev] &amp;&amp; [botonchan #BotDev]} {# global siteurl djchan title dj logchan listenurl radiochan dj song genre firstad autodj# ::http::config -useragent "Mozilla/5.0; Shoutinfo"# timer 60 [list run_periodically $chan]# set http_req [::http::geturl $siteurl -timeout 2000]# if {[::http::status $http_req] != "ok"} {# putnow "PRIVMSG $logchan :ABORT ABORT"# } else {# set data [::http::data $http_req]# ::http::cleanup $http_req# if {[regexp {&lt;font class=default&gt;Stream Title: &lt;/font&gt;&lt;/td&gt;&lt;td&gt;&lt;font class=default&gt;&lt;b&gt;([^&lt;]+)&lt;/b&gt;} $data x title]} {# set dj $title# } else {# catch {unset dj}# }# if {[regexp {&lt;font class=default&gt;Stream Genre: &lt;/font&gt;&lt;/td&gt;&lt;td&gt;&lt;font class=default&gt;&lt;b&gt;([^&lt;]+)&lt;/b&gt;} $data x title]} {# set genre $title# } else {# catch {unset genre}# }# if {[regexp {&lt;font class=default&gt;Current Song: &lt;/font&gt;&lt;/td&gt;&lt;td&gt;&lt;font class=default&gt;&lt;b&gt;([^&lt;]+)&lt;/b&gt;} $data x title]} {# set song $title# } else {# catch {unset song}# }# if {$dj == $autodj || $song == 0 || $dj == 0 || $dj == 0} {# putnow "PRIVMSG $logchan :AutoDJ is On or Server is Offline."# } else {# if {[string match *c* [lindex [split [getchanmode $chan]] 0]]} {# set a "\002$dj is live on the TI-Radio\002 || \002Genre\002: $genre || "# set b  "\002Now Playing\002: $song || \002Listen @ $listenurl \002"# putnow "PRIVMSG $chan : $a$b"# } else {# set c "\002\00303$dj is live on the TI-Radio\002\00303\00307 ||  "# set d "\00307\003\002Genre\002: $genre \003\00307|| \00307\003\002Now Playing"# set e "\002: $song \003\00307||\00307 \003\00304\002 Listen @ $listenurl \002\00304"# putnow "PRIVMSG $chan : $c$d$e"# }# }# }# }# return 1;# }## Checks if DJ has changed - 10s proc checkdj {} {global dj logchan siteurl newdj djchanif {![validchan #BotDev] || ![botonchan #BotDev]} { return }::http::config -useragent "Mozilla/5.0; Shoutinfo"set http_req [::http::geturl $siteurl -timeout 2000]after 10000 [list checkdj]if {[::http::status $http_req] != "ok"} {# we assume the server is offlineputnow "PRIVMSG $logchan :Assumption: Server is Offline or Lagging"return}set data [::http::data $http_req]::http::cleanup $http_reqif {![regexp {&lt;font class=default&gt;Stream Title: &lt;/font&gt;&lt;/td&gt;&lt;td&gt;&lt;font class=default&gt;&lt;b&gt;([^&lt;]+)&lt;/b&gt;} $data x newdj]} {if {[djonline]} {#Online -&gt; Offlineif {[djauto]} {#Auto DJ -&gt; Offlineserverofflinecatch {unset dj}} elseif {![isautodj $newdj]} {#Real DJ -&gt; Offlineoffairfinishsave $djcatch {unset dj}}}return}if {![djonline]} {# Offline -&gt; Onlineif {![isautodj $newdj]} {#Offline -&gt; Real DJonairset dj $newdjstartsave $dj} else {#Offline -&gt; Auto DJset dj $newdjautodjon}} elseif {$dj != $newdj} {# Generic state changeif {[djauto]} {#AutoDJ -&gt; Real DJset dj $newdjstartsave $djonair} elseif {[isautodj $newdj]} {#Real DJ -&gt; AutoDJfinishsave $djautooffairset dj $newdj} else {#Real DJ -&gt; Real DJtempoffairfinishsave $djset dj $newdjstartsave $djonair}}return}## Checks if peaked in listeners proc maxlisteners {} {global logchan siteurl peakfile djchan::http::config -useragent "Mozilla/5.0; Shoutinfo"set http_req [::http::geturl $siteurl -timeout 2000]after 100000 [list maxlisteners]if {[::http::status $http_req] != "ok"} {putnow "PRIVMSG $logchan :Assumption: Server is Offline or Lagging"} else {set data [::http::data $http_req]::http::cleanup $http_reqif {[regexp {&lt;font class=default&gt;Listener Peak: &lt;/font&gt;&lt;/td&gt;&lt;td&gt;&lt;font class=default&gt;&lt;b&gt;([^&lt;]+)&lt;/b&gt;} $data x title]} {set testdata $titleset peakfile [open "peak.txt" r]gets $peakfile lineset peakhigh $lineclose $peakfileif {$testdata &gt; $peakhigh} {# Create a Timestamp for the fileset timestamp [clock format [clock seconds] -format {%Y%m%d%H%M%S}]set filename "peak.txt"# Create a Temp and Backup Fileset temp $filename.new.$timestamp# Set In/Out to Open Peak.txt in Read-Only/Write-Onlyset in [open $filename r]set out [open $temp w]while {[gets $in line] != -1} {set line $testdataputs $out $line}putnow "PRIVMSG $djchan :Max Viewers has increased :D! Good job."# Close Both Filesclose $inclose $out# Rename Temp to Original File Namefile rename -force $temp $filename}}}}## Command to Start Timers proc starttimers {nick uhost hand chan arg} {global djchanif {$chan == $djchan} {if {[isop $nick $djchan] == 1 || [ishalfop $nick $djchan] == 1} {putserv "PRIVMSG $chan :$nick started the timers."putlog "$nick started the timers."start}}}## Command to get Last Played Listproc songlist {nick uhost hand chan arg} {global dj logchan siteurl newdj lastplayed if {![validchan #BotDev] || ![botonchan #BotDev]} { return }::http::config -useragent "Mozilla/5.0; Shoutinfo"set http_req [::http::geturl $lastplayed -timeout 2000]if {[::http::status $http_req] != "ok"} {# we assume the server is offlineputnow "PRIVMSG $logchan : Unable to connect"return}set data [::http::data $http_req]::http::cleanup $http_reqset testvalue 0foreach {x length title} [regexp -all -inline {&lt;td&gt;(\d\d:\d\d:\d\d)&lt;/td&gt;&lt;td&gt;([^&lt;]+-[^&lt;]+)&lt;} $data] {if {$testvalue != 0} {putnow "notice $nick :#$testvalue: $length | $title"incr testvalue} else {putnow "notice $nick :\002Current Song\002: $length | $title "incr testvalue}}}## Advert the Request List proc requestlist {nick uhost hand chan arg} {global djchanputnow "NOTICE $nick :\002\The OLDEST request will be deleted every 10 minutes.\002"if {$chan == $djchan} {set reqnumber 0set filename "requestlist.txt"set in [open $filename r]while {1} {set line [gets $in]if {$line == ""} {putnow "PRIVMSG $djchan :There are no requests at the moment."break} else {if {[eof $in]} {putnow "PRIVMSG $djchan :Oldest: $line"close $inbreak}if {$reqnumber == 0} {putnow "PRIVMSG $djchan :Newest: $line"incr reqnumber} else {putnow "PRIVMSG $djchan :$reqnumber: $line"incr reqnumber}}}}}## Clear the Request List proc clearlist {nick uhost hand chan arg} {global djchanif {$chan == $djchan} {if {[isop $nick $chan] == 1 || [ishalfop $nick $chan] == 1} {set filename "requestlist.txt"set out [open $filename w]set line ""puts $out $lineputnow "PRIVMSG $djchan :$nick has cleared the request list."close $out}}}## Delete Request Func + Timerproc requestproc {reqitem} {set filename "requestlist.txt"set testin [open $filename r]set line [gets $testin]close $testinif {$line == ""} {set out [open $filename [list RDWR APPEND CREAT]]set newline $reqitemputs -nonewline $out $newlineclose $out} else {# Create a Timestamp for the fileset timestamp [clock format [clock seconds] -format {%Y%m%d%H%M%S}]# Create a Temp and Backup Fileset temp $filename.new.$timestamp# Set In/Out to Open Peak.txt in Read-Only/Write-Onlyset in [open $filename r]set out [open $temp [list RDWR APPEND CREAT]]set line $reqitemputs $out $lineset file_data [read $in]puts -nonewline $out $file_dataclose $inclose $outfile rename -force $temp $filename}}## Command to Show Now Playing proc nowplaying {nick uhost hand chan arg} {global siteurl radiochan mainchanset radiochan [string tolower $radiochan]::http::config -useragent "Mozilla/5.0; Shoutinfo"set http_req [::http::geturl $siteurl -timeout 2000]if {[::http::status $http_req] != "ok"} {putnow "PRIVMSG $chan :Stream is unavailable";}set data [::http::data $http_req]::http::cleanup $http_reqif {[regexp {&lt;font class=default&gt;Current Song: &lt;/font&gt;&lt;/td&gt;&lt;td&gt;&lt;font class=default&gt;&lt;b&gt;([^&lt;]+)&lt;/b&gt;} $data x title]} {putnow "PRIVMSG $chan :\002Current Song\002: $title"} else {if {$chan != $mainchan} {putnow "PRIVMSG $chan :Couldn't receive any information, checking server status..."} else {putnow "NOTICE $nick :Couldn't receive any information, checking server status..."}}}## Command to show who is DJproc deejay {nick uhost hand chan arg} {global siteurl radiochan dj mainchanset radiochan [string tolower $radiochan]::http::config -useragent "Mozilla/5.0; Shoutinfo"set http_req [::http::geturl $siteurl -timeout 2000]if {[::http::status $http_req] != "ok"} {putnow "PRIVMSG $chan :Stream is unavailable";}set data [::http::data $http_req]::http::cleanup $http_reqif {[regexp {&lt;font class=default&gt;Stream Title: &lt;/font&gt;&lt;/td&gt;&lt;td&gt;&lt;font class=default&gt;&lt;b&gt;([^&lt;]+)&lt;/b&gt;} $data x title]} {if {$chan != $mainchan} {putnow "PRIVMSG $chan :\002DJ\002: $title"set dj $title} else {putnow "NOTICE $nick :\002DJ\002: $title"set dj $title}} else {if {$chan != $mainchan} {putnow "PRIVMSG $chan :Couldn't receive any information, checking server status..."} else {putnow "NOTICE $nick :Couldn't receive any information, checking server status..."}}}## Command to get URL Infoproc site {nick uhost hand chan arg} {global siteurl mainchanif {$chan != $mainchan} {putnow "PRIVMSG $chan :\002Website\002: $siteurl"} else {putnow "NOTICE $nick :\002Website\002: $siteurl"}}## Command to get Server Infoproc serverinfo {nick uhost hand chan arg} {global siteurl radiochan mainchanset radiochan [string tolower $radiochan]::http::config -useragent "Mozilla/5.0; Shoutinfo"set http_req [::http::geturl $siteurl -timeout 2000]if {[::http::status $http_req] != "ok"} {putnow "PRIVMSG $chan :Stream is unavailable";}set data [::http::data $http_req]::http::cleanup $http_reqif {[regexp {&lt;font class=default&gt;Server Status: &lt;/font&gt;&lt;/td&gt;&lt;td&gt;&lt;font class=default&gt;&lt;b&gt;([^&lt;]+)&lt;/b&gt;} $data x title]} {if {$chan != $mainchan} {putnow "PRIVMSG $chan :\  002Server  \002: $title"} else {putnow "PRIVMSG $nick :\  002Server  \002: $title"}} else {if {$chan != $mainchan} {putnow "PRIVMSG $chan :Couldn't contact the server, please check the configuration and/or streaming server"} else {putnow "NOTICE $nick :Couldn't contact the server, please check the configuration and/or streaming server"}}}## Command to get current Genreproc genre {nick uhost hand chan arg} {global siteurl radiochan mainchanset radiochan [string tolower $radiochan]::http::config -useragent "Mozilla/5.0; Shoutinfo"set http_req [::http::geturl $siteurl -timeout 2000]if {[::http::status $http_req] != "ok"} {putnow "PRIVMSG $chan :Stream is unavailable";}set data [::http::data $http_req]::http::cleanup $http_reqif {[regexp {&lt;font class=default&gt;Stream Genre: &lt;/font&gt;&lt;/td&gt;&lt;td&gt;&lt;font class=default&gt;&lt;b&gt;([^&lt;]+)&lt;/b&gt;} $data x title]} {if {$chan != $mainchan} {putnow "PRIVMSG $chan :\002Genre\002: $title"} else {putnow "NOTICE $nick :\002Genre\002: $title"}} else {if {$chan != $mainchan} {putnow "PRIVMSG $chan :Couldn't receive any information, checking server status..."} else {putnow "NOTICE $nick :Couldn't receive any information, checking server status..."}}}## Command to get Peak Infoproc peak {nick uhost hand chan arg} {global siteurl radiochan mainchanset radiochan [string tolower $radiochan]::http::config -useragent "Mozilla/5.0; Shoutinfo"set http_req [::http::geturl $siteurl -timeout 20000]if {[::http::status $http_req] != "ok"} {putnow "PRIVMSG $chan :Stream is unavailable";}set data [::http::data $http_req]::http::cleanup $http_reqif {[regexp {&lt;font class=default&gt;Listener Peak: &lt;/font&gt;&lt;/td&gt;&lt;td&gt;&lt;font class=default&gt;&lt;b&gt;([^&lt;]+)&lt;/b&gt;} $data x title]} {if {$chan != $mainchan} {set peakfile [open "peak.txt" r]gets $peakfile lineset peakhigh $lineclose $peakfileputnow "PRIVMSG $chan :\002Session Peak\002: $title \002Overall Peak\002: $peakhigh "}} else {if {$chan != $mainchan} {putnow "PRIVMSG $chan :Couldn't receive any information, checking server status..."} else {putnow "NOTICE $nick :Couldn't receive any information, checking server status..."}}}## Command to get Listenproc pls {nick uhost hand chan arg} {global listenurlputnow "PRIVMSG $chan :\002Stream/Listen\002: $listenurl"}## Command to get Command FAQproc commands {nick uhost hand chan arg} {global radiochan djchan mainchanset radiochan [string tolower $radiochan]if {$chan != $mainchan} {if {$chan == $djchan} {set a "\002DJ/Admin Commands\002: !rehash !start !login "set b "+cookie -cookie !reqlist !clearlist"set c "\002Radio Commands\002: !listen !np !lp !dj !peak"set d "!request !genre !server !topdj"putnow "PRIVMSG $chan : $a$b"putnow "PRIVMSG $chan : $c$d"} else {set e "\002Radio Commands\002: !listen !np !lp !dj !peak "set f "!request !genre !server !topdj"putnow "PRIVMSG $chan : $e$f"}} else {set g "\002Radio Commands\002: !listen !np !lp !dj !peak "set h "!request !genre !server !topdj"putnow "NOTICE $nick : $g$h"}}## Command to submit a requestproc request {nick uhost hand chan arg} {global radiochan djchan reqitem set radiochan [string tolower $radiochan]if {[string tolower $chan] == "$radiochan"} {if {[llength $arg]==0} {putnow "PRIVMSG $chan :\002Syntax\002: !request &lt;Artist - Title&gt;"} else {if {[string match *Bieber* $arg] || [string match *Beiber* $arg]} {if {[isop $nick $chan] || [ishalfop $nick $chan]} {putnow "PRIVMSG $chan :Troll Alert!"} else {putnow "PRIVMSG $chan :Troll Alert!"putkick $chan $nick "Stop trolling.."}} else {set reqitem $argrequestproc $reqitemset query1 "http://www.waffles.fm/browse.php?q="set query2 "http://what.cd/torrents.php?searchstr="for { set index 0 } { $index&lt;[llength $arg] } { incr index } {set query1 "$query1[lindex $arg $index]"if {$index&lt;[llength $arg]-1} then {set query1 "$query1+"}}for { set index 0 } { $index&lt;[llength $arg] } { incr index } {set query2 "$query2[lindex $arg $index]"if {$index&lt;[llength $arg]-1} then {set query2 "$query2+"}}set a "PRIVMSG $djchan :\002\Request\002: $arg | Requested by:\002 "set b "$nick \002 | \002Waffles\002: $query1 | \002What.CD\002: $query2"putnow "$a$b"putnow "NOTICE $nick :\002$arg\002 is succesfully requested"set token [http::config -useragent "Mozilla/5.0; Shoutinfo"]set token [http::geturl $query1]puts stderr ""upvar #0 $token stateset max 0}}}}##     !log DJ Log Informationproc getlog {nick uhost hand chan arg} {global dbhost dbuser dbname dbpassset m [mysqlconnect -host $dbhost -user $dbuser -db $dbname -password $dbpass]if {[llength $arg]==0} {set tt_query "SELECT total_time from djlog where dj_name='$nick'"set ts_query "SELECT total_sessions from djlog where dj_name='$nick'"set log_name $nick} else {set tt_query "SELECT total_time from djlog where dj_name='$arg'"set ts_query "SELECT total_sessions from djlog where dj_name='$arg'"set log_name $arg}set tt_result [mysqlsel $m $tt_query -list]set ts_result [mysqlsel $m $ts_query -list]if {$ts_result  != "" &amp;&amp; $tt_result != "" } {set total_time [lindex $tt_result 0]set total_sessions [lindex $ts_result 0]set total_time [expr {$total_time*1}]set totalt [duration $total_time]putnow "PRIVMSG $chan : $log_name has been on air a total of $total_sessions times for $totalt."} else {putnow "PRIVMSG $chan : Sorry but $arg was not found in the log."}}##  First Save: Name + Onair Timeproc startsave {dj} {global dbhost dbuser dbname dbpassset start_time [clock seconds]set m [mysqlconnect -host $dbhost -user $dbuser -db $dbname -password $dbpass]set query "SELECT dj_name from session_log order by ID desc limit 1"set result [mysqlsel $m $query -list]set testname [lindex $result 0]putnow "PRIVMSG #BotDev : $testname"set testquery "SELECT offair_time from session_log order by ID desc limit 1"set testresult [mysqlsel $m $testquery -list]set testtime [lindex $testresult 0]putnow "PRIVMSG #BotDev : $testtime"if {$testtime != "{}" &amp;&amp; $testname != $dj} {######## session_log######set query "INSERT INTO session_log(dj_name, onair_time) VALUES('$dj', '$start_time')"set result [mysqlexec $m $query]######### djlog######set query "SELECT dj_name from djlog where dj_name='$dj'"set result [mysqlsel $m $query -list]set dj_name [lindex $result 0]if {$dj_name != ""} {set query "SELECT total_sessions from djlog where dj_name='$dj'"set result [mysqlsel $m $query -list]set total_sessions [lindex $result 0]incr total_sessionsset query "UPDATE djlog set total_sessions=$total_sessions where dj_name='$dj'"set result [mysqlexec $m $query]} else {set query "INSERT INTO djlog(dj_name, total_sessions) VALUES('$dj', '1')"set result [mysqlexec $m $query]}if {$result} {putlog "DJ Database Entry Sent. $dj with $start_time"} else {putlog "Database error."}mysqlclose $m} elseif {$testname == $dj &amp;&amp; $testtime != "{}"} {######## session_log######set query "INSERT INTO session_log(dj_name, onair_time) VALUES('$dj', '$start_time')"set result [mysqlexec $m $query]######### djlog######set query "SELECT dj_name from djlog where dj_name='$dj'"set result [mysqlsel $m $query -list]set dj_name [lindex $result 0]if {$dj_name != ""} {set query "SELECT total_sessions from djlog where dj_name='$dj'"set result [mysqlsel $m $query -list]set total_sessions [lindex $result 0]incr total_sessionsset query "UPDATE djlog set total_sessions=$total_sessions where dj_name='$dj'"set result [mysqlexec $m $query]} else {set query "INSERT INTO djlog(dj_name, total_sessions) VALUES('$dj', '1')"set result [mysqlexec $m $query]}if {$result} {putlog "DJ Database Entry Sent. $dj with $start_time"} else {putlog "Database error."}mysqlclose $m} elseif {$testname == $dj &amp;&amp; $testtime == "{}"} {putnow "PRIVMSG #DJ :$dj is already in a session."}}## Second: Offair, Session, Totalproc finishsave {dj} {global djchan dbhost dbuser dbname dbpassset end_time [clock seconds]set m [mysqlconnect -host $dbhost -user $dbuser -db $dbname -password $dbpass]# Checking out the Top-Row's DJ Nameset query "SELECT dj_name from session_log order by ID desc limit 1"set result [mysqlsel $m $query -list]set dj_name [lindex $result 0]set testquery "SELECT offair_time from session_log order by ID desc limit 1"set testresult [mysqlsel $m $testquery -list]set testtime [lindex $testresult 0]# If Our Arg is equal to DJ Name in Top Rowif {$dj == $dj_name &amp;&amp; $testtime == "{}"} {# Read when this person logged on-airset query "SELECT onair_time from session_log order by ID desc limit 1"set result [mysqlsel $m $query -list]set onair_time [lindex $result 0]# Calculate the session-timeset session_time [expr {$end_time - $onair_time}]# Set session-timeset query "UPDATE session_log set session_time=$session_time order by ID desc limit 1"set result [mysqlexec $m $query]# Set Offair-timeset query "UPDATE session_log set offair_time=$end_time order by ID desc limit 1"set result [mysqlexec $m $query]######### djlog####### Read Total Timeset query "SELECT total_time from djlog where dj_name='$dj'"set result [mysqlsel $m $query -list]set total_time [lindex $result 0]# This needs to be fixed or two tables createdif {$total_time != "{}"} {set newtotal_time [expr {$total_time + $session_time}]} else {set newtotal_time $session_time}# Set New Total Timeif {$session_time &gt;= 600} {set query "UPDATE djlog set total_time=$newtotal_time where dj_name='$dj'"set result [mysqlexec $m $query]putnow "PRIVMSG $djchan : Session Time: $session_time Total Time: $newtotal_time"} else {putnow "PRIVMSG $djchan : $dj, your session was less than 10 minutes, thus your time was not recorded."}if {$result} {putlog "DJ Database Entry Sent. $dj with $session_time and $newtotal_time"} else {putlog "Database error."}} else {putnow "PRIVMSG $djchan :$dj, you never went on-air, thus your time was not recorded."}}##     Top 5 or $arg of DJ Logproc toplog {nick uhost hand chan arg} {global dbhost dbuser dbname dbpassset m [mysqlconnect -host $dbhost -user $dbuser -db $dbname -password $dbpass]set name_query "SELECT dj_name from djlog order by total_time desc"set name_result [mysqlsel $m $name_query -list]set tt_query "SELECT total_time from djlog order by total_time desc"set ts_query "SELECT total_sessions from djlog order by total_time desc"set ts_result [mysqlsel $m $ts_query -list]set tt_result [mysqlsel $m $tt_query -list]set i 0set n 1if {[llength $arg]==0} {putnow "PRIVMSG $chan : Top 5 DJ Log"while {$i &lt; 5} {set name [lindex $name_result $i]set total_time [lindex $tt_result $i]set total_sessions [lindex $ts_result $i]set total_time [expr {$total_time*1}]set total_time [duration $total_time]putnow "PRIVMSG $chan : #$n: $name with $total_time on-air and $total_sessions sessions."incr iincr n}} else {putnow "PRIVMSG $chan : Top $arg DJ Log"set arg [expr {$arg*1}]while {$i &lt; $arg} {set name [lindex $name_result $i]set total_time [lindex $tt_result $i]set total_sessions [lindex $ts_result $i]set total_time [expr {$total_time*1}]set total_time [duration $total_time]putnow "PRIVMSG $chan : #$n: $name with $total_time on-air and $total_sessions sessions."incr iincr n}}}proc lastsessions {nick uhost hand chan arg} {global dbhost dbuser dbname dbpassset m [mysqlconnect -host $dbhost -user $dbuser -db $dbname -password $dbpass]set name_query "SELECT dj_name from session_log order by id desc"set name_result [mysqlsel $m $name_query -list]set on_query "SELECT onair_time from session_log order by id desc"set off_query "SELECT offair_time from session_log order by id desc"set on_result [mysqlsel $m $on_query -list]set off_result [mysqlsel $m $off_query -list]set session_query "SELECT session_time from session_log order by id desc"set session_result [mysqlsel $m $session_query -list]set i 0set n 1if {[llength $arg]==0} {putnow "PRIVMSG $chan : Last 5 DJ Sessions"while {$i &lt; 5} {set name [lindex $name_result $i]set onairs [lindex $on_result $i]set offairs [lindex $off_result $i]set session_time [lindex $session_result $i]putnow "PRIVMSG $chan : #$n: $name with $onairs on-air and $offairs offair and $session_time session time."incr iincr n}} else {putnow "PRIVMSG $chan : Last $arg DJ Sessions"set arg [expr {$arg*1}]while {$i &lt; $arg} {set name [lindex $name_result $i]set onairs [lindex $on_result $i]set offairs [lindex $off_result $i]set session_time [lindex $session_result $i]putnow "PRIVMSG $chan : #$n: $name with $onairs on-air and $offairs offair and $session_time session time."incr iincr n}}}## Delete Request Func + Timerproc deletereq {} {global djchan logchantimer 10 [list deletereq]set filename "requestlist.txt"set fp [open $filename r+]set data [read -nonewline $fp]set lines [split $data "\n"]close $fpset line_to_delete [expr {[llength $lines] - 1}]set lines [lreplace $lines $line_to_delete $line_to_delete]set fp [open $filename w+]if {[gets $fp data] &gt;= 1} {puts -nonewline $fp $linesclose $fp} else {puts -nonewline $fp [join $lines "\n"]close $fp}putnow "PRIVMSG $logchan :Deleting a Request"}##  Calculate Seconds to D:H:M:Sproc duration { int_time } {set timeList [list]foreach div {604800 86400 3600 60 1} mod {0 7 24 60 60} name {wk day hr min sec} {set n [expr {$int_time / $div}]if {$mod &gt; 0} {set n [expr {$n % $mod}]}if {$n &gt; 1} {lappend timeList "$n ${name}s"} elseif {$n == 1} {lappend timeList "$n $name"}}return [join $timeList]}## Advert if Offline-&gt;RealDJproc onair {} {global radiochan djchan dj newdj mainchanset a "\002$newdj\002 - Is Now Broadcasting Live! Tune "set b "in @ http://216.104.37.26:9005/listen.pls"set c "$newdj is now ON AIR @ "set d "#TI-Radio (http://216.104.37.26:9005/listen.pls)"set e "Radio || Status: DJ On Air || $newdj Is Now Broadcasting || "set f "URL: http://216.104.37.26:9005/listen.pls || Want to be a DJ?: http://bit.ly/J6cWtN"putnow "PRIVMSG $radiochan : $a$b"putnow "PRIVMSG $djchan :\002ON AIR\002: $newdj is now ON AIR."putnow "PRIVMSG $mainchan : $c$d"putnow "TOPIC $radiochan : $e$f"}## Advert if RealDJ-&gt;RealDJproc tempoffair {} {global radiochan djchan djset radiochan [string tolower $radiochan]if {$dj != 0} {putnow "PRIVMSG $radiochan :\002OFF AIR\002: $dj is now OFF AIR."putnow "PRIVMSG $djchan :\002OFF AIR\002: $dj is now OFF AIR."}}## Advert if Offline-&gt;AutoDJproc autodjon {} {global radiochanset radiochan [string tolower $radiochan]set a "Radio || Status: AutoDJ ||"set b "URL: http://216.104.37.26:9005/listen.pls || Want to be a DJ?: http://bit.ly/J6cWtN"putnow "TOPIC $radiochan : $a$b"}## Advert if Someone-&gt;Offlineproc serveroffline {} {global radiochanset radiochan [string tolower $radiochan]set a "Radio || Status: Stream Offline ||"set b " URL: http://216.104.37.26:9005/listen.pls || Want to be a DJ?: http://bit.ly/J6cWtN"putnow "TOPIC $radiochan : $a$b"}## Advert if RealDJ-&gt;AutoDJproc autooffair {} {global radiochan djchan djset radiochan [string tolower $radiochan]set a "Radio || Status: AutoDJ || "set b "URL: http://216.104.37.26:9005/listen.pls || Want to be a DJ?: http://bit.ly/J6cWtN"putnow "PRIVMSG $radiochan :\002OFF AIR\002: $dj is now OFF AIR."putnow "PRIVMSG $djchan :\002OFF AIR\002: $dj is now OFF AIR."putnow "TOPIC $radiochan : $a$b"}## Advert if Server if Offlineproc offair {} {global radiochan djchan djset radiochan [string tolower $radiochan]set a "Radio || Status: Stream Offline || "set b "URL: http://216.104.37.26:9005/listen.pls || Want to be a DJ?: http://bit.ly/J6cWtN"putnow "PRIVMSG $radiochan :\002OFF AIR\002: $dj is now OFF AIR."putnow "PRIVMSG $djchan :\002OFF AIR\002: $dj is now OFF AIR."putnow "PRIVMSG $djchan :\00304$dj, please remember to \002TURN ON AUTODJ\002 \00304"putnow "TOPIC $radiochan : $a$b"}putlog "Radio Script loaded..        | 1"start</code></pre></div>here is the link for this tcl script..<br><strong class="text-strong"><a href="https://github.com/The-Sky/SBot-Eggdrop-Shoutcast" class="postlink">https://github.com/The-Sky/SBot-Eggdrop-Shoutcast</a><br></strong><br>PS: the script is <strong class="text-strong">free</strong>, maybe can anyone help me with this script...<br><br><br>This script is for eggdrop and when a person make in channel !request Eminem or something and the song going to radio and next musik play..<br><br>AdmiraL<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12900">AdmiraL</a> — Mon May 10, 2021 4:38 pm</p><hr />
]]></content>
	</entry>
	</feed>
