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: City Cloak Issue  (Read 15482 times)

0 Members and 1 Guest are viewing this topic.

Offline wsbsteven

  • BeBot Rookie
  • *
  • Posts: 3
  • Karma: +0/-0
City Cloak Issue
« on: July 18, 2007, 05:02:25 pm »
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.

Offline Temar

  • Contributor
  • *******
  • Posts: 1140
  • Karma: +0/-0
    • AoFiles
Re: City Cloak Issue
« Reply #1 on: July 18, 2007, 06:41:54 pm »
im sure they can easily fix it
my guess is they will put a command to manualy enable cloak on bot

Offline Ebag333

  • Contributor
  • *******
  • Posts: 134
  • Karma: +0/-0
Re: City Cloak Issue
« Reply #2 on: July 19, 2007, 12:35:11 am »
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.

Offline wsbsteven

  • BeBot Rookie
  • *
  • Posts: 3
  • Karma: +0/-0
Re: City Cloak Issue
« Reply #3 on: July 19, 2007, 04:21:31 pm »
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.

Offline Ebag333

  • Contributor
  • *******
  • Posts: 134
  • Karma: +0/-0
Re: City Cloak Issue
« Reply #4 on: July 19, 2007, 04:46:37 pm »
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, 04:49:45 pm by Ebag333 »

Offline wsbsteven

  • BeBot Rookie
  • *
  • Posts: 3
  • Karma: +0/-0
Re: City Cloak Issue
« Reply #5 on: July 19, 2007, 06:23:00 pm »
parse error: syntax error, unexpected ';', expecting t_function in alienattack_guild.php on line 351

Offline Parfet

  • BeBot User
  • **
  • Posts: 33
  • Karma: +0/-0
Re: City Cloak Issue
« Reply #6 on: July 19, 2007, 07:18:57 pm »
got it working, great idea for random raids or missed messages, but it wasn't very complete :) this one works:

AlienAttack_GUILD.php
Code: [Select]
<?php
/*
* TowerAttack.php - Handle Alien attack events.
*
* BeBot - An Anarchy Online Chat Automaton
* Copyright (C) 2004 Jonas Jax
* Copyright (C) 2005 Thomas J. Stens� 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("/(.+) initiated removal of a (.+) in (.+)/i"$msg$info))
{
$action $info[2]." removal initiated";
$player $info[1];
$zone $info[3];

if ($this -> bot -> settings -> get('Cityinfo''Spamgc'))
$this -> bot -> send_gc("##highlight##" $player "##end## is removing a ".$info[2]." at our city in ##highlight##".$zone."##end##.");
}
else if (preg_match("/(.+) removed a (.+) in (.+)/i"$msg$info))
{
$action $info[2]." removed";
$player $info[1];
$zone $info[3];

if ($this -> bot -> settings -> get('Cityinfo''Spamgc'))
$this -> bot -> send_gc("##highlight##" $player "##end## removed a ".$info[2]." at our city in ##highlight##".$zone."##end##.");
}
else
{
$action "unknown";
$player $msg;

if ($this -> bot -> settings -> get('Cityinfo''Spamgc'))
$this -> bot -> send_gc("Something wierd is going on, and I don't know what it is!");
}
if ($action != "none")
{
$this -> bot -> db -> query("INSERT INTO #___org_city (time, action, player) VALUES
                                      (" 
time() . ", '" $action "', '" $player "')");
}
}
}


/*
This gets called if a buddy logs on/off
*/
function buddy($name$msg)
{
if ($this -> last_log["on"][$name] < (time() - 5))
if ($this -> bot -> settings -> get('Cityinfo''SpamMembers'))
$this -> bot -> send_tell($name$this -> city_blob($name$msg));
}



/*
cronjob
*/
function cron()
{
if (time() > $this -> time)
{
if ($this -> type == "on")
{
$this -> bot -> send_gc("Cloaking device has be enabled one hour ago. Alien attacks can now be initiated.");
unset($this -> bot -> cron["2sec"]["alien"]);
}
else if ($this -> type != "repeat")
{
$this -> bot -> send_gc("Cloaking device was disabled one hour ago. It is now possible to enable it again.");
$this -> time time() + (60 15);
$this -> type "repeat";
}
else
{
$this -> bot -> send_gc("Cloaking device is still disabled.");
$this -> time time() + (60 15);
}
}
}

/*
Makes the battle results
*/
function cloakset($name$msg)
{
if ($msg == "on")
{
$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##" $name "##end## manually set the cloaking device to ##highlight##on##end##!");
$this -> bot -> db -> query("INSERT INTO #___org_city (time, action, player) VALUES (" time() . ", '" $action "', '" $player "')");
}
return 'Cloak setting has been toggled.';
}
else if ($msg == "off")
{
$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##" $name "##end## manually set the cloaking device to ##highlight##off##end##!");
$this -> bot -> db -> query("INSERT INTO #___org_city (time, action, player) VALUES (" time() . ", '" $action "', '" $player "')");
}
return 'Cloak setting has been toggled.';
}

}
}
?>


Also added a feature to tell the cloak status to members on login, at the request of my org (can be toggled in the settings)
« Last Edit: July 20, 2007, 04:21:33 pm by Parfet »

Offline Ebag333

  • Contributor
  • *******
  • Posts: 134
  • Karma: +0/-0
Re: City Cloak Issue
« Reply #7 on: July 19, 2007, 10:41:01 pm »
You can reduce spam by going into the settings and changing Spamgc to false (under Cityinfo).

 

* 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: 190
  • 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