-
Notifications
You must be signed in to change notification settings - Fork 1
/
test.py
executable file
·113 lines (77 loc) · 2.09 KB
/
test.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
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#!/usr/bin/python
from kallisti import eris
is_connected = 0
is_logged = 0
is_ig = 0
has_server_info = 0
def connected():
print "connected called"
global is_connected
is_connected = 1
def disconnected():
print "disconnected called"
def gotServerInfo():
print "gotServerInfo called"
global has_server_info
has_server_info = 1
def disconnecting():
print "disconnecting called"
def failure():
print "failure called"
def status_changed():
print "status_changed called"
def login_success():
print "login_success called"
global is_logged
is_logged = 1
def login_failure():
print "login_failure called"
got_avatar=None
def avatar_success(avatar):
print "avatar_success called"
print avatar
global is_ig
global got_avatar
is_ig = 1
got_avatar = avatar
def avatar_failure():
print "avatar_failure called"
def avatar_deactivated():
print "avatar_deactivated called"
if __name__ == "__main__":
foo = eris.Connection("foo", "localhost", 6767, 1)
foo.Connected = connected
foo.Disconnected = disconnected
foo.GotServerInfo = gotServerInfo
foo.Disconnecting = disconnecting
foo.Failure = failure
foo.StatusChanged = status_changed
foo.connect()
while is_connected == 0:
eris.polldefault.poll()
print "Okay"
foo.refreshServerInfo()
while has_server_info == 0:
eris.polldefault.poll()
print foo.getServerInfo()
acc = eris.Account(foo)
acc.LoginSuccess = login_success
acc.LoginFailure = login_failure
acc.login("ajr", "hel")
while is_logged == 0:
eris.polldefault.poll()
has_server_info = 0
foo.refreshServerInfo()
while has_server_info == 0:
eris.polldefault.poll()
print foo.getServerInfo()
acc.AvatarSuccess = avatar_success
acc.AvatarFailure = avatar_failure
acc.AvatarDeactivated = avatar_deactivated
for i in acc.getCharacterTypes():
print "Type: ", i
acc.createCharacter("foo")
while not is_ig:
eris.polldefault.poll()
view = got_avatar.getView()
print view