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?
November 21, 2008, 08:24:56 PM

Login with username, password and session length
Search



Advanced search
Support GoPHP5.org
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Modules > Modules for older versions > 0.2.x Custom/Unofficial Modules > Topic: Kill on Sight
Pages: [1]   Go Down
« previous next »
Print
Author Topic: Kill on Sight  (Read 724 times)
0 Members and 1 Guest are viewing this topic.
Wanuarmi
BeBot Contributor
Apprentice
*******
Offline Offline

Posts: 121


Kill on Sight
« on: December 14, 2005, 12:54:57 AM »

This lets you keep a KoS list

!kos
!kos <player> (<reason>)
!kos del <player>


modules/Kos.php

Code:
<?
$kos = new Kos($bot);

$db -> query("CREATE TABLE IF NOT EXISTS `kos` (
`id` INT( 10 ) NOT NULL AUTO_INCREMENT ,
`player` VARCHAR( 100 ) NOT NULL ,
`addedby` VARCHAR( 100 ) NOT NULL ,
`reason` VARCHAR( 255 ) NULL ,
PRIMARY KEY ( `id` )
);");

$commands["tell"]["kos"] = &$kos;
$commands["pgmsg"]["kos"] = &$kos;
$commands["gc"]["kos"] = &$kos;


class Kos
{
var $bot;
var $kos_list;


function Kos (&$bot)
{
$this -> bot = &$bot;
$this -> load_kos();
}

function tell($name, $msg)
{
$this -> bot -> send_tell($name, $this -> process_command($name, $msg));
}

function pgmsg($name, $msg)
{
$this -> bot -> send_pgroup($this -> process_command($name, $msg));
}

function gc($name, $msg)
{
$this -> bot -> send_gc($this -> process_command($name, $msg));
}

function process_command($name, $msg)
{
if (preg_match("/^" . $this -> bot -> commpre . "kos$/i", $msg))
return $this -> show_kos();
if ($this -> bot -> admin -> in_group($name, "admin") || $this -> bot -> admin -> in_group($name, "superadmin"))
{
if (preg_match("/^" . $this -> bot -> commpre . "kos del (.*)$/i", $msg, $info))
return $this -> delete_kos($info[1]);
else if (preg_match("/^" . $this -> bot -> commpre . "kos (([0-9]|[a-z]|[A-Z])+)(.*)$/i", $msg, $info))
return $this -> add_kos($name, $info[1], $info[3]);
}
else
{
return "/tell <botname> <pre>help";
}
}

function show_kos()
{
if (empty($this -> kos_list))
{
return "KoS is empty.";
}
$blob = "<font color=CCInfoHeader>::::: Kill on Sight :::::\n";
foreach ($this -> kos_list AS $kos)
{
$player = ucfirst($kos['player']);
$whois = "<a href='chatcmd:///tell helpbot whois $player'>whois</a>";
$online = "<a href='chatcmd:///tell <botname> !is $player'>online?</a>";
$blob .= "\n$player    ($whois)  ($online)";
empty($kos['reason']) ? $reason = "none" : $reason = $kos['reason'];
$blob .= "\n    (reason: $reason)\n";
}
return "Kill on Sight :: " . $this -> bot -> make_blob("click to view", $blob);
}

function add_kos($name, $player, $reason)
{
$player = strtolower($player);
$id = $this -> bot -> aoc -> get_uid($player);
if (empty($id))
{
return "Player " . ucfirst($player) . " does not exist.";
}
$result = $this -> bot -> db -> select("SELECT * FROM kos WHERE player = '$player'");
if (!empty($result))
{
return ucfirst($player) . " is already on Kill on Sight.";
}
$reason = trim($reason);
$this -> bot -> db -> query("INSERT INTO kos (player, addedby, reason) VALUES ('$player', '$name', '$reason')");
$this -> load_kos();
return ucfirst($player) . " was added to Kill on Sight.";
}

function delete_kos($player)
{
$player = strtolower($player);
$result = $this -> bot -> db -> select("SELECT * FROM kos WHERE player = '$player'");
if (empty($result))
{
return ucfirst($player) . " is not on Kill on Sight.";
}
$this -> bot -> db -> query("DELETE FROM kos WHERE player = '$player'");
$this -> load_kos();
return ucfirst($player) . " was removed from Kill on Sight.";
}

function load_kos()
{
$result = $this -> bot -> db -> select("SELECT * FROM kos");
if (!empty($result))
{
$a = array();
foreach ($result AS $row)
{
$a[] = array('player' => $row[1], 'addedby' => $row[2], 'reason' => $row[3]);
}
$this -> kos_list = $a;
}
else
{
$this -> kos_list = array();
}
}
}
?>


help/kos.txt

Code:
<font color=CCInfoHeader><pre>kos</font>
<font color=CCInfoText>Shows the "Kill on Sight" list.

<font color=CCInfoHeader><pre>kos &lt;player&gt; (&lt;reason&gt;)</font>
Adds someone to KoS, reason is optional.

<font color=CCInfoHeader><pre>kos del &lt;player&gt;</font>
Removes someone from KoS.</font>
« Last Edit: December 14, 2005, 01:08:41 AM by Wanuarmi » Logged
Zweiblum
Rookie
**
Offline Offline

Posts: 58


Re: Kill on Sight
« Reply #1 on: July 27, 2008, 10:39:36 AM »

anychance to get that baby on bebot 0.5.2 ?
cant find anything with search
Logged
Alreadythere
BeBot Maintainer
Administrator
Grandmaster
********
Offline Offline

Posts: 1077


Re: Kill on Sight
« Reply #2 on: July 27, 2008, 11:57:10 AM »

Try out the AoC KOS module, might work - there aren't that many structural changes between the versions.

http://bebot.shadow-realm.org/aoc-modules/kos-module-w-guild-kos/
Logged
Pages: [1]   Go Up
Print
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Modules > Modules for older versions > 0.2.x Custom/Unofficial Modules > Topic: Kill on Sight
« previous next »
 
Jump to:  

Recent
Change text in remember "...
by gerborg
[Today at 05:14:57 PM]

Log playtime from buddys ...
by Temar
[November 20, 2008, 10:33:57 AM]

Vote Core module and Simp...
by Temar
[November 19, 2008, 09:26:52 AM]

Restrict access for one m...
by Organizer
[November 19, 2008, 03:21:19 AM]

Custom / Revised Modules ...
by Elesar1
[November 17, 2008, 03:51:46 PM]

TWC
by Temar
[November 16, 2008, 11:39:12 AM]

Are there any FUN modules...
by Elesar1
[November 15, 2008, 07:39:15 PM]

Call to a member function...
by exxie
[November 15, 2008, 09:29:31 AM]

Ported Modules
by Alreadythere
[November 14, 2008, 06:10:07 PM]

cURL and other non-defaul...
by Temar
[November 14, 2008, 04:11:44 PM]
Stats
Members
Total Members: 1235
Latest: DDDepressionnn
Stats
Total Posts: 11037
Total Topics: 1496
Online Today: 16
Online Ever: 168
(July 01, 2007, 09:30:02 PM)
Users Online
Users: 1
Guests: 9
Total: 10
upstart

Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC
TinyPortal v0.9.8 © Bloc | NewDef design by Bloc
Page created in 0.306 seconds with 29 queries. (Pretty URLs adds 0.033s, 4q)
Loading...