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.

Need help finding a suitable script.

Old posts that have not been replied to for several years.
Locked
b
beaver3

Post by beaver3 »

Hey all. I've read through this forums and looked at examples, but none of the scripts have had the functionality I'd like.

Anyway, I'm running a shoutcast server. I would like the bot to simply read the log file and display if a new line appears.

The log looks like this:

12/01/01 14:18:34 1 zumjay - badman
12/01/01 14:19:04 1 Naid - Wakinÿ Up (Green Court Radio Edit)
12/01/01 14:19:34 1 Naid - Wakinÿ Up (Green Court Radio Edit)
12/01/01 14:20:04 1 Naid - Wakinÿ Up (Green Court Radio Edit)
12/01/01 14:20:34 1 Naid - Wakinÿ Up (Green Court Radio Edit)
12/01/01 14:21:04 2 Naid - Wakinÿ Up (Green Court Radio Edit)
12/01/01 14:21:34 2 Naid - Wakinÿ Up (Green Court Radio Edit)
12/01/01 14:22:04 3 Naid - Wakinÿ Up (Green Court Radio Edit)
12/01/01 14:22:34 3 Naid - Wakinÿ Up (Green Court Radio Edit)
12/01/01 14:23:04 3 Toby Lee Connor - Wicked Games
12/01/01 14:23:34 3 Toby Lee Connor - Wicked Games
12/01/01 14:24:04 3 Toby Lee Connor - Wicked Games
12/01/01 14:24:34 4 Toby Lee Connor - Wicked Games
12/01/01 14:25:04 4 Toby Lee Connor - Wicked Games
12/01/01 14:25:34 5 Toby Lee Connor - Wicked Games
12/01/01 14:26:04 5 Toby Lee Connor - Wicked Games
12/01/01 14:26:34 5 bad seed - the champ
12/01/01 14:27:04 5 bad seed - the champ
12/01/01 14:27:34 4 bad seed - the champ
12/01/01 14:28:04 3 bad seed - the champ

Now, The third number is the number of users on the server. Thats not needed, but would be fun to have in it too.

I would like to to just announce the name of the song being played. Ofcourse, only if its changed cause I dont want it displaying it 4 times for "bad seed - the champ" like the logfile displayes it.

Is there a script that already does this?

Thanks in advance!

/Beaver3
b
beaver3

Post by beaver3 »

Never mind :smile: Wrote my own with the help of a friend.

If anyone is interested in it, lemme know.

/Beaver3
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

Code: Select all

#set this to the full path of the file
set scfile "/path/to/log/file"

#channel to annouce the stuff on
set scchan "#channel"

set scdata {}
bind time - "*" sc:time
proc sc:time {min hour day month year} {
  global scdata scchan scfile
  set fp [open $scfile r]
  set d [split [read $fp] n]
  close $fp
  set ll [split [lindex $d [expr [llength $d] - 1]]]
  if {[lrange $ll 3 end] == $scdata} { return }
  set scdata [lrange $ll 3 end]
  puthelp "PRIVMSG $scchan :Now playing "${scdata}" ([lindex $ll 2] users)"
}
P
PBChannel

Post by PBChannel »

I tried that script...didnt work.

Using Eggdrop 1.6.10 and TCL 8.3.

Set the full path to the directory with and without the sc_hist.log filename, but still no go.

Any suggestions?

Thanks. :smile:
Locked