Jump to content
Korean Random
Van Dark

Python. Как сделать чтобы скрипт начинал работу, когда игрок находится в бою?

Recommended Posts

Python. Как сделать чтобы скрипт начинал работу, когда игрок находится в бою? Смотрел этот мод https://github.com/spoter/spoter-mods/blob/master/mod_artySplash/source/mod_artySplash.py, но при импорте модулей скрипт прекращает работу.

Edited by Van Dark

Share this post


Link to post

Short link
Share on other sites

Надо хукать функцию, которая вызывается, когда игрок входит в бой. Например startGUI вот так:

 

from Avatar import PlayerAvatar

old_startGUI = PlayerAvatar._PlayerAvatar__startGUI

def new_startGUI(*args):
    old_startGUI(*args)
    <свой код размещаешь тут
     ....
     ....>

PlayerAvatar._PlayerAvatar__startGUI = new_startGUI

 

Share this post


Link to post

Short link
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...