Hello everyone I was told to post this here instead of StackOverFlow.
I am using PyAutoGUI currently as this was the best tools I could manage to find to use a piece of software that has no native Python function. I am using the mouse and keyboard control to design maps for Dungeons and Dragons using the software Dungeon Painter Studio. It is working as intended and I have figured out a way to actually use my script to create maps on it however, since PyAutoGUI is based on mouse location and pixels it has been quite a manual process.
EDIT:
Here is a picture of the software with nothing in it just opened up:
Here is a picture after the code has been ran:
My reason for creating this script is so that I can eventually randomize it to create a random generated map for my D&D campaign that is somewhat original compared to just taking a map off the internet.
I am inputting a starting location for the mouse and have it click and moved based on relative location to that starting position. Here is a piece of what it currently looks like:
#Switch to dps, maximize window, select the tile hotkey
pyautogui.keyDown('altleft'); pyautogui.press('tab'); pyautogui.keyUp('altleft')
fw = pyautogui.getActiveWindow()
fw.maximize()
pyautogui.keyDown('enter')
#Select the background tile
pyautogui.click('dirt_k.png')
#Create background
pyautogui.moveTo(9,189)
pyautogui.mouseDown(9,189)
pyautogui.moveTo(748,808)
pyautogui.mouseUp(252,436)
#Select the dugeon tile
pyautogui.click('dirt_d.png')
#Create dungeon floor
pyautogui.moveTo(329,807)
pyautogui.mouseDown(329,807)
pyautogui.moveRel(100,-75)
pyautogui.mouseUp()
pyautogui.moveRel(-25,0)
pyautogui.mouseDown()
pyautogui.moveRel(-50,-50)
pyautogui.mouseUp()
pyautogui.moveRel(-100,0)
pyautogui.mouseDown()
pyautogui.moveRel(250,-125)
pyautogui.mouseUp()
pyautogui.moveRel(0,100)
pyautogui.mouseDown()
pyautogui.moveRel(50,25)
pyautogui.mouseUp()
pyautogui.moveRel(0,100)
pyautogui.mouseDown()
pyautogui.moveRel(100,-125)
pyautogui.mouseUp()
pyautogui.moveRel(0,0)
pyautogui.mouseDown()
pyautogui.moveRel(-25,-50)
pyautogui.mouseUp()
pyautogui.moveRel(-75,0)
pyautogui.mouseDown()
pyautogui.moveRel(175,-100)
pyautogui.mouseUp()
pyautogui.mouseDown()
pyautogui.moveRel(-25,-50)
pyautogui.mouseUp()
pyautogui.moveRel(25,0)
pyautogui.mouseDown()
pyautogui.moveRel(-225,-125)
pyautogui.mouseUp()
It basically continues on like that for hundreds of lines to create a sample map. I was just seeing if anyone else is familiar enough with PyAutoGUI (or any other tools) that would help automated this process a bit more.
I have the amount of pixels per square which is roughly 25px so it isn't too hard to calculate. Moving right is +25 left is -25 down is +25 up is -25. So using those measurements I have been able to calculate relative location where the mouse starts and move it around from there.
Any advice or help is greatly appreciated, thank you!