Essentially I want to turn an integer hp into strings of squares.
- I want to add a
:green_square:for every 500 inhp. - I want to add a
:red_square:for every missing 500 inhp(max hp is 10000). - I want to add a
:yellow_square:for a remaining value between 1-499 inhp.
So far I have written:
players = await getplayerdata()
numofgreensqs = math.floor(hp/500)
numofredsqs = math.floor((10000-hp)/500)
yellowsq = ?
hpmoji = str(numofgreensqs*":green_square:")+(yellowsq)+str(numofredsqs*":red_square:")```
So I really just need to figure out how to get the yellowsq
Edit:
yellowsq = math.ceil((hp-(numofgreensqs*500))/500)
hpmoji = str(numofgreensqs*":green_square:")+(yellowsq*":yellow_square:")+str(numofredsqs*":red_square:")
may have found a solution in the above. need to test though.