Profiles Selector

Other plugins for extending OpenKore's functionality. This forum is only for posting new plugins and commenting on existing plugins. For support, use the Support forum.

Moderator: Moderators

Message
Author
d3fc0n
Noob
Noob
Posts: 9
Joined: 04 Apr 2008, 13:34

Profiles Selector

#1 Post by d3fc0n »

working on SVN 2.0.5

don't need any batch files !!

support files
  • config
    items_control
    mon_control
    shop
profiles folder structure.
openkore
|-control
|-fields
|-plugins
|-profiles
| |-default
| |-another
| |-other
|-src
|-tables
profiles.pl

Code: Select all

#########################################################################
# This software is open source, licensed under the GNU General Public
# License, version 2.
# Basically, this means that you're allowed to modify and distribute
# this software. However, if you distribute modified versions, you MUST
# also distribute the source code.
# See http://www.gnu.org/licenses/gpl.html for the full license.
#########################################################################
# profiles selector (full)
# d3fc0n 30/12/2007
#########################################################################

package profiles;

use strict;
use Plugins;
use Globals qw($interface);

my $profile_folder = "profiles";

Plugins::register('profiles', 'Profiles Selector', \&on_unload);

my $hooks = Plugins::addHooks(
		['start', \&onStart]
	);

sub on_unload {
	Plugins::delHook($hooks);
	undef $profile_folder;
}

sub onStart {
	opendir D, $profile_folder;
	my @conlist = readdir(D);
	closedir D;

	my @profiles;

	foreach (@conlist) {
		next if (!-d "$profile_folder\\$_");
		next if ($_ =~ /^\./);
		push @profiles, $_;
	}

	my $choice = $interface->showMenu(
			"Please choose a Profiles folder.",
			\@profiles,
			title => "Profiles Selector"
		);

	if ($choice == -1) {
		exit;

	} else {

		if (-e "$profile_folder\\" . @profiles[$choice] . "\\config.txt") {
			$Settings::config_file = "$profile_folder\\" . @profiles[$choice] . "\\config.txt";
		}

		if (-e "$profile_folder\\" . @profiles[$choice] . "\\mon_control.txt") {
			$Settings::mon_control_file = "$profile_folder\\" . @profiles[$choice] . "\\mon_control.txt";
		}

		if (-e "$profile_folder\\" . @profiles[$choice] . "\\items_control.txt") {
			$Settings::items_control_file = "$profile_folder\\" . @profiles[$choice] . "\\items_control.txt";
		}

		if (-e "$profile_folder\\" . @profiles[$choice] . "\\shop.txt") {
			$Settings::shop_file = "$profile_folder\\" . @profiles[$choice] . "\\shop.txt";
		}
	}
}

return 1;
sorry for my eng. i'm just another thailander.

acemg
Noob
Noob
Posts: 9
Joined: 08 Apr 2008, 22:36

Re: Profiles Selector

#2 Post by acemg »

OK i will elaborate more further, since i coudnt make it to work i would appreciate if you give out comments and advise, heres the screenie

Image
Image


i just need some advise

d3fc0n
Noob
Noob
Posts: 9
Joined: 04 Apr 2008, 13:34

Re: Profiles Selector

#3 Post by d3fc0n »

just wrong folder structure.
Attachments
save.jpg
save.jpg (10.9 KiB) Viewed 43291 times
sorry for my eng. i'm just another thailander.

acemg
Noob
Noob
Posts: 9
Joined: 08 Apr 2008, 22:36

Re: Profiles Selector

#4 Post by acemg »

IMHO, timeout.txt should be supported as well.

lacunacoil
Noob
Noob
Posts: 13
Joined: 14 Apr 2008, 12:18

Re: Profiles Selector

#5 Post by lacunacoil »

Great plugin dude!
But man , your first SS is confusing everybody it made me believe that the profiles folder should be placed inside plugins folder.

PEOPLE PROFILE FOLDER MUST BE PLACES IN YOUR OPENKORE MAIN FOLDER OTHERWISE IT WONT WORK!

lacunacoil
Noob
Noob
Posts: 13
Joined: 14 Apr 2008, 12:18

Re: Profiles Selector

#6 Post by lacunacoil »

Btw can someone change it so it would automatically change timeouts and pickupitems also?
I've tryed but it didin't work I wonder why

gelo32k
Noob
Noob
Posts: 2
Joined: 26 Nov 2010, 07:51
Noob?: Yes

Re: Profiles Selector

#7 Post by gelo32k »

I'm very sorry for resurrecting this old topic, but I grew fond on using this plugin to organize my bot...

Can somebody fix this plug in to work with the latest SVN version? :D

or... a good alternative plugin will do ^_^

EternalHarvest
Developers
Developers
Posts: 1798
Joined: 05 Dec 2008, 05:42
Noob?: Yes

Re: Profiles Selector

#8 Post by EternalHarvest »

Added to svn: http://openkore.svn.sourceforge.net/vie ... l?view=log

Now overlays the whole control directory with profile directory (any files from control may be redefined), works with current trunk.

Post Reply