Jump to content
You need to play a total of 1 battles to post in this section.
cpt_stewie

Python ModApi Question

3 comments in this topic

Recommended Posts

[BANCV]
Players
8 posts
11,418 battles

Hi, i'm trying to use the Python ModApi.

 

I used the example from this post https://forum.worldofwarships.eu/topic/91855-modapi-how-to-use/ as a starting point.

 

Now i have two questions:

 

Why is it "events.qwe" and not "events.onFlashReady" as stated in the documentation?
Why is "events.onBattleStart" not being called when a battle starts?
 

API_VERSION = 'API_v1.0'

import os
import time

print 'Main.py loaded'

class MyMod:

	def __init__(self):
		flash.addExternalCallback('MyMod.btnClick', self.onButtonClick)
		events.qwe(self.onFlashReady)
        	events.onBattleStart(self.onBattleStart)

	def onButtonClick(self, id):
		print 'onButtonClick'
		flash.reloadMod('MyMod', True)

	def onFlashReady(self, modName):
		print modName
    
    	def onBattleStart(self):
      		print 'battleStart'

g_myMod = MyMod()

 

Share this post


Link to post
Share on other sites
Modder, Supertester
1,279 posts
11,026 battles
Quote

Why is it "events.qwe" and not "events.onFlashReady" as stated in the documentation?

 

events.onFlashReady() still exists and works without any problems at all.

 

Quote

Why is "events.onBattleStart" not being called when a battle starts?

 

Can't tell you that because you have a callback to a flash file which we don't have here for testing puproses which will give us an error message and it won't start witout the flash file. So pls provide the file so that we can test here as well.

 

cheers!

Share this post


Link to post
Share on other sites
[BANCV]
Players
8 posts
11,418 battles

I used the flash file unmodified from the example.

 

From what i understood you can use the python api seperatly from the flash file if you don't need the flash part. Or is that incorrect?

Share this post


Link to post
Share on other sites

×