BeBot - An Anarchy Online and Age Of Conan chat automaton

Archive => Age of Conan Archive => BeBot Hyborian modules => Topic started by: kardsen on July 11, 2008, 05:41:19 am

Title: KOS Module w/ Guild KOS
Post by: kardsen on July 11, 2008, 05:41:19 am
"Borrowed" from Noers 4.x updated Kos module"

Commands
!kos     (Displays both the KOS guilds and Players.. Guilds on top.  In alpha order)
!kos padd <player> <reason>    (adds player to KOS list.  Note Reason is optional)
!kos gadd <guild> :<reason>    (adds guild to KOS list. Note : is needed between reason and name)
!kos pdel <player>    (deletes player from KOS list)
!kos gdel <guild>    (deletes guild from KOS list)

=============================================
Rev 1.   kos.php and gkos.php  w/ 2 seperate Databases
Rev 2.   kos.php and gkos.php combined.   New database created.
Rev 2a.   Fixed error in code.  :  is now required between guild name and reason.
Rev 2b.   Fixed !help command error.
When incorrect syntax used, bot said to use !help gkos for command list.  Should be  !help kos.
Included, modified Whois.php file to display if user is on kos list when doing a !whois lookup
Removed the drop table statements.  Should no longer be needed.
Rev 2c.  Updated whois.php file for R46-48 of bebot Hyborian.

Also, each command has it's own permissions.  See /tell BOTNAME !commands subs kos.


TO INSTALL
Without Whois Mod
Download  kos.phps  rename to kos.php  install to ./custom/modules/

With Whois Mod - Verified working with bebot version r24 through r26
Download  kos.phps  rename to kos.php  install to ./custom/modules/
Download  whois.phps  rename to whois.php  overwrite existing file in ./modules/

Title: Re: KOS Module w/ Guild KOS
Post by: CheRny on July 12, 2008, 12:26:20 pm
Well, I like kos module as you could add a guild as well, but comparing to blacklist is has some limitation as blacklist in integrated with whois and notes modules. For ex. if you do !whois and if there is a name in blacklist, whois function will show you warning: Warning! Blacklisted!, which is very good as well as you could see a reason for blacklisting. It'll be great if you could add similar function to your kos module. I know you will need to make some changes in other modules. For ex. in whois.php:

- 174:            $blname = $this -> bot -> db -> select("SELECT name FROM #___blacklist WHERE name = '". $name . "'");
+ 174:             $blname = $this -> bot -> db -> select("SELECT * FROM koslist WHERE player = '$name' AND type = 'playerkos'");

This way whois will show a warning is a player is in kos list.
Title: Re: KOS Module w/ Guild KOS
Post by: kardsen on July 12, 2008, 11:25:58 pm
Cheny,

I'll look into this once I finish up fixing my supplies module.
Though I tend to shy away from messing with original coding.
Title: Re: KOS Module w/ Guild KOS
Post by: kardsen on July 14, 2008, 09:52:13 pm
Cheny,

Had to change a couple things in whois.php

Should have your requested effect now.
please download new  kos.php and  whois.php and put in respective folders.
Title: Re: KOS Module w/ Guild KOS
Post by: CheRny on July 15, 2008, 07:41:09 am
kardsen,

thanks a lot for it, for a few hours works great.
Title: Re: KOS Module w/ Guild KOS
Post by: kardsen on July 15, 2008, 09:34:34 pm
updated the whois.php module.


Also,  included comments where I added code.. incase another mod needs to edit it.. you know where my changes are at :)

Look for
//// START KARDSEN MODIFICATION  PRT 1 FOR   KOSLIST  and WHOIS info display//////////////////


and

//// START KARDSEN MODIFICATION  PRT 2 FOR   KOSLIST  and WHOIS info display//////////////////

