4 ###############################################
6 ###############################################
7 print "###############################################"
8 print "# dcpp_client v0.0.1 #"
9 print "# (c) ASCHE 2008 #"
10 print "###############################################"
11 ###############################################
12 host
= "avangard.no-ip.org"
17 client
= dcpp_client
.DCPP_CLIENT((host
, port
), nick
)
19 ###############################################
22 if not client
.connect():
26 print "###############################################"
28 ###############################################
36 data
, user
, msg
= client
.process_cache()
42 if (user
== owner
) and (msg
== "q!"):
47 if msg
== "->weather":
48 client
.send_to_user(user
, services
.GetWeather())
52 client
.send_to_user(user
, services
.GetBashQuote())
53 elif msg
== "->nyash":
54 client
.send_to_user(user
, services
.GetNyashQuote())
55 elif msg
== "->takto":
56 client
.send_to_user(user
, services
.GetTaktoQuote())
59 elif (msg
== "->en") or (msg
== "->ru"):
60 for room
in room_list
:
61 user_room
, last_msg
= room
63 client
.send_to_user(user
, services
.Decode(last_msg
, msg
[2:]))
66 elif msg
[:3] == "->e":
67 client
.send_to_user(user
, services
.Decode(msg
[4:], "en"))
68 elif msg
[:3] == "->r":
69 client
.send_to_user(user
, services
.Decode(msg
[4:], "ru"))
71 #---------------------------------------------#
75 for i
in range(len(room_list
)):
76 user_room
, last_msg
= room_list
[i
]
78 room_list
[i
] = user
, msg
84 room_list
.append(new_room
)
86 ###############################################
87 print "###############################################"
93 print "###############################################"