-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathattack.py
566 lines (495 loc) · 11.3 KB
/
attack.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
# import socket
# import pyautogui
# import signal
# import win32gui
# import win32api
# import win32con
# import json
# import os
# import sys
# import requests
# import uuid
import random
# import cv2
import time
# from math import log10, floor
from time import perf_counter
# import numpy as np
# import threading
# from pynput import keyboard
from pynput.keyboard import Listener as KeyListener # type: ignore[import]
from pynput.mouse import Listener as MouseListener # type: ignore[import]
# from PIL import ImageGrab
# from datetime import datetime
# from game import Game
# import asyncio
# import tkinter as tk
# from tkinter import messagebox
# from tkinter import *
# import gdi_capture
# from PIL import Image, ImageTk
from configparser import ConfigParser
from initinterception import interception, move_to, move_relative, left_click, keydown, keyup, sleep
# read player key settings on startup.
config = ConfigParser()
config.read('settings.ini')
atk = config.get('keybind', 'attack')
jump = config.get('keybind', 'jump')
teleport = config.get('keybind', 'teleport')
ropeconnect = config.get('keybind', 'ropeconnect')
npc = config.get('keybind', 'npc')
def refreshkeybind():
global atk
global jump
global teleport
global ropeconnect
global npc
config.read('settings.ini')
atk = config.get('keybind', 'attack')
jump = config.get('keybind', 'jump')
teleport = config.get('keybind', 'teleport')
ropeconnect = config.get('keybind', 'ropeconnect')
npc = config.get('keybind', 'npc')
async def leftp(x=31,y=101):
keydown('left')
r = random.randint(x, y)
r /= 1000
await sleep(r)
async def leftr(x=31,y=101):
keyup('left')
r = random.randint(x, y)
r /= 1000
await sleep(r)
async def rightp(x=31,y=101):
keydown('right')
r = random.randint(x, y)
r /= 1000
await sleep(r)
async def rightr(x=31,y=101):
keyup('right')
r = random.randint(x, y)
r /= 1000
await sleep(r)
async def upp(x=31,y=101):
keydown('up')
r = random.randint(x, y)
r /= 1000
await sleep(r)
async def upr(x=31,y=101):
keyup('up')
r = random.randint(x, y)
r /= 1000
await sleep(r)
async def downp(x=31,y=101):
keydown('down')
r = random.randint(x, y)
r /= 1000
await sleep(r)
async def downr(x=31,y=101):
keyup('down')
r = random.randint(x, y)
r /= 1000
await sleep(r)
async def jumpp(x=31,y=101):
keydown(jump)
r = random.randint(x, y)
r /= 1000
await sleep(r)
async def jumpr(x=31,y=101):
keyup(jump)
r = random.randint(x, y)
r /= 1000
await sleep(r)
async def teleportp(x=31,y=101):
keydown(teleport)
r = random.randint(x, y)
r /= 1000
await sleep(r)
async def teleportr(x=31,y=101):
keyup(teleport)
r = random.randint(x, y)
r /= 1000
await sleep(r)
async def npcp(x=31,y=101):
keydown(npc)
r = random.randint(x, y)
r /= 1000
await sleep(r)
async def npcr(x=31,y=101):
keyup(npc)
r = random.randint(x, y)
r /= 1000
await sleep(r)
async def attackp(x=31,y=101):
keydown(atk)
r = random.randint(x, y)
r /= 1000
await sleep(r)
async def attackr(x=31,y=101):
keyup(atk)
r = random.randint(x, y)
r /= 1000
await sleep(r)
async def ropeconnectp(x=31,y=101):
keydown(ropeconnect)
r = random.randint(x, y)
r /= 1000
await sleep(r)
async def ropeconnectr(x=31,y=101):
keyup(ropeconnect)
r = random.randint(x, y)
r /= 1000
await sleep(r)
async def ropeconnectpr():
await ropeconnectp()
await ropeconnectr()
# rectangular clockwise rotation
async def leftattack():
print(f'leftattack')
await leftp()
await attackp()
await attackr()
await leftr()
async def rightattack():
print(f'rightattack')
await rightp()
await attackp()
await attackr()
await rightr()
async def goleftattack():
print(f'goleftattack')
await leftp()
await teleportp()
await teleportr()
await attackp()
await attackr()
await leftr()
async def goleftattackk():
print(f'goleftattackk')
await leftp()
await teleportp()
await teleportr()
await attackp()
await attackr()
await attackp()
await attackr()
await leftr()
async def goleftattackv2():
print(f'goleftattackv2')
await leftp()
await jumpp()
await jumpr()
await jumpp()
await jumpr()
await attackp()
await attackr()
await leftr()
async def gorightattackk():
print(f'gorightattackk')
await rightp()
await teleportp()
await teleportr()
await attackp()
await attackr()
await attackp()
await attackr()
await rightr()
async def gorightattack():
print(f'gorightattack')
await rightp()
await teleportp()
await teleportr()
await attackp()
await attackr()
await rightr()
async def gorightattackv2():
print(f'gorightattackv2')
await rightp()
await jumpp()
await jumpr()
await jumpp()
await jumpr()
await attackp()
await attackr()
await rightr()
async def goupattackv2():
print(f'goupattackv2')
await rightp()
await ropeconnectp()
await ropeconnectr()
await attackp()
await attackr()
await rightr()
async def goupattack():
print(f'goupattack')
await sleep(.1)
await upp()
await teleportp()
await teleportr()
await upr()
await attackp()
await attackr()
await sleep(.1)
async def goupattackv3():
print(f'goupattackv3')
await sleep(.1)
await jumpp()
await jumpr()
await ropeconnectp(31,101)
await ropeconnectr(31,101)
await sleep(.333)
await attackp()
await attackr()
await attackp()
await attackr()
await sleep(.1)
async def upjumpattack():
print(f'upjumpattack')
await sleep(.1)
await upp()
await teleportp()
await teleportr()
await upr()
await attackp()
await attackr()
await sleep(.1)
async def upjumpattackv2(): # adele upjump
print(f'upjumpattackv2')
await sleep(.1)
await jumpp()
await jumpr()
await upp()
await jumpp()
await jumpr()
await upr()
await attackp()
await attackr()
await attackp()
await attackr()
await sleep(.1)
async def godownattack():
print(f'godownattack')
await downp()
await teleportp()
await teleportr()
await downr()
await attackp()
await attackr()
await sleep(.1)
async def godownattackv2():
print(f'godownattackv2')
await downp()
await jumpp()
await jumpr()
await attackp()
await attackr()
await downr()
# polo portal hunting map rotation patch
async def upjumpup():
print(f'upjumpup')
await jumpp()
await jumpr()
await upp()
await jumpp()
await jumpr()
await upr()
async def bountyhuntrotation():
print(f'bountyhuntrotation')
for i in range(5):
await goleftattack()
time.sleep(.502)
for i in range(5):
await gorightattack()
time.sleep(.502)
async def bountyhuntrotationv2(): # adele flash jump
print(f'bountyhuntrotationv2')
for i in range(4):
await goleftattack()
time.sleep(.502)
for i in range(4):
await gorightattack()
time.sleep(.502)
async def castlewallrotation():
print(f'castlewallrotation')
await leftattack()
time.sleep(.5)
await rightattack()
time.sleep(.5)
# await goleftattack()
# time.sleep(.502)
await upjumpup()
time.sleep(.802)
await leftattack()
time.sleep(.5)
await rightattack()
time.sleep(.5)
# await gorightattack()
# time.sleep(.502)
await downjump()
time.sleep(.702)
async def castlewallrotationv3():
print(f'castlewallrotationv3')
await leftattack()
time.sleep(.5)
await rightattack()
time.sleep(.5)
# await goleftattack()
# time.sleep(.502)
await ropeconnectpr()
time.sleep(.802)
await leftattack()
time.sleep(.5)
await rightattack()
time.sleep(.5)
# await gorightattack()
# time.sleep(.502)
await downjump()
time.sleep(.702)
async def castlewallrotationv2():
print(f'castlewallrotationv2')
for i in range(2):
await goleftattack()
time.sleep(.502)
await ropeconnectpr()
time.sleep(.802)
for i in range(2):
await gorightattack()
time.sleep(.502)
await downjump()
time.sleep(.702)
await attackp()
await attackr()
time.sleep(.502)
async def stormwingrotation():
print(f'stormwingrotation')
for i in range(5):
await goleftattack()
time.sleep(.502)
await ropeconnectpr()
time.sleep(.602)
for i in range(5):
await gorightattack()
time.sleep(.502)
for i in range(5):
await downjump()
time.sleep(.302)
# randomiser patch
async def send2(code):
keydown(code)
r = random.randint(31, 131)
r /= 1000
await sleep(r)
async def send3(code):
keyup(code)
r = random.randint(31, 131)
r /= 1000
await sleep(r)
# temp (not organized) (please delete soon)
async def shiftp(x=31, y=119):
# send2('01')
keydown('shift')
r = random.randint(x, y)
r /= 1000
await sleep(r)
async def shiftr(x=31, y=101):
# send3('01')
keyup('shift')
r = random.randint(x, y)
r /= 1000
await sleep(r)
async def shiftpr():
await shiftp()
await shiftr()
async def shikigamip(x=31,y=101):
# send2('27')
keydown('x')
r = random.randint(x, y)
r /= 1000
await sleep(r)
async def shikigamir(x=31,y=101):
# send3('27')
keyup('x')
r = random.randint(x, y)
r /= 1000
await sleep(r)
async def shikigamipr3(x=3,y=33):
await shikigamip()
await shikigamir(x,y)
await shikigamip()
await shikigamir(x,y)
await shikigamip()
await shikigamir(x,y)
async def jumpupjumpattack(x=31,y=101):
print(f'jumpupjumpattack')
# await ep()
# await er()
await jumpp(111,177)
await jumpr()
await upp()
await jumpp(111,177)
await jumpr(3,33)
await upr(3,33)
# await rp()
# await rr()
await shikigamip()
await shikigamir()
await sleep(.2)
async def downjump():
await downp()
await jumpp()
await jumpr()
await downr()
# time.await sleep(3)
# yinyangp()
# yinyangr(555,999)
async def downjumpv2():
await downp()
await jumpp()
await jumpr()
await shiftpr()
await downr(1333,1999)
async def yinyangp(x=31, y=101):
keydown('s')
r = random.randint(x, y)
r /= 1000
await sleep(r)
async def yinyangr(x=31, y=101):
keyup('s')
r = random.randint(x, y)
r /= 1000
await sleep(r)
async def leftjumpjumpattack(x=31, y=101):
await leftp()
await jumpp()
await jumpr()
# await jumpp()
# await jumpr()
await jumpp()
await jumpr()
# await shikigamip()
# await shikigamir()
await attackp()
await attackr()
await leftr()
async def rightjumpjumpattack(x=31, y=101):
await rightp()
await jumpp()
await jumpr()
# await jumpp()
# await jumpr()
await jumpp()
await jumpr()
# await shikigamip()
# await shikigamir()
await attackp()
await attackr()
await rightr()
async def upjumpshift():
await jumpp()
await jumpr()
await upp()
await shiftp()
await upr()
await shiftr(333, 888)
await yinyangp()
await yinyangr(444, 777)