I am not an ultimate vacation guy, but when I got asked whether I would like to join someone and her family on a trip to Hungary, I couldn’t say no (for obvious reasons). Being named “Hung” made Hungary somehow special to me, and I have also thought about the possibility of buying T-shirts with claims such as “I ♥ Hungary” and removing the “ary” part to have my own merchandise! In this article, I would like to share my experiences from visiting this lovely country.
Me no Mitch Buchannon
As I said, I am not a vacation guy. When you think of Hung, you cannot imagine Mitch Buchannon in his slippers walking down the beach. I am not that type of guy. And I don’t go on many vacations either. Take for example my last vacation, when I spent nearly 8 days building a tradebot that would allow me to buy cheap items in one of the games I was playing back then.
The game itself didn’t have any API that would allow me to get the auction data easily, which is why I created a Python script that worked with Tesseract. Tesseract is an open-source OCR (optical character recognition) engine that is contained within the PyTesseract package.
My general workflow was to set up a bot that would capture a screenshot of my game window using a PyAutoGUI module. This screenshot was then transferred to the OCR, which determined both the name and value of the given item. The price of an item was then compared to its respective value within my database, and if it was significantly lower, my app would send me an email notification. I should probably note that this bot didn’t give me that much of an advantage, as I have spent significantly more time building this tool than I was really using it. But it was quite fun, and I got some hands-on experience with how OCR works. This was the best vacation I have had up until now.
import pyautogui
import pytesseract
from PIL import Image
# Take a screenshot of a specific region in game window
region = (100, 100, 400, 400)
screenshot = pyautogui.screenshot(region=region)
# Converting to greyscale
screenshot = screenshot.convert('L')
# Use Tesseract to extract text from the image
text = pytesseract.image_to_string(screenshot)
# Connect to the database, compare the values, send email
Note: Due to the sensitive nature of my “mischief”, I am not sharing the detailed source code. 🙂
Back to my vacation…
In the morning of the first day, we embarked on the long trail to Budapest (the capital of Hungary), where we have spent the majority of our vacation. The journey itself was quite pleasant, despite the fact that it was cloudy almost the whole day. What I like about Hungary is that almost the whole country is a large plain with no hills, making it super convenient to travel! And there are also dust storms. I have tried to capture one in this picture.
After a three-hour drive, we have finally arrived in Budapest. Due to me being a bad photographer, I have taken this picture from the internet. Nevertheless, Budapest is one of the most beautiful cities in Central Europe. We checked into our AirBnB and immediately went to explore the city and its secrets. One of them being the Thai massages and ATMs on literally every corner. I guess this is just a bane of Europe.
On the next day, we have planned on visiting a couple of places within the city. But let me first talk about the subway! It’s one of the oldest subways in Europe, and the majority of the stations have quite a secession vibe. The subway tunnels were dug in 1896, meaning that they are only a couple of meters below the ground. Sometimes, when you walk on a pavement and there is a subway running under you, you can experience a small earthquake. It made me a bit scared the first time.
We have also visited the famous Széchenyi baths. They were super crowded, but if you happen to be in Budapest, I would highly advise you to pay them a visit. It’s a super nice place, and I have not felt this relaxed in a long time.
Good food comes to mind when I think of relaxing. I am probably one of the worst people when it comes to food. I tend to eat in a rush and don’t pay that much attention to what I eat, but during my vacation, I have decided to at least take a break and treat myself a bit. And I had the best carrot in my life!
The whole trip came to an end earlier than I had wished, but on the way home, we stopped at Lake Balaton, which is one of the largest lakes in Europe. It was a great vacation, and I am happy that I was convinced to go!
If you have read so far, you might want to follow me here on Hashnode. Feel free to connect with me over at LinkedIn or Mastodon.