Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Black Desert
You last visited: Today at 18:35

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



can't load scripts in pxy

Discussion on can't load scripts in pxy within the Black Desert forum part of the MMORPGs category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jul 2018
Posts: 61
Received Thanks: 29
can't load scripts in pxy



Not missing the files, all were there but somehow script.def location isn't recognized when try load it in pxy.



table.lua
Code:
function table.length(T)
  local count = 0
  for _ in pairs(T) do count = count + 1 end
  return count
end

function table.find(t, value)
    for k,v in pairs(t) do
        if v == value then
            return k
        end
    end
    return nil
end

function table.findIndex(t, value)
    local i = 1
    for k,v in pairs(t) do
        if v == value then
            return i
        end
        i = i + 1
    end
    return 0
end

function table.merge(a, b)
    if type(a) == 'table' and type(b) == 'table' then
        for k,v in pairs(b) do if type(v)=='table' and type(a[k] or false)=='table' then table.merge(a[k],v) else a[k]=v end end
    end
    return a
end

function table.print ( t )  
    local print_r_cache={}
    local function sub_print_r(t,indent)
        if (print_r_cache[tostring(t)]) then
            print(indent.."*"..tostring(t))
        else
            print_r_cache[tostring(t)]=true
            if (type(t)=="table") then
                for pos,val in pairs(t) do
                    if (type(val)=="table") then
                        print(indent.."["..pos.."] => "..tostring(t).." {")
                        sub_print_r(val,indent..string.rep(" ",string.len(pos)+8))
                        print(indent..string.rep(" ",string.len(pos)+6).."}")
                    elseif (type(val)=="string") then
                        print(indent.."["..pos..'] => "'..val..'"')
                    else
                        print(indent.."["..pos.."] => "..tostring(val))
                    end
                end
            else
                print(indent..tostring(t))
            end
        end
    end
    if (type(t)=="table") then
        print(tostring(t).." {")
        sub_print_r(t,"  ")
        print("}")
    else
        sub_print_r(t,"  ")
    end
    print()
end
Inside the pxy.

ScriptingContext.cpp
Code:
Pyx::Scripting::ScriptingContext& Pyx::Scripting::ScriptingContext::GetInstance()
{
    static ScriptingContext ctx;
    return ctx;
}

Pyx::Scripting::ScriptingContext::ScriptingContext()
{
}

Pyx::Scripting::ScriptingContext::~ScriptingContext()
{
}

void Pyx::Scripting::ScriptingContext::Initialize()
{
    ReloadScripts();
}

void Pyx::Scripting::ScriptingContext::Shutdown()
{
    for (auto* pScript : m_scripts)
    {
        pScript->Stop();
        delete pScript;
    }
    m_scripts.clear();
}

