Quote:
Originally Posted by geckoz
I wish there would be a chat bot with pre-defined messages getting posted every x minutes.
Somebody can do this? 
|
there are a few out there if you use downloadII there is one ..
if you use ibproarcade
you can do this..
You need to have VSa - Chatbox & ibproarcade installed.
Now create a new bbcode called 'siteurl' with the code
<a href="{option}">{param}</a>
(This makes the game link in the chatbox open in the same window rather than a new one)
Code:
Title = siteurl
BB Code Tag Name = siteurl
Replacement = <a href="{option}">{param}</a>
Example = [siteurl=http://www.example.com]Example Web Site[/siteurl]
Decription = This open site urls in the same window rather than the default target="_blank"
Use {option} = Yes
Button Image (Optional) = Leave Blank
Remove Tag If Empty = Yes
Disable BB Code Within This BB Code = No
Disable Smilies Within This BB Code = Yes
Disable Word Wrapping Within This BB Code = Yes
Ok Now open your root arcade.php file and find
PHP Code:
// finally update Highscore-Table
if ( ($this->arcade->user['id'] != 0) && ($player_score <> 0) )
{
$DB->query("UPDATE ibf_games_champs SET ".$db_string." WHERE champ_gid=".$gid);
$ginfo['champ_mid'] = $this->arcade->user['id'];
$ginfo['champ_name'] = $this->arcade->user['name'];
$ginfo['champ_score'] = $player_score;
Add after
PHP Code:
// Insert New Chatbox Message
$DB->query("SELECT c.*, g.gcat, cat.password FROM ibf_games_champs AS c, ibf_games_list AS g, ibf_games_cats AS cat WHERE c.champ_gid=g.gid AND g.gcat=cat.c_id AND g.active=1 AND trim(password)='' ORDER BY champ_date DESC LIMIT 0,1");
while( $row = $DB->fetch_row() )
{
$newchattxt .= "[color=green]".$row['champ_name']." set a new high score of ".$row['champ_score']." in [/color][siteurl=http://".$_SERVER['SERVER_NAME']."/arcade.php?do=play&gameid=".$row['champ_gid']."]".$row['champ_gtitle']."[/siteurl]";
$vbulletin->db->query_write("
INSERT INTO ".TABLE_PREFIX."vsa_chatbox
(userid, userip, message, dateline, textprop)
VALUES ('42', '".$_SERVER['REMOTE_ADDR']."', '".$newchattxt."', ".TIMENOW.", '')
");
}
// End insert
Then Find
PHP Code:
if ($player_score <> 0) // no champ with no result ...
{
$DB->query("INSERT INTO ibf_games_champs (" .$db_string['FIELD_NAMES']. ") VALUES (". $db_string['FIELD_VALUES'] .")");
$ginfo['champ_mid'] = $this->arcade->user['id'];
$ginfo['champ_name'] = $this->arcade->user['name'];
$ginfo['champ_score'] = $player_score;
Add after
PHP Code:
// Insert New Chatbox Message
$DB->query("SELECT c.*, g.gcat, cat.password FROM ibf_games_champs AS c, ibf_games_list AS g, ibf_games_cats AS cat WHERE c.champ_gid=g.gid AND g.gcat=cat.c_id AND g.active=1 AND trim(password)='' ORDER BY champ_date DESC LIMIT 0,1");
while( $row = $DB->fetch_row() )
{
$newchattxt .= "[color=green]".$row['champ_name']." set a new high score of ".$row['champ_score']." in [/color][siteurl=http://".$_SERVER['SERVER_NAME']."/arcade.php?do=play&gameid=".$row['champ_gid']."]".$row['champ_gtitle']."[/siteurl]";
$vbulletin->db->query_write("
INSERT INTO ".TABLE_PREFIX."vsa_chatbox
(userid, userip, message, dateline, textprop)
VALUES ('42', '".$_SERVER['REMOTE_ADDR']."', '".$newchattxt."', ".TIMENOW.", '')
");
}
// End insert
example
Change
BOTH INSTANCES of 42 in the above code to the value of the userid of the users name you wish to appear in the chatbox. I have a user with id 42 called spam_master who does all the arcade shouting for this addon.
this code was writen by someone here @vb.org
but it was never posted as a mod.. so it's lost ATM
I keep the code on hand .. when I seen it
I forget who wrote it ..
If I find it I will give 100% credit to him for this great addition