#๐Ÿ”’ Map grid

15 messages ยท Page 1 of 1 (latest)

safe oxide
#

Could there be a way to divide a 650x650px map into grid? I can use map as .png or get element from browser using selenium. I'd like each square to have its own coordinates, for example, the bottom right corner (65, 65) (x, y), similar to a battleship game. I need this so I can navigate the map. For instance, I'd like to move to coordinates (20, 30) and have the program click on a specific square with those coordinates. The entire map is a canvas element in a browser game where I can't directly mark the opponent, so this is the only workaround I've come up with.

im also posing map.png if that helps.

young sapphireBOT
#

@safe oxide

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

cloud iris
safe oxide
#

I already got one. on browser game.

<canvas class="handheld-mini-map-canvas" width="650" height="650"></canvas>

cloud iris
#

I'm not really sure what you're asking then?

safe oxide
#

in game they are cordinates, (x,y) map im sending screenshot of is minimap for game. if u press something on minimap, character will go there.

so i need program that:

  • get minimap element (already done)
  • make grid on it
  • each square is cords eg. (0,0) is top left and (65,65) is bottom right
  • ask program to click on square (some cords for example (21,22)) so game character will go there
cloud iris
#

oh so you actually want to modify the existing HTML to achieve this?

safe oxide
#

im not sure how can i do it but i need it without modifing html

cloud iris
#

I'm really not sure then

safe oxide
#

blue diamond is player
gray square is monster

u can see player cords on top (55,52)
game is made as grid
i want to do same with minimap
so program will know i want go to monster.

cloud iris
#

you could make a separate program on the side where you can just punch in the values and keep track of this stuff

#

but yeah, I'm not sure how to directly plug into this

young sapphireBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.