BeBot - An Anarchy Online and Age Of Conan chat automaton

Development => Module Requests => Topic started by: Elesar1 on October 03, 2008, 05:55:38 am

Title: MediaControl
Post by: Elesar1 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.
Title: Re: MediaControl
Post by: Faelwen 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 :)
Title: Re: MediaControl
Post by: Elesar1 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.
Title: Re: MediaControl
Post by: Vain 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.
Title: Re: MediaControl
Post by: Alreadythere 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.
Title: Re: MediaControl
Post by: Vain 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>";
 }
?>
Title: Re: MediaControl
Post by: Elesar1 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
SimplePortal 2.3.7 © 2008-2025, SimplePortal