SHARE
TWEET

Untitled

a guest Sep 22nd, 2019 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def besteAngreiferJedesTypsUpdaten():
  2.     #Aktualisiert die besten Angreifer jedes Typs (https://pokefans.net/spiele/pokemon-go/beste-angreifer-jedes-typs)
  3.     daten = jsonOeffnen()
  4.     besteAngreifer = ""
  5.     for typ in ["Boden","Drache","Eis","Elektro","Fee","Feuer","Flug","Geist","Gift","Gestein","Kampf","Käfer","Normal","Pflanze","Psycho","Stahl","Unlicht","Wasser"]:
  6.         movesetsDesTypen = []
  7.         for p in pokemon:
  8.             for m in daten["pokemon"][p]["movesetsZweier"]:
  9.                 if (daten["attacken"][m[2]]["typ"] == slugify(typ) and daten["attacken"][m[3]]["typ"] == slugify(typ)):
  10.                     movesetsDesTypen.append([p]+m)
  11.         movesetsDesTypen = sorted(movesetsDesTypen,key=lambda x: x[8], reverse=True)
  12.         i = 1
  13.         if len(movesetsDesTypen) < 20:
  14.             anzahl = len(movesetsDesTypen)
  15.         else:
  16.             anzahl = 20
  17.         besteAngreifer += "<h2 id=\""+slugify(typ)+"\">Die "+str(anzahl)+" besten "+typ+"-Angreifer</h2>\n<div class=\"table-responsive\">\n\t<table class=\"centered-v\">\n\t\t<tr class=\"head\">\n\t\t\t<td>Rang</td>\n\t\t\t<td colspan=\"2\">Pokémon</td>\n\t\t\t<td>Sofort-Attacke</td>\n\t\t\t<td>Lade-Attacke</td>\n\t\t\t<td>Potenzial</td>\n\t\t\t<td>Def.</td>\n\t\t</tr>"
  18.         while i < 21:
  19.             if i == 1:
  20.                 firstPlace = movesetsDesTypen[i-1][8]
  21.             if len(movesetsDesTypen) >= i:
  22.                 percent = str(int(((movesetsDesTypen[i-1][8] / firstPlace) * 100)))
  23.                 stats = daten["pokemon"][movesetsDesTypen[i-1][0]]["statuswerte"]
  24.                 tankiness = stats["kp"] * stats["vert"]
  25.                 if tankiness > 35000: farbe = "gruen"
  26.                 else:
  27.                     if tankiness > 25000: farbe = "gelb"
  28.                     else: farbe = "rot"
  29.                 besteAngreifer += "\t\t<tr>\n\t\t\t<td>"+str(i)+"</td>\n\t\t\t<td>{icon:"+iconify(movesetsDesTypen[i-1][0])+";}</td>\n\t\t\t<td>{pokemongo:"+movesetsDesTypen[i-1][0]+";}</td>\n\t\t\t<td><a href=\"https://pokefans.net/spiele/pokemon-go/attacken/"+slugify(movesetsDesTypen[i-1][1])+"\">"+movesetsDesTypen[i-1][1]+"</a></td>\n\t\t\t<td><a href=\"https://pokefans.net/spiele/pokemon-go/attacken/"+slugify(movesetsDesTypen[i-1][2])+"\">"+movesetsDesTypen[i-1][2]+"</a></td>\n\t\t\t<td>"+percent+"%</td>\n\t\t\t<td><span class=\"point point-"+farbe+"\"></span></td>\n\t\t</tr>"
  30.             i += 1
  31.         besteAngreifer += "\n\t</table>\n</div>\n\n"
  32.     content = Content(id=6333)
  33.     content.code = re.sub("<!--Begin List-->(.*?)<!--End List-->","<!--Begin List-->"+besteAngreifer+"<!--End List-->",content.code,flags=re.DOTALL)
  34.     content.save()
  35.     print("Liste der besten Angreifer je Typ erfolgreich aktualisiert.")
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top