Skip to content
This repository was archived by the owner on Oct 9, 2025. It is now read-only.

Commit f66041e

Browse files
committed
Merge branch 'dev' into main
2 parents 35e3a13 + f78956d commit f66041e

File tree

3 files changed

+115
-2
lines changed

3 files changed

+115
-2
lines changed

README.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,23 @@
1-
# Basic-New-World-Bot
2-
Basic New World Bot
1+
# Basic New World Bot
2+
Watch the video! - https://www.youtube.com/watch?v=ixOkG0h6SjI
3+
4+
Join teh Discord - https://discord.com/invite/YwMqW5P8ZN
5+
6+
### Prereqs
7+
Make sure you have a pet Python - https://www.python.org/
8+
9+
Make sure you pip install the following packages
10+
```
11+
pip install PyAutoGUI
12+
pip install PyDirectInput
13+
```
14+
15+
New World must be installed and running..... But you know this already right?
16+
17+
### Run
18+
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.
19+
```
20+
python main.py
21+
```
22+
**We are always looking for new Volunteers to join our Champions!
23+
If you have any ideas for videos or programs, let us know!**

imgs/e0.png

1.55 KB
Loading

main.py

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
import pyautogui
2+
import pydirectinput
3+
import time
4+
import random
5+
6+
def main():
7+
"""
8+
Main function for the program
9+
"""
10+
11+
# Finds all Windows with the title "New World"
12+
newWorldWindows = pyautogui.getWindowsWithTitle("New World")
13+
14+
# Find the Window titled exactly "New World" (typically the actual game)
15+
for window in newWorldWindows:
16+
if window.title == "New World":
17+
newWorldWindow = window
18+
break
19+
20+
# Select that Window
21+
newWorldWindow.activate()
22+
23+
# Move your mouse to the center of the game window
24+
centerW = newWorldWindow.left + (newWorldWindow.width/2)
25+
centerH = newWorldWindow.top + (newWorldWindow.height/2)
26+
pyautogui.moveTo(centerW, centerH)
27+
28+
# Clicky Clicky
29+
time.sleep(.1)
30+
pyautogui.click()
31+
time.sleep(.1)
32+
33+
# Seconds to move foward
34+
fowardMoveTotal = 20
35+
36+
# Current seconds foward moved
37+
currentFoward = 0
38+
39+
# Go right or left
40+
flip = 1
41+
42+
# Turn 90 degrees, value will be different for you, im on a 4k monitor
43+
flipMouseMove = 2000
44+
45+
# Making tuple with data from the window for later use
46+
region = (newWorldWindow.left, newWorldWindow.top, newWorldWindow.width, newWorldWindow.height)
47+
48+
# Main bot loop, runs forever use CTRL+C to turn it off
49+
while True:
50+
# Find that image on screen, in that region, with a confidence of 65%
51+
if pyautogui.locateOnScreen("imgs/e0.png", grayscale=True, confidence=.65, region=region) is not None:
52+
pyautogui.press('e')
53+
time.sleep(1)
54+
continue
55+
56+
# Do I got to explain?
57+
pyautogui.press('=')
58+
59+
# Randomly move foward 0 - 1.5 seconds
60+
temp = 1.5 * random.random()
61+
currentFoward += temp
62+
time.sleep(temp)
63+
64+
# Brah, you know
65+
pyautogui.press('=')
66+
67+
# Flippy flip if you hitty hit the max move time (fowardMoveTotal)
68+
if currentFoward >= fowardMoveTotal:
69+
# Reset the move foward
70+
currentFoward = 0
71+
72+
# Move the mouse 90 degrees
73+
pydirectinput.move(flipMouseMove * flip, 1, relative=True)
74+
75+
# Move Foward 1.5 secs
76+
pyautogui.press('=')
77+
time.sleep(1.5)
78+
pyautogui.press('=')
79+
80+
# Move the mouse 90 degrees
81+
pydirectinput.move(flipMouseMove * flip, 1, relative=True)
82+
83+
# Flippy flippy the value. Evil math.
84+
flip *= -1
85+
86+
# Sleeping for the animation
87+
time.sleep(.1)
88+
89+
90+
# Runs the main function
91+
if __name__ == '__main__':
92+
main()

0 commit comments

Comments
 (0)