forked from MetinOpenBot/OpenBot
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinit.py
More file actions
37 lines (28 loc) · 914 Bytes
/
init.py
File metadata and controls
37 lines (28 loc) · 914 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#Responsible for inputing the right methods
#DON'T RUN SCRIPTS FROM ON HERE
import sys
import chatm2g as _chat
import playerm2g2 as _player
import m2netm2g as _net
import chrmgrm2g as _chrmgr
import eXLib
import chr,app
sys.modules['player'] = _player
sys.modules['net'] = _net
sys.modules['chat'] = _chat
sys.modules['chrmgr'] = _chrmgr
def SetSingleDIKKeyState(key,state):
if state == 1:
_player.OnKeyDown(key)
else:
_player.OnKeyUp(key)
def SetAttackKeyState(state):
if state == 1:
_player.OnKeyDown(app.DIK_SPACE)
else:
_player.OnKeyUp(app.DIK_SPACE)
setattr(chr, 'GetPixelPosition', eXLib.GetPixelPosition)
setattr(chr, 'MoveToDestPosition', eXLib.MoveToDestPosition)
setattr(_net, 'GetMainActorVID', _player.GetMainCharacterIndex)
setattr(_player, 'SetSingleDIKKeyState', SetSingleDIKKeyState)
setattr(_player, 'SetAttackKeyState', SetAttackKeyState)