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?
December 02, 2008, 04:46:49 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 > BeBot Hyborian modules > Topic: KOS Module w/ Guild KOS
Pages: [1] 2   Go Down
« previous next »
Print
Author Topic: KOS Module w/ Guild KOS  (Read 2296 times)
0 Members and 1 Guest are viewing this topic.
kardsen
Apprentice
***
Offline Offline

Posts: 81


KOS Module w/ Guild KOS
« on: July 10, 2008, 10:41:19 PM »

"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/

« Last Edit: July 15, 2008, 02:35:13 PM by kardsen » Logged
CheRny
Freshman
*
Offline Offline

Posts: 15


Re: KOS Module w/ Guild KOS
« Reply #1 on: July 12, 2008, 05:26:20 AM »

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.
Logged
kardsen
Apprentice
***
Offline Offline

Posts: 81


Re: KOS Module w/ Guild KOS
« Reply #2 on: July 12, 2008, 04: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.
Logged
kardsen
Apprentice
***
Offline Offline

Posts: 81


Re: KOS Module w/ Guild KOS
« Reply #3 on: July 14, 2008, 02: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.
Logged
CheRny
Freshman
*
Offline Offline

Posts: 15


Re: KOS Module w/ Guild KOS
« Reply #4 on: July 15, 2008, 12:41:09 AM »

kardsen,

thanks a lot for it, for a few hours works great.
Logged
kardsen
Apprentice
***
Offline Offline

Posts: 81


Re: KOS Module w/ Guild KOS
« Reply #5 on: July 15, 2008, 02: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 Smiley

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
Logged
URFUBAR
Freshman
*
Offline Offline

Posts: 9


Re: KOS Module w/ Guild KOS
« Reply #6 on: July 15, 2008, 02: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?
Logged
kardsen
Apprentice
***
Offline Offline

Posts: 81


Re: KOS Module w/ Guild KOS
« Reply #7 on: July 15, 2008, 02: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
Logged
URFUBAR
Freshman
*
Offline Offline

Posts: 9


Re: KOS Module w/ Guild KOS
« Reply #8 on: July 15, 2008, 03: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).
« Last Edit: July 15, 2008, 03:18:44 PM by URFUBAR » Logged
URFUBAR
Freshman
*
Offline Offline

Posts: 9


Re: KOS Module w/ Guild KOS
« Reply #9 on: July 15, 2008, 03: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...
Logged
kardsen
Apprentice
***
Offline Offline

Posts: 81


Re: KOS Module w/ Guild KOS
« Reply #10 on: July 15, 2008, 03: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
Logged
CheRny
Freshman
*
Offline Offline

Posts: 15


Re: KOS Module w/ Guild KOS
« Reply #11 on: July 26, 2008, 07:34:45 AM »

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:
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.
Logged
Alreadythere
BeBot Maintainer
Administrator
Grandmaster
********
Offline Offline

Posts: 1085


Re: KOS Module w/ Guild KOS
« Reply #12 on: July 26, 2008, 11:01:44 AM »

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.
Logged
kardsen
Apprentice
***
Offline Offline

Posts: 81


Re: KOS Module w/ Guild KOS
« Reply #13 on: July 28, 2008, 07:37:44 AM »

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.
Logged
kardsen
Apprentice
***
Offline Offline

Posts: 81


Re: KOS Module w/ Guild KOS
« Reply #14 on: July 28, 2008, 08:56:49 AM »

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.
Logged
Pages: [1] 2   Go Up
Print
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Modules > BeBot Hyborian modules > Topic: KOS Module w/ Guild KOS
« previous next »
 
Jump to:  

Recent
Log playtime from buddys ...
by IKShadow
[Today at 06:48:12 AM]

[request] Raid timers
by Elesar1
[December 01, 2008, 04:41:09 PM]

Shared DB online list
by Temar
[December 01, 2008, 01:55:47 AM]

relay colors
by Temar
[December 01, 2008, 01:54:56 AM]

BeBot v0.6.0 released
by Alreadythere
[November 30, 2008, 05:32:00 PM]

Change to Bid.php
by Temar
[November 30, 2008, 11:41:44 AM]

OnlineOrg
by Jiheld
[November 29, 2008, 12:44:27 PM]

Silly Newbie Question.
by Temar
[November 29, 2008, 12:00:02 PM]

massive_pvp_time_table 1
by gerborg
[November 29, 2008, 06:55:35 AM]

Bot not see Guild Chat
by Delvar
[November 28, 2008, 08:30:34 AM]
Stats
Members
Total Members: 1244
Latest: Armonkens
Stats
Total Posts: 11145
Total Topics: 1505
Online Today: 25
Online Ever: 168
(July 01, 2007, 09:30:02 PM)
Users Online
Users: 6
Guests: 14
Total: 20
Glarawyn
xlDanek
clashbot
gerborg
Temar

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.377 seconds with 28 queries. (Pretty URLs adds 0.055s, 4q)
Loading...