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: Seperate Official and Unofficial/Custom Modules  (Read 2181 times)

0 Members and 1 Guest are viewing this topic.

Offline Glarawyn

  • BeBot Hero
  • ******
  • Posts: 521
  • Karma: +0/-0
Seperate Official and Unofficial/Custom Modules
« on: August 30, 2006, 06:36:54 pm »
Just a thought as I've done this on a couple of the bots I run to ease upgrades a bit.

For example, I've added the following to main.php before the code that loads the official modules. If I modify an official module, I move it to one of the custom directories. Any modules I write or grab from this site also go into the custom directories.

Code: [Select]
// Load up all custom core-modules
$folder = dir("./custom-core/");
while ($mod = $folder->read())
{
    if (!is_dir($mod) && !preg_match("/^_/", $mod) && preg_match("/php$/i", $mod))
    {
        require_once "custom-core/" . $mod;
        $bot -> log("CCORE", "LOAD", $mod);
    }
}

// Load up all custom modules
$folder = dir("./custom-modules/");
while ($mod = $folder->read())
{
    if (!is_dir($mod) && !preg_match("/^_/", $mod) && preg_match("/php$/i", $mod) && (($guildbot && !preg_match("/_RAID/", $mod)) || (!$guildbot && !preg_match("/_GUILD/", $mod))))
    {
        require_once "custom-modules/" . $mod;
        $bot -> log("CMOD", "LOAD", $mod);
    }
}

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Re: Seperate Official and Unofficial/Custom Modules
« Reply #1 on: August 30, 2006, 08:20:21 pm »
Good idea Glara.

Will be adding this to 0.3
BeBot Founder and Fixer Kingpin

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Re: Seperate Official and Unofficial/Custom Modules
« Reply #2 on: September 27, 2006, 10:05:11 pm »
Added to SVN for 0.3
BeBot Founder and Fixer Kingpin

Offline Glarawyn

  • BeBot Hero
  • ******
  • Posts: 521
  • Karma: +0/-0
Re: Seperate Official and Unofficial/Custom Modules
« Reply #3 on: October 26, 2006, 07:15:40 pm »
In addition, extend help so that there is a custom/help directory.

Original BotHelp.php line 91.
Code: [Select]
if (is_file("./help/" . $info . ".txt"))

Modified BotHelp.php (Replace line 91 with the following)
Code: [Select]
        // Custom help files take precedence over normal help files.
        if (is_file("./custom/help/" . $info . ".txt")) {$path = "./custom/help/";}
        else {$path = "./help/";} // Default path

        if (is_file($path . $info . ".txt"))

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Re: Seperate Official and Unofficial/Custom Modules
« Reply #4 on: October 29, 2006, 11:57:16 pm »
Committed.
BeBot Founder and Fixer Kingpin

 

* 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: 744
  • 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