Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Keyboard macro for the Olive's Art-Venture game
- # https://www.newgrounds.com/portal/view/830421
- import keyboard
- import pyautogui as pg
- import time
- pg.PAUSE = 0.0000001
- # circle, triangle, square, diamond
- coords = [[(1292, 627), (1289, 610), (1294, 598), (1305, 585), (1314, 572), (1320, 562), (1331, 550), (1346, 542), (1364, 535), (1383, 533), (1407, 533), (1427, 538), (1448, 549), (1464, 565),
- (1479, 582), (1484, 594), (1487, 602), (1489, 616), (1490, 628), (1490, 638), (1488, 651), (1483, 667), (1475, 678), (1466, 694), (1457, 705), (1443, 715), (1428, 719), (1414, 722), (1399, 723), (1381, 724), (1364, 721), (1349, 710), (1335, 701), (1323, 692), (1312, 682), (1300, 669), (1295, 658), (1292, 645), (1291, 636), (1291, 635)], [(1389, 514), (1387, 523), (1376, 542), (1367, 557), (1357, 570), (1346, 586), (1337, 602), (1330, 614), (1325, 622), (1321, 636), (1316, 651), (1309, 673), (1303, 688), (1296, 703), (1288, 723), (1281, 738), (1274, 750), (1272, 754), (1292, 751), (1307, 748), (1324, 746), (1344, 746), (1371, 747), (1381, 747), (1397, 748), (1418, 749), (1435, 750), (1458, 750), (1482, 750), (1499, 750), (1515, 750), (1519, 750), (1504, 734), (1493, 722), (1487, 712), (1480, 699), (1471, 686), (1463, 663), (1460, 650), (1454, 637), (1446, 622), (1437, 603), (1428, 585), (1420, 571), (1414, 559), (1404, 543), (1394, 527), (1388, 515)], [(1267, 490), (1266, 519), (1266, 540), (1266, 558), (1265, 582), (1264, 605), (1262, 620), (1262, 638), (1262, 671), (1262, 700), (1260, 738), (1265, 753), (1281, 756), (1316, 757), (1346, 757), (1370, 757), (1399, 756), (1425, 754), (1457, 754), (1485, 754), (1514, 750), (1520, 744), (1519, 703), (1519, 677), (1519, 651), (1516, 624), (1514, 591), (1518, 561), (1519, 532), (1518, 500), (1517, 489), (1471, 489), (1430, 489), (1397, 492), (1363, 492), (1337, 492), (1312, 492), (1282, 492), (1269, 492)], [(1393, 472), (1383, 486), (1367, 505), (1347, 524), (1321, 553), (1301, 576), (1287, 590), (1271, 609), (1259, 622), (1257, 625), (1265, 630), (1277, 639), (1292, 659), (1308, 681), (1322, 698), (1342, 718), (1358, 738), (1376, 760), (1384, 771), (1393, 766), (1409, 756), (1421, 749), (1432, 740), (1450, 724), (1467, 705), (1476, 693), (1484, 680), (1492, 669), (1505, 649), (1520, 634), (1532, 623), (1527, 619), (1498, 602), (1481, 580), (1468, 560), (1456, 542), (1437, 518), (1421, 500), (1406, 485), (1396, 472), (1389, 466)]]
- new_coords = [[]]
- num = 0
- def spell(index):
- global num
- if index >= 4:
- if index == 4:
- coord = tuple(pg.position())
- new_coords[num].append(coord)
- elif index == 5:
- new_coords.append([])
- num += 1
- elif index == 6:
- print(new_coords)
- return
- init_pos = coords[index][0]
- pg.moveTo(*init_pos)
- pg.mouseDown()
- for coord in coords[index]:
- pg.moveTo(*coord)
- pg.mouseUp()
- key_list = ('z', 'x', 'c', 'v', 'i', 'o', 'p')
- prev_key = None
- pressed = False
- while True:
- for i, key in enumerate(key_list):
- if keyboard.is_pressed(key):
- if prev_key != key:
- spell(i)
- prev_key = key
- pressed = True
- if not pressed:
- prev_key = None
- pressed = False
- time.sleep(0.001)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement