Jump to content
Korean Random

pipje2001

User
  • Content Count

    30
  • Joined

  • Last visited

Posts posted by pipje2001


  1. @The Illusion Well its gonna be a lot of reading stuff and trying stuff and see what happends, I am also a beginner at making a world of tanks mod. But i just started with this example: https://bitbucket.org/_vb_/wot.mods/wiki/GettingStarted

    Also to compile your code you can use: https://koreanrandom.com/forum/topic/15280-pjorion-редактирование-компиляция-декомпиляция-обфускация-модов-версия-135-дата-23082017/#comments

    I write my code in visual studio code and then copy it pjorion to compile it.

    If you have any questions feel free to ask me or contact me on discord: pipje2001#5929

     


  2. Is it possible to import a pyd file? i tried to import the file testC.pyd with this as code: (not actually a usefull code but just for testing)

    #include <Python.h>
    
    static PyObject *testCError;
    
    static PyObject* testC_say_hello(PyObject* self, PyObject *args){
        const char* msg;
        int sts=0;
    
        if(!PyArg_ParseTuple(args, "s", &msg)){
            return NULL;
        }
    
        if(strcmp(msg, "this_is_an_error") == 0){
            PyErr_SetString(testCError, "This is a test exception");
            
            return NULL;
        }else{
            printf("This is C world\nYour message is: %s\n", msg);
            sts=21;
        }
        return Py_BuildValue("i", sts);
        
    }
    
    static PyMethodDef testC_methods[] = {
        {"say_hello", testC_say_hello, METH_VARARGS, "description"},
        {NULL, NULL, 0, NULL}
    };
    
    PyMODINIT_FUNC inittestC(void){
        PyObject *m;
        m = Py_InitModule("testC", testC_methods);
        if(m == NULL) return;
    
        testCError = PyErr_NewException("testC.error", NULL, NULL);
        Py_INCREF(testCError);
        PyModule_AddObject(m, "error", testCError);
    }

    and i want to import this from mod_test.pyc:

    import testC
    status = testC.say_hello("morning")

    both files are in C:\Games\World_of_Tanks_EU\res_mods\1.5.0.0\scripts\client\gui\mods

     

    but when i try this it just gives me this error:

    ERROR: [EXCEPTION] (scripts/client/gui/mods/__init__.py, 74):
    Traceback (most recent call last):
      File "scripts/client/gui/mods/__init__.py", line 67, in _findValidMODs
      File "scripts/common/Lib/importlib/__init__.py", line 37, in import_module
      File "mod_test", line 2, in <module>
    ImportError: No module named testC
     

    i feel like i am doing something very simple wrong or it isn't even possible in world of tanks. Does anyone has an idea?


  3. 18 minutes ago, Kotyarko_O said:

    @pipje2001 

    
    from gui.Scaleform.daapi.view.battle.shared.indicators import SixthSenseIndicator
    
    def new_show(self):
        old_show(self)
        print("spotted")
    
    old_show = SixthSenseIndicator._SixthSenseIndicator__show
    SixthSenseIndicator._SixthSenseIndicator__show = new_show

     

    well that was a simple fix, Thanks!


  4. Alright, i don't want to use xvm mainly because there is a lot of discussion about this right now (or is that something else?). I tried to make my own hook but i am just doing something and it doesn't seem to work (which is not suprising because i don't understand shit about how it actually works XD) 

    so i tried this:

    from gui.Scaleform.daapi.view.battle.shared.indicators import SixthSenseIndicator
    
    def new_show(self):
        old_show(self)
        print("spotted")
    
    old_show = SixthSenseIndicator.show
    SSixthSenseIndicator.show = new_show

    but this resulted in a lot of error's


  5. @Kotyarko_O newSettings are the settings that you changed in the game so 

    print 'onModSettingsChanged', newSettings

    will print

    onModSettingsChanged {'enabled': True, 'ip_hub': '192.168.1.101', 'minimapClick': True}

    so i need to get the newSettings from inside my own mod, because settings in the mod_modsettings.py don't change

    otherwise i need to press apply everytime i restart the game


  6. @Kotyarko_O I tried using https://bitbucket.org/The_IzeBerg/modssettingsapi/src and https://bitbucket.org/P0LIR0ID/wot-modslist/src/ce1e5c1d2662?at=master, but i can't find where the settings are saved and how is can access them from my own mod...  

    for example i want to be able to set the ip adress of the hub in the settings menu, but i have no idea how

    mod_hello.py

    mod_modsettings.py


  7. @Kotyarko_O Thanks, that did the trick, do you mind if i ask you some more questions? 

    - how do you know if the tank is on fire?

    - how do you know if modules are hit? and which module is hit?

    - and how can you make a settings window in the game?

     

    I tried to search for answers but because most stuff is in russian searching is kinda difficult  


  8. @Kotyarko_O Awesome, i got one more problem though, i try to run this code in a loop:

    def LowHp():
        while curHp > 0:
            b.set_light(1, 'xy', [0.678, 0.3168], transitiontime=0)
            b.set_light(1, 'bri', 254, transitiontime=10)
    
            time.sleep(1)
    
            b.set_light(1, 'bri', 0, transitiontime=10)
    
            time.sleep(1)
        
        print("LH_Done")

    But i only want this function to run once at a time so i use this method to check if the tread is already running but it "forgets" that its running so the next time i get shot it just runs it again which kinda breaks my lights XD

     

    if fcurHp/fmaxHp <= 0.1:
    	LH = threading.Thread(target=LowHp)
    	print(LH.is_alive())
    	if not LH.is_alive():
        	LH.start()
        	print("LH_Start")

     

    mod_hello.py

×
×
  • Create New...