collapse collapse
* User Info
 
 
Welcome, Guest. Please login or register.
* Search

* Board Stats
  • stats Total Members: 989
  • stats Total Posts: 18366
  • stats Total Topics: 2501
  • stats Total Categories: 7
  • stats Total Boards: 35
  • stats Most Online: 1144

Author Topic: MediaControl  (Read 4927 times)

0 Members and 2 Guests are viewing this topic.

Offline Elesar1

  • BeBot User
  • **
  • Posts: 47
  • Karma: +0/-0
MediaControl
« on: October 03, 2008, 05:55:38 am »
Just wondering if it would be possible to make a WinAmp media control module for commanding a streaming music bot on TS/Ventrilo.

Possible Commands:
Play / Play SongNumber
Pause
Next
Previous
Volume 1-100
Playlist (Show next 10 or so songs in the list)

I know that this has been done for a chatbot for Warcraft3, but that was all done in VBScript.

Just something I thought would be fun.

Offline Faelwen

  • BeBot User
  • **
  • Posts: 35
  • Karma: +0/-0
Re: MediaControl
« Reply #1 on: October 03, 2008, 11:25:43 am »
I have done this with my own guild tho, you just search in youtube.com on soundbot for ventrilo :), easy as it looks like :)

Offline Elesar1

  • BeBot User
  • **
  • Posts: 47
  • Karma: +0/-0
Re: MediaControl
« Reply #2 on: October 03, 2008, 03:38:18 pm »
I have the streaming bot going just fine, but having to run into the other room, or connect via VNC, just to change songs is rather annoying, so that is why I was seeing if there was the possibility of a control system through the bot, as my BeBots and my Vent musicbot are on the same system.

Offline Vain

  • BeBot User
  • **
  • Posts: 57
  • Karma: +0/-0
Re: MediaControl
« Reply #3 on: November 25, 2008, 06:19:07 pm »
I have the streaming bot going just fine, but having to run into the other room, or connect via VNC, just to change songs is rather annoying, so that is why I was seeing if there was the possibility of a control system through the bot, as my BeBots and my Vent musicbot are on the same system.

Wow this would be awsome... I never thought about it before.
But having the bot do the owrk would be great. and maybe even a playlist search to see what is available also.

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: MediaControl
« Reply #4 on: November 25, 2008, 06:29:41 pm »
If you got a command line tool to execute the commands you could do it.

Use system() or exec() to call the command to control the media server.

Security wise just be sure that you don't pass any unfiltered user-input to the exec() or system() commands, otherwise this could have truly bad consequences.

Filter either by limiting regular expressions or by using the escape functions mentioned on the help pages to the php functions.

Offline Vain

  • BeBot User
  • **
  • Posts: 57
  • Karma: +0/-0
Re: MediaControl
« Reply #5 on: November 25, 2008, 06:42:59 pm »
I found this code snipet with google...
Its crude and I dont know if it will help.

Code: [Select]
<?
$directory = "D:/mp3s";   // Set the directory we're looking at..

 if (isset($filename)) {
   $link = "d:\\mp3s\\";
   $link .= urldecode($filename);
   exec("COMMAND.COM /C START c:\progra~1\winamp\winamp.exe \"$link\"NUL");
   header("Location:index.php?status=playing&arg=$filename");
 }

 if ($status=="playing") {
   $proper = urldecode($arg);
   echo "Now playing: <H3>$arg</H3>";
 }

 $count=0;
 $handle=opendir($directory);
 echo "Choose a song to play from <B>$directory</B>:<BR>";

 while (false !== ($file = readdir($handle))) {
   if ($file != "." && $file != "..") {
     if (substr($file, -4)==".mp3"){
       // ignore any non-mp3 files
       $filelist[$count++] = $file;
     }
   }
 }

 closedir($handle);

 sort ($filelist);  // alphabetize the files

 for ($i=0; $i<$count; $i++) {
   $link = urlencode($filelist[$i]);
   echo "<A HREF=\"index.php?filename=$link\">$filelist[$i]</A><BR>";
 }
?>

Offline Elesar1

  • BeBot User
  • **
  • Posts: 47
  • Karma: +0/-0
Re: MediaControl
« Reply #6 on: November 27, 2008, 06:11:23 am »
I will start looking into this soon, hopefully....

My guild has just purchased a new server and we are in the works on getting our new forums up and fully integrating the bot with the forums to have real-time chat (TWC) and use our mule-item module (Not released yet) to have full, sorted listings of what each character is holding for the guild, along with the ability to request the item from the forums or in game :D

 

* Recent Posts
Com bot module by bitnykk
[November 25, 2024, 05:36:11 pm ]


0.8.x updates for AO by bitnykk
[June 23, 2024, 03:19:47 pm ]


0.8.x updates for AoC by bitnykk
[June 23, 2024, 03:19:44 pm ]


[AoC] special char for items module by bitnykk
[February 09, 2024, 09:41:18 pm ]


BeBot still alive & kicking ! by bitnykk
[December 17, 2023, 12:58:44 am ]

* Who's Online
  • Dot Guests: 90
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.
* Forum Staff
bitnykk admin bitnykk
Administrator
Khalem admin Khalem
Administrator
WeZoN gmod WeZoN
Global Moderator
SimplePortal 2.3.7 © 2008-2024, SimplePortal