BeBot - An Anarchy Online and Age Of Conan chat automaton

Archive => Anarchy Online Archive => 0.2.x Custom/Unofficial Modules => Topic started by: Alreadythere on January 26, 2006, 11:41:39 am

Title: Mercbot (RK2) style raid plugin
Post by: Alreadythere on January 26, 2006, 11:41:39 am
As mentioned in some other thread, I've written a raid module based on the mercbot raidsystem that was used on RK2 by Omnis.

Basic ideas: you get a fixed amount of points for a specific raid, not points over time, and use those points to bid for the loot.

This module is written for guild use, so people can add themself to the raidlist as long as it's not closed. If closed, only raidleader can still add people.

For bidding it offers a few options:
If you bid X points and win, you will pay X+cost points in total.

The module logs all !raiddone/!raidpoints commands, including all people in raidlist, and logs all won items. Those information can be accessed by the !history and !raidhistory commands.

File (http://www.m8y.de/ao/bebot/Raid_RAID.phps), save as .php

Note: this module is still in some development, there doesn't exist any interface to define raid types yet, I'm still doing it directly in the database. And I make heavy use of my colors table and get_tablename function.
Further I depend on my custom rights management to check access rights, I'm not doing any checks in this code.
Title: Re: Mercbot (RK2) style raid plugin
Post by: Alreadythere on January 27, 2006, 03:09:24 pm
Forgot to add in the original post: the module is works with the alts table, if raids_points_to_main is set to true all points will go to the main. And people can only join with one of their mains for points, adding a second will overwrite the first joined one. So they can use as many chars at once as they wish, they will only get points once.
No alts table or raid_points_to_main set to false disables this behavior.
Title: Re: Mercbot (RK2) style raid plugin
Post by: stonybg on February 17, 2006, 11:47:34 pm
hy nice modul but got a problem
Fatal error: Call to undefined function:  get_setting() in D:\bebot\modules\Raid_RAID.php on line 84
any idea what is problem?
Title: Re: Mercbot (RK2) style raid plugin
Post by: Alreadythere on February 18, 2006, 10:28:21 am
Yes, I've added the following two functions to my Bot class.
Code: [Select]
function get_setting($set)
{
$res = $this -> bot -> db -> select("SELECT * FROM settings WHERE setting = '" . $set . "'");

if (!empty($res))
return $res[0][1];
else
return "";
}

function set_setting($set, $value)
{
$this -> bot -> db -> query("UPDATE settings SET value = '" . $value . "' WHERE setting = '" . $set . "'");
}

Either add those two functions in the Bot class, or you can add them in the raid class too, then you just need to modify all $this -> bot -> [get|set]_setting() to $this -> [get|set]_setting().
Title: Re: Mercbot (RK2) style raid plugin
Post by: stonybg on February 18, 2006, 08:26:09 pm
weare i need to put functiom?
Title: Re: Mercbot (RK2) style raid plugin
Post by: Alreadythere on February 19, 2006, 10:32:54 am
Put the two functions in Bot.php, in the Bot class.
Title: Re: Mercbot (RK2) style raid plugin
Post by: stonybg on February 19, 2006, 12:04:26 pm
i put on bot clas but return erorr
Fatal error: Call to a member function on a non-object in D:\Install\bots\pandcom\Bot.php on line 75
i atach editet bot php if you can see it weare i make error, please chek it im too new in php programing.
Title: Re: Mercbot (RK2) style raid plugin
Post by: Xenixa on February 20, 2006, 10:31:48 pm
You need to move both those functions to be inside the Function Bot which is part of the Class Bot.
Right under were Class Bot is defined won't quite work. Your best bet is find the following:
Code: [Select]
    /*
      Dissconnect the bot
    */
    function disconnect()
    {
      $this -> aoc -> disconnect();

      if (!empty($this -> commands["disconnect"]))
      {
        $keys = array_keys($this -> commands["disconnect"]);
        foreach ($keys as $key)
          $this -> commands["disconnect"][$key] -> disconnect();
      }
    }

Place the get and set functions above right after that.
Title: Re: Mercbot (RK2) style raid plugin
Post by: stonybg on February 21, 2006, 01:28:02 am
damed error
tnx Xenixa function work but now have next error

Fatal error: Call to undefined function:  get_tablename() in D:\Install\bots\modules\Raid_RAID.php on line 39
Title: Re: Mercbot (RK2) style raid plugin
Post by: Alreadythere on February 21, 2006, 10:58:36 am
Add the following function right behind the get/set_setting functions
Code: [Select]
function get_tablename($name)
{
return $name;
}
Should solve that problem.
Title: Re: Mercbot (RK2) style raid plugin
Post by: stonybg on February 22, 2006, 05:02:44 am
tncx now work ;)
Title: Re: Mercbot (RK2) style raid plugin
Post by: Otvertkin on July 27, 2006, 01:25:47 pm
i have error
Fatal error: Call to undefined method Raids::get_setting() in ....\BeBot_v0.2.5\modules\raidsingle.php on line 84
after all changes in any case
Title: Re: Mercbot (RK2) style raid plugin
Post by: Alreadythere on July 27, 2006, 07:55:22 pm
i have error
Fatal error: Call to undefined method Raids::get_setting() in ....\BeBot_v0.2.5\modules\raidsingle.php on line 84
after all changes in any case