enjoy
Title: Re: KOS Module w/ Guild KOS
Post by: URFUBAR on July 15, 2008, 09:51:09 pm
Hi there, followed the instructions (I'm using the svn version of the bot) and I although I can see the kos module listed when i do a "/tell botuser !modules" , none of the kos commands are available when I try and use them.

any ideas?
Title: Re: KOS Module w/ Guild KOS
Post by: kardsen on July 15, 2008, 09:55:05 pm
are you the "owner" of the bot.  or a admin?

The bot has permission controls built into it


if you do a !whois on yourself
Look at the  Bot access:
it should read  Owner  or  Leader  or Admin

If you are lower than that.  All commands except adding a player to the KOS list will not work


Also,  can you give me a copy of the bot log when you try to use
!kos padd PLAYER REASON
or
!kos gadd GUILD : REASON  ?
and  just
!kos

Thanks
Title: Re: KOS Module w/ Guild KOS
Post by: URFUBAR on July 15, 2008, 10:07:01 pm
Bot Access: Owner

Guild [TELL]    [INC]   Naho: !kos padd PLAYER REASON
Guild [TELL]    [OUT]   -> Naho: /tell Guild !help

same for the other commands


and kos.php is listed when you do a "/tell guild !modules" (under Custom).
Title: Re: KOS Module w/ Guild KOS
Post by: URFUBAR on July 15, 2008, 10:21:38 pm
Sorry, just looked at the module code and its all my fault... did a wget to get kos.phps and instead of receiving the file got the HTTP redirect page...
Title: Re: KOS Module w/ Guild KOS
Post by: kardsen on July 15, 2008, 10:33:46 pm
1. shutdown bot
2. go into your  /conf/   folder
2a. delete file named   BOTNAME.Modules
3. go into your /custom/modules/   folder 
3a. delete old kos.php file and redownload my lastest one at the top of this post and install it to /custom/modules/
4. reload bot.
5. See if kos appears in the module list.
6. I believe the bot isn't picking up the kos module.   As my Kos module would not output /tell guild !help
it would output /tell guild Learn how to use the command. See !help kos



* Saw your post after typing above.
The  !modules list  is actually a Cache of the modules the bot has seen.  So it may be listing old modules you no longer have.

better command to use is  /tell BOT !commands kos all
to see if it list's it there..  or just do  /tell BOT !commands all
Title: Re: KOS Module w/ Guild KOS
Post by: CheRny on July 26, 2008, 02:34:45 pm
There is a security problem in this module. Anyone could add/delete any player/guild to kos list and so on.

Seems like you should add something like:

Code: [Select]
function add_pkos($name, $player, $reason)
{
if ($this -> bot -> core("security") -> check_access($source, "LEADER"))
{
$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 koslist WHERE player = '$player' AND type = 'playerkos'");
if (!empty($result))
{
return ucfirst($player) . " is already on Kill on Sight.";
}
$reason = trim($reason);
$this -> bot -> db -> query("INSERT INTO koslist (player, addedby, reason, type) VALUES ('$player', '$name', '$reason', 'playerkos')");
$this -> load_pkos();
return ucfirst($player) . " was added to Kill on Sight.";
}
else
{
return "Your access level must be LEADER or higher to do this.";
}
}

In this case only LEADER and higher could add/del players in kos list. I attached a fixed version. Please, check as I dont spent to much time searching the code. Thanks a lot.
Title: Re: KOS Module w/ Guild KOS
Post by: Alreadythere on July 26, 2008, 06:01:44 pm
You could simply use the subcommand support for access control and use that for the checks. The module is creating entries for the padd/gadd and pdel/gdel subcommands, simply change those to ADMIN to have the same effect.
Title: Re: KOS Module w/ Guild KOS
Post by: kardsen on July 28, 2008, 02:37:44 pm
I'm pretty sure that the commands had access controls built onto them, that is configurable in game.

I will look over the code once at work and verify.
Title: Re: KOS Module w/ Guild KOS
Post by: kardsen on July 28, 2008, 03:56:49 pm
Confirmed.  My code is correct, and it does include command permissions


if you look at line 16 of my code, you will see that they have all been set to MEMBER.  You can change this ingame, or in the file... 

If you want to change it via the file, just change MEMBER to LEADER or OFFICER ADMIN   ect

      $this -> register_command("all", "kos", "MEMBER", array('padd' => 'MEMBER', 'gadd' => 'MEMBER', 'pdel' => 'MEMBER', 'gdel' => 'MEMBER'));


Or, you can do what I originally stated in my first post
Also, each command has it's own permissions.  See /tell BOTNAME !commands subs kos.
Title: Re: KOS Module w/ Guild KOS
Post by: CheRny on July 28, 2008, 07:43:20 pm
kardsen, you are right, everything is fine with the code. it was my mistake (seems like I was too lazy to read your first post  ::)) /tell BOTNAME !commands subs kos works great :) sorry about my post.
Title: Re: KOS Module w/ Guild KOS
Post by: kardsen on July 29, 2008, 04:05:54 pm
Good to hear :)