void Pyx::Scripting::ScriptingContext::ReloadScripts()
{
    PyxContext::GetInstance().Log(XorStringA("[Scripting] Reloading scripts ..."));

    const auto& pyxSettings = PyxContext::GetInstance().GetSettings();

    for (auto* pScript : m_scripts)
    {
        if (pScript->IsRunning()) 
            pScript->Stop();
        delete pScript;
    }

    m_scripts.clear();

    WIN32_FIND_DATA ffd;
    HANDLE hFind = INVALID_HANDLE_VALUE;
    DWORD dwError = 0;
    hFind = FindFirstFileW(std::wstring(pyxSettings.RootDirectory + pyxSettings.ScriptsDirectory + L"\\*").c_str(), &ffd);

    if (INVALID_HANDLE_VALUE == hFind)
        return;

    do
    {
        if (ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
        {
            auto fileName = pyxSettings.RootDirectory + pyxSettings.ScriptsDirectory + L"\\" + std::wstring(ffd.cFileName) + L"\\script.def";
            auto scriptName = std::wstring(ffd.cFileName);
            DWORD dwAttrib = GetFileAttributesW(fileName.c_str());
            if (dwAttrib != INVALID_FILE_ATTRIBUTES &&
                !(dwAttrib & FILE_ATTRIBUTE_DIRECTORY))
            {
                ScriptDef scriptDef{ fileName };
                if (scriptDef.IsScript())
                {
                    PyxContext::GetInstance().Log(XorStringW(L"[Scripting] Found script \"%s\""), scriptDef.GetName().c_str());
                    m_scripts.insert(new Script(scriptDef.GetName(), fileName));
                }
            }
        }
    } while (FindNextFileW(hFind, &ffd) != 0);
}
ScriptingContext.h
Code:
namespace Pyx
{
    class PyxContext;
    namespace Scripting
    {
        class Script;
        class ScriptingContext
        {

        public:
            typedef void OnStartScriptCallback(Script& script);

        public:
            static ScriptingContext& GetInstance();

        private:
            std::set<Script*> m_scripts;
            Utility::Callbacks<OnStartScriptCallback> m_OnStartScriptCallbacks;

        public:
            explicit ScriptingContext();
            ~ScriptingContext();
            void Initialize();
            void Shutdown();
            void ReloadScripts();
            std::set<Script*> GetScripts() const { return m_scripts; }
            Utility::Callbacks<OnStartScriptCallback>& GetOnStartScriptCallbacks() { return m_OnStartScriptCallbacks; };
            template<typename... Args>
            void FireCallbacks(const std::wstring& name, Args&&... args)
            {
                for (Script* pScript : m_scripts)
                {
                    if (pScript->IsRunning())
                    {
                        pScript->FireCallback(name, std::forward<Args>(args)...);
                    }
                }
            }

        };
    }
}
ScriptDef.h
Code:
namespace Pyx
{
    namespace Scripting
    {
        class ScriptDef
        {

        public:
            ScriptDef(std::wstring fileName);
            const std::wstring GetName();
            const std::wstring GetType();
            bool IsScript() { return GetType() == L"script"; }
            bool IsLib() { return GetType() == L"lib"; }
            std::vector<std::wstring> GetFiles();
            std::vector<std::wstring> GetDependencies();
            bool Validate(std::wstring& error);
            bool Run(LuaState& luaState);

        private:
            std::wstring m_scriptDirectory;
            std::vector<Utility::IniFile::SectionValue> m_scriptSection;
            std::vector<Utility::IniFile::SectionValue> m_filesSection;
            std::vector<Utility::IniFile::SectionValue> m_dependenciestSection;

        };
    }
}
PyxInitSettings.h
Code:
namespace Pyx
{
    struct PyxInitSettings
    {
        Pyx::GuiType GuiType = Pyx::GuiType::ImGui;
        std::wstring RootDirectory = L"";
        bool GuiBlockInput = false;
        bool LogToFile = true;
        std::wstring LogDirectory = L"\\Logs";
        std::wstring ScriptsDirectory = L"\\Scripts";
    };
}
NanoNanoo is offline  
Old 08/06/2018, 07:30   #2
 
R3p's Avatar
 
elite*gold: 778
The Black Market: 259/10/0
Join Date: Apr 2010
Posts: 520
Received Thanks: 927
where u got the source code from?
R3p is offline  
Thanks
1 User
Old 08/06/2018, 09:50   #3
 
elite*gold: 0
Join Date: Jan 2016
Posts: 290
Received Thanks: 33
mind hooking me up with the source?

Quote:
Originally Posted by R3p View Post
where u got the source code from?
ruikangzhu1990 is offline  
Old 08/06/2018, 12:54   #4
 
elite*gold: 0
Join Date: Jun 2018
Posts: 1
Received Thanks: 0
you noobs stop asking dbz final bout source codes, every single post
goigum is offline  
Old 08/06/2018, 15:14   #5
 
elite*gold: 0
Join Date: Jan 2016
Posts: 290
Received Thanks: 33
Quote:
Originally Posted by goigum View Post
you noobs stop asking dbz final bout source codes, every single post
calling others noobs, mainwhile, cant even code
ruikangzhu1990 is offline  
Old 08/06/2018, 19:36   #6
 
R3p's Avatar
 
elite*gold: 778
The Black Market: 259/10/0
Join Date: Apr 2010
Posts: 520
Received Thanks: 927
Nvm

Quote:
Originally Posted by ruikangzhu1990 View Post
mind hooking me up with the source?



It's from R3p.bdo source of the x64fw2? So not have other files. Just used them cause they were handy
R3p is offline  
Thanks
1 User
Old 08/06/2018, 22:15   #7
 
elite*gold: 0
Join Date: Sep 2015
Posts: 54
Received Thanks: 3
It's a PacketStudio source
Farolly is offline  
Old 08/08/2018, 14:48   #8
 
consxx's Avatar
 
elite*gold: 0
Join Date: Aug 2010
Posts: 246
Received Thanks: 8
its has missing Func that the pyx have. much better your censored the server you playin. becoz itll be patch quickly.
consxx is offline  
Reply


Similar Threads Similar Threads
[Selling] Hero online bot with scripts (i can make more scripts on request)
08/01/2013 - elite*gold Trading - 10 Replies
http://www.elitepvpers.com/theblackmarket/treasure /176992 message me for more info ive recently discovered a macro record program , ive been using it for years now ...tho the thing is without decent scripts its useless so ive put together some scripts to sell with the macro bot program i will add the macro bot (without scripts) its the scripts i'm selling just request a script file for it and i wil make and sell it
S>CRph Load 400m / 1 CRph load
12/11/2011 - Cabal Online Trading - 2 Replies
pm [email protected] up
i want to trade my 100m SRO gold to your levelup load or RF load
04/15/2008 - Silkroad Online Trading - 1 Replies
hi..........anyone want SRO gold i have 100m i want to trade this to your levelup load or RF load anyone have just pm me or contact me this email add. [email protected] or +639202300892
Can't Load
05/27/2007 - Silkroad Online - 4 Replies
I have the newest bot and client (1.63 and the 1.098) And two nights ago my bot was working fine, now everytime i right click the bot and go to start game it gives me the sand timer for about 1 second and nothing loads up. I have un-installed/re-installed Silkroad, re-installed the 1.63 bot and the 1.098 client. I've done everything that i know of. I'm using the payed bot btw, so if anyone knows of what to do your help would be greatly appreciated. EDIT* here is whats in both of my folders,...



All times are GMT +2. The time now is 18:35.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.