L* R*
HOME FORUM DOWNLOADS
Content
  Links
     Browse SVN
     SVN Commit log
     Documentation (Wiki)
  Developers
     Taskmanager
User
Welcome, Guest. Please login or register.
Did you miss your activation email?
October 06, 2008, 09:19:16 AM

Login with username, password and session length
Search



Advanced search
Support GoPHP5.org
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Support > Support for older versions > BeBot 0.3 support > Topic: City Cloak Issue
Pages: [1]   Go Down
« previous next »
Print
Author Topic: City Cloak Issue  (Read 533 times)
0 Members and 1 Guest are viewing this topic.
wsbsteven
Freshman
*
Offline Offline

Posts: 3


City Cloak Issue
« on: July 18, 2007, 10:02:25 AM »

After doing a couple city raids, it seems that the bot will miss the cloak being enabled sometimes.  It then proceeds to spam "Cloaking device is still disabled." every 15min when the cloak is enabled on the controller.  Is this a known issue or something that's never been reported?  I'm using the version 0.3.5 version.  Let me know if more information is needed.
Logged
Temar
BeBot Developer
Grandmaster
********
Offline Offline

Gender: Male
Posts: 772



WWW
Re: City Cloak Issue
« Reply #1 on: July 18, 2007, 11:41:54 AM »

im sure they can easily fix it
my guess is they will put a command to manualy enable cloak on bot
Logged
Ebag333
BeBot Contributor
Apprentice
*******
Offline Offline

Posts: 132


Re: City Cloak Issue
« Reply #2 on: July 18, 2007, 05:35:11 PM »

That would obviously be one solution, but the better one is to figure out why it's not getting updated in the first place.

Running a test and seeing if the bot even catches that the cloak went back up would be the first thing to do.  It's possible that there's something wrong with your internet/computer/etc that's preventing it from catching that the cloak went up.

Incidentally I've never seen any of my bots miss that the cloak went up, with the exception of when I have a network/comp issue and the bot simply never gets the message.

If you're running the bot on an overloaded 'net or computer, you're going to have more issues than just missing a cloak message.
Logged
wsbsteven
Freshman
*
Offline Offline

Posts: 3


Re: City Cloak Issue
« Reply #3 on: July 19, 2007, 09:21:31 AM »

It seems to be lag.  I checked the logs and it misses the cloaking message and also some of the chatter is missing in the log from org mates.  The feature to manually enable cloaking in the database would be nice though.
Logged
Ebag333
BeBot Contributor
Apprentice
*******
Offline Offline

Posts: 132


Re: City Cloak Issue
« Reply #4 on: July 19, 2007, 09:46:37 AM »

Try this version:

ftp://66.178.153.45/AlienAttack_GUILD.php


Note that I have NOT tested this at all, when (if) I get some time today I will attempt to do so.

The command should be cloakset on|off, and it defaults to admin access rights.

I've not yet committed this to SVN as I haven't tested it yet.
« Last Edit: July 19, 2007, 09:49:45 AM by Ebag333 » Logged
wsbsteven
Freshman
*
Offline Offline

Posts: 3


Re: City Cloak Issue
« Reply #5 on: July 19, 2007, 11:23:00 AM »

parse error: syntax error, unexpected ';', expecting t_function in alienattack_guild.php on line 351
Logged
Parfet
Rookie
**
Offline Offline

Posts: 33


Re: City Cloak Issue
« Reply #6 on: July 19, 2007, 12:18:57 PM »

got it working, great idea for random raids or missed messages, but it wasn't very complete Smiley this one works:

AlienAttack_GUILD.php
Code:
<?php
/*
* TowerAttack.php - Handle Alien attack events.
*
* BeBot - An Anarchy Online Chat Automaton
* Copyright (C) 2004 Jonas Jax
* Copyright (C) 2005 Thomas J. Stens&#239;&#191;&#189; and ShadowRealm Creations
*
* Developed by:
* - Blondengy (RK1)
* - Khalem (RK1)
*
* See Credits file for all aknowledgements.
*
*  This program is free software; you can redistribute it and/or modify
*  it under the terms of the GNU General Public License as published by
*  the Free Software Foundation; either version 2 of the License, or
*  (at your option) any later version.
*
*  This program is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU General Public License for more details.
*
*  You should have received a copy of the GNU General Public License
*  along with this program; if not, write to the Free Software
*  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
*  USA
*
* File last changed at $LastChangedDate: 2007-07-18 05:51:08 -0700 (Wed, 18 Jul 2007) $
* Revision: $Id: AlienAttack_GUILD.php 785 2007-07-18 12:51:08Z alreadythere $
*/