I guess I could have set the default permissions higher.. but ehh, im lazy :)
Title: Re: KOS Module w/ Guild KOS
Post by: Sigi_cz on July 30, 2008, 01:15:06 pm
PROBLEM: cant add names with dot
eg.: !kos gadd T.E.S.T : because
Title: Re: KOS Module w/ Guild KOS
Post by: kardsen on July 31, 2008, 05:39:07 am
Try this file

Title: Re: KOS Module w/ Guild KOS
Post by: Sigi_cz on August 01, 2008, 01:53:30 pm
Try this file
still not working
Title: Re: KOS Module w/ Guild KOS
Post by: kardsen on August 01, 2008, 02:31:00 pm
I'll look into it today, while at work.
Title: Re: KOS Module w/ Guild KOS
Post by: Theoris on August 07, 2008, 09:55:00 pm
Hey kardsen.

I'm having the same issue URFUBAR had, but I don't seem to be able to solve it in the same manner. I downloaded your newest files as of today, put the files where they should go and renamed them. Restarted the bot - wouldn't work.
It shows in !modules under 'custom', but that's about it. I have owner access, and when I try to do the command all I get is the bots default '/tell botname !help'.

Tried the deleting BOTNAME.Modules-procedure, no luck. Any ideas?

PS: I'm having the same problem with the chuck.php, cannot call the command in anyway (just get the standard !help-reply).

Thanks.
Title: Re: KOS Module w/ Guild KOS
Post by: kardsen on August 10, 2008, 04:58:55 pm
Watch the bot when it boots up, and pay attention to the section about it loading customer modules.  make sure you see it loading the kos.php


Honestly I haven't updated bebot in a while as I haven't had a reason.
I'll play around with the newest version on monday while at work and see what I come up with.
Title: Re: KOS Module w/ Guild KOS
Post by: saik0 on August 12, 2008, 06:43:09 am
Code: [Select]
$result = $this -> bot -> db -> select("SELECT * FROM koslist WHERE type = 'guildkos' ORDER BY player ASC");
if (!empty($result))
{
$b = array();
foreach ($result AS $row)
{
$b[] = array('guild' => $row[1], 'addedby' => $row[2], 'reason' => $row[3], 'type' => $row[4]);
}
$this -> gkos_list = $b;
}

You could clean this up by just using an associative array.

Code: [Select]
$result = $this -> bot -> db -> select("SELECT * FROM koslist WHERE type = 'guildkos' ORDER BY player ASC", MYSQL_ASSOC);
Title: Re: KOS Module w/ Guild KOS
Post by: SoulBr on August 17, 2008, 04:16:30 pm
This plugin dont working.  ??? . No answer -----> !kos .  WTF?(!modules - he listed(plugin))
Title: Re: KOS Module w/ Guild KOS
Post by: SoulBr on August 19, 2008, 05:49:27 pm
This plugin dont working.  ??? . No answer -----> !kos .  WTF?(!modules - he listed(plugin))
Working fine. Just reinstall bot  :D
Title: Re: KOS Module w/ Guild KOS
Post by: Cayron on January 02, 2009, 12:11:53 pm
I cannot add guilds with multi-word names. I mean "!kos gadd The Guild:Good reason" does not work for me. Do I need any fix or update of kos.php file?
Title: Re: KOS Module w/ Guild KOS
Post by: catolh on January 17, 2009, 12:55:37 pm
The module seems to be loading info from the database on bot startup, and not on command execution. Is there any way to get the module to read from db when the !kos command is called?

As it is now i have to restart the bot after i add a guild to kos.
Title: Re: KOS Module w/ Guild KOS
Post by: keirou on March 05, 2009, 04:50:37 am
i got this working (finally)
any chance of getting it to automatically check if KoS player are online when you call the list?
Also, am having issues adding guilds to the list, with or without a space, with or without a reason
Title: Re: KOS Module w/ Guild KOS
Post by: dillinger on December 20, 2009, 03:20:46 am
This module works fine, but when I want to add a guild to the KOS list (!kos gadd SampleGuild) I will get the message: Learn how to use the command. See !help kos.

I am SUPERADMIN and the permissions are allready set with !commands subs kos

Any idea whats going on here?

