-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
80 lines (61 loc) · 2.25 KB
/
main.py
File metadata and controls
80 lines (61 loc) · 2.25 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
from memoryWatcher import MemoryWatcher;
from Controller import Controller;
import sys;
import os;
import basicCommands as bc;
import time;
def findDolphinPath():
homePath = os.path.expanduser('~'); # this is the home path
if sys.platform == "linux" or sys.platform == "linux2":
path = homePath # linux
if (os.path.isdir(homePath + '/.local/share/dolphin-emu')): path += '/.local/share/dolphin-emu';
else: path = homePath + '/.local/dolphin-emu';
homePath = path;
elif sys.platform == "darwin": homePath += "/Library/Application Support/Dolphin"
print(homePath);
if(not (os.path.isdir(homePath))):
print("can not find path for dolphin, are you sure it is installed??");
print("if it is already installed then can you please store the location to the dolphin config files in the environment variable XDG_DATA_HOME");
print("example: export XDG_DATA_HOME='path to dolphin'");
return "";
## return the home path
return homePath;
memWatcher = None; # MemoryWatcher(findDolphinPath());
controller = None; # Controller(findDolphinPath());
def initialSetup():
global memWatcher;
global controller;
memWatcher = MemoryWatcher(findDolphinPath());
memWatcher.startSocket();
controller = Controller(findDolphinPath());
return;
def main():
initialSetup();
# bc.main();
basicCommands = bc.BasicCommands(memWatcher, controller);
basicCommands.test2()
# while(True):
# memWatcher.readMemory();
controller.releaseButtons();
# print("starting");
# for i in range(3):
# print("in the ith: " + str(i) + " time");
# memWatcher.pauseForTime(100);
# # basicCommands.upTilt();
# # basicCommands.roll("right");
# # basicCommands.dashAttack("left");
# # basicCommands.waveDash("left");
# basicCommands.jump(2);
# controller.releaseButtons();
# memWatcher.pauseForTime(100);
# memWatcher.pauseForTime(100);
# controller.releaseButtons();
# print("done");
# while(True):
# # basicCommands.test2();
# basicCommands.recover();
# # basicCommands.dashDance();
# controller.releaseButtons();
return;
if __name__ == '__main__':
main();