/*
Prepare MySQL database
*/
$db->query("CREATE TABLE IF NOT EXISTS " . $db -> define_tablename("org_city", "true") . "
        (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
        time INT,
        action VARCHAR(10),
        player VARCHAR(15))"
);



$alienAttack = new AlienAttack($bot);


$commands["tell"]["city"] = &$alienAttack;
$commands["tell"]["cloak"] = &$alienAttack;
$commands["tell"]["cloakset"] = &$alienAttack;
$commands["pgmsg"]["city"] = &$alienAttack;
$commands["pgmsg"]["cloak"] = &$alienAttack;
$commands["pgmsg"]["cloakset"] = &$alienAttack;
$commands["gc"]["city"] = &$alienAttack;
$commands["gc"]["cloak"] = &$alienAttack;
$commands["gc"]["cloakset"] = &$alienAttack;

$commands["buddy"][] = &$alienAttack;

$commands["gmsg"][$guild_name][] = &$alienAttack;

/*
The Class itself...
*/
class AlienAttack
{
var $bot;
var $type;
var $time;
var $action;


/*
Constructor:
Hands over a referance to the "Bot" class.
*/
function AlienAttack (&$bot)
{
$this -> bot = &$bot;

$this -> bot -> accesscontrol -> create('tell', 'city', 'GUEST');
$this -> bot -> accesscontrol -> create('gc', 'city', 'GUEST');
$this -> bot -> accesscontrol -> create('pgmsg', 'city', 'GUEST');
$this -> bot -> accesscontrol -> create('tell', 'cloak', 'GUEST');
$this -> bot -> accesscontrol -> create('gc', 'cloak', 'GUEST');
$this -> bot -> accesscontrol -> create('pgmsg', 'cloak', 'GUEST');
$this -> bot -> accesscontrol -> create('tell', 'cloakset', 'ADMIN');
$this -> bot -> accesscontrol -> create('gc', 'cloakset', 'ADMIN');
$this -> bot -> accesscontrol -> create('pgmsg', 'cloakset', 'ADMIN');

$this -> bot -> settings -> create ("Cityinfo", "Spamgc", True, "Should we spam messages to GC when they occur?");
$this -> bot -> settings -> create ("Cityinfo", "SpamMembers", True, "Should we spam messages to members when they login?");

$this -> help['description'] = "Shows information and history pertaining to the city and city controller.";
$this -> help['command']['city'] = "- See description";
$this -> help['command']['cloak'] = "- See description";
$this -> help['command']['cloakset on|off'] = "Manually forces the cloak to be on or off.";
}



/*
This gets called on a tell with the command
*/
function tell($name, $msg)
{
if (preg_match("/^" . $this -> bot -> commpre . "cloakset (.+)$/i", $msg, $info))
$this -> bot -> send_tell($name, $this -> cloakset($name, $info[1]));
else $this -> bot -> send_tell($name, $this -> city_blob($name, $msg));
}



/*
This gets called on a msg in the privgroup with the command
*/
function pgmsg($name, $msg)
{
if (preg_match("/^" . $this -> bot -> commpre . "cloakset (.+)$/i", $msg, $info))
$this -> bot -> send_pgroup($this -> cloakset($name, $info[1]));
else $this -> bot -> send_pgroup($this -> city_blob($name, $msg));
}



/*
This gets called on a msg in the guildchat with the command
*/
function gc($name, $msg)
{
if (preg_match("/^" . $this -> bot -> commpre . "cloakset (.+)$/i", $msg, $info))
$this -> bot -> send_gc($this -> cloakset($name, $info[1]));
else $this -> bot -> send_gc($this -> city_blob($name, $msg));
}



/*
Makes the battle results
*/
function city_blob($name, $msg)
{
$result = $this -> bot -> db -> select("SELECT time, action, player FROM #___org_city ORDER BY time DESC LIMIT 0, 12");
if (!$result)
{
return "No city events found in database.";
}
else
{
$city = "##blob_title##::::: Recent City Attacks :::::##end##\n\n";

foreach ($result as $res)
{
$city .= "##blob_text##Time:##end## " . gmdate($this -> bot -> settings -> get("Time", "FormatString"), $res[0]) . "\n";

if ($res[1] == "attack")
$city .= "City was attacked.\n";
else if ($res[1] == "on")
$city .= $res[2] . " turned cloaking ##highlight##on##end##.\n";
else if ($res[1] == "off")
$city .= $res[2] . " turned cloaking ##highlight##off##end##.\n";
else if ($res[1] == "hq")
$city .= $res[2] . " destroyed the ##highlight##HQ##end##.\n";
else if ($res[1] == "house")
$city .= $res[2] . " destroyed a ##highlight##building##end##.\n";

$city .= "\n";
}

$result = $this -> bot -> db -> select("SELECT time, action FROM #___org_city WHERE action = 'on' OR action = 'off' ORDER BY time DESC LIMIT 0, 1");

$avilmin = date("i",3600-(time()-$result[0][0]));
$avilsec = date("s",3600-(time()-$result[0][0]));

if ($result[0][1] == "on")
{
$status = "enable";
$status2 = "disable";
}
else
{
$status = "disable";
$status2 = "enable";
}

if($result[0][0] > (time() - 3600))
$ttchange = true;
else
$ttchange = false;

$state = "The cloaking device is ##highlight##" . $status . "d##end##.";
$state .= $ttchange ? "" : " It is now possible to ##highlight##" . $status2 . "##end## it. ";
$state .= $ttchange ? " It will be possible to ##highlight##" . $status2 . "##end## it in ##highlight##" . $avilmin . "##end## minutes and ##highlight##" . $avilsec . "##end## seconds. " : "";
return $state . $this -> bot -> make_blob("City History", $city);
}
}


/*
This gets called on a msg in the group
*/
function gmsg($name, $group, $msg)
{
if ($name == "0")
{
$action = "none";
$player = "";
if (preg_match("/Your radar station is picking up alien activity in the area surrounding your city./i", $msg))
{
if ($this -> bot -> settings -> get('Cityinfo', 'Spamgc'))
$this -> bot -> send_gc("Alien attack incoming! Beware!");
}
else if (preg_match("/Your city in (.+) has been targeted by hostile forces./i", $msg, $info))
{
$action = "attack";
$zone = $info[1];

if ($this -> bot -> settings -> get('Cityinfo', 'Spamgc'))
$this -> bot -> send_gc("Our city in ".$zone." is about to be under attack! 0MGZ RUN!!!!");
}
else if (preg_match("/(.+) turned the cloaking device in your city off./i", $msg, $info))
{
$this -> type = "off";
$this -> time = time() + (60 * 60);
$this -> bot -> cron["2sec"]["alien"] = &$this -> bot -> commands["tell"]["city"];

$action = "off";
$player = $info[1];

if ($this -> bot -> settings -> get('Cityinfo', 'Spamgc'))
$this -> bot -> send_gc("##highlight##" . $player . "##end## turned the cloaking device in our city ##highlight##off##end##!");
}
else if (preg_match("/(.+) turned the cloaking device in your city on./i", $msg, $info))
{
$this -> type = "on";
$this -> time = time() + (60 * 60);
$this -> bot -> cron["2sec"]["alien"] = &$this -> bot -> commands["tell"]["city"];

$action = "on";
$player = $info[1];

if ($this -> bot -> settings -> get('Cityinfo', 'Spamgc'))
$this -> bot -> send_gc("##highlight##" . $player . "##end## turned the cloaking device in our city back ##highlight##on##end##!");
}
else if (preg_match("/(.+) initiated removal of the organization headquarters in (.+)/i", $msg, $info))
{
$action = "HQ";
$player = $info[1];
$zone = $info[2];

if ($this -> bot -> settings -> get('Cityinfo', 'Spamgc'))
$this -> bot -> send_gc("##highlight##" . $player . "##end## is removeing our HQ in ##highlight##".$zone."##end##! Our city... will.. *sobs* ...be destroyed!! *starts crying*");
}
else if (preg_match("/(.+) removed the organization headquarters in (.+)/i", $msg, $info))
{
$action = "HQ removed";
$player = $info[1];
$zone = $info[2];

if ($this -> bot -> settings -> get('Cityinfo', 'Spamgc'))
$this -> bot -> send_gc("##highlight##" . $player . "##end## has removed our HQ in ##highlight##".$zone."##end##! We are now homeless street urchin people!! *crys even harder*");
}
else if (preg_match("/(.+)