dill
Title: Re: KOS Module w/ Guild KOS
Post by: Getrix on December 20, 2009, 12:32:53 pm
Do as it the message say, learn how to use the command :P

Quote
kos gadd <guildname> : <reason> - Add Guild to Kill on Sight list with reason.  You need to add the : between the guild name and reason.  This is due to spacing in the guild names and the only workaround I know.
Title: Re: KOS Module w/ Guild KOS
Post by: Space on April 08, 2010, 02:15:26 pm
1st of all thank you for all the time you spend on this ...

I installed everything as said in previous post, and i can see the KOS.php load without errors.
i also used the !commands subs kos, which works also , i can change buy presing the ABRIVIATIONS A, L,M etz...

BUT still get YOUR ACCES LVL HAS TO BE...

I am the owner, no matter what i chooses in the commands subs kos...
Member, Admin, Superadmin, OWNER...

I get always when trying to add YOUR ACCES LVL MUST BE.....

Anybody any clue what iam doing wrong!

Title: Re: KOS Module w/ Guild KOS
Post by: freakyfreak on June 04, 2010, 10:04:42 am
Hi Guys,

This is my first Try to mod something.
All works fine except the Kos List.
It only shows the Friendly Guilds and Members.

Here is the Code.
Code: [Select]
<?

$kos = new Kos($bot);

class Kos Extends BaseActiveModule
{
var $bot;
var $pkos_list;
var $gkos_list;


function __construct (&$bot)
{
parent::__construct(&$bot, get_class($this));

$this -> register_command("all", "kos", "MEMBER", array('padd' => 'MEMBER', 'gadd' => 'MEMBER', 'pdel' => 'MEMBER', 'gdel' => 'MEMBER'));

$this -> help['description'] = 'Kill On Sight/n created by Kardsen US-Bane';
$this -> help['command']['kos'] = "- Display Kill on Sight list.";
$this -> help['command']['kos padd <playername> <reason>'] = "- Add name to Kill on Sight list with reason.";
$this -> help['command']['kos gadd <guildname> : <reason>'] = "- Add Guild to Kill on Sight list with reason.  You need to add the : between the guild name and reason.  This is due to spacing in the guild names and the only workaround I know.";
$this -> help['command']['kos fpadd <playername> <reason>'] = "- Add name to Guild Friend List with reason.";
$this -> help['command']['kos fgadd <guildname> : <reason>'] = "- Add Guild to Guild Friend List with reason.  You need to add the : between the guild name and reason.  This is due to spacing in the guild names and the only workaround I know.";
$this -> help['command']['kos pdel name'] = "- Remove Player from Kill on Sight list.";
$this -> help['command']['kos gdel guild'] = "- Remove Guild from Kill on Sight list.";
$this -> help['command']['kos fpdel name'] = "- Remove Player from Guild Friend List.";
$this -> help['command']['kos fgdel guild'] = "- Remove Guild from Guild Friend List.";

$this -> bot -> db -> query("CREATE TABLE IF NOT EXISTS `koslist` (
`id` INT( 10 ) NOT NULL AUTO_INCREMENT ,
`player` VARCHAR( 100 ) NOT NULL ,
`addedby` VARCHAR( 100 ) NOT NULL ,
`reason` VARCHAR( 255 ) NULL ,
`type` VARCHAR ( 100 ) NOT NULL,
PRIMARY KEY ( `id` )
);"
);
$this -> load_pkos();
$this -> load_gkos();
$this -> load_fpkos();
$this -> load_fgkos();

}

function command_handler($name, $msg, $origin)
{
if (preg_match("/^kos$/i", $msg))
                        return $this -> show_kos();
                else if (preg_match("/^kos pdel (.*)$/i", $msg, $info))
                        return $this -> delete_pkos($info[1]);
else if (preg_match("/^kos gdel (.*)$/i", $msg, $info))
                        return $this -> delete_gkos($info[1]);
                else if (preg_match("/^kos fpdel (.*)$/i", $msg, $info))
                        return $this -> delete_fpkos($info[1]);
else if (preg_match("/^kos fgdel (.*)$/i", $msg, $info))
                        return $this -> delete_fgkos($info[1]);
                else if (preg_match("/^kos padd (([0-9]|[a-z]|[A-Z])+)(.*)$/i", $msg, $info))
                        return $this -> add_pkos($name, $info[1], $info[3]);
                else if (preg_match("/^kos gadd (([0-9]|[a-z]|[A-Z]| )+):(.*)$/i", $msg, $info))
                        return $this -> add_gkos($name, $info[1], $info[3]);
                else if (preg_match("/^kos fpadd (([0-9]|[a-z]|[A-Z])+)(.*)$/i", $msg, $info))
                        return $this -> add_fpkos($name, $info[1], $info[3]);
                else if (preg_match("/^kos fgadd (([0-9]|[a-z]|[A-Z]| )+):(.*)$/i", $msg, $info))
                        return $this -> add_fgkos($name, $info[1], $info[3]);
else    return "Learn how to use the command. See !help kos";

}

