-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathinit.py
44 lines (35 loc) · 1.19 KB
/
init.py
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
35
36
37
38
39
40
41
42
43
44
#Responsible for inputing the right methods
#DON'T RUN SCRIPTS FROM ON HERE
import sys, os
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)
#Set Path
folder = eXLib.PATH+"OpenBot"
command = 'mklink /d OpenBot "' + folder +'"'
sys.path.append(os.path.join(eXLib.PATH))
sys.path.append(os.path.join(eXLib.PATH,'OpenBot'))
sys.path.append(os.path.join(eXLib.PATH,'OpenBot', 'lib'))
sys.path.append(os.path.join(eXLib.PATH,'OpenBot', 'Modules'))