-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
115 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,23 @@ | ||
# Basic-New-World-Bot | ||
Basic New World Bot | ||
# Basic New World Bot | ||
Watch the video! - https://www.youtube.com/watch?v=ixOkG0h6SjI | ||
|
||
Join teh Discord - https://discord.com/invite/YwMqW5P8ZN | ||
|
||
### Prereqs | ||
Make sure you have a pet Python - https://www.python.org/ | ||
|
||
Make sure you pip install the following packages | ||
``` | ||
pip install PyAutoGUI | ||
pip install PyDirectInput | ||
``` | ||
|
||
New World must be installed and running..... But you know this already right? | ||
|
||
### Run | ||
If you have python and the 2 packages you are good to go. Load up New World on your MAIN monitor (Only applicable for people with multiple monitors), enter the game and walk to a nice farming spot, then run the program. | ||
``` | ||
python main.py | ||
``` | ||
**We are always looking for new Volunteers to join our Champions! | ||
If you have any ideas for videos or programs, let us know!** |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
import pyautogui | ||
import pydirectinput | ||
import time | ||
import random | ||
|
||
def main(): | ||
""" | ||
Main function for the program | ||
""" | ||
|
||
# Finds all Windows with the title "New World" | ||
newWorldWindows = pyautogui.getWindowsWithTitle("New World") | ||
|
||
# Find the Window titled exactly "New World" (typically the actual game) | ||
for window in newWorldWindows: | ||
if window.title == "New World": | ||
newWorldWindow = window | ||
break | ||
|
||
# Select that Window | ||
newWorldWindow.activate() | ||
|
||
# Move your mouse to the center of the game window | ||
centerW = newWorldWindow.left + (newWorldWindow.width/2) | ||
centerH = newWorldWindow.top + (newWorldWindow.height/2) | ||
pyautogui.moveTo(centerW, centerH) | ||
|
||
# Clicky Clicky | ||
time.sleep(.1) | ||
pyautogui.click() | ||
time.sleep(.1) | ||
|
||
# Seconds to move foward | ||
fowardMoveTotal = 20 | ||
|
||
# Current seconds foward moved | ||
currentFoward = 0 | ||
|
||
# Go right or left | ||
flip = 1 | ||
|
||
# Turn 90 degrees, value will be different for you, im on a 4k monitor | ||
flipMouseMove = 2000 | ||
|
||
# Making tuple with data from the window for later use | ||
region = (newWorldWindow.left, newWorldWindow.top, newWorldWindow.width, newWorldWindow.height) | ||
|
||
# Main bot loop, runs forever use CTRL+C to turn it off | ||
while True: | ||
# Find that image on screen, in that region, with a confidence of 65% | ||
if pyautogui.locateOnScreen("imgs/e0.png", grayscale=True, confidence=.65, region=region) is not None: | ||
pyautogui.press('e') | ||
time.sleep(1) | ||
continue | ||
|
||
# Do I got to explain? | ||
pyautogui.press('=') | ||
|
||
# Randomly move foward 0 - 1.5 seconds | ||
temp = 1.5 * random.random() | ||
currentFoward += temp | ||
time.sleep(temp) | ||
|
||
# Brah, you know | ||
pyautogui.press('=') | ||
|
||
# Flippy flip if you hitty hit the max move time (fowardMoveTotal) | ||
if currentFoward >= fowardMoveTotal: | ||
# Reset the move foward | ||
currentFoward = 0 | ||
|
||
# Move the mouse 90 degrees | ||
pydirectinput.move(flipMouseMove * flip, 1, relative=True) | ||
|
||
# Move Foward 1.5 secs | ||
pyautogui.press('=') | ||
time.sleep(1.5) | ||
pyautogui.press('=') | ||
|
||
# Move the mouse 90 degrees | ||
pydirectinput.move(flipMouseMove * flip, 1, relative=True) | ||
|
||
# Flippy flippy the value. Evil math. | ||
flip *= -1 | ||
|
||
# Sleeping for the animation | ||
time.sleep(.1) | ||
|
||
|
||
# Runs the main function | ||
if __name__ == '__main__': | ||
main() |