function show_kos()
{
if (empty($this -> pkos_list))
{
if (empty($this -> gkos_list))
{
return "KoS is empty.";
}
}



$blob = "<font color='SILVER' face='hyborianlarge'>:: Kill on Sight Guilds ::</font>\n";
foreach ($this -> gkos_list AS $gkos)
{
$guild = ucfirst($gkos['guild']);
empty($gkos['reason']) ? $reason = "none" : $reason = $gkos['reason'];
$blob .= "\n<font color='#FF0000'>$guild</font>   (reason $reason)\n";

}

$blob .= "\n\n<font color='SILVER' face='hyborianlarge'>:: Kill on Sight Players ::</font>\n";
foreach ($this -> pkos_list AS $pkos)
{
$player = ucfirst($pkos['player']);
$whois = "<a href='chatcmd:///tell <botname> !whois $player'>whois</a>";
$online = "<a href='chatcmd:///tell <botname> !is $player'>online?</a>";
$blob .= "\n<font color='#FF0000'>$player</font>    ($whois)  ($online)";
empty($pkos['reason']) ? $reason = "none" : $reason = $pkos['reason'];
$blob .= "\n    --(reason: $reason)\n";
}

$blob = "\n\n\n<font color='SILVER' face='hyborianlarge'>:: Friendly Guilds ::</font>\n";
foreach ($this -> fgkos_list AS $fgkos)
{
$guild = ucfirst($fgkos['fguild']);
empty($fgkos['reason']) ? $reason = "none" : $reason = $fgkos['reason'];
$blob .= "\n<font color='#FF0000'>$guild</font>   (reason $reason)\n";

}

$blob .= "\n\n\n\n<font color='SILVER' face='hyborianlarge'>:: Friendly Players ::</font>\n";
foreach ($this -> fpkos_list AS $fpkos)
{
$player = ucfirst($pkos['fplayer']);
$whois = "<a href='chatcmd:///tell <botname> !whois $player'>whois</a>";
$online = "<a href='chatcmd:///tell <botname> !is $player'>online?</a>";
$blob .= "\n<font color='#FF0000'>$player</font>    ($whois)  ($online)";
empty($fpkos['reason']) ? $reason = "none" : $reason = $fpkos['reason'];
$blob .= "\n    --(reason: $reason)\n";
}

return "Kill on Sight :: " . $this -> bot -> core("tools") -> make_blob("click to view", $blob);
}

function add_pkos($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 koslist WHERE player = '$player' AND type = 'playerkos'");
if (!empty($result))
{
return ucfirst($player) . " is already on Kill on Sight.";
}
$reason = trim($reason);
$this -> bot -> db -> query("INSERT INTO koslist (player, addedby, reason, type) VALUES ('$player', '$name', '$reason', 'playerkos')");
$this -> load_pkos();
return ucfirst($player) . " was added to Kill on Sight.";
}

function add_gkos($name, $guild, $reason)
{
$guild = strtolower($guild);
$result = $this -> bot -> db -> select("SELECT * FROM koslist WHERE player = '$guild' AND type = 'guildkos'");
if (!empty($result))
{
return ucfirst($guild) . " is already on Guild Kill list.";
}
$reason = trim($reason);
$this -> bot -> db -> query("INSERT INTO koslist (player, addedby, reason, type) VALUES ('$guild', '$name', '$reason', 'guildkos')");
$this -> load_gkos();
return ucfirst($guild) . " was added to Kill on Sight.";
}

function add_fpkos($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 koslist WHERE player = '$player' AND type = 'fplayerkos'");
if (!empty($result))
{
return ucfirst($player) . " is already on Kill on Sight.";
}
$reason = trim($reason);
$this -> bot -> db -> query("INSERT INTO koslist (player, addedby, reason, type) VALUES ('$player', '$name', '$reason', 'fplayerkos')");
$this -> load_fpkos();
return ucfirst($player) . " was added to Kill on Sight.";
}

