-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbomberbot.py
More file actions
37 lines (30 loc) · 823 Bytes
/
bomberbot.py
File metadata and controls
37 lines (30 loc) · 823 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
35
36
37
# -*- coding: utf-8 -*-
import socket
class BomberStandar():
""" Bomberbot client Standart
"""
def __init__(self, user, token, host, port):
"""
Arguments:
- `user`:
- `token`:
"""
self.sck = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.user = user
self.token = token
self._host = host
self._port = port
def login(self):
self.sck.connect((self._host, self._port))
if self.sck.recv(4096).endswith("Ingrese usuario y token:\r\n"):
self.sck.send("%s,%s" % (self.user, self.token))
return True
else:
return False
def play(self):
self.login()
while True:
pass
if __name__ == '__main__':
b = BomberStandar()
b.play()