Openkore.com

OpenKore Forums
It is currently 19 Apr 2018, 21:24

All times are UTC - 5 hours [ DST ]





Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Profiles Selector
PostPosted: 05 Apr 2008, 05:04 
Offline
Noob
Noob

Joined: 04 Apr 2008, 13:34
Posts: 9
working on SVN 2.0.5

don't need any batch files !!

support files
    config
    items_control
    mon_control
    shop

profiles folder structure.
Quote:
openkore
|-control
|-fields
|-plugins
|-profiles
| |-default
| |-another
| |-other
|-src
|-tables


profiles.pl
Code:
#########################################################################
# 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.


Top
 Profile  
 
 Post subject: Re: Profiles Selector
PostPosted: 08 Apr 2008, 23:37 
Offline
Noob
Noob
User avatar

Joined: 08 Apr 2008, 22:36
Posts: 9
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

_________________
http://bibian.ath.cx/openkore/


Top
 Profile  
 
 Post subject: Re: Profiles Selector
PostPosted: 11 Apr 2008, 00:04 
Offline
Noob
Noob

Joined: 04 Apr 2008, 13:34
Posts: 9
just wrong folder structure.


Attachments:
save.jpg
save.jpg [ 10.9 KiB | Viewed 24934 times ]

_________________
sorry for my eng. i'm just another thailander.
Top
 Profile  
 
 Post subject: Re: Profiles Selector
PostPosted: 13 Apr 2008, 20:19 
Offline
Noob
Noob
User avatar

Joined: 08 Apr 2008, 22:36
Posts: 9
IMHO, timeout.txt should be supported as well.

_________________
http://bibian.ath.cx/openkore/


Top
 Profile  
 
 Post subject: Re: Profiles Selector
PostPosted: 14 Apr 2008, 12:21 
Offline
Noob
Noob
User avatar

Joined: 14 Apr 2008, 12:18
Posts: 13
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!

_________________
lacopenkore@hotmail.com


Top
 Profile  
 
 Post subject: Re: Profiles Selector
PostPosted: 14 Apr 2008, 13:11 
Offline
Noob
Noob
User avatar

Joined: 14 Apr 2008, 12:18
Posts: 13
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

_________________
lacopenkore@hotmail.com


Top
 Profile  
 
 Post subject: Re: Profiles Selector
PostPosted: 01 Dec 2010, 04:27 
Offline
Noob
Noob

Joined: 26 Nov 2010, 07:51
Posts: 2
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 ^_^


Top
 Profile  
 
 Post subject: Re: Profiles Selector
PostPosted: 27 Oct 2011, 17:42 
Offline
Developers
Developers

Joined: 05 Dec 2008, 05:42
Posts: 1811
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: Google [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group