function add_fgkos($name, $guild, $reason)
{
$guild = strtolower($guild);
$result = $this -> bot -> db -> select("SELECT * FROM koslist WHERE player = '$guild' AND type = 'fguildkos'");
if (!empty($result))
{
return ucfirst($guild) . " is already on Guild Kill list.";
}
$reason = trim($reason);
$this -> bot -> db -> query("INSERT INTO koslist (player, addedby, reason, type) VALUES ('$guild', '$name', '$reason', 'fguildkos')");
$this -> load_fgkos();
return ucfirst($guild) . " was added to Kill on Sight.";
}

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

function delete_gkos($guild)
{
$guild = strtolower($guild);
$result = $this -> bot -> db -> select("SELECT * FROM koslist WHERE player = '$guild' AND type = 'guildkos'");
if (empty($result))
{
return ucfirst($guild) . " is not on Kill on Sight.";
}
$this -> bot -> db -> query("DELETE FROM koslist WHERE player = '$guild' AND type = 'guildkos'");
$this -> load_gkos();
return ucfirst($guild) . " was removed from Kill on Sight.";
}

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

function delete_fgkos($guild)
{
$guild = strtolower($guild);
$result = $this -> bot -> db -> select("SELECT * FROM koslist WHERE player = '$guild' AND type = 'fguildkos'");
if (empty($result))
{
return ucfirst($guild) . " is not on Kill on Sight.";
}
$this -> bot -> db -> query("DELETE FROM koslist WHERE player = '$guild' AND type = 'fguildkos'");
$this -> load_fgkos();
return ucfirst($guild) . " was removed from Kill on Sight.";
}
function load_pkos()
{
$result = $this -> bot -> db -> select("SELECT * FROM koslist WHERE type = 'playerkos' ORDER BY player ASC");
if (!empty($result))
{
$a = array();
foreach ($result AS $row)
{
$a[] = array('player' => $row[1], 'addedby' => $row[2], 'reason' => $row[3], 'type' => $row[4]);
}
$this -> pkos_list = $a;
}
else
{
$this -> pkos_list = array();
}
}

function load_gkos()
{
$result = $this -> bot -> db -> select("SELECT * FROM koslist WHERE type = 'guildkos' ORDER BY player ASC");
if (!empty($result))
{
$b = array();
foreach ($result AS $row)
{
$b[] = array('guild' => $row[1], 'addedby' => $row[2], 'reason' => $row[3], 'type' => $row[4]);
}
$this -> gkos_list = $b;
}
else
{
$this -> gkos_list = array();
}
}

function load_fpkos()
{
$result = $this -> bot -> db -> select("SELECT * FROM koslist WHERE type = 'fplayerkos' ORDER BY player ASC");
if (!empty($result))
{
$a = array();
foreach ($result AS $row)
{
$a[] = array('player' => $row[1], 'addedby' => $row[2], 'reason' => $row[3], 'type' => $row[4]);
}
$this -> fpkos_list = $a;
}
else
{
$this -> fpkos_list = array();
}
}

function load_fgkos()
{
$result = $this -> bot -> db -> select("SELECT * FROM koslist WHERE type = 'fguildkos' ORDER BY player ASC");
if (!empty($result))
{
$b = array();
foreach ($result AS $row)
{
$b[] = array('guild' => $row[1], 'addedby' => $row[2], 'reason' => $row[3], 'type' => $row[4]);
}
$this -> fgkos_list = $b;
}
else
{
$this -> fgkos_list = array();
}
}
}
?>

maybe someone can help me.

And there is a little bug in the Whois file.
with the #___ u set it the Botname.koslist, but in the header u set the DB only to koslist.

Old part
Code: [Select]
$blname = $this -> bot -> db -> select("SELECT player FROM #___koslist WHERE player = '". $name . "'");
New part
Code: [Select]
$blname = $this -> bot -> db -> select("SELECT player FROM koslist WHERE player = '". $name . "'");
Title: Re: KOS Module w/ Guild KOS
Post by: freakyfreak on August 10, 2010, 06:49:52 pm
Push :D
SimplePortal 2.3.7 © 2008-2024, SimplePortal