Did you add the above mentioned get_setting() functions? They should solve the errors.
Title: Re: Mercbot (RK2) style raid plugin
Post by: Otvertkin on July 28, 2006, 08:34:05 am
$this -> bot -> db ->
just wost need remove bot ->
i place it in bot.php
this is right if placed in raid.php
Title: Re: Mercbot (RK2) style raid plugin
Post by: Alreadythere on July 28, 2006, 02:09:59 pm
If you take my basic module it expects the get_tablename, get_/set_setting functions to be inside the Bot class.

If you put the functions into the raid module you have to modify the calls from $this -> bot -> to just $this ->.
Title: Re: Mercbot (RK2) style raid plugin
Post by: neongen on November 13, 2006, 05:34:17 pm
hmm i can't get the get(color) to work...

tryed to put it up as _colors.php and just colors.php

but i keep getting error when i start a raid

Fatal error: Call to a member function get() on a non-object in C:\halocom\modules\raid_RAID.php on line 377

377 = $this -> bot -> send_pgroup($this -> bot -> colors -> get("green") . "Raid started: " . $raid[0][1] . " ["


nvm i found it on the forum...
Title: Re: Mercbot (RK2) style raid plugin
Post by: atroxical on December 23, 2006, 06:12:55 pm
Can anyone post up their working Bot.php file for this module?
I canst seem to get this working at all even after all the changes.
Title: Re: Mercbot (RK2) style raid plugin
Post by: atroxical on December 24, 2006, 01:57:45 am
current bot.php
Title: Re: Mercbot (RK2) style raid plugin
Post by: atroxical on December 24, 2006, 04:33:13 am
Ok have finally got it working now but does anyone know how to start a raid?
Whenever I do !raidstart
it says to select a valid raid
How to I add raids into the .php file?
Very lost here
Title: Re: Mercbot (RK2) style raid plugin
Post by: Alreadythere on December 24, 2006, 12:19:09 pm
The version on the web doesn't offer an interface to add raids yet. Only way to add raids is to add them directly in the database.

I'll try to get around and post my up-to-date version which has an admin interface for it.
Title: Re: Mercbot (RK2) style raid plugin
Post by: Alreadythere on December 28, 2006, 06:08:02 pm
Uploaded my current version to the ftp, just redownload it.

It contains a basic admin interface which handles adding and removing raids.
Commands:
Title: Re: Mercbot (RK2) style raid plugin
Post by: Dontask on June 22, 2008, 12:09:48 pm
Bump for a working download link for this module!
SimplePortal 2.3.7 © 2008-2024, SimplePortal