Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Project U-232 (http://www.bvlist.com/forumdisplay.php?f=80)
-   -   [INPROGRESS] Autobot MSG w/ sound (http://www.bvlist.com/showthread.php?t=12316)

BamBam0077 10th December 2020 17:21

[INPROGRESS] Autobot MSG w/ sound
 
Original Version!
PHP Code:

function autoshout ($msg '')
{
    
$message $msg;

    
sql_query("INSERT INTO shoutbox (date, text)
                VALUES ("
.implode(", "array_map("sqlesc", array(time(), $message))).")") or sqlerr(__FILE____LINE__);
    echo 
"<embed loop='false' src='sounds/chat.mp3' hidden='true' autoplay='true' />";


So before we begin let's create some directories chat
inside that new folder create another folder
sounds

Insert a index.html file in both keep it empty and chmod them folders 0755

Now inside the sounds folder will hold the files you want to play the success.wav file or mp3 or etc

Download & Extract:
http://frug.github.io/AJAX-Chat/

^^ sounds can be found in there.

TEST INSIDE u232 yo!
PHP Code:

/* Chat Functions */
function  autoshout($msg ''){

$message $msg;

function 
timeout(time()){
return 
time();
}

if( 
$message ){
$htmlout "<embed loop='flase' src='chat/sounds/success.wav' hidden='true' autoplay='true' />";
print 
$htmlout;
}

$query "INSERT INTO `shoutbox` (date, text, sounds) VALUES (".implode(", "array_map("sqlesc", array(timeout(), $message'0'))).")";


PHP Code:

ALTER TABLE shoutbox ADD sounds int(8unsigned NOT NULL default '0'

its for the trigger words to basicly appear though its the function which spits the output for the trigger word list to work inside your chatroom's if you dont understand learn about v3 shoutbox scripts you'll find the first function provided on beginning of topic so anyway replace it once you find it n if it works report back :welcome:

Its a bot that should make a sound when i post a msg through shoutbox. For now i am just gonna rename original function to ajxbot($msg='') in the near future goals.

I HAVE YET TO TEST MYSELF!!!
Should work yo!

Go to domain: http://localhost:8080/shoutbox.php or index.php depends on how you designed your website. Once you inside test it after you replace code where nessecessory n then run script and it should make a sound when you run a trigger_word like !irc that would show me how to connect my irc in my shoutbox via text and would arrive with a sound if successfully posted. Sometimes we like these small mods yo!


All times are GMT +2. The time now is 00:39.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.