Announcement

Collapse
No announcement yet.

Mirc & songrequester

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Mirc & songrequester

    More goodies I am working on... Anyone wanna contribute as I am just cobbling this together?

    This will connect to the winamp songrequester plugin and show the songs on the first page to whoever types !playlist.

    Will be working on adding functionality... Browse and request songs from within mirc interactively with songrequester.

    Should use the newest version of Mirc.

    code:

    on *:SOCKOPEN:http2: {
    echo -s *** $sockname was just opened, Retrieving file
    sockwrite -n $sockname GET /playlist.html HTTP/1.0
    sockwrite -n $sockname User-Agent: Mozilla
    sockwrite -n $sockname Host: radio.somnambulance.org
    sockwrite $sockname $crlf
    }

    on *:SOCKCLOSE:http2: {
    echo -s *** $sockname just closed
    }

    on *:SOCKREAD:http2: {
    if ($sockerr > 0) {
    echo 13 -a socketerror $sockerr
    return
    }
    :nextread
    sockread %temp
    ; read the data coming from the socket
    if ($sockbr == 0) return
    ; if i've read all the data, stop
    write c:\info.txt %temp
    %idt1 = <tr><td colspan="3" width="100%" bgcolor="#C5C5C5"><p align="left"><a href="request.cgi?listpos=
    %idt2 = "><font color="#000000" size="2" face="Tahoma">
    %idt3 = </font></a></p></td></tr>
    if (%idt1 isin %temp) {
    inc %ct
    %pos. [ $+ [ %ct ] ] = $gettok($remove(%temp,%idt1),1,34)
    %poslen = $len(%pos. [ $+ [ %ct ] ] )
    %songlen = $len($remtok($remove(%temp,%idt1,%idt2,%idt3),1,32))
    %dif2 = %songlen - %poslen
    %song. [ $+ [ %ct ] ] = $htmlfree($right($remtok($remove(%temp,%idt1,%idt2,%idt3),1,32),%dif2))
    msg %reqr %ct - %song. [ $+ [ %ct ] ]
    ; echo 14 -a %ct - %song. [ $+ [ %ct ] ]
    }
    ; if there was stuff received from the socket, then echo it
    goto nextread
    }

    on 1:TEXT:!playlist:*: {
    statopen2
    %reqr = $nick
    }

    alias statopen2 {
    sockopen http2 localhost 88
    write -c c:\info.txt
    %ct = 0
    unset %pos.*
    unset %pos2.*
    unset %song.*
    %poslen = 1
    unset %songlen
    unset %dif2
    }

    alias -l htmlfree {
    ; It's local because it won't be used by the command line, only this file.
    ; Local aliases avoid conflicting names.
    var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x,&nbsp
    return %x
    }


    Last edited by Herris; 12 June 2003, 13:01.

  • #2
    oops

    that last section should be

    code:

    alias -l htmlfree {
    ; It's local because it won't be used by the command line, only this file.
    ; Local aliases avoid conflicting names.
    var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x,&nbsp
    return %x
    }

    Comment


    • #3
      Functioning mirc/songrequester.

      This works with the winamp songrequester plugin. It allows people to navigate through the songs and request songs to be added to the songrequester queue.

      Sometimes you may have to retype the command but it works.

      !playlist will start it up.

      I am sure there are bugs in here and I am sure that things could be done better and so on and so forth. If you fix them please let me know so I can use it too! =D

      code:

      ; Change all occurences of localhost 88 to whatever server and port your songrequester is running on.
      ; Also Change all host: yourhost.org to whatever you need it to be.

      ; Change %idt1 to everything that comes before %%PLAYLISTPOS%%. Make sure there are not spaces between the tags in your html template
      ; on this line.
      %idt1 = <tr><td colspan="3" width="100%" bgcolor="#C5C5C5"><p align="left"><a href="request.cgi?listpos=

      ; Change %idt2 to everything that comes after %%PLAYLISTPOS%% up to %%PLAYLISTENTRY%%. Make sure there are not spaces between the tags in your html
      ; template on this line.
      %idt2 = "><font color="#000000" size="2" face="Tahoma">

      ; Change %idt3 to everything that comes after %%PLAYLISTENTRY%% to the end of the line. Make sure there are not spaces between the tags in your html
      ; template on this line.
      %idt3 = </font></a></p></td></tr>

      on *:SOCKOPEN:http2: {
      echo -s *** $sockname was just opened, Retrieving file
      sockwrite -n $sockname GET /playlist.html HTTP/1.0
      sockwrite -n $sockname User-Agent: Mozilla
      sockwrite -n $sockname Host: yourhost.org
      sockwrite $sockname $crlf
      }

      on *:SOCKOPEN:next: {
      echo -s *** $sockname was just opened, Retrieving file
      sockwrite -n $sockname GET /playlist.cgi?current= [ $+ [ %plc. [ $+ [ %reqr ] ] ] ] HTTP/1.0
      sockwrite -n $sockname User-Agent: Mozilla
      sockwrite -n $sockname Host: yourhost.org
      sockwrite $sockname $crlf
      }

      on *:SOCKOPEN:dreq: {
      echo -s *** $sockname was just opened, Retrieving file
      sockwrite -n $sockname GET /request.cgi?listpos= [ $+ [ %sreq ] ] HTTP/1.0
      sockwrite -n $sockname User-Agent: Mozilla
      sockwrite -n $sockname Host: yourhost.org
      sockwrite $sockname $crlf
      }

      on *:SOCKCLOSE:next: {
      echo -s *** $sockname just closed
      }

      on *:SOCKCLOSE:http2: {
      echo -s *** $sockname just closed
      }

      on *:SOCKCLOSE:dreq: {
      echo -s *** $sockname just closed
      }

      on *:SOCKREAD:http2: {
      if ($sockerr > 0) {
      echo 13 -a socketerror $sockerr
      return
      }
      :nextread
      sockread %temp
      ; read the data coming from the socket
      if ($sockbr == 0) return
      ; if i've read all the data, stop
      if (%idt1 isin %temp) {
      inc %ct
      %pos. [ $+ [ %reqr ] ] [ $+ [ . [ $+ [ %ct ] ] ] ] = $gettok($remove(%temp,%idt1),1,34)
      %poslen = $len(%pos. [ $+ [ %reqr ] ] [ $+ [ . [ $+ [ %ct ] ] ] ] )
      %songlen = $len($remtok($remove(%temp,%idt1,%idt2,%idt3),1,32))
      %dif2 = %songlen - %poslen
      %song. [ $+ [ %reqr ] ] [ $+ [ . [ $+ [ %ct ] ] ] ] = $htmlfree($right($remtok($remove(%temp,%idt1,%idt2,%idt3),1,32),%dif2))
      msg %reqr %ct - %song. [ $+ [ %reqr ] ] [ $+ [ . [ $+ [ %ct ] ] ] ]
      ;echo 14 -a %ct - %song. [ $+ [ %reqr ] ] [ $+ [ . [ $+ [ %ct ] ] ] ]
      }
      if (</html> isin %temp) msg %reqr Type !next to see the next %ct songs! Type !request and the number of the song you wan to add it to the queue!
      ; if there was stuff received from the socket, then echo it
      goto nextread
      }

      on *:SOCKREAD:dreq: {
      if ($sockerr > 0) {
      echo 13 -a socketerror $sockerr
      return
      }
      :nextread
      sockread %temp
      ; read the data coming from the socket
      if ($sockbr == 0) return
      ; if i've read all the data, stop
      if (Connection: isin %temp) msg %reqr %sreq2 has been added to the queue!
      ; if there was stuff received from the socket, then echo it
      goto nextread
      }


      on *:SOCKREAD:next: {
      if ($sockerr > 0) {
      echo 13 -a socketerror $sockerr
      return
      }
      :nextread
      sockread %temp
      ; read the data coming from the socket
      if ($sockbr == 0) return
      ; if i've read all the data, stop
      if (%idt1 isin %temp) {
      inc %ct
      %pos. [ $+ [ %reqr ] ] [ $+ [ . [ $+ [ %ct ] ] ] ] = $gettok($remove(%temp,%idt1),1,34)
      %poslen = $len(%pos. [ $+ [ %reqr ] ] [ $+ [ . [ $+ [ %ct ] ] ] ] )
      %songlen = $len($remtok($remove(%temp,%idt1,%idt2,%idt3),1,32))
      %dif2 = %songlen - %poslen
      %song. [ $+ [ %reqr ] ] [ $+ [ . [ $+ [ %ct ] ] ] ] = $htmlfree($right($remtok($remove(%temp,%idt1,%idt2,%idt3),1,32),%dif2))
      msg %reqr %ct - %song. [ $+ [ %reqr ] ] [ $+ [ . [ $+ [ %ct ] ] ] ]
      ;echo 14 -a %ct - %song. [ $+ [ %reqr ] ] [ $+ [ . [ $+ [ %ct ] ] ] ]
      }
      if (</html> isin %temp) msg %reqr Type !next to see the next %ct songs or !prev to see the previous %ct songs! Type !request and the number of the song you wan to add it to the queue!
      ; if there was stuff received from the socket, then echo it
      goto nextread
      }

      on 1:TEXT:!playlist:*: {
      %reqr = $nick
      statopen2
      }

      on 1:TEXT:!next:*: {
      %reqr = $nick
      getnext
      }

      on 1:TEXT:!prev:*: {
      %reqr = $nick
      getprev
      }

      on 1:TEXT:!request*:* {
      %reqr = $nick
      %sreq = %pos. [ $+ [ %reqr ] ] [ $+ [ . [ $+ [ $2 ] ] ] ]
      %sreq2 = %song. [ $+ [ %reqr ] ] [ $+ [ . [ $+ [ $2 ] ] ] ]
      echo 14 -a %sreq
      doreq
      }

      alias statopen2 {
      sockopen http2 localhost 88
      %ct = 0
      unset %pos. [ $+ [ %reqr ] ] *
      unset %song. [ $+ [ %reqr ] ] *
      unset %plc. [ $+ [ %reqr ] ]
      }

      alias -l htmlfree {
      ; It's local because it won't be used by the command line, only this file.
      ; Local aliases avoid conflicting names.
      var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x,&nbsp
      return %x
      }

      alias getnext {
      sockopen next localhost 88
      inc %plc. [ $+ [ %reqr ] ] %ct
      %ct = 0
      unset %pos. [ $+ [ %reqr ] ] *
      unset %song. [ $+ [ %reqr ] ] *
      }

      alias getprev {
      sockopen next localhost 88
      dec %plc. [ $+ [ %reqr ] ] %ct
      %ct = 0
      unset %pos. [ $+ [ %reqr ] ] *
      unset %song. [ $+ [ %reqr ] ] *
      }

      alias doreq {
      sockopen dreq localhost 88
      }

      Comment


      • #4
        Small bug fixed that was causing everyone to not be able to use this script. It's still quite flakey and I will work on it some more as I get to it.

        Enjoy.


        code:

        ; Change all occurences of localhost 88 to whatever server and port your songrequester is running on.
        ; Also Change all host: yourhost.org to whatever you need it to be.
        ; This script has issues with lots of whitespace... get rid of as much as you can in your template if you run into problems.

        on *:START: {
        ; Change %idt1 to everything that comes before %%PLAYLISTPOS%%. Make sure there are not spaces between the tags in your html template
        ; on this line.
        %idt1 = <tr><td colspan="3" width="100%" bgcolor="#C5C5C5"><p align="left"><a href="request.cgi?listpos=

        ; Change %idt2 to everything that comes after %%PLAYLISTPOS%% up to %%PLAYLISTENTRY%%. Make sure there are not spaces between the tags in your html
        ; template on this line.
        %idt2 = "><font color="#000000" size="2" face="Tahoma">

        ; Change %idt3 to everything that comes after %%PLAYLISTENTRY%% to the end of the line. Make sure there are not spaces between the tags in your html
        ; template on this line.
        %idt3 = </font></a></p></td></tr>
        }

        on *:SOCKOPEN:http2: {
        echo -s *** $sockname was just opened, Retrieving file
        sockwrite -n $sockname GET /playlist.html HTTP/1.0
        sockwrite -n $sockname User-Agent: Mozilla
        sockwrite -n $sockname Host: yourhost.org
        sockwrite $sockname $crlf
        }

        on *:SOCKOPEN:next: {
        echo -s *** $sockname was just opened, Retrieving file
        sockwrite -n $sockname GET /playlist.cgi?current= [ $+ [ %plc. [ $+ [ %reqr ] ] ] ] HTTP/1.0
        sockwrite -n $sockname User-Agent: Mozilla
        sockwrite -n $sockname Host: yourhost.org
        sockwrite $sockname $crlf
        }

        on *:SOCKOPEN:dreq: {
        echo -s *** $sockname was just opened, Retrieving file
        sockwrite -n $sockname GET /request.cgi?listpos= [ $+ [ %sreq ] ] HTTP/1.0
        sockwrite -n $sockname User-Agent: Mozilla
        sockwrite -n $sockname Host: yourhost.org
        sockwrite $sockname $crlf
        }

        on *:SOCKCLOSE:next: {
        echo -s *** $sockname just closed
        }

        on *:SOCKCLOSE:http2: {
        echo -s *** $sockname just closed
        }

        on *:SOCKCLOSE:dreq: {
        echo -s *** $sockname just closed
        }

        on *:SOCKREAD:http2: {
        if ($sockerr > 0) {
        echo 13 -a socketerror $sockerr
        return
        }
        :nextread
        sockread %temp
        ; read the data coming from the socket
        if ($sockbr == 0) return
        ; if i've read all the data, stop
        if (%idt1 isin %temp) {
        inc %ct
        %pos. [ $+ [ %reqr ] ] [ $+ [ . [ $+ [ %ct ] ] ] ] = $gettok($remove(%temp,%idt1),1,34)
        %poslen = $len(%pos. [ $+ [ %reqr ] ] [ $+ [ . [ $+ [ %ct ] ] ] ] )
        %songlen = $len($remtok($remove(%temp,%idt1,%idt2,%idt3),1,32))
        %dif2 = %songlen - %poslen
        %song. [ $+ [ %reqr ] ] [ $+ [ . [ $+ [ %ct ] ] ] ] = $htmlfree($right($remtok($remove(%temp,%idt1,%idt2,%idt3),1,32),%dif2))
        msg %reqr %ct - %song. [ $+ [ %reqr ] ] [ $+ [ . [ $+ [ %ct ] ] ] ]
        ;echo 14 -a %ct - %song. [ $+ [ %reqr ] ] [ $+ [ . [ $+ [ %ct ] ] ] ]
        }
        if (</html> isin %temp) msg %reqr Type !next to see the next %ct songs! Type !request and the number of the song you wan to add it to the queue!
        ; if there was stuff received from the socket, then echo it
        goto nextread
        }

        on *:SOCKREAD:dreq: {
        if ($sockerr > 0) {
        echo 13 -a socketerror $sockerr
        return
        }
        :nextread
        sockread %temp
        ; read the data coming from the socket
        if ($sockbr == 0) return
        ; if i've read all the data, stop
        if (Connection: isin %temp) msg %reqr %sreq2 has been added to the queue!
        ; if there was stuff received from the socket, then echo it
        goto nextread
        }


        on *:SOCKREAD:next: {
        if ($sockerr > 0) {
        echo 13 -a socketerror $sockerr
        return
        }
        :nextread
        sockread %temp
        ; read the data coming from the socket
        if ($sockbr == 0) return
        ; if i've read all the data, stop
        if (%idt1 isin %temp) {
        inc %ct
        %pos. [ $+ [ %reqr ] ] [ $+ [ . [ $+ [ %ct ] ] ] ] = $gettok($remove(%temp,%idt1),1,34)
        %poslen = $len(%pos. [ $+ [ %reqr ] ] [ $+ [ . [ $+ [ %ct ] ] ] ] )
        %songlen = $len($remtok($remove(%temp,%idt1,%idt2,%idt3),1,32))
        %dif2 = %songlen - %poslen
        %song. [ $+ [ %reqr ] ] [ $+ [ . [ $+ [ %ct ] ] ] ] = $htmlfree($right($remtok($remove(%temp,%idt1,%idt2,%idt3),1,32),%dif2))
        msg %reqr %ct - %song. [ $+ [ %reqr ] ] [ $+ [ . [ $+ [ %ct ] ] ] ]
        ;echo 14 -a %ct - %song. [ $+ [ %reqr ] ] [ $+ [ . [ $+ [ %ct ] ] ] ]
        }
        if (</html> isin %temp) msg %reqr Type !next to see the next %ct songs or !prev to see the previous %ct songs! Type !request and the number of the song you wan to add it to the queue!
        ; if there was stuff received from the socket, then echo it
        goto nextread
        }

        on 1:TEXT:!playlist:*: {
        %reqr = $nick
        statopen2
        }

        on 1:TEXT:!next:*: {
        %reqr = $nick
        getnext
        }

        on 1:TEXT:!prev:*: {
        %reqr = $nick
        getprev
        }

        on 1:TEXT:!request*:* {
        %reqr = $nick
        %sreq = %pos. [ $+ [ %reqr ] ] [ $+ [ . [ $+ [ $2 ] ] ] ]
        %sreq2 = %song. [ $+ [ %reqr ] ] [ $+ [ . [ $+ [ $2 ] ] ] ]
        doreq
        }

        alias statopen2 {
        sockopen http2 localhost 88
        %ct = 0
        unset %pos. [ $+ [ %reqr ] ] *
        unset %song. [ $+ [ %reqr ] ] *
        unset %plc. [ $+ [ %reqr ] ]
        }

        alias -l htmlfree {
        ; It's local because it won't be used by the command line, only this file.
        ; Local aliases avoid conflicting names.
        var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x,&nbsp
        return %x
        }

        alias getnext {
        sockopen next localhost 88
        inc %plc. [ $+ [ %reqr ] ] %ct
        %ct = 0
        unset %pos. [ $+ [ %reqr ] ] *
        unset %song. [ $+ [ %reqr ] ] *
        }

        alias getprev {
        sockopen next localhost 88
        dec %plc. [ $+ [ %reqr ] ] %ct
        %ct = 0
        unset %pos. [ $+ [ %reqr ] ] *
        unset %song. [ $+ [ %reqr ] ] *
        }

        alias doreq {
        sockopen dreq localhost 88
        }

        Comment


        • #5
          Much Easier

          Much easier mIRC SHOUTcast bot here.

          - Nexeo
          ShoutScript

          Comment


          • #6
            Can't download it to check it out. =(

            Does your script allow you to interactively make requests?

            As in... !request <song #> and it adds it to the queue?

            Comment


            • #7
              Yes, if you say @request band - song
              It private messages the request to the dj.
              The download should work

              Comment


              • #8
                Hmm... The script I posted interacts with the songrequester plugin allowing you to browse through the songs and put a request in to the plugin... The plugin handles everything. It puts the requested song in queue to be played automatically.

                Comment


                • #9
                  aight w/e, just helping out w/ a bot that does everything not just requests, it does listeners, song, bitrate, and when someone SHOUTOUTS or REQUESTS it pm's the dj...

                  Comment


                  • #10
                    No no... Yours does much more than mine. I can't download it to test it out. =(

                    For some reason the domain isn't resolving on my side.

                    Comment


                    • #11
                      Nexeo has a nice script, however it doesn't do what yours does Herris.

                      This is a nice script.

                      Comment


                      • #12
                        I've made a few more updates, try this link again to dl it

                        Mirror 1: http://www.diginetstudios.com/ShoutScript.zip
                        Mirror 2: http://www10.brinkster.com/onyxsoft/ShoutScript.zip

                        -Nexeo

                        Comment


                        • #13
                          err the 2nd link is supposed to be

                          Comment


                          • #14
                            Updated

                            Now shows currently playing song everytime !playlist !next or !prev is typed along with how long the song has to go.

                            Example:

                            <HerrisSRV> Currently Playing: Concrete Blonde - Joey (Better Accoustic) 3.9min/s left to go
                            <HerrisSRV> 1 - Finger Eleven - Broken Words
                            <HerrisSRV> 2 - Fiona Apple - Criminal
                            <HerrisSRV> 3 - Fiona Apple - Slow Like Honey
                            <HerrisSRV> 4 - Fiona Apple - To Your Love
                            <HerrisSRV> 5 - Frankie Goes To Hollywood - The Power Of Love
                            <HerrisSRV> 6 - Frente! - Girl
                            <HerrisSRV> 7 - Garbage - # Crush
                            <HerrisSRV> 8 - Garbage - My Lover's Box
                            <HerrisSRV> 9 - God Lives Underwater - No More Love
                            <HerrisSRV> 10 - Goldfinger - Mind's Eye
                            <HerrisSRV> 11 - Goldfinger - Here In Your Bedroom
                            <HerrisSRV> 12 - Goldfinger - If Only
                            <HerrisSRV> 13 - Goldfinger - Superman
                            <HerrisSRV> 14 - Michelle Branch - Goodbye to You
                            <HerrisSRV> 15 - Hed PE - Bartender
                            <HerrisSRV> 16 - Hed PE - Pac Bell
                            <HerrisSRV> 17 - Him - Wicked Game (666 Remix)
                            <HerrisSRV> 18 - Insane Clown Posse - Another Love Song
                            <HerrisSRV> 19 - Incubus - Stellar
                            <HerrisSRV> 20 - INXS - I Need You Tonight
                            <HerrisSRV> Type !next to see the next 20 songs or !prev to see the previous 20 songs! Type !request and the number of the song you want to add to the queue!

                            code:

                            ; Change all occurences of localhost 88 to whatever server and port your songrequester is running on.
                            ; Also Change all host: yourhost.org to whatever you need it to be.
                            on *:START: {
                            ; Change %idt1 to everything that comes before %%PLAYLISTPOS%%. Make sure there are not spaces between the tags in your html template
                            ; on this line.
                            %idt1 = <tr><td colspan="3" width="100%" bgcolor="#C5C5C5"><p align="left"><a href="request.cgi?listpos=

                            ; Change %idt2 to everything that comes after %%PLAYLISTPOS%% up to %%PLAYLISTENTRY%%. Make sure there are not spaces between the tags in your html
                            ; template on this line.
                            %idt2 = "><font color="#000000" size="2" face="Tahoma">

                            ; Change %idt1 to everything that comes after %%PLAYLISTENTRY%% to the end of the line. Make sure there are not spaces between the tags in your html
                            ; template on this line.
                            %idt3 = </font></a></p></td></tr>
                            ; Change %idt4 to everything before %%CURRENTSONG%%&nbsp;&nbsp;
                            %idt4 = <p align="center"><font color="#000000" size="2" face="Tahoma">

                            ; Change %idt5 to everything after %%CURRENTSONG%% to the end of the line. Include the &nbsp;&nbsp; before your custom info.
                            %idt5 = &nbsp;&nbsp;</font><input align="center" TYPE="text" Name="thetime" size=5></p><br>

                            %idt6 = <meta http-equiv="Refresh" content="
                            }

                            on *:SOCKOPEN:http2: {
                            echo -s *** $sockname was just opened, Retrieving file
                            sockwrite -n $sockname GET /playlist.html HTTP/1.0
                            sockwrite -n $sockname User-Agent: Mozilla
                            sockwrite -n $sockname Host: yourhost.org
                            sockwrite $sockname $crlf
                            }

                            on *:SOCKOPEN:next: {
                            echo -s *** $sockname was just opened, Retrieving file
                            sockwrite -n $sockname GET /playlist.cgi?current= [ $+ [ %plc. [ $+ [ %reqr ] ] ] ] HTTP/1.0
                            sockwrite -n $sockname User-Agent: Mozilla
                            sockwrite -n $sockname Host: yourhost.org
                            sockwrite $sockname $crlf
                            }

                            on *:SOCKOPEN:dreq: {
                            echo -s *** $sockname was just opened, Retrieving file
                            sockwrite -n $sockname GET /request.cgi?listpos= [ $+ [ %sreq ] ] HTTP/1.0
                            sockwrite -n $sockname User-Agent: Mozilla
                            sockwrite -n $sockname Host: yourhost.org
                            sockwrite $sockname $crlf
                            }

                            on *:SOCKCLOSE:next: {
                            echo -s *** $sockname just closed
                            }

                            on *:SOCKCLOSE:http2: {
                            echo -s *** $sockname just closed
                            }

                            on *:SOCKCLOSE:dreq: {
                            echo -s *** $sockname just closed
                            }

                            on *:SOCKREAD:http2: {
                            if ($sockerr > 0) {
                            echo 13 -a socketerror $sockerr
                            return
                            }
                            :nextread
                            sockread %temp
                            ; read the data coming from the socket
                            if ($sockbr == 0) return
                            ; if i've read all the data, stop
                            if (%idt6 isin %temp) {
                            %stg = $calc($remove(%temp,%idt6,/60)
                            %ttg = $left(%stg,$calc($len(%stg) - (($len(%stg)-2) - $pos(%stg,.,1))))
                            ; %ttg = $calc($remove(%temp,%idt6,/60)
                            }
                            if (%idt5 isin %temp) {
                            %cursong = $remove(%temp,%idt4,%idt5)
                            msg %reqr Currently Playing: %cursong %ttg $+ mins left to go
                            }
                            if (%idt1 isin %temp) {
                            inc %ct
                            %pos. [ $+ [ %reqr ] ] [ $+ [ . [ $+ [ %ct ] ] ] ] = $gettok($remove(%temp,%idt1),1,34)
                            %poslen = $len(%pos. [ $+ [ %reqr ] ] [ $+ [ . [ $+ [ %ct ] ] ] ] )
                            %songlen = $len($remtok($remove(%temp,%idt1,%idt2,%idt3),1,32))
                            %dif2 = %songlen - %poslen
                            %song. [ $+ [ %reqr ] ] [ $+ [ . [ $+ [ %ct ] ] ] ] = $htmlfree($right($remtok($remove(%temp,%idt1,%idt2,%idt3),1,32),%dif2))
                            msg %reqr %ct - %song. [ $+ [ %reqr ] ] [ $+ [ . [ $+ [ %ct ] ] ] ]
                            ;echo 14 -a %ct - %song. [ $+ [ %reqr ] ] [ $+ [ . [ $+ [ %ct ] ] ] ]
                            }
                            if (</html> isin %temp) msg %reqr Type !next to see the next %ct songs! Type !request and the number of the song you want to add to the queue!
                            ; if there was stuff received from the socket, then echo it
                            goto nextread
                            }

                            on *:SOCKREAD:dreq: {
                            if ($sockerr > 0) {
                            echo 13 -a socketerror $sockerr
                            return
                            }
                            :nextread
                            sockread %temp
                            ; read the data coming from the socket
                            if ($sockbr == 0) return
                            ; if i've read all the data, stop
                            if (Connection: isin %temp) msg %reqr %sreq2 has been added to the queue!
                            ; if there was stuff received from the socket, then echo it
                            goto nextread
                            }


                            on *:SOCKREAD:next: {
                            if ($sockerr > 0) {
                            echo 13 -a socketerror $sockerr
                            return
                            }
                            :nextread
                            sockread %temp
                            ; read the data coming from the socket
                            if ($sockbr == 0) return
                            ; if i've read all the data, stop
                            if (%idt6 isin %temp) {
                            %stg = $calc($remove(%temp,%idt6,/60)
                            %ttg = $left(%stg,$calc($len(%stg) - (($len(%stg)-2) - $pos(%stg,.,1))))
                            ; %ttg = $calc($remove(%temp,%idt6,/60)
                            }
                            if (%idt5 isin %temp) {
                            %cursong = $remove(%temp,%idt4,%idt5)
                            msg %reqr Currently Playing: %cursong %ttg $+ min/s left to go
                            }
                            if (%idt1 isin %temp) {
                            inc %ct
                            %pos. [ $+ [ %reqr ] ] [ $+ [ . [ $+ [ %ct ] ] ] ] = $gettok($remove(%temp,%idt1),1,34)
                            %poslen = $len(%pos. [ $+ [ %reqr ] ] [ $+ [ . [ $+ [ %ct ] ] ] ] )
                            %songlen = $len($remtok($remove(%temp,%idt1,%idt2,%idt3),1,32))
                            %dif2 = %songlen - %poslen
                            %song. [ $+ [ %reqr ] ] [ $+ [ . [ $+ [ %ct ] ] ] ] = $htmlfree($right($remtok($remove(%temp,%idt1,%idt2,%idt3),1,32),%dif2))
                            msg %reqr %ct - %song. [ $+ [ %reqr ] ] [ $+ [ . [ $+ [ %ct ] ] ] ]
                            ;echo 14 -a %ct - %song. [ $+ [ %reqr ] ] [ $+ [ . [ $+ [ %ct ] ] ] ]
                            }
                            if (</html> isin %temp) msg %reqr Type !next to see the next %ct songs or !prev to see the previous %ct songs! Type !request and the number of the song you want to add to the queue!
                            ; if there was stuff received from the socket, then echo it
                            goto nextread
                            }

                            on 1:TEXT:!playlist:*: {
                            %reqr = $nick
                            statopen2
                            }

                            on 1:TEXT:!next:*: {
                            %reqr = $nick
                            getnext
                            }

                            on 1:TEXT:!prev:*: {
                            %reqr = $nick
                            getprev
                            }

                            on 1:TEXT:!request*:* {
                            %reqr = $nick
                            %sreq = %pos. [ $+ [ %reqr ] ] [ $+ [ . [ $+ [ $2 ] ] ] ]
                            %sreq2 = %song. [ $+ [ %reqr ] ] [ $+ [ . [ $+ [ $2 ] ] ] ]
                            doreq
                            }

                            alias statopen2 {

                            sockopen http2 localhost 88
                            %ct = 0
                            unset %pos. [ $+ [ %reqr ] ] *
                            unset %song. [ $+ [ %reqr ] ] *
                            unset %plc. [ $+ [ %reqr ] ]
                            }

                            alias -l htmlfree {
                            ; It's local because it won't be used by the command line, only this file.
                            ; Local aliases avoid conflicting names.
                            var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x,&nbsp
                            return %x
                            }

                            alias getnext {
                            sockopen next localhost 88
                            inc %plc. [ $+ [ %reqr ] ] %ct
                            %ct = 0
                            unset %pos. [ $+ [ %reqr ] ] *
                            unset %song. [ $+ [ %reqr ] ] *
                            }

                            alias getprev {
                            sockopen next localhost 88
                            dec %plc. [ $+ [ %reqr ] ] %ct
                            %ct = 0
                            unset %pos. [ $+ [ %reqr ] ] *
                            unset %song. [ $+ [ %reqr ] ] *
                            }

                            alias doreq {
                            sockopen dreq localhost 88
                            }

                            Comment


                            • #15
                              Another bug fix and added a new command!

                              !search <word> will search your playlist and return the results to the user and allow them to !request it!

                              Example:

                              <Herris> !search peter
                              <HerrisSRV> Currently Playing: PJ Harvey - Who Will Love Me Now? 4mins 53secs left to go
                              <HerrisSRV> 1 - Peter Murphy - The Sweetest Drop
                              <HerrisSRV> 2 - Peter Murphy - You're So Close
                              <HerrisSRV> 3 - Peter Yorn - I Wanna Be Your Boyfriend
                              <HerrisSRV> Type !request and the number of the song you want to add to the queue! Type !playlist to see the songs currently in the playlist!

                              This thread is getting long with code so you can go to to my site to download it...

                              Directly at http://www.somnambulance.org/shoutcast2.mrc

                              Comment

                              Working...
                              X
                              😀
                              🥰
                              🤢
                              😎
                              😡
                              👍
                              👎