Giter Site home page Giter Site logo

geoscentshack's Introduction

GeoScentsHack

A Python Program that cheats at GeoScents.net.

GeoScents is a game that pits online users against each other in a challenge to guess where a given location is in a certain amount of time. It is a remake of an old game called GeoSense, made by a reddit user, u/mattfel. I heard about this game through a r/webgames thread.

Dependencies

  • pyautogui
  • pytesseract
  • pynput
  • geopy

How to Use

  1. Load up the Application
  2. Load up GeoScents.net
  3. Put them side by side
  4. Start a game on the 'World Server'
  5. Click "Text Top Left" and then hover over the top left of where text shows up for the location and then press space. DO NOT CLICK otherwise the program crashes (who knows why?)
  6. Repeat for "Text Bottom Right" and do the same but for the bottom right.
  7. Click "Equator" and then hover over where the equator is on the map and press space.
  8. Same for "Cape-CT" or the Cape of Good Hope (where Cape Town is basically).
  9. You can experiment with "Get Word" and "Get Location", but to do both of them at the same time, click "Redo W-L" and it should automatically read the text and look up coordinates. Finally once that process is done, click "Click" and your mouse should move to the location on the map.

Example GIFs

gs1 gs2 gs3 gs4 gs5

Explanation

I decided to use an afternoon to make a program to beat the game for me. There were 3 things needed:

  • Reading the place given to players
  • Looking up where that place is (latitude/longitude coordinates)
  • Moving the mouse to where the place is on the world map

I decided to use Python-tesseract, a wrapper for Google's Tesseract OCR Engine. It can read image files and output the text on the images. To get the image itself, I used something called PyAutoGUI, a library that automates GUI features, to capture a screenshot given coordinates on the screen. To get those coordinates, I needed keyboard input and thus required pynput, a library that controls input devices. When setting up the program, the user has to give coordinates on the screen of where the text of the location to look up will show up. Thus, we can get an image of the text and passing it into pytesseract, we get the location in string.

To look up where the place is, I used a libary called geopy. Geopy has OpenStreetMap's Nominatum which allows me to get the latitude and longitude of a place given an address. Thus, all it needed was a simple function to look up the latitude/longitude of a given location. The lookup took less than 1 second in most cases as well.

Finally, to move the mouse to the given latitude and longitude on the GeoScents map, I used PyAutoGUI. However I ran into a problem - the map given wasn't entirely correct (the equator was much lower than the center of the map). Because this was a hack and not something that needed immense precision (and because GeoScents lets you guess the location within a radius), I decided to forego precision for convenience and instead allowed the user to input 2 known locations and extrapolated where the mouse would be given the scaling. I chose the equator and the Cape of Good Hope as the two places needed to be selected. Once the screen coordinates are received, the program automatically finds the conversion from latitude/longitude coordinates to pixels and thus converts the location coordinates to pixel coordinates on screen.

geoscentshack's People

Contributors

amritamar avatar

Stargazers

 avatar  avatar

Watchers

James Cloos avatar  avatar

geoscentshack's Issues

GeoScentsHack Detector

I love this. Good job implementing it! Feel free to write a watchdog in javascript that can detect when someone is using this script ๐Ÿ˜›

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.