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?
November 22, 2008, 01:38: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 > Development > Feedback and Suggestions > Topic: Seperate Official and Unofficial/Custom Modules
Pages: [1]   Go Down
« previous next »
Print
Author Topic: Seperate Official and Unofficial/Custom Modules  (Read 635 times)
0 Members and 1 Guest are viewing this topic.
Glarawyn
BeBot Developer
Champion
********
Offline Offline

Posts: 414



Seperate Official and Unofficial/Custom Modules
« on: August 30, 2006, 11:36:54 AM »

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:
// 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);
    }
}
Logged
Khalem
BeBot Founder
Administrator
Grandmaster
********
Offline Offline

Gender: Male
Posts: 670



WWW
Re: Seperate Official and Unofficial/Custom Modules
« Reply #1 on: August 30, 2006, 01:20:21 PM »

Good idea Glara.

Will be adding this to 0.3
Logged

BeBot Founder and Fixer Kingpin
Madman coder and destroyer of good code
Khalem
BeBot Founder
Administrator
Grandmaster
********
Offline Offline

Gender: Male
Posts: 670



WWW
Re: Seperate Official and Unofficial/Custom Modules
« Reply #2 on: September 27, 2006, 03:05:11 PM »

Added to SVN for 0.3
Logged

BeBot Founder and Fixer Kingpin
Madman coder and destroyer of good code
Glarawyn
BeBot Developer
Champion
********
Offline Offline

Posts: 414



Re: Seperate Official and Unofficial/Custom Modules
« Reply #3 on: October 26, 2006, 12:15:40 PM »

In addition, extend help so that there is a custom/help directory.

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

Modified BotHelp.php (Replace line 91 with the following)
Code:
        // 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"))
Logged
Khalem
BeBot Founder
Administrator
Grandmaster
********
Offline Offline

Gender: Male
Posts: 670



WWW
Re: Seperate Official and Unofficial/Custom Modules
« Reply #4 on: October 29, 2006, 05:57:16 PM »

Committed.
Logged

BeBot Founder and Fixer Kingpin
Madman coder and destroyer of good code
Pages: [1]   Go Up
Print
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Development > Feedback and Suggestions > Topic: Seperate Official and Unofficial/Custom Modules
« previous next »
 
Jump to:  

Recent
Change text in remember "...
by gerborg
[November 21, 2008, 05:14:57 PM]

Log playtime from buddys ...
by Temar
[November 20, 2008, 10:33:57 AM]

Vote Core module and Simp...
by Temar
[November 19, 2008, 09:26:52 AM]

Restrict access for one m...
by Organizer
[November 19, 2008, 03:21:19 AM]

Custom / Revised Modules ...
by Elesar1
[November 17, 2008, 03:51:46 PM]

TWC
by Temar
[November 16, 2008, 11:39:12 AM]

Are there any FUN modules...
by Elesar1
[November 15, 2008, 07:39:15 PM]

Call to a member function...
by exxie
[November 15, 2008, 09:29:31 AM]

Ported Modules
by Alreadythere
[November 14, 2008, 06:10:07 PM]

cURL and other non-defaul...
by Temar
[November 14, 2008, 04:11:44 PM]
Stats
Members
Total Members: 1235
Latest: DDDepressionnn
Stats
Total Posts: 11037
Total Topics: 1496
Online Today: 18
Online Ever: 168
(July 01, 2007, 09:30:02 PM)
Users Online
Users: 0
Guests: 21
Total: 21

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