load macros.txt from openkore root dir?

International

Moderator: Moderators

hellzito
Noob
Noob
Posts: 5
Joined: 17 Oct 2013, 12:34
Noob?: Yes

load macros.txt from openkore root dir?

#1 Post by hellzito »

Hello everybody

I need to change the control/macros.txt to load from root dir, but setting it in config.txt (macros_file) i get a error.

i tryied: macro_file ../macros.txt

how you can see, i use relative path, but i had not success

Any ideas how to fix it??

Code: Select all

OpenKore version what-will-become-2.1
SVN revision: 8846
Loaded plugins:
  plugins/macro.pl (macro; description: allows usage of macros)

Error message:
Name must be a valid file base name.

Stack trace:
Trace begun at C:\Users\Andre\Desktop\ready\src\Settings.pm line 658
Settings::_assertNameIsBasename('../macros.txt') called at C:\Users\Andre\Desktop\ready\src\Settings.pm line 665
Settings::_findFileFromFolders('../macros.txt', 'ARRAY(0x2be9bfc)') called at C:\Users\Andre\Desktop\ready\src\Settings.pm line 430
Settings::loadByHandle(55) called at C:\Users\Andre\Desktop\ready\plugins\macro.pl line 60
macro::onstart3('start3', undef, undef) called at src\Plugins.pm line 434
Plugins::callHook('start3') called at src\functions.pl line 290
main::loadDataFiles at src\functions.pl line 82
main::mainLoop at src\Interface.pm line 75
Interface::mainLoop('Interface::Console::Win32=HASH(0x8d222c)') called at openkore.pl line 97
main::__start at start.pl line 136

Interrompido nesta linha:
     my (undef, undef, $file) = File::Spec->splitpath($_[0]);
*    if ($file ne $_[0]) {
        ArgumentException->throw("Name must be a valid file base name.");
thx very much
allanon256
Developers
Developers
Posts: 19
Joined: 06 Mar 2010, 19:33
Noob?: No

Re: load macros.txt from openkore root dir?

#2 Post by allanon256 »

i tried: macro_file ../macros.txt
This won't work, because the macro_file setting must point to a file in the control directory (that is, it must be a filename with no directory part).

However, there is still hope. You can use the !include option to include files with directories. Take out the macro_file setting, and put the following in your control/macros.txt:

Code: Select all

!include ../macros.txt
Then you can just put all of your macros in the macros.txt file in your openkore root dir.
hellzito
Noob
Noob
Posts: 5
Joined: 17 Oct 2013, 12:34
Noob?: Yes

Re: load macros.txt from openkore root dir?

#3 Post by hellzito »

allanon256 wrote:
i tried: macro_file ../macros.txt
This won't work, because the macro_file setting must point to a file in the control directory (that is, it must be a filename with no directory part).

However, there is still hope. You can use the !include option to include files with directories. Take out the macro_file setting, and put the following in your control/macros.txt:

Code: Select all

!include ../macros.txt
Then you can just put all of your macros in the macros.txt file in your openkore root dir.
Thank you very much! It worked fine !! God bless you!!

See ya!