Jump to content
Korean Random
VitaliyKoreev

Помогите начинающему мододелу

Recommended Posts

Интересует пара вопросов:

1. Как отследить наведение на любой танк?

Например: я хочу чтобы при наведении на танк и нажатии определенной кнопки выводилось сообщение в чат для владельца этого танка.

Как получать информацию о танке, на который наведён?

2. Отсюда второй вопрос, как правильно отследить нажатие этой кнопки? Всё тем же getch или так не будет правильно?

import BigWorld
from messenger import MessengerEntry
from constants import PREBATTLE_TYPE
from messenger.m_constants import PROTO_TYPE

channelsCtrl = MessengerEntry.g_instance.gui.channelsCtrl

for controller in channelsCtrl.getControllersIterator():
    channel = controller.getChannel()
    if channel.getClientID() == -129:
        controller.sendMessage("TEST MESSAGE".encode("utf8"))

3. Как правильно писать код мода? 

Очень был бы благодарен за любую помощь.

Share this post


Link to post

Short link
Share on other sites

Интересует пара вопросов:

1. Как отследить наведение на любой танк?

Например: я хочу чтобы при наведении на танк и нажатии определенной кнопки выводилось сообщение в чат для владельца этого танка.

Как получать информацию о танке, на который наведён?

2. Отсюда второй вопрос, как правильно отследить нажатие этой кнопки? Всё тем же getch или так не будет правильно?

import BigWorld
from messenger import MessengerEntry
from constants import PREBATTLE_TYPE
from messenger.m_constants import PROTO_TYPE

channelsCtrl = MessengerEntry.g_instance.gui.channelsCtrl

for controller in channelsCtrl.getControllersIterator():
    channel = controller.getChannel()
    if channel.getClientID() == -129:
        controller.sendMessage("TEST MESSAGE".encode("utf8"))

3. Как правильно писать код мода? 

 

Очень был бы благодарен за любую помощь.

Смотри исходники.

http://github.com/spoter

1. самое простое 

if BigWorld.target() is not None:

2. нажатие кнопки:

from gui import InputHandler
import game
import Keys
def newhandleKeyEvent(event):
    isDown, key, mods, isRepeat = game.convertKeyEvent(event)
    if key == Keys.KEY_NUMPAD6 and isDown:
        print isDown, key, mods, isRepeat

InputHandler.g_instance.onKeyDown += newhandleKeyEvent
InputHandler.g_instance.onKeyUp += newhandleKeyEvent

3. смотри исходники модов других мододелов или xvm

Edited by spoter

Share this post


Link to post

Short link
Share on other sites

Смотри исходники.

http://github.com/spoter

1. самое простое 

if BigWorld.target() is not None:

2. нажатие кнопки:

from gui import InputHandler
import game
import Keys
def newhandleKeyEvent(event):
    isDown, key, mods, isRepeat = game.convertKeyEvent(event)
    if key == Keys.KEY_NUMPAD6 and isDown:
        print isDown, key, mods, isRepeat

InputHandler.g_instance.onKeyDown += newhandleKeyEvent
InputHandler.g_instance.onKeyUp += newhandleKeyEvent

3. смотри исходники модов других мододелов или xvm

 

У других мододелов пробовал смотреть, но почти все моды зашифрованы и не декомпилируются, к сожалению. А ХVM попробую, спасибо большое!

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...