Skip to content

Commit

Permalink
Merge branch 'Kushal997-das:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
saiumasankar authored Jul 8, 2024
2 parents d8d2d1e + df9c2d5 commit c657388
Show file tree
Hide file tree
Showing 48 changed files with 8,144 additions and 241 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# **Selenium Automated Cookie player game**
It automates gameplay for the popular browser game **Cookie Clicker**. Using the power of Selenium, it strategically clicks upgrade buttons, making your cookie production skyrocket!

### **How it Works:**

* **Target Acquired**: The script launches the game at [Cookie game](https://orteil.dashnet.org/experiments/cookie/).

* **Upgrade Identification**: It uses Selenium to locate upgrade buttons for various in-game elements like cursors, grandmas, and factories.

* **Strategic Clicks**: The script analyzes your current cookie count and clicks the most efficient upgrade button based on its cost.

### **Requirements:**

* Selenium library (install using pip install selenium)
A WebDriver for your browser (download from https://www.selenium.dev/downloads/)
Setup:

* Download and install the appropriate WebDriver for your browser (e.g., ChromeDriver which is compativle with your Chrome version from her: https://googlechromelabs.github.io/chrome-for-testing/)

* Place the WebDriver in a directory accessible to your Python script or add it to your path variables (Recommended).



https://github.com/PiyushBagde/Project-Guidance/assets/100503136/f26114bb-7419-4ca1-aaa6-6262c0db3519

Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import time

from selenium import webdriver
from selenium.webdriver.common.by import By

chrome_option = webdriver.ChromeOptions()
chrome_option.add_experimental_option('detach', True)

driver = webdriver.Chrome(options=chrome_option)
driver.get("https://orteil.dashnet.org/experiments/cookie/")

cookie_button = driver.find_element(By.ID, value='cookie')
store = driver.find_elements(By.CSS_SELECTOR, value="#store div b")

end_time = time.time() + 5 * 60

while time.time() < end_time:
money = int(driver.find_element(By.ID, value='money').text)

time_machine = driver.find_element(By.CSS_SELECTOR, value="div[id='buyAlchemy lab'] b")
portal = driver.find_element(By.CSS_SELECTOR, value="div #buyPortal b")
alchemy = driver.find_element(By.CSS_SELECTOR, value="div[id='buyAlchemy lab'] b")
shipment = driver.find_element(By.CSS_SELECTOR, value="div #buyShipment b")
mine = driver.find_element(By.CSS_SELECTOR, value="div #buyMine b")
factory = driver.find_element(By.CSS_SELECTOR, value="div #buyFactory b")
grandma = driver.find_element(By.CSS_SELECTOR, value="div #buyGrandma b")
cursor = driver.find_element(By.CSS_SELECTOR, value="div #buyCursor b")

time_machine_amount = int(time_machine.text.split()[-1].replace(",", ""))
portal_amount = int(portal.text.split()[-1].replace(",", ""))
alchemy_amount = int(alchemy.text.split()[-1].replace(",", ""))
shipment_amount = int(shipment.text.split()[-1].replace(",", ""))
mine_amount = int(mine.text.split()[-1].replace(",", ""))
factory_amount = int(factory.text.split()[-1].replace(",", ""))
grandma_amount = int(grandma.text.split()[-1].replace(",", ""))
cursor_amount = int(cursor.text.split()[-1].replace(",", ""))

if money >= time_machine_amount:
time_machine.click()
time.sleep(0.1)
elif money >= portal_amount:
portal.click()
time.sleep(0.1)
elif money >= alchemy_amount:
alchemy.click()
time.sleep(0.1)
elif money >= shipment_amount:
shipment.click()
time.sleep(0.1)
elif money >= mine_amount:
mine.click()
time.sleep(0.1)
elif money >= factory_amount:
factory.click()
time.sleep(0.1)
elif money >= grandma_amount:
grandma.click()
time.sleep(0.1)
elif money >= cursor_amount:
cursor.click()
time.sleep(0.1)

cookie_button.click()

print("one minute finished")
1 change: 1 addition & 0 deletions Desktop Application/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
| 29. | [Screen Recorder](https://github.com/Kushal997-das/Project-Guidance/tree/main/Desktop%20Application/Basic/Python/Screen-Recorder) |
| 30. | [PDF Utility Tool](https://github.com/Kushal997-das/Project-Guidance/tree/main/Desktop%20Application/Basic/Python/PDF%20Utility%20Tool) |
| 31. | [Quiz_Application](https://github.com/Kushal997-das/Project-Guidance/tree/main/Desktop%20Application/Basic/Python/Quiz_Application) |
| 32. | [Selenium Automated game playing bot](https://github.com/Kushal997-das/Project-Guidance/tree/main/Desktop%20Application/Basic/Python/Selenium-Automated-Cookie-PlayerGame) |
</br>

## Java 🚀
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
streamlit==1.31.0
scikit-learn==1.2.2
scikit-learn==1.5.0
streamlit_option_menu== 0.3.12
74 changes: 74 additions & 0 deletions Web Development/Advanced/Todo app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Todo CRUD app - MERN stack

The full form of CRUD is Create, Read, Update, and Delete. These are the four basic operations that can be performed on data in a database or any persistent storage system.

- **Create**: This operation adds new data to the database. For example, adding a new record in a table.
- **Read**: This operation retrieves data from the database. For example, fetching records from a table.
- **Update**: This operation modifies existing data in the database. For example, changing values of an existing record.
- **Delete**: This operation removes data from the database. For example, deleting a record from a table.
These operations are fundamental to managing and manipulating data in a database, ensuring that users can interact with the data effectively.

This is a simple todo app, demonstrates CRUD operations in MERN stack.

| Task | HTTP Method | Route Path |
|----------|----------|----------|
| Get all tasks | ![GET](https://img.shields.io/badge/GET-blue) | `/todo/all` |
| Get task by id | ![GET](https://img.shields.io/badge/GET-blue) | `/todo/{id}` |
| Create a task | ![POST](https://img.shields.io/badge/POST-green) | `/todo/new` |
| Edit a task | ![PUT](https://img.shields.io/badge/PUT-yellow) | `/todo/{id}` |
| Delete a task | ![DELETE](https://img.shields.io/badge/DELETE-red)| `/todo/{id}` |


## How to run the app?

1. Fork the repository.

2. Clone the Repository.

```
git clone repository-url
```

3. Go to root of project directory.

```
cd repository-directory
```

4. Navigate to server
```
cd server/
```

5. Install server dependecies
```
npm install
```

6. Run the server
```
npm start
```

7. Navigate to client
```
cd client/
```

8. Install server dependecies
```
npm install
```

9. Run the server
```
npm run dev
```

## Screeanshots

![image](https://github.com/DharshiBalasubramaniyam/Project-Guidance/assets/139672976/5ac007d3-3259-490e-b740-09b2f0d0cb68)

![image](https://github.com/DharshiBalasubramaniyam/Project-Guidance/assets/139672976/f38b0309-0d4e-4e47-9847-c7d9d0c588e7)

![image](https://github.com/DharshiBalasubramaniyam/Project-Guidance/assets/139672976/09121f07-49ca-4bc7-afba-7f878c35802d)
Binary file added Web Development/Advanced/Todo app/assets/todo.mp4
Binary file not shown.
8 changes: 8 additions & 0 deletions Web Development/Advanced/Todo app/client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# React + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
13 changes: 13 additions & 0 deletions Web Development/Advanced/Todo app/client/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>MyToDo</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>
Loading

0 comments on commit c657388

Please sign in to comment.