#1 [TUTO] Comando ranking Qua Set 26, 2012 3:30 pm
Style~°
Vá na source, dê ctrl f e pesquise por "elif event == "ranking": (Sem aspas)
Remova o comando que estava e coloque este:
Aperte F5 e teste!
Créditos
TransforBR Team
Remova o comando que estava e coloque este:
- Código:
elif event == "classement" or event == "ranking":
Userlist = []
dbcur.execute('select name, saves, first, cheese from users')
rrfRows = dbcur.fetchall()
if rrfRows is None:
pass
else:
for rrf in rrfRows:
Userlist.append(rrf)
#Saves
SaveList={}
SaveListDisp=[]
for user in Userlist:
SaveList[user[0]] = user[1]
mSL=max(SaveList.iterkeys(), key=lambda k: SaveList[k])
SaveListDisp.append([1, mSL, SaveList[mSL]])
del SaveList[mSL]
mSL=max(SaveList.iterkeys(), key=lambda k: SaveList[k])
SaveListDisp.append([2, mSL, SaveList[mSL]])
del SaveList[mSL]
mSL=max(SaveList.iterkeys(), key=lambda k: SaveList[k])
SaveListDisp.append([3, mSL, SaveList[mSL]])
del SaveList[mSL]
mSL=max(SaveList.iterkeys(), key=lambda k: SaveList[k])
SaveListDisp.append([4, mSL, SaveList[mSL]])
del SaveList[mSL]
mSL=max(SaveList.iterkeys(), key=lambda k: SaveList[k])
SaveListDisp.append([5, mSL, SaveList[mSL]])
del SaveList[mSL]
mSL=max(SaveList.iterkeys(), key=lambda k: SaveList[k])
SaveListDisp.append([6, mSL, SaveList[mSL]])
del SaveList[mSL]
mSL=max(SaveList.iterkeys(), key=lambda k: SaveList[k])
SaveListDisp.append([7, mSL, SaveList[mSL]])
del SaveList[mSL]
mSL=max(SaveList.iterkeys(), key=lambda k: SaveList[k])
SaveListDisp.append([8, mSL, SaveList[mSL]])
del SaveList[mSL]
mSL=max(SaveList.iterkeys(), key=lambda k: SaveList[k])
SaveListDisp.append([9, mSL, SaveList[mSL]])
del SaveList[mSL]
mSL=max(SaveList.iterkeys(), key=lambda k: SaveList[k])
SaveListDisp.append([10, mSL, SaveList[mSL]])
del SaveList[mSL]
#Firsts
FirstList={}
FirstListDisp=[]
for user in Userlist:
FirstList[user[0]] = user[2]
mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
FirstListDisp.append([1, mSL, FirstList[mSL]])
del FirstList[mSL]
mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
FirstListDisp.append([2, mSL, FirstList[mSL]])
del FirstList[mSL]
mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
FirstListDisp.append([3, mSL, FirstList[mSL]])
del FirstList[mSL]
mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
FirstListDisp.append([4, mSL, FirstList[mSL]])
del FirstList[mSL]
mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
FirstListDisp.append([5, mSL, FirstList[mSL]])
del FirstList[mSL]
mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
FirstListDisp.append([6, mSL, FirstList[mSL]])
del FirstList[mSL]
mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
FirstListDisp.append([7, mSL, FirstList[mSL]])
del FirstList[mSL]
mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
FirstListDisp.append([8, mSL, FirstList[mSL]])
del FirstList[mSL]
mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
FirstListDisp.append([9, mSL, FirstList[mSL]])
del FirstList[mSL]
mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
FirstListDisp.append([10, mSL, FirstList[mSL]])
del FirstList[mSL]
#Cheese
CheeseList={}
CheeseListDisp=[]
for user in Userlist:
CheeseList[user[0]] = user[3]
mSL=max(CheeseList.iterkeys(), key=lambda k: CheeseList[k])
CheeseListDisp.append([1, mSL, CheeseList[mSL]])
del CheeseList[mSL]
mSL=max(CheeseList.iterkeys(), key=lambda k: CheeseList[k])
CheeseListDisp.append([2, mSL, CheeseList[mSL]])
del CheeseList[mSL]
mSL=max(CheeseList.iterkeys(), key=lambda k: CheeseList[k])
CheeseListDisp.append([3, mSL, CheeseList[mSL]])
del CheeseList[mSL]
mSL=max(CheeseList.iterkeys(), key=lambda k: CheeseList[k])
CheeseListDisp.append([4, mSL, CheeseList[mSL]])
del CheeseList[mSL]
mSL=max(CheeseList.iterkeys(), key=lambda k: CheeseList[k])
CheeseListDisp.append([5, mSL, CheeseList[mSL]])
del CheeseList[mSL]
mSL=max(CheeseList.iterkeys(), key=lambda k: CheeseList[k])
CheeseListDisp.append([6, mSL, CheeseList[mSL]])
del CheeseList[mSL]
mSL=max(CheeseList.iterkeys(), key=lambda k: CheeseList[k])
CheeseListDisp.append([7, mSL, CheeseList[mSL]])
del CheeseList[mSL]
mSL=max(CheeseList.iterkeys(), key=lambda k: CheeseList[k])
CheeseListDisp.append([8, mSL, CheeseList[mSL]])
del CheeseList[mSL]
mSL=max(CheeseList.iterkeys(), key=lambda k: CheeseList[k])
CheeseListDisp.append([9, mSL, CheeseList[mSL]])
del CheeseList[mSL]
mSL=max(CheeseList.iterkeys(), key=lambda k: CheeseList[k])
CheeseListDisp.append([10, mSL, CheeseList[mSL]])
savetitle0 = self.server.getCurrentTitle(str(SaveListDisp[0][1]))
savetitle1 = self.server.getCurrentTitle(str(SaveListDisp[1][1]))
savetitle2 = self.server.getCurrentTitle(str(SaveListDisp[2][1]))
savetitle3 = self.server.getCurrentTitle(str(SaveListDisp[3][1]))
savetitle4 = self.server.getCurrentTitle(str(SaveListDisp[4][1]))
savetitle5 = self.server.getCurrentTitle(str(SaveListDisp[5][1]))
savetitle6 = self.server.getCurrentTitle(str(SaveListDisp[6][1]))
savetitle7 = self.server.getCurrentTitle(str(SaveListDisp[7][1]))
savetitle8 = self.server.getCurrentTitle(str(SaveListDisp[8][1]))
savetitle9 = self.server.getCurrentTitle(str(SaveListDisp[9][1]))
cheesetitle0 = self.server.getCurrentTitle(str(CheeseListDisp[0][1]))
cheesetitle1 = self.server.getCurrentTitle(str(CheeseListDisp[1][1]))
cheesetitle2 = self.server.getCurrentTitle(str(CheeseListDisp[2][1]))
cheesetitle3 = self.server.getCurrentTitle(str(CheeseListDisp[3][1]))
cheesetitle4 = self.server.getCurrentTitle(str(CheeseListDisp[4][1]))
cheesetitle5 = self.server.getCurrentTitle(str(CheeseListDisp[5][1]))
cheesetitle6 = self.server.getCurrentTitle(str(CheeseListDisp[6][1]))
cheesetitle7 = self.server.getCurrentTitle(str(CheeseListDisp[7][1]))
cheesetitle8 = self.server.getCurrentTitle(str(CheeseListDisp[8][1]))
cheesetitle9 = self.server.getCurrentTitle(str(CheeseListDisp[9][1]))
firsttitle0 = self.server.getCurrentTitle(str(FirstListDisp[0][1]))
firsttitle1 = self.server.getCurrentTitle(str(FirstListDisp[1][1]))
firsttitle2 = self.server.getCurrentTitle(str(FirstListDisp[2][1]))
firsttitle3 = self.server.getCurrentTitle(str(FirstListDisp[3][1]))
firsttitle4 = self.server.getCurrentTitle(str(FirstListDisp[4][1]))
firsttitle5 = self.server.getCurrentTitle(str(FirstListDisp[5][1]))
firsttitle6 = self.server.getCurrentTitle(str(FirstListDisp[6][1]))
firsttitle7 = self.server.getCurrentTitle(str(FirstListDisp[7][1]))
firsttitle8 = self.server.getCurrentTitle(str(FirstListDisp[8][1]))
firsttitle9 = self.server.getCurrentTitle(str(FirstListDisp[9][1]))
self.sendData("\x1A"+"\x0A", [str(SaveListDisp[0][1])+","+str(savetitle0)+","+str(SaveListDisp[0][2])+","+str(SaveListDisp[1][1])+","+str(savetitle1)+","+str(SaveListDisp[1][2])
+","+str(SaveListDisp[2][1])+","+str(savetitle2)+","+str(SaveListDisp[2][2])
+","+str(SaveListDisp[3][1])+","+str(savetitle3)+","+str(SaveListDisp[3][2])
+","+str(SaveListDisp[4][1])+","+str(savetitle4)+","+str(SaveListDisp[4][2])
+","+str(SaveListDisp[5][1])+","+str(savetitle5)+","+str(SaveListDisp[5][2])
+","+str(SaveListDisp[6][1])+","+str(savetitle6)+","+str(SaveListDisp[6][2])
+","+str(SaveListDisp[7][1])+","+str(savetitle7)+","+str(SaveListDisp[7][2])
+","+str(SaveListDisp[8][1])+","+str(savetitle8)+","+str(SaveListDisp[8][2])
+","+str(SaveListDisp[9][1])+","+str(savetitle9)+","+str(SaveListDisp[9][2])
,
str(CheeseListDisp[0][1])+","+str(cheesetitle0)+","+str(CheeseListDisp[0][2])
+","+str(CheeseListDisp[1][1])+","+str(cheesetitle1)+","+str(CheeseListDisp[1][2])
+","+str(CheeseListDisp[2][1])+","+str(cheesetitle2)+","+str(CheeseListDisp[2][2])
+","+str(CheeseListDisp[3][1])+","+str(cheesetitle3)+","+str(CheeseListDisp[3][2])
+","+str(CheeseListDisp[4][1])+","+str(cheesetitle4)+","+str(CheeseListDisp[4][2])
+","+str(CheeseListDisp[5][1])+","+str(cheesetitle5)+","+str(CheeseListDisp[5][2])
+","+str(CheeseListDisp[6][1])+","+str(cheesetitle6)+","+str(CheeseListDisp[6][2])
+","+str(CheeseListDisp[7][1])+","+str(cheesetitle7)+","+str(CheeseListDisp[7][2])
+","+str(CheeseListDisp[8][1])+","+str(cheesetitle8)+","+str(CheeseListDisp[8][2])
+","+str(CheeseListDisp[9][1])+","+str(cheesetitle9)+","+str(CheeseListDisp[9][2])
,
str(FirstListDisp[0][1])+","+str(firsttitle0)+","+str(FirstListDisp[0][2])
+","+str(FirstListDisp[1][1])+","+str(firsttitle1)+","+str(FirstListDisp[1][2])
+","+str(FirstListDisp[2][1])+","+str(firsttitle2)+","+str(FirstListDisp[2][2])
+","+str(FirstListDisp[3][1])+","+str(firsttitle3)+","+str(FirstListDisp[3][2])
+","+str(FirstListDisp[4][1])+","+str(firsttitle4)+","+str(FirstListDisp[4][2])
+","+str(FirstListDisp[5][1])+","+str(firsttitle5)+","+str(FirstListDisp[5][2])
+","+str(FirstListDisp[6][1])+","+str(firsttitle6)+","+str(FirstListDisp[6][2])
+","+str(FirstListDisp[7][1])+","+str(firsttitle7)+","+str(FirstListDisp[7][2])
+","+str(FirstListDisp[8][1])+","+str(firsttitle8)+","+str(FirstListDisp[8][2])
+","+str(FirstListDisp[9][1])+","+str(firsttitle9)+","+str(FirstListDisp[9][2])])
Aperte F5 e teste!
Créditos
TransforBR Team