Add files via upload
This commit is contained in:
1 parent
cfda61a52d
commit
a88687ffef
14 files changed
+1714
No files matched your search
@@ -0,0 +1,86 @@
|
||||
#!/usr/bin/Nessar
|
||||
|
||||
import urllib.request
|
||||
import json
|
||||
import time
|
||||
from time import strftime
|
||||
import ts3
|
||||
import re
|
||||
|
||||
def lookup(ip):
|
||||
|
||||
response = urllib.request.Request("http://v2.api.iphub.info/ip/{}".format(ip))
|
||||
response.add_header("X-Key", "***REMOVED***")
|
||||
|
||||
try:
|
||||
response = json.loads(urllib.request.urlopen(response).read().decode())
|
||||
except:
|
||||
return False # In the case of an error, pass all IP's to avoid blocking innocents
|
||||
|
||||
return response.get("block") # Defaults to None if failed to get block value
|
||||
|
||||
def vieprog(cluid, clname):
|
||||
time = strftime("%d/%m/%Y %H:%M:%S")
|
||||
banclient = 0
|
||||
with open("/home/pi/Documents/python/data_file.json", "r") as read_file:
|
||||
identites = json.load(read_file)
|
||||
try:
|
||||
if identites[cluid] is not None:
|
||||
if identites[cluid]["vie"] != 0:
|
||||
identites[cluid]["vie"] = identites[cluid]["vie"] - 1
|
||||
identites[cluid]['time'] = time
|
||||
except:
|
||||
identites.update({cluid: {"clname": clname, "vie": 2, "time": time}})
|
||||
|
||||
with open("/home/pi/Documents/python/data_file.json", "w") as write_file:
|
||||
json.dump(identites, write_file)
|
||||
|
||||
return identites[cluid]['vie']
|
||||
|
||||
# response = requests.get("https://api.xdefcon.com/proxy/check/?ip=")
|
||||
# info = json.loads(response.text)
|
||||
# print (info['message'])
|
||||
|
||||
def prog(ts3conn):
|
||||
ts3conn.send_keepalive()
|
||||
try:
|
||||
event = ts3conn.wait_for_event(240)
|
||||
print(time.strftime("%H:%M:%S"))
|
||||
print(' Info: Evenement' + '\n')
|
||||
except:
|
||||
print(time.strftime("%H:%M:%S"))
|
||||
print('Warning: Timeout' + '\n')
|
||||
return 2
|
||||
try:
|
||||
if event[0]["reasonid"] == '0' and event[0]["client_type"] != 1 :
|
||||
clsg = event[0]['client_servergroups']
|
||||
if re.search("6",clsg) is None and re.search("9",clsg) is None and re.search("18",clsg) is None:
|
||||
clinfo = ts3conn.clientinfo(clid=event[0]['clid'])
|
||||
clip = clinfo[0]["connection_client_ip"]
|
||||
clname = clinfo[0]['client_nickname']
|
||||
clid = event[0]["clid"]
|
||||
if lookup(clip) == 1:
|
||||
vie = vieprog(event[0]['client_unique_identifier'], clname)
|
||||
if vie > 0:
|
||||
vie = str(vie)
|
||||
ts3conn.clientpoke(msg="Pas de proxy ! (Seulement l'ip est ban, il te reste "+vie+" vie(s) avant que ton identite soit ban !", clid=clid)
|
||||
ts3conn.banadd(ip=clip, banreason="Pas de Proxy !", time=0)
|
||||
else:
|
||||
ts3conn.clientpoke(msg="Pas de proxy ! Ton identite est aussi ban !", clid=clid)
|
||||
ts3conn.banadd(uid=event[0]['client_unique_identifier'], banreason="Pas de Proxy "+clname+"!", time=0)
|
||||
ts3conn.banadd(ip=clip, banreason="Pas de Proxy !", time=0)
|
||||
except:
|
||||
print(time.strftime("%H:%M:%S"))
|
||||
print('Warning: ERROR' + '\n')
|
||||
return 3
|
||||
|
||||
with ts3.query.TS3Connection("localhost") as ts3conn:
|
||||
ts3conn.login(
|
||||
client_login_name="***REMOVED***",
|
||||
client_login_password="***REMOVED***"
|
||||
)
|
||||
ts3conn.use(sid=1)
|
||||
ts3conn.clientupdate(client_nickname="Bot Anti-VPN")
|
||||
ts3conn.servernotifyregister(event="server")
|
||||
while True:
|
||||
prog(ts3conn)
|
||||
+105
@@ -0,0 +1,105 @@
|
||||
#!/usr/bin/Nessar3
|
||||
|
||||
import time
|
||||
import ts3
|
||||
import re
|
||||
|
||||
def prog(ts3conn):
|
||||
ts3conn.send_keepalive()
|
||||
try:
|
||||
event = ts3conn.wait_for_event(240)
|
||||
print(time.strftime("%H:%M:%S"))
|
||||
print(' Info: évenement' + '\n')
|
||||
except:
|
||||
print(time.strftime("%H:%M:%S"))
|
||||
print(' Warning: Timeout' + '\n')
|
||||
#ts3conn.close()
|
||||
return 2
|
||||
try:
|
||||
if event[0]["invokeruid"] == "***REMOVED***" or event[0]["invokeruid"] == "***REMOVED***" or event[0]["invokeruid"] == "***REMOVED***":
|
||||
msg = event[0]['msg']
|
||||
msg = msg.lstrip(' ').rstrip(' ')
|
||||
msg = msg.lower()
|
||||
Iid = event[0]['invokerid']
|
||||
if msg[:3] == "§kt":
|
||||
if msg[4:7] == "add":
|
||||
new = msg[8:]
|
||||
try:
|
||||
ts3conn.clientfind(pattern=new)
|
||||
except:
|
||||
ts3conn.clientpoke(msg="Pseudo incorrect !", clid=Iid)
|
||||
print(time.strftime("%H:%M:%S"))
|
||||
print(' Warning: Client introuvable' + '\n')
|
||||
#ts3conn.close()
|
||||
return 4
|
||||
newclid = ts3conn.clientfind(pattern=new)
|
||||
newinfo = ts3conn.clientinfo(clid=newclid[0]['clid'])
|
||||
newdb = newinfo[0]['client_database_id']
|
||||
newsg = newinfo[0]['client_servergroups']
|
||||
if re.search("21", newsg) is None:
|
||||
ts3conn.servergroupaddclient(sgid=21, cldbid=int(newdb))
|
||||
ts3conn.channelclientaddperm(cid=91, cldbid=int(newdb), permsid="i_channel_join_power", permvalue=75)
|
||||
ts3conn.channelclientaddperm(cid=92, cldbid=int(newdb), permsid="i_channel_join_power", permvalue=75)
|
||||
ts3conn.channelclientaddperm(cid=94, cldbid=int(newdb), permsid="i_channel_join_power", permvalue=75)
|
||||
ts3conn.clientpoke(msg=new+" a bien été ajouter à la KT", clid=Iid)
|
||||
ts3conn.clientpoke(msg="Félicitation pour votre recrutement "+new+" !", clid=newclid[0]['clid'])
|
||||
else:
|
||||
ts3conn.clientpoke(msg=new+" est déjà dans la KT !", clid=Iid)
|
||||
elif msg[4:7] == "del":
|
||||
gb = msg[8:]
|
||||
try:
|
||||
ts3conn.clientfind(pattern=gb)
|
||||
except:
|
||||
ts3conn.clientpoke(msg="Pseudo incorrect !", clid=Iid)
|
||||
print(time.strftime("%H:%M:%S"))
|
||||
print(' Warning: Client introuvable' + '\n')
|
||||
#ts3conn.close()
|
||||
return 4
|
||||
gbclid = ts3conn.clientfind(pattern=gb)
|
||||
gbinfo = ts3conn.clientinfo(clid=gbclid[0]['clid'])
|
||||
gbdb = gbinfo[0]['client_database_id']
|
||||
gbsg = gbinfo[0]['client_servergroups']
|
||||
if re.search("21", gbsg) is not None:
|
||||
ts3conn.servergroupdelclient(sgid=21, cldbid=int(gbdb))
|
||||
ts3conn.channelclientdelperm(cid=91, cldbid=int(gbdb), permsid="i_channel_join_power")
|
||||
ts3conn.channelclientdelperm(cid=92, cldbid=int(gbdb), permsid="i_channel_join_power")
|
||||
ts3conn.channelclientdelperm(cid=94, cldbid=int(gbdb), permsid="i_channel_join_power")
|
||||
ts3conn.clientpoke(msg=gb+" a bien été supprimé de la KT", clid=Iid)
|
||||
ts3conn.clientpoke(msg="Vous avez été expulsé de la KT "+gb+" !", clid=gbclid[0]['clid'])
|
||||
else:
|
||||
ts3conn.clientpoke(msg=gb+" n'est pas dans la KT !", clid=Iid)
|
||||
elif msg[4:6] == "on":
|
||||
info = ts3conn.channelfind(pattern="Recrutement")
|
||||
if info[0]['channel_name'][13:15] == "ON":
|
||||
ts3conn.clientpoke(msg="Le recrutement est déjà actif !", clid=Iid)
|
||||
else:
|
||||
ts3conn.channeledit(cid=95, channel_name="Recrutement [ON]", channel_description="[CENTER]La team K.T. [U]RECRUTE ![/U][/CENTER]")
|
||||
ts3conn.channeladdperm(cid=95, permsid="i_channel_needed_join_power", permvalue=0)
|
||||
ts3conn.clientpoke(msg="Le recrutement est désormais actif.", clid=Iid)
|
||||
|
||||
elif msg[4:7] == "off":
|
||||
info = ts3conn.channelfind(pattern="Recrutement")
|
||||
if info[0]['channel_name'][13:15] == "OF":
|
||||
ts3conn.clientpoke(msg="Le recrutement est déjà inactif !", clid=Iid)
|
||||
else:
|
||||
ts3conn.channeledit(cid=95, channel_name="Recrutement [OFF]", channel_description="[CENTER]La team K.T. [U]NE RECRUTE PLUS[/U][/CENTER]")
|
||||
ts3conn.channeladdperm(cid=95, permsid="i_channel_needed_join_power", permvalue=75)
|
||||
ts3conn.clientpoke(msg="Le recrutement est désormais inactif.", clid=Iid)
|
||||
else:
|
||||
ts3conn.clientpoke(msg="Commande incorrecte (§kt on|off ou §kt add|del pseudo)", clid=Iid)
|
||||
except:
|
||||
print(time.strftime("%H:%M:%S"))
|
||||
print(' Error: Inconnu' + '\n')
|
||||
#ts3conn.close()
|
||||
return 5
|
||||
|
||||
with ts3.query.TS3Connection("localhost") as ts3conn:
|
||||
ts3conn.login(
|
||||
client_login_name="***REMOVED***",
|
||||
client_login_password="***REMOVED***"
|
||||
)
|
||||
ts3conn.use(sid=1)
|
||||
ts3conn.clientupdate(client_nickname="Bot KT")
|
||||
ts3conn.servernotifyregister(event="textserver")
|
||||
while True:
|
||||
prog(ts3conn)
|
||||
+108
@@ -0,0 +1,108 @@
|
||||
#!/usr/bin/Nessar
|
||||
|
||||
import time
|
||||
import ts3
|
||||
import re
|
||||
import requests
|
||||
import json
|
||||
import MySQLdb
|
||||
import asyncio
|
||||
import r6sapi as api
|
||||
|
||||
db = MySQLdb.connect(host="localhost",user="***REMOVED***",passwd="***REMOVED***", db="forum")
|
||||
cur = db.cursor()
|
||||
|
||||
rankelo = [[1100,1200,1300,1400,1500],[1600,1700,1800,1900,2000],[2100,2200,2300,2400,2500],[2600,2800,3000],[3200,3600,4000],[4400],[5000]]
|
||||
rankts = [[217,218,219,220,221],[222,223,224,225,226],[227,228,229,230,231],[232,233,234],[235,236,237],[238],[239]]
|
||||
|
||||
def prog(ts3conn, cur):
|
||||
cur.execute("SELECT * FROM forum_membres")
|
||||
for row in cur.fetchall():
|
||||
r6 = row[9]
|
||||
tsuid = row[8]
|
||||
if tsuid != None:
|
||||
if r6 != None:
|
||||
try:
|
||||
cldbid_ = ts3conn.clientgetdbidfromuid(cluid=tsuid)
|
||||
cldbid_ = cldbid_[0]['cldbid']
|
||||
clids = ts3conn.clientgetids(cluid=tsuid)
|
||||
clid_ = clids[0]['clid']
|
||||
clinfo = ts3conn.clientinfo(clid=clid_)
|
||||
clsg = clinfo[0]['client_servergroups']
|
||||
if re.search("27", clsg):
|
||||
r6rank(ts3conn, cur, r6, tsuid)
|
||||
except:
|
||||
pass
|
||||
|
||||
def r6rank(ts3conn, cur, r6, tsuid):
|
||||
cur.execute("SELECT * FROM forum_membres")
|
||||
# info = json.loads(response.text)
|
||||
try:
|
||||
async def run(a):
|
||||
auth = api.Auth("***REMOVED***", "***REMOVED***")
|
||||
player = await auth.get_player(a, api.Platforms.UPLAY)
|
||||
mmr2 = await player.get_rank(api.RankedRegions.EU)
|
||||
rank = mmr2.mmr
|
||||
await auth.close()
|
||||
return rank
|
||||
pmmr = asyncio.get_event_loop().run_until_complete(run(r6))
|
||||
except:
|
||||
rank = 0
|
||||
tier = 0
|
||||
pmmr = 0
|
||||
rankadd = 0
|
||||
if pmmr != 0:
|
||||
if pmmr <= 5000:
|
||||
for i in range(len(rankelo)):
|
||||
for i2 in range(len(rankelo[i])):
|
||||
if pmmr < rankelo[i][i2]:
|
||||
if i2 == 0:
|
||||
if i == 0:
|
||||
rankadd = str(rankts[i][i2])
|
||||
break
|
||||
else:
|
||||
rankadd = str(rankts[i-1][int(len(rankelo[i-1])-1)])
|
||||
break
|
||||
else:
|
||||
rankadd = str(rankts[i][i2-1])
|
||||
break
|
||||
if rankadd != 0:
|
||||
break
|
||||
|
||||
else:
|
||||
rankadd = str(rankts[6][0])
|
||||
else:
|
||||
rankadd = 0
|
||||
# print(r6)
|
||||
# print(pmmr)
|
||||
addrank(ts3conn, rankadd, tsuid)
|
||||
|
||||
def addrank(ts3conn, rankadd, tsuid):
|
||||
if rankadd != 0:
|
||||
cldbid_ = ts3conn.clientgetdbidfromuid(cluid=tsuid)
|
||||
cldbid_ = cldbid_[0]['cldbid']
|
||||
clids = ts3conn.clientgetids(cluid=tsuid)
|
||||
clid_ = clids[0]['clid']
|
||||
clinfo = ts3conn.clientinfo(clid=clid_)
|
||||
clsg = clinfo[0]['client_servergroups']
|
||||
n = 217
|
||||
while n <= 239:
|
||||
if re.search(str(n), clsg):
|
||||
if n == int(rankadd):
|
||||
return 5
|
||||
sgdel = n
|
||||
ts3conn.servergroupdelclient(sgid=int(sgdel), cldbid=cldbid_)
|
||||
break
|
||||
n = n + 1
|
||||
ts3conn.servergroupaddclient(sgid=int(rankadd), cldbid=cldbid_)
|
||||
|
||||
with ts3.query.TS3Connection("localhost") as ts3conn:
|
||||
ts3conn.login(
|
||||
client_login_name="***REMOVED***",
|
||||
client_login_password="***REMOVED***"
|
||||
)
|
||||
ts3conn.use(sid=1)
|
||||
ts3conn.clientupdate(client_nickname="Bot R6")
|
||||
while True:
|
||||
prog(ts3conn,cur)
|
||||
time.sleep(60)
|
||||
@@ -0,0 +1,290 @@
|
||||
#!/usr/bin/Nessar
|
||||
|
||||
import time
|
||||
import ts3
|
||||
import re
|
||||
import requests
|
||||
import json
|
||||
import MySQLdb
|
||||
import asyncio
|
||||
import r6sapi as api
|
||||
|
||||
db = MySQLdb.connect(host="localhost",user="***REMOVED***",passwd="***REMOVED***", db="forum")
|
||||
cur = db.cursor()
|
||||
apikeylol = "***REMOVED***"
|
||||
apikeytft = "***REMOVED***"
|
||||
|
||||
rankelo = [[1100,1200,1300,1400,1500],[1600,1700,1800,1900,2000],[2100,2200,2300,2400,2500],[2600,2800,3000],[3200,3600,4000],[4400],[5000]]
|
||||
rankts = [[217,218,219,220,221],[222,223,224,225,226],[227,228,229,230,231],[232,233,234],[235,236,237],[238],[239]]
|
||||
|
||||
def progr6(ts3conn, cur):
|
||||
cur.execute("SELECT * FROM forum_membres")
|
||||
for row in cur.fetchall():
|
||||
r6 = row[9]
|
||||
tsuid = row[8]
|
||||
if tsuid != None:
|
||||
if r6 != None:
|
||||
try:
|
||||
cldbid_ = ts3conn.clientgetdbidfromuid(cluid=tsuid)
|
||||
cldbid_ = cldbid_[0]['cldbid']
|
||||
clids = ts3conn.clientgetids(cluid=tsuid)
|
||||
clid_ = clids[0]['clid']
|
||||
clinfo = ts3conn.clientinfo(clid=clid_)
|
||||
clsg = clinfo[0]['client_servergroups']
|
||||
if re.search("27", clsg):
|
||||
r6rank(ts3conn, cur, r6, tsuid)
|
||||
except:
|
||||
pass
|
||||
|
||||
def r6rank(ts3conn, cur, r6, tsuid):
|
||||
cur.execute("SELECT * FROM forum_membres")
|
||||
# info = json.loads(response.text)
|
||||
try:
|
||||
async def run(a):
|
||||
auth = api.Auth("***REMOVED***", "***REMOVED***")
|
||||
player = await auth.get_player(a, api.Platforms.UPLAY)
|
||||
mmr2 = await player.get_rank(api.RankedRegions.EU)
|
||||
rank = mmr2.mmr
|
||||
await auth.close()
|
||||
return rank
|
||||
pmmr = asyncio.get_event_loop().run_until_complete(run(r6))
|
||||
except:
|
||||
rank = 0
|
||||
tier = 0
|
||||
pmmr = 0
|
||||
rankadd = 0
|
||||
if pmmr != 0:
|
||||
if pmmr <= 5000:
|
||||
for i in range(len(rankelo)):
|
||||
for i2 in range(len(rankelo[i])):
|
||||
if pmmr < rankelo[i][i2]:
|
||||
if i2 == 0:
|
||||
if i == 0:
|
||||
rankadd = str(rankts[i][i2])
|
||||
break
|
||||
else:
|
||||
rankadd = str(rankts[i-1][int(len(rankelo[i-1])-1)])
|
||||
break
|
||||
else:
|
||||
rankadd = str(rankts[i][i2-1])
|
||||
break
|
||||
if rankadd != 0:
|
||||
break
|
||||
|
||||
else:
|
||||
rankadd = str(rankts[6][0])
|
||||
else:
|
||||
rankadd = 0
|
||||
print(r6)
|
||||
print(pmmr)
|
||||
time.sleep(5)
|
||||
addrankr6(ts3conn, rankadd, tsuid)
|
||||
|
||||
def addrankr6(ts3conn, rankadd, tsuid):
|
||||
if rankadd != 0:
|
||||
cldbid_ = ts3conn.clientgetdbidfromuid(cluid=tsuid)
|
||||
cldbid_ = cldbid_[0]['cldbid']
|
||||
clids = ts3conn.clientgetids(cluid=tsuid)
|
||||
clid_ = clids[0]['clid']
|
||||
clinfo = ts3conn.clientinfo(clid=clid_)
|
||||
clsg = clinfo[0]['client_servergroups']
|
||||
n = 217
|
||||
while n <= 239:
|
||||
if re.search(str(n), clsg):
|
||||
if n == int(rankadd):
|
||||
return 5
|
||||
sgdel = n
|
||||
ts3conn.servergroupdelclient(sgid=int(sgdel), cldbid=cldbid_)
|
||||
break
|
||||
n = n + 1
|
||||
ts3conn.servergroupaddclient(sgid=int(rankadd), cldbid=cldbid_)
|
||||
|
||||
def proglol(ts3conn, cur):
|
||||
cur.execute("SELECT * FROM forum_membres")
|
||||
for row in cur.fetchall():
|
||||
loli = row[7]
|
||||
tsuid = row[8]
|
||||
if tsuid != None:
|
||||
if loli != None:
|
||||
try:
|
||||
cldbid_ = ts3conn.clientgetdbidfromuid(cluid=tsuid)
|
||||
cldbid_ = cldbid_[0]['cldbid']
|
||||
clids = ts3conn.clientgetids(cluid=tsuid)
|
||||
clid_ = clids[0]['clid']
|
||||
clinfo = ts3conn.clientinfo(clid=clid_)
|
||||
clsg = clinfo[0]['client_servergroups']
|
||||
if re.search("36", clsg):
|
||||
lol(ts3conn, cur, loli, tsuid)
|
||||
if re.search("41", clsg):
|
||||
tft(ts3conn, cur, loli, tsuid)
|
||||
except:
|
||||
pass
|
||||
|
||||
def tft(ts3conn,cur,lol,tsuid):
|
||||
cur.execute("SELECT * FROM forum_membres")
|
||||
try:
|
||||
response = requests.get("https://euw1.api.riotgames.com/tft/summoner/v1/summoners/by-name/"+lol+"?api_key="+apikeytft)
|
||||
except:
|
||||
rank = 0
|
||||
tier = 0
|
||||
info = json.loads(response.text)
|
||||
if info['id'] != '':
|
||||
lolid = info['id']
|
||||
try:
|
||||
response = requests.get("https://euw1.api.riotgames.com/tft/league/v1/entries/by-summoner/"+lolid+"?api_key="+apikeytft)
|
||||
except:
|
||||
rank = 0
|
||||
tier = 0
|
||||
info = json.loads(response.text)
|
||||
try:
|
||||
rank = info[0]['tier']
|
||||
tier = info[0]['rank']
|
||||
except:
|
||||
rank = 0
|
||||
tier = 0
|
||||
addranklol(ts3conn, rank, tier, tsuid, 1)
|
||||
|
||||
def lol(ts3conn,cur,lol,tsuid):
|
||||
cur.execute("SELECT * FROM forum_membres")
|
||||
try:
|
||||
response = requests.get("https://euw1.api.riotgames.com/lol/summoner/v4/summoners/by-name/"+lol+"?api_key="+apikeylol)
|
||||
except:
|
||||
rank = 0
|
||||
tier = 0
|
||||
info = json.loads(response.text)
|
||||
if info['id'] != '':
|
||||
lolid = info['id']
|
||||
try:
|
||||
response = requests.get("https://euw1.api.riotgames.com/lol/league/v4/entries/by-summoner/"+lolid+"?api_key="+apikeylol)
|
||||
except:
|
||||
rank = 0
|
||||
tier = 0
|
||||
info = json.loads(response.text)
|
||||
try:
|
||||
rank1 = info[0]['tier']
|
||||
tier1 = info[0]['rank']
|
||||
try:
|
||||
rank2 = info[1]['tier']
|
||||
tier2 = info[1]['rank']
|
||||
if rankchiffre(rank1) == rankchiffre(rank2):
|
||||
rank = rank1
|
||||
if romainlatin(tier1) > romainlatin(tier2):
|
||||
tier = tier1
|
||||
# print(tier1+lol)
|
||||
else:
|
||||
tier = tier2
|
||||
# print(tier2+lol)
|
||||
elif rankchiffre(rank1) > rankchiffre(rank2):
|
||||
rank = rank1
|
||||
tier = tier1
|
||||
else:
|
||||
rank = rank2
|
||||
tier = tier2
|
||||
except:
|
||||
rank = rank1
|
||||
tier = tier1
|
||||
except:
|
||||
rank = 0
|
||||
tier = 0
|
||||
addranklol(ts3conn, rank, tier, tsuid, 0)
|
||||
|
||||
def addranklol(ts3conn, rank, tier, tsuid, jeu):
|
||||
if jeu == 0:
|
||||
a = None
|
||||
if rank != 0:
|
||||
sglist = [[162,163,164,165],[167,168,169,170],[171,172,173,174],[175,176,177,178],[179,180,181,182],[183,184,185,186],187,188,189]
|
||||
cldbid_ = ts3conn.clientgetdbidfromuid(cluid=tsuid)
|
||||
cldbid_ = cldbid_[0]['cldbid']
|
||||
clids = ts3conn.clientgetids(cluid=tsuid)
|
||||
clid_ = clids[0]['clid']
|
||||
clinfo = ts3conn.clientinfo(clid=clid_)
|
||||
clsg = clinfo[0]['client_servergroups']
|
||||
a = romainlatin(tier)
|
||||
b = rankchiffre(rank)
|
||||
if a == 0:
|
||||
sgadd = sglist[b]
|
||||
else:
|
||||
sgadd = sglist[b][a-1]
|
||||
n = 162
|
||||
while n <= 189:
|
||||
if re.search(str(n), clsg):
|
||||
if n == sgadd:
|
||||
return 5
|
||||
sgdel = n
|
||||
ts3conn.servergroupdelclient(sgid=int(sgdel), cldbid=cldbid_)
|
||||
break
|
||||
n = n + 1
|
||||
ts3conn.servergroupaddclient(sgid=int(sgadd), cldbid=cldbid_)
|
||||
elif jeu ==1:
|
||||
a = None
|
||||
if rank != 0:
|
||||
sglist = [[190,191,192,193],[194,195,196,197],[198,199,200,201],[202,203,204,205],[206,207,208,209],[210,211,212,213],214,215,216]
|
||||
cldbid_ = ts3conn.clientgetdbidfromuid(cluid=tsuid)
|
||||
cldbid_ = cldbid_[0]['cldbid']
|
||||
clids = ts3conn.clientgetids(cluid=tsuid)
|
||||
clid_ = clids[0]['clid']
|
||||
clinfo = ts3conn.clientinfo(clid=clid_)
|
||||
clsg = clinfo[0]['client_servergroups']
|
||||
a = romainlatin(tier)
|
||||
b = rankchiffre(rank)
|
||||
if a == 0:
|
||||
sgadd = sglist[b]
|
||||
else:
|
||||
sgadd = sglist[b][a-1]
|
||||
n = 190
|
||||
while n <= 216:
|
||||
if re.search(str(n), clsg):
|
||||
if n == sgadd:
|
||||
return 5
|
||||
sgdel = n
|
||||
ts3conn.servergroupdelclient(sgid=int(sgdel), cldbid=cldbid_)
|
||||
break
|
||||
n = n + 1
|
||||
ts3conn.servergroupaddclient(sgid=int(sgadd), cldbid=cldbid_)
|
||||
|
||||
def romainlatin(a):
|
||||
if a == "I":
|
||||
b = 4
|
||||
elif a == "II":
|
||||
b = 3
|
||||
elif a == "III":
|
||||
b = 2
|
||||
elif a == "IV":
|
||||
b = 1
|
||||
else:
|
||||
b = 0
|
||||
return b
|
||||
|
||||
def rankchiffre(a):
|
||||
if a == "IRON":
|
||||
b = 0
|
||||
elif a == "BRONZE":
|
||||
b = 1
|
||||
elif a == "SILVER":
|
||||
b = 2
|
||||
elif a == "GOLD":
|
||||
b = 3
|
||||
elif a == "PLATINUM":
|
||||
b = 4
|
||||
elif a == "DIAMOND":
|
||||
b = 5
|
||||
elif a == "MASTER":
|
||||
b = 6
|
||||
elif a == "GRANDMASTER":
|
||||
b = 7
|
||||
elif a == "CHALLENGER":
|
||||
b = 8
|
||||
return b
|
||||
|
||||
with ts3.query.TS3Connection("localhost") as ts3conn:
|
||||
ts3conn.login(
|
||||
client_login_name="***REMOVED***",
|
||||
client_login_password="***REMOVED***"
|
||||
)
|
||||
ts3conn.use(sid=1)
|
||||
ts3conn.clientupdate(client_nickname="Bot Jeux")
|
||||
while True:
|
||||
proglol(ts3conn,cur)
|
||||
time.sleep(60)
|
||||
progr6(ts3conn,cur)
|
||||
time.sleep(60)
|
||||
+200
@@ -0,0 +1,200 @@
|
||||
#!/usr/bin/Nessar
|
||||
|
||||
import time
|
||||
import ts3
|
||||
import re
|
||||
import requests
|
||||
import json
|
||||
import MySQLdb
|
||||
|
||||
db = MySQLdb.connect(host="localhost",user="***REMOVED***",passwd="***REMOVED***", db="forum")
|
||||
cur = db.cursor()
|
||||
apikey = "***REMOVED***"
|
||||
|
||||
def prog(ts3conn, cur):
|
||||
cur.execute("SELECT * FROM forum_membres")
|
||||
for row in cur.fetchall():
|
||||
loli = row[7]
|
||||
tsuid = row[8]
|
||||
if tsuid != None:
|
||||
if loli != None:
|
||||
try:
|
||||
cldbid_ = ts3conn.clientgetdbidfromuid(cluid=tsuid)
|
||||
cldbid_ = cldbid_[0]['cldbid']
|
||||
clids = ts3conn.clientgetids(cluid=tsuid)
|
||||
clid_ = clids[0]['clid']
|
||||
clinfo = ts3conn.clientinfo(clid=clid_)
|
||||
clsg = clinfo[0]['client_servergroups']
|
||||
if re.search("36", clsg):
|
||||
lol(ts3conn, cur, loli, tsuid)
|
||||
if re.search("41", clsg):
|
||||
tft(ts3conn, cur, loli, tsuid)
|
||||
except:
|
||||
pass
|
||||
|
||||
def tft(ts3conn,cur,lol,tsuid):
|
||||
cur.execute("SELECT * FROM forum_membres")
|
||||
try:
|
||||
response = requests.get("https://euw1.api.riotgames.com/lol/summoner/v4/summoners/by-name/"+lol+"?api_key="+apikey)
|
||||
except:
|
||||
rank = 0
|
||||
tier = 0
|
||||
info = json.loads(response.text)
|
||||
if info['id'] != '':
|
||||
lolid = info['id']
|
||||
try:
|
||||
response = requests.get("https://euw1.api.riotgames.com/tft/league/v1/entries/by-summoner/"+lolid+"?api_key="+apikey)
|
||||
except:
|
||||
rank = 0
|
||||
tier = 0
|
||||
info = json.loads(response.text)
|
||||
try:
|
||||
rank = info[0]['tier']
|
||||
tier = info[0]['rank']
|
||||
except:
|
||||
rank = 0
|
||||
tier = 0
|
||||
addrank(ts3conn, rank, tier, tsuid, 1)
|
||||
|
||||
def lol(ts3conn,cur,lol,tsuid):
|
||||
cur.execute("SELECT * FROM forum_membres")
|
||||
try:
|
||||
response = requests.get("https://euw1.api.riotgames.com/lol/summoner/v4/summoners/by-name/"+lol+"?api_key="+apikey)
|
||||
except:
|
||||
rank = 0
|
||||
tier = 0
|
||||
info = json.loads(response.text)
|
||||
if info['id'] != '':
|
||||
lolid = info['id']
|
||||
try:
|
||||
response = requests.get("https://euw1.api.riotgames.com/lol/league/v4/entries/by-summoner/"+lolid+"?api_key="+apikey)
|
||||
except:
|
||||
rank = 0
|
||||
tier = 0
|
||||
info = json.loads(response.text)
|
||||
try:
|
||||
rank1 = info[0]['tier']
|
||||
tier1 = info[0]['rank']
|
||||
try:
|
||||
rank2 = info[1]['tier']
|
||||
tier2 = info[1]['rank']
|
||||
if rankchiffre(rank1) == rankchiffre(rank2):
|
||||
rank = rank1
|
||||
if romainlatin(tier1) > romainlatin(tier2):
|
||||
tier = tier1
|
||||
print(tier1+lol)
|
||||
else:
|
||||
tier = tier2
|
||||
print(tier2+lol)
|
||||
elif rankchiffre(rank1) > rankchiffre(rank2):
|
||||
rank = rank1
|
||||
tier = tier1
|
||||
else:
|
||||
rank = rank2
|
||||
tier = tier2
|
||||
except:
|
||||
rank = rank1
|
||||
tier = tier1
|
||||
except:
|
||||
rank = 0
|
||||
tier = 0
|
||||
addrank(ts3conn, rank, tier, tsuid, 0)
|
||||
|
||||
def addrank(ts3conn, rank, tier, tsuid, jeu):
|
||||
if jeu == 0:
|
||||
a = None
|
||||
if rank != 0:
|
||||
sglist = [[162,163,164,165],[167,168,169,170],[171,172,173,174],[175,176,177,178],[179,180,181,182],[183,184,185,186],187,188,189]
|
||||
cldbid_ = ts3conn.clientgetdbidfromuid(cluid=tsuid)
|
||||
cldbid_ = cldbid_[0]['cldbid']
|
||||
clids = ts3conn.clientgetids(cluid=tsuid)
|
||||
clid_ = clids[0]['clid']
|
||||
clinfo = ts3conn.clientinfo(clid=clid_)
|
||||
clsg = clinfo[0]['client_servergroups']
|
||||
a = romainlatin(tier)
|
||||
b = rankchiffre(rank)
|
||||
if a == 0:
|
||||
sgadd = sglist[b]
|
||||
else:
|
||||
sgadd = sglist[b][a-1]
|
||||
n = 162
|
||||
while n <= 189:
|
||||
if re.search(str(n), clsg):
|
||||
if n == sgadd:
|
||||
return 5
|
||||
sgdel = n
|
||||
ts3conn.servergroupdelclient(sgid=int(sgdel), cldbid=cldbid_)
|
||||
break
|
||||
n = n + 1
|
||||
ts3conn.servergroupaddclient(sgid=int(sgadd), cldbid=cldbid_)
|
||||
elif jeu ==1:
|
||||
a = None
|
||||
if rank != 0:
|
||||
sglist = [[190,191,192,193],[194,195,196,197],[198,199,200,201],[202,203,204,205],[206,207,208,209],[210,211,212,213],214,215,216]
|
||||
cldbid_ = ts3conn.clientgetdbidfromuid(cluid=tsuid)
|
||||
cldbid_ = cldbid_[0]['cldbid']
|
||||
clids = ts3conn.clientgetids(cluid=tsuid)
|
||||
clid_ = clids[0]['clid']
|
||||
clinfo = ts3conn.clientinfo(clid=clid_)
|
||||
clsg = clinfo[0]['client_servergroups']
|
||||
a = romainlatin(tier)
|
||||
b = rankchiffre(rank)
|
||||
if a == 0:
|
||||
sgadd = sglist[b]
|
||||
else:
|
||||
sgadd = sglist[b][a-1]
|
||||
n = 190
|
||||
while n <= 216:
|
||||
if re.search(str(n), clsg):
|
||||
if n == sgadd:
|
||||
return 5
|
||||
sgdel = n
|
||||
ts3conn.servergroupdelclient(sgid=int(sgdel), cldbid=cldbid_)
|
||||
break
|
||||
n = n + 1
|
||||
ts3conn.servergroupaddclient(sgid=int(sgadd), cldbid=cldbid_)
|
||||
|
||||
def romainlatin(a):
|
||||
if a == "I":
|
||||
b = 4
|
||||
elif a == "II":
|
||||
b = 3
|
||||
elif a == "III":
|
||||
b = 2
|
||||
elif a == "IV":
|
||||
b = 1
|
||||
else:
|
||||
b = 0
|
||||
return b
|
||||
|
||||
def rankchiffre(a):
|
||||
if a == "IRON":
|
||||
b = 0
|
||||
elif a == "BRONZE":
|
||||
b = 1
|
||||
elif a == "SILVER":
|
||||
b = 2
|
||||
elif a == "GOLD":
|
||||
b = 3
|
||||
elif a == "PLATINUM":
|
||||
b = 4
|
||||
elif a == "DIAMOND":
|
||||
b = 5
|
||||
elif a == "MASTER":
|
||||
b = 6
|
||||
elif a == "GRANDMASTER":
|
||||
b = 7
|
||||
elif a == "CHALLENGER":
|
||||
b = 8
|
||||
return b
|
||||
|
||||
with ts3.query.TS3Connection("localhost") as ts3conn:
|
||||
ts3conn.login(
|
||||
client_login_name="***REMOVED***",
|
||||
client_login_password="***REMOVED***"
|
||||
)
|
||||
ts3conn.use(sid=1)
|
||||
ts3conn.clientupdate(client_nickname="Bot LoL")
|
||||
while True:
|
||||
prog(ts3conn,cur)
|
||||
time.sleep(60)
|
||||
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/Nessar3
|
||||
|
||||
import time
|
||||
import ts3
|
||||
import re
|
||||
|
||||
def prog(ts3conn):
|
||||
try:
|
||||
ts3conn.send_keepalive()
|
||||
event = ts3conn.wait_for_event(240)
|
||||
if event[0]["reasonid"] == '0' and event[0]["client_type"] != 1:
|
||||
ts3conn.servergroupaddclient(sgid=35, cldbid=int(event[0]["client_database_id"]))
|
||||
ts3conn.servergroupaddclient(sgid=43, cldbid=int(event[0]["client_database_id"]))
|
||||
ts3conn.servergroupaddclient(sgid=34, cldbid=int(event[0]["client_database_id"]))
|
||||
ts3conn.servergroupaddclient(sgid=33, cldbid=int(event[0]["client_database_id"]))
|
||||
ts3conn.servergroupaddclient(sgid=44, cldbid=int(event[0]["client_database_id"]))
|
||||
ts3conn.servergroupaddclient(sgid=8, cldbid=int(event[0]["client_database_id"]))
|
||||
return 1
|
||||
except:
|
||||
return 2
|
||||
|
||||
with ts3.query.TS3Connection("localhost") as ts3conn:
|
||||
ts3conn.login(
|
||||
client_login_name="***REMOVED***",
|
||||
client_login_password="***REMOVED***"
|
||||
)
|
||||
ts3conn.use(sid=1)
|
||||
ts3conn.clientupdate(client_nickname="Bot nouveaux")
|
||||
ts3conn.servernotifyregister(event="server")
|
||||
while True:
|
||||
prog(ts3conn)
|
||||
@@ -0,0 +1,90 @@
|
||||
#!/usr/bin/Nessar
|
||||
|
||||
import time
|
||||
import ts3
|
||||
import re
|
||||
|
||||
def prog(ts3conn, a):
|
||||
ts3conn.send_keepalive()
|
||||
try:
|
||||
event = ts3conn.wait_for_event(240)
|
||||
if a == 1:
|
||||
return 2
|
||||
print(time.strftime("%H:%M:%S"))
|
||||
print(' Info: Evenement' + '\n')
|
||||
except:
|
||||
print(time.strftime("%H:%M:%S"))
|
||||
print(' Warning: Timeout' + '\n')
|
||||
#ts3conn.close()
|
||||
return 2
|
||||
try:
|
||||
if event[0]["ctid"] == "45" and event[0]["reasonid"] == "1" and event[0]["invokerid"] != "14":
|
||||
clid_ = event[0]["clid"]
|
||||
ts3conn.clientpoke(clid=clid_, msg="Bienvenue en PRISON")
|
||||
clinfo = ts3conn.clientinfo(clid=clid_)
|
||||
cldbid_ = clinfo[0]["client_database_id"]
|
||||
clsg = clinfo[0]["client_servergroups"]
|
||||
if re.search("19", clsg) is not None:
|
||||
ts3conn.servergroupdelclient(sgid=19, cldbid=cldbid_)
|
||||
ts3conn.servergroupaddclient(sgid=19, cldbid=cldbid_)
|
||||
return 1
|
||||
|
||||
if event[0]["ctid"] == "46" and event[0]["reasonid"] == "1" and event[0]["invokerid"] != "14":
|
||||
clid_ = event[0]["clid"]
|
||||
ts3conn.clientpoke(clid=clid_, msg="Bienvenue en PRISON")
|
||||
clinfo = ts3conn.clientinfo(clid=clid_)
|
||||
cldbid_ = clinfo[0]["client_database_id"]
|
||||
clsg = clinfo[0]["client_servergroups"]
|
||||
if re.search("19", clsg) is not None:
|
||||
ts3conn.servergroupdelclient(sgid=19, cldbid=cldbid_)
|
||||
ts3conn.servergroupaddclient(sgid=19, cldbid=cldbid_)
|
||||
return 1
|
||||
|
||||
if event[0]["ctid"] == "47" and event[0]["reasonid"] == "1" and event[0]["invokerid"] != "14":
|
||||
clid_ = event[0]["clid"]
|
||||
ts3conn.clientpoke(clid=clid_, msg="Bienvenue en PRISON")
|
||||
clinfo = ts3conn.clientinfo(clid=clid_)
|
||||
cldbid_ = clinfo[0]["client_database_id"]
|
||||
clsg = clinfo[0]["client_servergroups"]
|
||||
if re.search("19", clsg) is not None:
|
||||
ts3conn.servergroupdelclient(sgid=19, cldbid=cldbid_)
|
||||
ts3conn.servergroupaddclient(sgid=19, cldbid=cldbid_)
|
||||
return 1
|
||||
|
||||
if event[0]["ctid"] != "47" and event[0]["ctid"] != "46" and event[0]["ctid"] != "45" and event[0]["reasonid"] == "1" and event[0]["invokerid"] != "14":
|
||||
clid_ = event[0]["clid"]
|
||||
clinfo = ts3conn.clientinfo(clid=clid_)
|
||||
cldbid_ = clinfo[0]["client_database_id"]
|
||||
clsg = clinfo[0]["client_servergroups"]
|
||||
if re.search("19", clsg) is not None:
|
||||
ts3conn.servergroupdelclient(sgid=19, cldbid=cldbid_)
|
||||
a = 0
|
||||
return 1
|
||||
|
||||
if event[0]["ctid"] == "131":
|
||||
try:
|
||||
clid_ = event[0]["clid"]
|
||||
ts3conn.clientupdate(client_nickname="Bot grades")
|
||||
ts3conn.clientpoke(msg="Pour toute demande de grade repondez :", clid=clid_)
|
||||
ts3conn.clientpoke(msg="!rank ask|del R6|CSGO|fortnite|RL|PUBG|LOL|Minecraft|tft|Gmod", clid=clid_)
|
||||
ts3conn.clientpoke(msg="Pour demander d'autre ranks|channels=>[URL=https://ktfaction.fr/forum/voirforum.php?f=4]Forum[/URL].", clid=clid_)
|
||||
ts3conn.clientupdate(client_nickname="Bot prison")
|
||||
except:
|
||||
pass
|
||||
return 1
|
||||
except:
|
||||
print(time.strftime("%H:%M:%S"))
|
||||
print(" Error: Inconnue" + '\n')
|
||||
#ts3conn.close()
|
||||
return 4
|
||||
|
||||
with ts3.query.TS3Connection("localhost") as ts3conn:
|
||||
ts3conn.login(
|
||||
client_login_name="***REMOVED***",
|
||||
client_login_password="***REMOVED***"
|
||||
)
|
||||
ts3conn.use(sid=1)
|
||||
ts3conn.servernotifyregister(event="channel", id_=0)
|
||||
ts3conn.clientupdate(client_nickname="Bot prison")
|
||||
while True:
|
||||
prog(ts3conn, 0)
|
||||
@@ -0,0 +1,85 @@
|
||||
#!/usr/bin/Nessar3
|
||||
|
||||
import time
|
||||
import ts3
|
||||
import re
|
||||
import os
|
||||
|
||||
jeux = ['r6', 'csgo', 'rl', 'fortnite', 'pubg', 'lol', 'minecraft', 'gmod','tft']
|
||||
groupe = ['27', '28', '29', '30', '31', '36', '37', '45','41']
|
||||
jeuxstr = ", ".join(jeux)
|
||||
|
||||
def prog(ts3conn, jeux, groupe):
|
||||
ts3conn.send_keepalive()
|
||||
a = -1
|
||||
success = 0
|
||||
try:
|
||||
event = ts3conn.wait_for_event(240)
|
||||
print(time.strftime("%H:%M:%S"))
|
||||
print(' Info: Evenement' + '\n')
|
||||
except:
|
||||
print(time.strftime("%H:%M:%S"))
|
||||
print('Warning: Timeout' + '\n')
|
||||
return 2
|
||||
try:
|
||||
Iid = event[0]["invokerid"]
|
||||
Iuid = event[0]["invokeruid"]
|
||||
Idbid = ts3conn.clientdbfind(pattern=Iuid, uid=True)
|
||||
Idbid = Idbid[0]['cldbid']
|
||||
msg = event[0]['msg']
|
||||
msg = msg.lstrip(' ').rstrip(' ')
|
||||
msg = msg.lower()
|
||||
except:
|
||||
print(time.strftime("%H:%M:%S"))
|
||||
print('Error: DBid' + '\n')
|
||||
return 2
|
||||
if msg[:5] == "!rank" :
|
||||
if msg[6:9] == "ask":
|
||||
for i in jeux:
|
||||
a += 1
|
||||
if msg[10:] == i:
|
||||
clinfo = ts3conn.clientinfo(clid=Iid)
|
||||
clsg = clinfo[0]['client_servergroups']
|
||||
if re.search(groupe[a], clsg) is None:
|
||||
ts3conn.servergroupaddclient(sgid=int(groupe[a]), cldbid=int(Idbid))
|
||||
ts3conn.sendtextmessage(targetmode=2, target=131, msg="Vous avez bien été ajouté au groupe")
|
||||
success = 1
|
||||
else:
|
||||
ts3conn.sendtextmessage(targetmode=2, target=131, msg="Vous avez déjà ce grade ! Si vous voulez le supprimer faites: !grade del "+i)
|
||||
if success == 0:
|
||||
ts3conn.sendtextmessage(targetmode=2, target=131, msg="Seuls les jeux: "+jeuxstr+" sont acceptés pour l'instant. Si vous en voulez d'autre => [URL=https://nessar.fr/forum/voirforum.php?f=4]Forum[/URL].")
|
||||
elif msg[6:9] == "del":
|
||||
for i in jeux:
|
||||
a += 1
|
||||
if msg[10:] == i:
|
||||
clinfo = ts3conn.clientinfo(clid=Iid)
|
||||
clsg = clinfo[0]['client_servergroups']
|
||||
if re.search(groupe[a], clsg) is not None:
|
||||
ts3conn.servergroupdelclient(sgid=int(groupe[a]), cldbid=int(Idbid))
|
||||
ts3conn.sendtextmessage(targetmode=2, target=131, msg="Vous avez bien été supprimé au groupe")
|
||||
success = 1
|
||||
else:
|
||||
ts3conn.sendtextmessage(targetmode=2, target=131, msg="Vous n'avez pas ce grade ! Si vous voulez l'ajouter faites: !grade ask "+i)
|
||||
if success == 0:
|
||||
ts3conn.sendtextmessage(targetmode=2, target=131, msg="Seuls les jeux: "+jeuxstr+" sont acceptés pour l'instant. Si vous en voulez d'autre => [URL=https://nessar.fr/forum/voirforum.php?f=4]Forum[/URL].")
|
||||
elif msg[:5] == "!help":
|
||||
ts3conn.sendtextmessage(targetmode=2, target=131, msg="Voici la liste des commandes:")
|
||||
ts3conn.sendtextmessage(targetmode=2, target=131, msg="!rank ask")
|
||||
ts3conn.sendtextmessage(targetmode=2, target=131, msg="!rank del")
|
||||
ts3conn.sendtextmessage(targetmode=2, target=131, msg="Seuls les jeux: "+jeuxstr+" sont acceptés pour l'instant. Si vous en voulez d'autre => [URL=https://nessar.fr/forum/voirforum.php?f=4]Forum[/URL].")
|
||||
|
||||
else:
|
||||
ts3conn.sendtextmessage(targetmode=2, target=131, msg="Commande incorrecte")
|
||||
|
||||
with ts3.query.TS3Connection("localhost") as ts3conn:
|
||||
ts3conn.login(
|
||||
client_login_name="***REMOVED***",
|
||||
client_login_password="***REMOVED***"
|
||||
)
|
||||
ts3conn.use(sid=1)
|
||||
ts3conn.clientupdate(client_nickname="Bot grade")
|
||||
ts3conn.servernotifyregister(event="textchannel")
|
||||
clidbot = ts3conn.clientfind(pattern="Bot grade")
|
||||
ts3conn.clientmove(clid=clidbot[0]['clid'], cid=131)
|
||||
while True:
|
||||
prog(ts3conn, jeux, groupe)
|
||||
@@ -0,0 +1,154 @@
|
||||
#!/usr/bin/Nessar
|
||||
|
||||
import time
|
||||
import ts3
|
||||
import re
|
||||
import requests
|
||||
import json
|
||||
import MySQLdb
|
||||
|
||||
db = MySQLdb.connect(host="localhost",user="***REMOVED***",passwd="***REMOVED***", db="forum")
|
||||
cur = db.cursor()
|
||||
|
||||
def prog(ts3conn, cur):
|
||||
try:
|
||||
event = ts3conn.wait_for_event(60)
|
||||
except:
|
||||
return 3
|
||||
if event[0]["ctid"] == "156":
|
||||
siteuid = ""
|
||||
clid_ = event[0]["clid"]
|
||||
cluid_ = ts3conn.clientgetuidfromclid(clid=clid_)
|
||||
name = cluid_[0]['nickname']
|
||||
cur.execute("SELECT * FROM `forum_membres` WHERE `membre_pseudo` = '"+name+"'")
|
||||
for row in cur.fetchall():
|
||||
siteuid = row[19]
|
||||
if siteuid != "":
|
||||
ts3conn.clientpoke(msg="UID: "+str(cluid_[0]['cluid']), clid=clid_)
|
||||
ts3conn.clientpoke(msg="Code Secret: "+siteuid, clid=clid_)
|
||||
else:
|
||||
ts3conn.clientpoke(msg="Vous devez avoir le même pseudo que sur le site", clid=clid_)
|
||||
|
||||
return 4
|
||||
|
||||
def steam(ts3conn, cur):
|
||||
cur.execute("SELECT * FROM forum_membres")
|
||||
for row in cur.fetchall():
|
||||
try:
|
||||
jeu = 0
|
||||
steam = row[6]
|
||||
tsuid = row[8]
|
||||
if tsuid is not None:
|
||||
if steam is not None:
|
||||
steamname = steam[30:]
|
||||
try:
|
||||
response = requests.get("http://api.steampowered.com/ISteamUser/ResolveVanityURL/v0001/?key=***REMOVED***&vanityurl="+steamname)
|
||||
except:
|
||||
jeu = 0
|
||||
info = json.loads(response.text)
|
||||
|
||||
if info['response']['success'] == 1:
|
||||
steamid = info['response']['steamid']
|
||||
try:
|
||||
response = requests.get("http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=***REMOVED***&steamids="+steamid)
|
||||
except:
|
||||
jeu = 0
|
||||
info = json.loads(response.text)
|
||||
try:
|
||||
jeu = info['response']['players'][0]['gameextrainfo']
|
||||
except:
|
||||
jeu = 0
|
||||
elif info['response']['success'] == 42:
|
||||
if len(steamname) == 17:
|
||||
try:
|
||||
response = requests.get("http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=***REMOVED***&steamids="+steamname)
|
||||
except:
|
||||
jeu = 0
|
||||
info = json.loads(response.text)
|
||||
try:
|
||||
jeu = info['response']['players'][0]['gameextrainfo']
|
||||
except:
|
||||
jeu = 0
|
||||
|
||||
addjeu(ts3conn, tsuid, jeu)
|
||||
except:
|
||||
pass
|
||||
|
||||
def addjeu(ts3conn, tsuid, jeu):
|
||||
if jeu != 0:
|
||||
sglist = ts3conn.servergrouplist()
|
||||
cldbid_ = ts3conn.clientgetdbidfromuid(cluid=tsuid)
|
||||
cldbid_ = cldbid_[0]['cldbid']
|
||||
i = 0
|
||||
stop = 0
|
||||
c = 0
|
||||
while stop != 2:
|
||||
try :
|
||||
a = sglist[i]['name']
|
||||
b = sglist[i]['sgid']
|
||||
try:
|
||||
clids = ts3conn.clientgetids(cluid=tsuid)
|
||||
except:
|
||||
break
|
||||
clid_ = clids[0]['clid']
|
||||
clinfo = ts3conn.clientinfo(clid=clid_)
|
||||
clsg = clinfo[0]['client_servergroups']
|
||||
if re.search(a, jeu[0:30]) is not None:
|
||||
stop = 2
|
||||
n = 240
|
||||
while n < 300:
|
||||
if re.search(str(n), clsg) is not None:
|
||||
if re.search(b, clsg) is None:
|
||||
sgdel = n
|
||||
ts3conn.servergroupdelclient(sgid=sgdel, cldbid=cldbid_)
|
||||
ts3conn.servergroupaddclient(sgid=b, cldbid=cldbid_)
|
||||
return 4
|
||||
n = n + 1
|
||||
clinfo = ts3conn.clientinfo(clid=clid_)
|
||||
clsg = clinfo[0]['client_servergroups']
|
||||
if re.search(b, clsg) is None:
|
||||
ts3conn.servergroupaddclient(sgid=b, cldbid=cldbid_)
|
||||
return 4
|
||||
i = i + 1
|
||||
except:
|
||||
ts3conn.servergroupadd(name=jeu[0:30])
|
||||
sglist = ts3conn.servergrouplist()
|
||||
while True:
|
||||
try:
|
||||
d = sglist[c]['sgid']
|
||||
c = c + 1
|
||||
except:
|
||||
ts3conn.servergroupaddperm(sgid=int(d), permsid="i_group_show_name_in_tree", permvalue=2, permnegated=0, permskip=0)
|
||||
break
|
||||
elif jeu == 0:
|
||||
try:
|
||||
cldbid_ = ts3conn.clientgetdbidfromuid(cluid=tsuid)
|
||||
cldbid_ = cldbid_[0]['cldbid']
|
||||
clids = ts3conn.clientgetids(cluid=tsuid)
|
||||
clid_ = clids[0]['clid']
|
||||
clinfo = ts3conn.clientinfo(clid=clid_)
|
||||
clsg = clinfo[0]['client_servergroups']
|
||||
n = 240
|
||||
while n < 300:
|
||||
if re.search(str(n), clsg):
|
||||
sgdel = n
|
||||
ts3conn.servergroupdelclient(sgid=sgdel, cldbid=cldbid_)
|
||||
return 5
|
||||
n = n + 1
|
||||
return 5
|
||||
except:
|
||||
return 6
|
||||
|
||||
with ts3.query.TS3Connection("localhost") as ts3conn:
|
||||
ts3conn.login(
|
||||
client_login_name="***REMOVED***",
|
||||
client_login_password="***REMOVED***"
|
||||
)
|
||||
ts3conn.use(sid=1)
|
||||
ts3conn.clientupdate(client_nickname="Bot Steam")
|
||||
ts3conn.servernotifyregister(event="channel", id_=156)
|
||||
while True:
|
||||
ts3conn.send_keepalive()
|
||||
print("OK "+str(time.strftime("%H,%M,%S")))
|
||||
prog(ts3conn, cur)
|
||||
steam(ts3conn, cur)
|
||||
@@ -0,0 +1 @@
|
||||
{"D/cMykw+H6MRfE4QnoZG2u7KHyA=": {"vie": 2, "clname": "TeamSpeakUser", "time": "28/08/2019 19:55:45"}, "gcOXVkt3ygJdWVy6BpHI+dcRuSg=": {"vie": 2, "clname": "Nuja", "time": "09/06/2019 20:06:06"}, "p2B1GS96l1LyxhfMXUlDa7KgasI=": {"vie": 2, "clname": "Pascal", "time": "05/03/2019 20:56:33"}, "R/uc+xK5aS8lGmFEEJs409g8zDY=": {"vie": 2, "clname": "M03", "time": "31/03/2019 17:33:54"}, "Q9vR27RB8ALpHi36Zg40k0W8cfs=": {"vie": 2, "clname": "Victime", "time": "18/02/2019 00:48:26"}, "fKa/lzYNxsuNrXOhzwStx/DmWoo=": {"vie": 2, "clname": "Victime N\u00b02", "time": "18/02/2019 01:12:32"}, "1OyDshjgUIj+DeHSGLZsyD57hxE=": {"vie": 2, "clname": "1\"3", "time": "11/06/2019 22:42:39"}, "ai/nMZMDHRCGU3AXlIz2fCvuGSg=": {"vie": 2, "clname": "Torroan", "time": "27/03/2019 23:46:35"}, "umcwS1u/Vq2CUTEj9nhHdY4dwnk=": {"vie": 2, "clname": "labrique", "time": "27/03/2019 14:37:20"}, "ServerQuery": {"vie": 0, "clname": "Unknown", "time": "26/09/2019 22:04:35"}, "es7iZD8u58W4PCxy0/2HRS/r17o=": {"clname": "killianbill", "vie": 2, "time": "22/09/2019 00:51:10"}}
|
||||
@@ -0,0 +1,3 @@
|
||||
import MySQLdb
|
||||
import time
|
||||
|
||||
+496
@@ -0,0 +1,496 @@
|
||||
#!/bin/bash
|
||||
|
||||
function greenMessage() {
|
||||
echo -e "\\033[32;1m${*}\\033[0m"
|
||||
}
|
||||
|
||||
function magentaMessage() {
|
||||
echo -e "\\033[35;1m${*}\\033[0m"
|
||||
}
|
||||
|
||||
function cyanMessage() {
|
||||
echo -e "\\033[36;1m${*}\\033[0m"
|
||||
}
|
||||
|
||||
function redMessage() {
|
||||
echo -e "\\033[31;1m${*}\\033[0m"
|
||||
}
|
||||
|
||||
function yellowMessage() {
|
||||
echo -e "\\033[33;1m${*}\\033[0m"
|
||||
}
|
||||
|
||||
if [ "$1" = "start" ]&&[ "$2" = "" ]; then
|
||||
yellowMessage '─────────────────────────────────'
|
||||
if ! screen -list | grep -q "BOT_rank"; then
|
||||
screen -dmS BOT_rank python3 ./BOT_rank.py
|
||||
sleep 1
|
||||
if ! screen -list | grep -q "BOT_rank"; then
|
||||
redMessage '[BOT_rank] ERROR'
|
||||
else
|
||||
greenMessage '[BOT_rank] Démarrer avec succès !'
|
||||
fi
|
||||
else
|
||||
greenMessage '[BOT_rank] déjà actif !'
|
||||
fi
|
||||
if ! screen -list | grep -q "BOT_new"; then
|
||||
screen -dmS BOT_new python3 ./BOT_new.py
|
||||
sleep 1
|
||||
if ! screen -list | grep -q "BOT_new"; then
|
||||
redMessage '[BOT_new] ERROR'
|
||||
else
|
||||
greenMessage '[BOT_new] Démarrer avec succès !'
|
||||
fi
|
||||
else
|
||||
greenMessage '[BOT_new] déjà actif !'
|
||||
fi
|
||||
if ! screen -list | grep -q "BOT_Anti-VPN"; then
|
||||
screen -dmS BOT_Anti-VPN python3 ./BOT_Anti-VPN.py
|
||||
sleep 1
|
||||
if ! screen -list | grep -q "BOT_Anti-VPN"; then
|
||||
redMessage '[BOT_Anti-VPN] ERROR'
|
||||
else
|
||||
greenMessage '[BOT_Anti-VPN] Démarrer avec succès !'
|
||||
fi
|
||||
else
|
||||
greenMessage '[BOT_Anti-VPN] déjà actif !'
|
||||
fi
|
||||
if ! screen -list | grep -q "BOT_prison"; then
|
||||
screen -dmS BOT_prison python3 ./BOT_prison.py
|
||||
sleep 1
|
||||
if ! screen -list | grep -q "BOT_prison"; then
|
||||
redMessage '[BOT_prison] ERROR'
|
||||
else
|
||||
greenMessage '[BOT_prison] Démarrer avec succès !'
|
||||
fi
|
||||
else
|
||||
greenMessage '[BOT_prison] déjà actif !'
|
||||
fi
|
||||
if ! screen -list | grep -q "BOT_KT"; then
|
||||
screen -dmS BOT_KT python3 ./BOT_KT.py
|
||||
sleep 1
|
||||
if ! screen -list | grep -q "BOT_KT"; then
|
||||
redMessage '[BOT_KT] ERROR'
|
||||
else
|
||||
greenMessage '[BOT_KT] Démarrer avec succès !'
|
||||
fi
|
||||
else
|
||||
greenMessage '[BOT_KT] déjà actif !'
|
||||
fi
|
||||
if ! screen -list | grep -q "BOT_steam"; then
|
||||
screen -dmS BOT_steam python3 ./BOT_steam.py
|
||||
sleep 1
|
||||
if ! screen -list | grep -q "BOT_steam"; then
|
||||
redMessage '[BOT_steam] ERROR'
|
||||
else
|
||||
greenMessage '[BOT_steam] Démarrer avec succès !'
|
||||
fi
|
||||
else
|
||||
greenMessage '[BOT_steam] déjà actif !'
|
||||
fi
|
||||
if ! screen -list | grep -q "BOT_jeux"; then
|
||||
screen -dmS BOT_jeux python3 ./BOT_jeux.py
|
||||
sleep 1
|
||||
if ! screen -list | grep -q "BOT_jeux"; then
|
||||
redMessage '[BOT_jeux] ERROR'
|
||||
else
|
||||
greenMessage '[BOT_jeux] Démarrer avec succès !'
|
||||
fi
|
||||
else
|
||||
greenMessage '[BOT_jeux] déjà actif !'
|
||||
fi
|
||||
# if ! screen -list | grep -q "BOT_R6"; then
|
||||
# screen -dmS BOT_R6 python3 ./BOT_R6.py
|
||||
# sleep 1
|
||||
# if ! screen -list | grep -q "BOT_R6"; then
|
||||
# redMessage '[BOT_R6] ERROR'
|
||||
# else
|
||||
# greenMessage '[BOT_R6] Démarrer avec succès !'
|
||||
# fi
|
||||
# else
|
||||
# greenMessage '[BOT_R6] déjà actif !'
|
||||
# fi
|
||||
yellowMessage '─────────────────────────────────'
|
||||
|
||||
elif [ "$1" = "start" ]&&[ "$2" = "KT" ]; then
|
||||
yellowMessage '─────────────────────────────────'
|
||||
if ! screen -list | grep -q "BOT_KT"; then
|
||||
screen -dmS BOT_KT python3 ./BOT_KT.py
|
||||
sleep 1
|
||||
if ! screen -list | grep -q "BOT_KT"; then
|
||||
redMessage '[BOT_KT] ERROR'
|
||||
else
|
||||
greenMessage '[BOT_KT] Démarrer avec succès !'
|
||||
fi
|
||||
else
|
||||
redMessage '[BOT_KT] déjà actif !'
|
||||
fi
|
||||
yellowMessage '─────────────────────────────────'
|
||||
|
||||
elif [ "$1" = "start" ]&&[ "$2" = "new" ]; then
|
||||
yellowMessage '─────────────────────────────────'
|
||||
if ! screen -list | grep -q "BOT_new"; then
|
||||
screen -dmS BOT_new python3 ./BOT_new.py
|
||||
sleep 1
|
||||
if ! screen -list | grep -q "BOT_new"; then
|
||||
redMessage '[BOT_new] ERROR'
|
||||
else
|
||||
greenMessage '[BOT_new] Démarrer avec succès !'
|
||||
fi
|
||||
else
|
||||
redMessage '[BOT_new] déjà actif !'
|
||||
fi
|
||||
yellowMessage '─────────────────────────────────'
|
||||
|
||||
elif [ "$1" = "start" ]&&[ "$2" = "jeux" ]; then
|
||||
yellowMessage '─────────────────────────────────'
|
||||
if ! screen -list | grep -q "BOT_jeux"; then
|
||||
screen -dmS BOT_jeux python3 ./BOT_jeux.py
|
||||
sleep 1
|
||||
if ! screen -list | grep -q "BOT_jeux"; then
|
||||
redMessage '[BOT_jeux] ERROR'
|
||||
else
|
||||
greenMessage '[BOT_jeux] Démarrer avec succès !'
|
||||
fi
|
||||
else
|
||||
redMessage '[BOT_jeux] déjà actif !'
|
||||
fi
|
||||
yellowMessage '─────────────────────────────────'
|
||||
|
||||
# elif [ "$1" = "start" ]&&[ "$2" = "r6" ]; then
|
||||
# yellowMessage '─────────────────────────────────'
|
||||
# if ! screen -list | grep -q "BOT_R6"; then
|
||||
# screen -dmS BOT_R6 python3 ./BOT_R6.py
|
||||
# sleep 1
|
||||
# if ! screen -list | grep -q "BOT_R6"; then
|
||||
# redMessage '[BOT_R6] ERROR'
|
||||
# else
|
||||
# greenMessage '[BOT_R6] Démarrer avec succès !'
|
||||
# fi
|
||||
# else
|
||||
# redMessage '[BOT_R6] déjà actif !'
|
||||
# fi
|
||||
yellowMessage '─────────────────────────────────'
|
||||
|
||||
elif [ "$1" = "start" ]&&[ "$2" = "vpn" ]; then
|
||||
yellowMessage '─────────────────────────────────'
|
||||
if ! screen -list | grep -q "BOT_Anti-VPN"; then
|
||||
screen -dmS BOT_Anti-VPN python3 ./BOT_Anti-VPN.py
|
||||
sleep 1
|
||||
if ! screen -list | grep -q "BOT_Anti-VPN"; then
|
||||
redMessage '[BOT_Anti-VPN] ERROR'
|
||||
else
|
||||
greenMessage '[BOT_Anti-VPN] Démarrer avec succès !'
|
||||
fi
|
||||
else
|
||||
redMessage '[BOT_Anti-VPN] déjà actif !'
|
||||
fi
|
||||
yellowMessage '─────────────────────────────────'
|
||||
|
||||
elif [ "$1" = "start" ]&&[ "$2" = "prison" ]; then
|
||||
yellowMessage '─────────────────────────────────'
|
||||
if ! screen -list | grep -q "BOT_prison"; then
|
||||
screen -dmS BOT_prison python3 ./BOT_prison.py
|
||||
sleep 1
|
||||
if ! screen -list | grep -q "BOT_prison"; then
|
||||
redMessage '[BOT_prison] ERROR'
|
||||
else
|
||||
greenMessage '[BOT_prison] Démarrer avec succès !'
|
||||
fi
|
||||
else
|
||||
redMessage '[BOT_prison] déjà actif !'
|
||||
fi
|
||||
yellowMessage '─────────────────────────────────'
|
||||
|
||||
elif [ "$1" = "start" ]&&[ "$2" = "steam" ]; then
|
||||
yellowMessage '─────────────────────────────────'
|
||||
if ! screen -list | grep -q "BOT_steam"; then
|
||||
screen -dmS BOT_steam python3 ./BOT_steam.py
|
||||
sleep 1
|
||||
if ! screen -list | grep -q "BOT_steam"; then
|
||||
redMessage '[BOT_steam] ERROR'
|
||||
else
|
||||
greenMessage '[BOT_steam] Démarrer avec succès !'
|
||||
fi
|
||||
else
|
||||
redMessage '[BOT_steam] déjà actif !'
|
||||
fi
|
||||
yellowMessage '─────────────────────────────────'
|
||||
|
||||
elif [ "$1" = "start" ]&&[ "$2" = "rank" ]; then
|
||||
yellowMessage '─────────────────────────────────'
|
||||
if ! screen -list | grep -q "BOT_rank"; then
|
||||
screen -dmS BOT_rank python3 ./BOT_rank.py
|
||||
sleep 1
|
||||
if ! screen -list | grep -q "BOT_rank"; then
|
||||
redMessage '[BOT_rank] ERROR'
|
||||
else
|
||||
greenMessage '[BOT_rank] Démarrer avec succès !'
|
||||
fi
|
||||
else
|
||||
redMessage '[BOT_rank] déjà actif !'
|
||||
fi
|
||||
yellowMessage '─────────────────────────────────'
|
||||
|
||||
elif [ "$1" = "stop" ]&&[ "$2" = "" ]; then
|
||||
screen -S BOT_new -X quit
|
||||
screen -S BOT_KT -X quit
|
||||
screen -S BOT_rank -X quit
|
||||
screen -S BOT_prison -X quit
|
||||
screen -S BOT_Anti-VPN -X quit
|
||||
screen -S BOT_steam -X quit
|
||||
screen -S BOT_jeux -X quit
|
||||
# screen -S BOT_R6 -X quit
|
||||
sleep 2
|
||||
yellowMessage '─────────────────────────────────'
|
||||
if ! screen -list | grep -q "BOT_KT"; then
|
||||
redMessage '[BOT_KT] Arreté avec succès !'
|
||||
else
|
||||
greenMessage '[BOT_KT] Fontionne toujours !'
|
||||
fi
|
||||
if ! screen -list | grep -q "BOT_Anti-VPN"; then
|
||||
redMessage '[BOT_Anti-VPN] Arreté avec succès !'
|
||||
else
|
||||
greenMessage '[BOT_Anti-VPN] Fontionne toujours !'
|
||||
fi
|
||||
if ! screen -list | grep -q "BOT_prison"; then
|
||||
redMessage '[BOT_prison] Arreté avec succès !'
|
||||
else
|
||||
greenMessage '[BOT_prison] Fontionne toujours !'
|
||||
fi
|
||||
if ! screen -list | grep -q "BOT_new"; then
|
||||
redMessage '[BOT_new] Arreté avec succès !'
|
||||
else
|
||||
greenMessage '[BOT_new] Fontionne toujours !'
|
||||
fi
|
||||
if ! screen -list | grep -q "BOT_rank"; then
|
||||
redMessage '[BOT_rank] Arreté avec succès !'
|
||||
else
|
||||
greenMessage '[BOT_rank] Fontionne toujours !'
|
||||
fi
|
||||
if ! screen -list | grep -q "BOT_steam"; then
|
||||
redMessage '[BOT_steam] Arreté avec succès !'
|
||||
else
|
||||
greenMessage '[BOT_steam] Fontionne toujours !'
|
||||
fi
|
||||
if ! screen -list | grep -q "BOT_jeux"; then
|
||||
redMessage '[BOT_jeux] Arreté avec succès !'
|
||||
else
|
||||
greenMessage '[BOT_jeux] Fontionne toujours !'
|
||||
fi
|
||||
# if ! screen -list | grep -q "BOT_R6"; then
|
||||
# redMessage '[BOT_R6] Arreté avec succès !'
|
||||
# else
|
||||
# greenMessage '[BOT_R6] Fontionne toujours !'
|
||||
# fi
|
||||
yellowMessage '─────────────────────────────────'
|
||||
|
||||
elif [ "$1" = "stop" ] && [ "$2" = "KT" ]; then
|
||||
if ! screen -list | grep -q "BOT_KT"; then
|
||||
yellowMessage '─────────────────────────────────'
|
||||
redMessage '[BOT_KT] Déjà inactif'
|
||||
yellowMessage '─────────────────────────────────'
|
||||
else
|
||||
screen -S BOT_KT -X quit
|
||||
sleep 1
|
||||
yellowMessage '─────────────────────────────────'
|
||||
if ! screen -list | grep -q "BOT_KT"; then
|
||||
redMessage '[BOT_KT] Arreté avec succès !'
|
||||
else
|
||||
greenMessage '[BOT_KT] Fontionne toujours !'
|
||||
fi
|
||||
yellowMessage '─────────────────────────────────'
|
||||
fi
|
||||
|
||||
elif [ "$1" = "stop" ]&&[ "$2" = "prison" ]; then
|
||||
if ! screen -list | grep -q "BOT_prison"; then
|
||||
yellowMessage '─────────────────────────────────'
|
||||
redMessage '[BOT_prison] Déjà inactif'
|
||||
yellowMessage '─────────────────────────────────'
|
||||
else
|
||||
screen -S BOT_prison -X quit
|
||||
sleep 1
|
||||
yellowMessage '─────────────────────────────────'
|
||||
if ! screen -list | grep -q "BOT_prison"; then
|
||||
redMessage '[BOT_prison] Arreté avec succès !'
|
||||
else
|
||||
greenMessage '[BOT_prison] Fontionne toujours !'
|
||||
fi
|
||||
yellowMessage '─────────────────────────────────'
|
||||
fi
|
||||
|
||||
elif [ "$1" = "stop" ]&&[ "$2" = "jeux" ]; then
|
||||
if ! screen -list | grep -q "BOT_jeux"; then
|
||||
yellowMessage '─────────────────────────────────'
|
||||
redMessage '[BOT_jeux] Déjà inactif'
|
||||
yellowMessage '─────────────────────────────────'
|
||||
else
|
||||
screen -S BOT_jeux -X quit
|
||||
sleep 1
|
||||
yellowMessage '─────────────────────────────────'
|
||||
if ! screen -list | grep -q "BOT_jeux"; then
|
||||
redMessage '[BOT_jeux] Arreté avec succès !'
|
||||
else
|
||||
greenMessage '[BOT_jeux] Fontionne toujours !'
|
||||
fi
|
||||
yellowMessage '─────────────────────────────────'
|
||||
fi
|
||||
|
||||
# elif [ "$1" = "stop" ]&&[ "$2" = "r6" ]; then
|
||||
# if ! screen -list | grep -q "BOT_R6"; then
|
||||
# yellowMessage '─────────────────────────────────'
|
||||
# redMessage '[BOT_R6] Déjà inactif'
|
||||
# yellowMessage '─────────────────────────────────'
|
||||
# else
|
||||
# screen -S BOT_R6 -X quit
|
||||
# sleep 1
|
||||
# yellowMessage '─────────────────────────────────'
|
||||
# if ! screen -list | grep -q "BOT_R6"; then
|
||||
# redMessage '[BOT_R6] Arreté avec succès !'
|
||||
# else
|
||||
# greenMessage '[BOT_R6] Fontionne toujours !'
|
||||
# fi
|
||||
# yellowMessage '─────────────────────────────────'
|
||||
# fi
|
||||
|
||||
elif [ "$1" = "stop" ]&&[ "$2" = "rank" ]; then
|
||||
if ! screen -list | grep -q "BOT_rank"; then
|
||||
yellowMessage '─────────────────────────────────'
|
||||
redMessage '[BOT_rank] Déjà inactif'
|
||||
yellowMessage '─────────────────────────────────'
|
||||
else
|
||||
screen -S BOT_rank -X quit
|
||||
sleep 1
|
||||
yellowMessage '─────────────────────────────────'
|
||||
if ! screen -list | grep -q "BOT_rank"; then
|
||||
redMessage '[BOT_rank] Arreté avec succès !'
|
||||
else
|
||||
greenMessage '[BOT_rank] Fontionne toujours !'
|
||||
fi
|
||||
yellowMessage '─────────────────────────────────'
|
||||
fi
|
||||
|
||||
elif [ "$1" = "stop" ]&&[ "$2" = "vpn" ]; then
|
||||
if ! screen -list | grep -q "BOT_Anti-VPN"; then
|
||||
yellowMessage '─────────────────────────────────'
|
||||
redMessage '[BOT_Anti-VPN] Déjà inactif'
|
||||
yellowMessage '─────────────────────────────────'
|
||||
else
|
||||
screen -S BOT_Anti-VPN -X quit
|
||||
sleep 1
|
||||
yellowMessage '─────────────────────────────────'
|
||||
if ! screen -list | grep -q "BOT_Anti-VPN"; then
|
||||
redMessage '[BOT_Anti-VPN] Arreté avec succès !'
|
||||
else
|
||||
greenMessage '[BOT_Anti-VPN] Fontionne toujours !'
|
||||
fi
|
||||
yellowMessage '─────────────────────────────────'
|
||||
fi
|
||||
|
||||
elif [ "$1" = "stop" ]&&[ "$2" = "new" ]; then
|
||||
if ! screen -list | grep -q "BOT_new"; then
|
||||
yellowMessage '─────────────────────────────────'
|
||||
redMessage '[BOT_new] Déjà inactif'
|
||||
yellowMessage '─────────────────────────────────'
|
||||
else
|
||||
screen -S BOT_new -X quit
|
||||
sleep 1
|
||||
yellowMessage '─────────────────────────────────'
|
||||
if ! screen -list | grep -q "BOT_new"; then
|
||||
redMessage '[BOT_new] Arreté avec succès !'
|
||||
else
|
||||
greenMessage '[BOT_new] Fontionne toujours !'
|
||||
fi
|
||||
yellowMessage '─────────────────────────────────'
|
||||
fi
|
||||
|
||||
elif [ "$1" = "stop" ]&&[ "$2" = "prison" ]; then
|
||||
if ! screen -list | grep -q "BOT_prison"; then
|
||||
yellowMessage '─────────────────────────────────'
|
||||
redMessage '[BOT_prison] Déjà inactif'
|
||||
yellowMessage '─────────────────────────────────'
|
||||
else
|
||||
screen -S BOT_prison -X quit
|
||||
sleep 1
|
||||
yellowMessage '─────────────────────────────────'
|
||||
if ! screen -list | grep -q "BOT_prison"; then
|
||||
redMessage '[BOT_prison] Arreté avec succès !'
|
||||
else
|
||||
greenMessage '[BOT_prison] Fontionne toujours !'
|
||||
fi
|
||||
yellowMessage '─────────────────────────────────'
|
||||
fi
|
||||
|
||||
elif [ "$1" = "stop" ]&&[ "$2" = "steam" ]; then
|
||||
if ! screen -list | grep -q "BOT_steam"; then
|
||||
yellowMessage '─────────────────────────────────'
|
||||
redMessage '[BOT_steam] Déjà inactif'
|
||||
yellowMessage '─────────────────────────────────'
|
||||
else
|
||||
screen -S BOT_steam -X quit
|
||||
sleep 1
|
||||
yellowMessage '─────────────────────────────────'
|
||||
if ! screen -list | grep -q "BOT_prison"; then
|
||||
redMessage '[BOT_steam] Arreté avec succès !'
|
||||
else
|
||||
greenMessage '[BOT_steam] Fontionne toujours !'
|
||||
fi
|
||||
yellowMessage '─────────────────────────────────'
|
||||
fi
|
||||
|
||||
elif [ "$1" = "status" ]; then
|
||||
|
||||
yellowMessage '─────────────────────────────────'
|
||||
if ! screen -list | grep -q "BOT_KT"; then
|
||||
redMessage '[BOT_KT] Actuellement inactif !'
|
||||
else
|
||||
greenMessage '[BOT_KT] Actuellement actif'
|
||||
fi
|
||||
|
||||
if ! screen -list | grep -q "BOT_Anti-VPN"; then
|
||||
redMessage '[BOT_Anti-VPN] Actuellement inactif !'
|
||||
else
|
||||
greenMessage '[BOT_Anti-VPN] Actuellement actif'
|
||||
fi
|
||||
|
||||
if ! screen -list | grep -q "BOT_prison"; then
|
||||
redMessage '[BOT_prison] Actuellement inactif !'
|
||||
else
|
||||
greenMessage '[BOT_prison] Actuellement actif !'
|
||||
fi
|
||||
|
||||
if ! screen -list | grep -q "BOT_rank"; then
|
||||
redMessage '[BOT_rank] Actuellement inactif !'
|
||||
else
|
||||
greenMessage '[BOT_rank] Actuellement actif !'
|
||||
fi
|
||||
|
||||
if ! screen -list | grep -q "BOT_new"; then
|
||||
redMessage '[BOT_new] Actuellement inactif !'
|
||||
else
|
||||
greenMessage '[BOT_new] Actuellement actif !'
|
||||
fi
|
||||
|
||||
if ! screen -list | grep -q "BOT_steam"; then
|
||||
redMessage '[BOT_steam] Actuellement inactif !'
|
||||
else
|
||||
greenMessage '[BOT_steam] Actuellement actif !'
|
||||
fi
|
||||
|
||||
if ! screen -list | grep -q "BOT_jeux"; then
|
||||
redMessage '[BOT_jeux] Actuellement inactif !'
|
||||
else
|
||||
greenMessage '[BOT_jeux] Actuellement actif !'
|
||||
fi
|
||||
|
||||
# if ! screen -list | grep -q "BOT_R6"; then
|
||||
# redMessage '[BOT_R6] Actuellement inactif !'
|
||||
# else
|
||||
# greenMessage '[BOT_R6] Actuellement actif !'
|
||||
# fi
|
||||
|
||||
yellowMessage '─────────────────────────────────'
|
||||
|
||||
else
|
||||
yellowMessage 'Utilisation : ./start.sh <start|stop|status> <nom_du_BOT>'
|
||||
fi
|
||||
@@ -0,0 +1,52 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# Modules
|
||||
|
||||
import time
|
||||
import ts3
|
||||
|
||||
#Variables
|
||||
|
||||
start = 1
|
||||
|
||||
pseudo = input("Choisir le pseudo: ")
|
||||
if (pseudo == ""):
|
||||
exit()
|
||||
|
||||
delay = (input("Choisir le delai entre les pokes: "))
|
||||
if (delay == ""):
|
||||
delay = 1
|
||||
else:
|
||||
delay = float(delay)
|
||||
|
||||
msg = input("Choisir le message: ")
|
||||
if (msg == ""):
|
||||
msg = "Je suis désolé :-)"
|
||||
|
||||
num = input("Choisir le nombre de poke(rien = infini): ")
|
||||
if (num == ""):
|
||||
num = -1
|
||||
else:
|
||||
num = int(num)
|
||||
|
||||
def poke(pseudo, delay, msg, num, ts3conn):
|
||||
clients = ts3conn.clientfind(pattern=pseudo)
|
||||
clients = [client["clid"] for client in clients]
|
||||
|
||||
while True:
|
||||
for clid in clients:
|
||||
ts3conn.clientpoke(msg=msg, clid=clid)
|
||||
time.sleep(delay)
|
||||
return num
|
||||
with ts3.query.TS3Connection("localhost") as ts3conn:
|
||||
ts3conn.login(client_login_name="***REMOVED***", client_login_password="***REMOVED***")
|
||||
ts3conn.use(sid=1)
|
||||
while True:
|
||||
if poke(pseudo, delay, msg, num, ts3conn) > 0 or start == 1 or num == -1:
|
||||
start = 0
|
||||
if num != -1:
|
||||
num = num -1
|
||||
print(num)
|
||||
else:
|
||||
print("FINI")
|
||||
exit()
|
||||
@@ -0,0 +1,13 @@
|
||||
import ts3
|
||||
|
||||
a = 0
|
||||
|
||||
with ts3.query.TS3Connection("localhost") as ts3conn:
|
||||
ts3conn.login(
|
||||
client_login_name="***REMOVED***",
|
||||
client_login_password="***REMOVED***"
|
||||
)
|
||||
ts3conn.use(sid=1)
|
||||
while a != 22:
|
||||
a = a + 1
|
||||
ts3conn.servergroupadd(name="LOL "+str(a))
|
||||
Reference in new issue
Block a user