collapse collapse
* User Info
 
 
Welcome, Guest. Please login or register.
* Search

* Board Stats
  • stats Total Members: 989
  • stats Total Posts: 18363
  • stats Total Topics: 2500
  • stats Total Categories: 7
  • stats Total Boards: 35
  • stats Most Online: 1144

Author Topic: Mercbot (RK2) style raid plugin  (Read 12125 times)

0 Members and 1 Guest are viewing this topic.

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Mercbot (RK2) style raid plugin
« 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:
  • You can set the amount of points it costs to bid.
  • You can chose whether the amount that someone bids is shown or not.
  • You can forbid reducing bids to stop last second ninja bidding. Unbidding or bidding the same as last highest bid always works.
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, 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.
« Last Edit: January 26, 2006, 11:43:11 am by Alreadythere »

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Mercbot (RK2) style raid plugin
« Reply #1 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.

Offline stonybg

  • BeBot User
  • **
  • Posts: 23
  • Karma: +0/-0
Re: Mercbot (RK2) style raid plugin
« Reply #2 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?

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Mercbot (RK2) style raid plugin
« Reply #3 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().

Offline stonybg

  • BeBot User
  • **
  • Posts: 23
  • Karma: +0/-0
Re: Mercbot (RK2) style raid plugin
« Reply #4 on: February 18, 2006, 08:26:09 pm »
weare i need to put functiom?

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Mercbot (RK2) style raid plugin
« Reply #5 on: February 19, 2006, 10:32:54 am »
Put the two functions in Bot.php, in the Bot class.

Offline stonybg

  • BeBot User
  • **
  • Posts: 23
  • Karma: +0/-0
Re: Mercbot (RK2) style raid plugin
« Reply #6 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.
« Last Edit: February 21, 2006, 01:28:32 am by stonybg »

Offline Xenixa

  • Contributor
  • *******
  • Posts: 307
  • Karma: +0/-0
Re: Mercbot (RK2) style raid plugin
« Reply #7 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.
<<< Hack's in Zend Studio

All my Custom Bebot files may be Found Here <-clicky

Offline stonybg

  • BeBot User
  • **
  • Posts: 23
  • Karma: +0/-0
Re: Mercbot (RK2) style raid plugin
« Reply #8 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

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Mercbot (RK2) style raid plugin
« Reply #9 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.

Offline stonybg

  • BeBot User
  • **
  • Posts: 23
  • Karma: +0/-0
Re: Mercbot (RK2) style raid plugin
« Reply #10 on: February 22, 2006, 05:02:44 am »
tncx now work ;)

Offline Otvertkin

  • BeBot Rookie
  • *
  • Posts: 2
  • Karma: +0/-0
Re: Mercbot (RK2) style raid plugin
« Reply #11 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

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Mercbot (RK2) style raid plugin
« Reply #12 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.

Offline Otvertkin

  • BeBot Rookie
  • *
  • Posts: 2
  • Karma: +0/-0
Re: Mercbot (RK2) style raid plugin
« Reply #13 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

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Mercbot (RK2) style raid plugin
« Reply #14 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 ->.

 

* Recent Posts
[AoC] special char for items module by bitnykk
[February 09, 2024, 09:41:18 pm]


0.8.x updates for AoC by bitnykk
[January 30, 2024, 11:16:08 pm]


0.8.x updates for AO by bitnykk
[January 30, 2024, 11:15:37 pm]


BeBot still alive & kicking ! by bitnykk
[December 17, 2023, 12:58:44 am]


Bebot and Rasberry by bitnykk
[November 29, 2023, 11:04:14 pm]

* Who's Online
  • Dot Guests: 468
  • 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