Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- #al_bot.py
- import os
- import random
- import zipfile
- import discord
- import re
- import io
- import string_utils
- import regex
- import asyncio
- import importlib
- from discord.ext import commands
- from dotenv import load_dotenv
- from discord.utils import get
- import codecs
- import fuzzywuzzy
- import operator
- import pickle
- import itertools
- #MISSING ERROR CONTROL ON COMMANDS
- load_dotenv()
- TOKEN = os.getenv('DISCORD_TOKEN')
- bot = commands.Bot(command_prefix='!', case_insensitive=True)
- #text_channels = ["general", "canal2"]
- rex = re.compile('\.zip')
- response = "Something went wrong, contact an admin!"
- monsterData = {}
- lootData = {}
- reverseLootData = {}
- itemsData = {}
- craftData = {}
- bugList = []
- sugList = []
- testData = {}
- infoTestData = {}
- fh = codecs.open("units.txt", "r", "utf-8")
- data = fh.read()
- monsters = re.compile("\[*.\]").split(data)
- for x in monsters:
- x = re.sub(r"\|[cC][a-fA-F0-9]{8}", "", x)
- x = re.sub(r"^=.*", "", x).replace("|","")
- x = x.strip().replace("|r","").replace(":",":").replace("。",".").replace(",",",").replace("\r","")
- x = re.sub(r"\[.*\\r", "", x) #test ID removal
- x = re.sub(r"\[.*\\n", "", x)
- print("DATA BLOCK-------------\n"+x)
- monsterData = dict(line.split('=') for line in x.split("\n"))
- try:
- #
- #print("TEST--"+monsterData["Name"])
- #print("KEY--> "+monsterData["Name"]) #Keys show correctly
- #print("----------------------------------------------------------------------------------")
- #print("DATA--> "+monsterData["Name"])
- lootData[monsterData["Name"]] = monsterData #Not sure how to make this work, need a [name][all-data-of-this-name] dict
- #print(monsterData["Name"])
- except KeyError:
- print("0000")
- except ValueError:
- print("")
- print(lootData.keys())
- print(lootData["Egthoro, the Angry God"].get("Art"))
- ---SAMPLE FROM TXT DATA BELOW--
- [AexT]
- sortAbil=z2
- comment(s)=Naisha
- auto=_
- abilList=A0LM,A0LN,A02V
- InBeta=0
- sortBalance=z2
- sort2=zz
- level=725
- =FALSE
- type=giant
- goldcost=195
- lumbercost=20
- goldRep=195
- lumberRep=20
- fmade= -
- fused=3
- bountydice=0
- bountysides=0
- bountyplus=0
- lumberbountydice=0
- lumberbountysides=0
- lumberbountyplus=0
- stockMax=3
- stockRegen=30
- stockStart=0
- HP=31000000
- realHP=700
- regenHP=20000.00
- regenType=always
- manaN=100
- realM=-
- mana0=-
- regenMana= -
- def=953
- defUp=2
- realdef=3
- defType=hero
- spd=400
- minSpd=0
- maxSpd=0
- bldtm=30
- reptm=30
- sight=3000
- nsight=3000
- STR= -
- INT= -
- AGI= -
- STRplus= -
- INTplus= -
- AGIplus= -
- abilTest=-
- Primary=_
- upgrades=
- tilesets=*
- nbrandom=-
- isbldg=0
- preventPlace=_
- requirePlace=_
- repulse=0
- repulseParam=0
- repulseGroup=0
- repulsePrio=0
- collision=32
- sort=z2
- race=undead
- prio=3
- threat=1
- valid=1
- deathType=3
- death=3
- canSleep=0
- cargoSize=1
- movetp=foot
- moveHeight=0
- moveFloor=0
- turnRate=0.6
- propWin=60
- orientInterp=4
- formation=0
- targType=ground
- pathTex=_
- fatLOS=0
- points=100
- buffType=_
- buffRadius=-
- nameCount=-
- canFlee=1
- requireWaterRadius=0
- isBuildOn=0
- canBuildOn=0
- version=1
- sortUI=z2
- file=war3mapImported\Tauren.mdl
- fileVerFlags=0
- unitSound=Naisha
- tilesetSpecific=0
- name=naisha
- special=0
- campaign=0
- inEditor=1
- hiddenInEditor=0
- hostilePal=-
- dropItems=1
- nbmmIcon=-
- useClickHelper=0
- hideHeroBar=0
- hideHeroMinimap=0
- hideHeroDeathMsg=0
- hideOnMinimap=0
- blend=0.15
- scale=3.00
- scaleBull=0
- maxPitch=45
- maxRoll=10
- elevPts=-
- elevRad=30
- fogRad=0
- walk=240
- run=240
- selZ=3.00
- weap1=MetalMediumSlice
- weap2=_
- teamColor=-1
- customTeamColor=0
- armor=Flesh
- modelScale=4.00
- red=125
- green=125
- blue=125
- uberSplat=_
- unitShadow=Shadow
- buildingShadow=_
- shadowW=190
- shadowH=190
- shadowX=75
- shadowY=75
- shadowOnWater=1
- selCircOnWater=0
- occH=0
- sortWeap=z2
- weapsOn=1
- acquire=600.00
- minRange=-
- castpt=0.6
- castbsw=0.4
- launchX=0
- launchY=0
- launchZ=60
- launchSwimZ=0
- impactZ=60
- impactSwimZ=0
- weapType1=
- targs1=ground,structure,item,debris,air,ward
- showUI1=1
- rangeN1=350
- RngTst=-
- RngBuff1=250
- atkType1=chaos
- weapTp1=normal
- cool1=2.00
- mincool1=-
- dice1=1
- sides1=5
- dmgplus1=321525
- dmgUp1=-
- mindmg1=27
- avgdmg1=29
- maxdmg1=31
- dmgpt1=0.46
- backSw1=0.54
- Farea1=400
- Harea1= -
- Qarea1= -
- Hfact1=-
- Qfact1=-
- splashTargs1=ground,structure,debris,item,ward,enemy
- targCount1=5
- damageLoss1=0.5
- spillDist1=0
- spillRadius1=0
- DmgUpg=high
- dmod1=22
- DPS=16.1111111111111
- weapType2=_
- targs2=_
- showUI2=1
- rangeN2=-
- RngTst2=-
- RngBuff2=-
- atkType2=normal
- weapTp2=_
- cool2=-
- mincool2=-
- dice2=-
- sides2=-
- dmgplus2=-
- dmgUp2=-
- mindmg2= -
- avgdmg2=-
- maxdmg2= -
- dmgpt2=-
- backSw2=-
- Farea2=-
- Harea2=-
- Qarea2=-
- Hfact2=-
- Qfact2=-
- splashTargs2=_
- targCount2=1
- damageLoss2=0
- spillDist2=0
- spillRadius2=0
- Name=|cffd45e19Egthoro, the Angry God|
- Art=ReplaceableTextures\CommandButtons\BTNTauren.blp
- Buttonpos=1,0
- Specialart=Objects\Spawnmodels\NightElf\NightElfLargeDeathExplode\NightElfLargeDeathExplode.mdl
- Attachmentanimprops=medium
- Missileart=
- Missilearc=0.10
- Missilespeed=900
- [Hblm]
- sortAbil=a1
- comment(s)=HeroBloodMage
- auto=_
- abilList=AInv,Asph,Amls
- heroAbilList=A02S,A00I,ANcf,AHpx,ANic
- InBeta=1
- sortBalance=a1
- sort2=uher
- level=5
- =FALSE
- type=_
- goldcost=425
- lumbercost=100
- goldRep=425
- lumberRep=100
- fmade=-
- fused=5
- bountydice=8
- bountysides=3
- bountyplus=30
- lumberbountydice=0
- lumberbountysides=0
- lumberbountyplus=0
- stockMax=3
- stockRegen=30
- stockStart=0
- HP=100
- realHP=550
- regenHP=0.25
- regenType=always
- manaN=0
- realM=285
- mana0=100
- regenMana=5.00
- def=0
- defUp=0
- realdef=2.2
- defType=hero
- spd=300
- minSpd=0
- maxSpd=0
- bldtm=55
- reptm=55
- sight=1800
- nsight=800
- STR=18
- INT=24
- AGI=14
- STRplus=2
- INTplus=3.20
- AGIplus=1
- abilTest=6
- Primary=INT
- upgrades=_
- tilesets=*
- nbrandom=-
- isbldg=0
- preventPlace=_
- requirePlace=_
- repulse=0
- repulseParam=0
- repulseGroup=0
- repulsePrio=0
- collision=32
- sort=a1
- race=human
- prio=9
- threat=1
- valid=1
- deathType=2
- death=3
- canSleep=0
- cargoSize=1
- movetp=foot
- moveHeight=0
- moveFloor=0
- turnRate=0.5
- propWin=60
- orientInterp=4
- formation=2
- targType=ground
- pathTex=_
- fatLOS=0
- points=100
- buffType=_
- buffRadius=-
- nameCount=1
- canFlee=1
- requireWaterRadius=0
- isBuildOn=0
- canBuildOn=0
- version=1
- sortUI=a1
- file=units\human\HeroBloodElf\HeroBloodElf
- fileVerFlags=0
- unitSound=BloodElfSorceror
- tilesetSpecific=0
- name=bloodmage
- unitClass=HHero04
- special=0
- campaign=0
- inEditor=1
- hiddenInEditor=0
- hostilePal=-
- dropItems=1
- nbmmIcon=-
- useClickHelper=0
- hideHeroBar=0
- hideHeroMinimap=0
- hideHeroDeathMsg=0
- hideOnMinimap=0
- blend=0.15
- scale=1.5
- scaleBull=1
- maxPitch=10
- maxRoll=10
- elevPts=-
- elevRad=30
- fogRad=0
- walk=250
- run=250
- selZ=0
- weap1=_
- weap2=_
- teamColor=-1
- customTeamColor=0
- armor=Flesh
- modelScale=1
- red=255
- green=255
- blue=255
- uberSplat=_
- unitShadow=Shadow
- buildingShadow=_
- shadowW=170
- shadowH=170
- shadowX=65
- shadowY=65
- shadowOnWater=1
- selCircOnWater=0
- occH=0
- sortWeap=a1
- weapsOn=1
- acquire=600
- minRange=-
- castpt=0.5
- castbsw=1
- launchX=15
- launchY=0
- launchZ=66
- launchSwimZ=0
- impactZ=60
- impactSwimZ=0
- weapType1=_
- targs1=ground,structure,debris,air,item,ward
- showUI1=1
- rangeN1=600
- RngTst=-
- RngBuff1=250
- atkType1=hero
- weapTp1=missile
- cool1=1.64
- mincool1=-
- dice1=2
- sides1=4
- dmgplus1=0
- dmgUp1=-
- mindmg1=2
- avgdmg1=5
- maxdmg1=8
- dmgpt1=0.55
- backSw1=0.85
- Farea1= -
- Harea1= -
- Qarea1= -
- Hfact1=-
- Qfact1=-
- splashTargs1=_
- targCount1=1
- damageLoss1=0
- spillDist1=0
- spillRadius1=0
- DmgUpg=-
- dmod1=-
- DPS=3.04878048780488
- weapType2=_
- targs2=ground,structure,debris,air,item,ward
- showUI2=1
- rangeN2=500
- RngTst2=-
- RngBuff2=250
- atkType2=hero
- weapTp2=missile
- cool2=1.64
- mincool2=-
- dice2=2
- sides2=4
- dmgplus2=0
- dmgUp2=-
- mindmg2=2
- avgdmg2=5
- maxdmg2=8
- dmgpt2=0.55
- backSw2=0.85
- Farea2=-
- Harea2=-
- Qarea2=-
- Hfact2=-
- Qfact2=-
- splashTargs2=_
- targCount2=1
- damageLoss2=0
- spillDist2=0
- spillRadius2=0
- Name=Blood Mage
- Propernames=Hale Magefir
- Tip=
- Hotkey=
- Ubertip=
- Revivetip=
- Awakentip=
- Art=ReplaceableTextures\CommandButtons\BTNHeroBloodElfPrince.blp
- Buttonpos=0,1
- Requires=
- Requires1=hkee
- Requires2=hcas
- Specialart=Objects\Spawnmodels\Human\HumanLargeDeathExplode\HumanLargeDeathExplode.mdl
- ScoreScreenIcon=UI\Glues\ScoreScreen\scorescreen-hero-sorceror.blp
- Missileart=Abilities\Weapons\BloodElfMissile\BloodElfMissile.mdl
- Missilearc=0.15
- Missilespeed=900
- MissileHoming=1
- Requirescount=3
- [Hmkg]
- sortAbil=a1
- comment(s)=HeroMountainKing
- auto=_
- abilList=AInv,A01K
- heroAbilList=AHtb,AHtc,AHbh,AHav,A005
- InBeta=1
- sortBalance=a1
- sort2=uher
- level=5
- =FALSE
- type=_
- goldcost=425
- lumbercost=100
- goldRep=425
- lumberRep=100
- fmade=-
- fused=5
- bountydice=8
- bountysides=3
- bountyplus=30
- lumberbountydice=0
- lumberbountysides=0
- lumberbountyplus=0
- stockMax=3
- stockRegen=30
- stockStart=0
- HP=100
- realHP=700
- regenHP=10.00
- regenType=always
- manaN=0
- realM=225
- mana0=100
- regenMana=0.01
- def=1
- defUp=0
- realdef=2.3
- defType=hero
- spd=400
- minSpd=0
- maxSpd=0
- bldtm=55
- reptm=55
- sight=1800
- nsight=800
- STR=28
- INT=15
- AGI=11
- STRplus=4.00
- INTplus=1.5
- AGIplus=1.5
- abilTest=6
- Primary=STR
- upgrades=_
- tilesets=*
- nbrandom=-
- isbldg=0
- preventPlace=_
- requirePlace=_
- repulse=0
- repulseParam=0
- repulseGroup=0
- repulsePrio=0
- collision=32
- sort=a1
- race=human
- prio=9
- threat=1
- valid=1
- deathType=2
- death=2.5
- canSleep=0
- cargoSize=1
- movetp=foot
- moveHeight=0
- moveFloor=0
- turnRate=0.6
- propWin=60
- orientInterp=5
- formation=0
- targType=ground
- pathTex=_
- fatLOS=0
- points=100
- buffType=_
- buffRadius=-
- nameCount=1
- canFlee=1
- requireWaterRadius=0
- isBuildOn=0
- canBuildOn=0
- version=0
- sortUI=a1
- file=units\human\HeroMountainKing\HeroMountainKing
- fileVerFlags=0
- unitSound=HeroMountainKing
- tilesetSpecific=0
- name=mountainking
- unitClass=HHero03
- special=0
- campaign=0
- inEditor=1
- hiddenInEditor=0
- hostilePal=-
- dropItems=1
- nbmmIcon=-
- useClickHelper=0
- hideHeroBar=0
- hideHeroMinimap=0
- hideHeroDeathMsg=0
- hideOnMinimap=0
- blend=0.15
- scale=1.25
- scaleBull=1
- maxPitch=10
- maxRoll=10
- elevPts=-
- elevRad=50
- fogRad=0
- walk=250
- run=250
- selZ=0
- weap1=MetalHeavyBash
- weap2=_
- teamColor=-1
- customTeamColor=0
- armor=Metal
- modelScale=1.10
- red=255
- green=255
- blue=255
- uberSplat=_
- unitShadow=Shadow
- buildingShadow=_
- shadowW=150
- shadowH=150
- shadowX=60
- shadowY=60
- shadowOnWater=1
- selCircOnWater=0
- occH=0
- sortWeap=a1
- weapsOn=1
- acquire=500
- minRange=-
- castpt=0.4
- castbsw=0.5
- launchX=0
- launchY=0
- launchZ=60
- launchSwimZ=0
- impactZ=60
- impactSwimZ=0
- weapType1=MetalHeavyBash
- targs1=ground,structure,item,debris,air,ward
- showUI1=1
- rangeN1=100
- RngTst=-
- RngBuff1=250
- atkType1=hero
- weapTp1=normal
- cool1=1.80
- mincool1=-
- dice1=2
- sides1=6
- dmgplus1=0
- dmgUp1=-
- mindmg1=2
- avgdmg1=7
- maxdmg1=12
- dmgpt1=0.35
- backSw1=0.65
- Farea1= -
- Harea1= -
- Qarea1= -
- Hfact1=-
- Qfact1=-
- splashTargs1=_
- targCount1=1
- damageLoss1=0
- spillDist1=0
- spillRadius1=0
- DmgUpg=-
- dmod1=-
- DPS=3.15315315315315
- weapType2=_
- targs2=ground,structure,debris,air,item,ward
- showUI2=1
- rangeN2=500
- RngTst2=-
- RngBuff2=250
- atkType2=hero
- weapTp2=missile
- cool2=2.22
- mincool2=-
- dice2=2
- sides2=6
- dmgplus2=0
- dmgUp2=-
- mindmg2=2
- avgdmg2=7
- maxdmg2=12
- dmgpt2=0.35
- backSw2=0.65
- Farea2=-
- Harea2=-
- Qarea2=-
- Hfact2=-
- Qfact2=-
- splashTargs2=_
- targCount2=1
- damageLoss2=0
- spillDist2=0
- spillRadius2=0
- Name=Mountain King
- Propernames=Munin Ironclif
- Tip=
- Hotkey=
- Ubertip=
- Revivetip=
- Awakentip=
- Art=ReplaceableTextures\CommandButtons\BTNHeroMountainKing.blp
- Buttonpos=1,2
- Requires=
- Requires1=hkee
- Requires2=hcas
- Specialart=Objects\Spawnmodels\Human\HumanLargeDeathExplode\HumanLargeDeathExplode.mdl
- ScoreScreenIcon=UI\Glues\ScoreScreen\scorescreen-hero-mountainking.blp
- Requirescount=3
- UberTip="Warrior Hero, adept at offensive combat and disrupting enemy troops. Can learn Storm Bolt, Thunder Clap, Bash and Avatar. |n|n|cffffcc00Attacks land units.|r"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement