-
Notifications
You must be signed in to change notification settings - Fork 7
/
functions.ahk
2225 lines (2089 loc) · 63.3 KB
/
functions.ahk
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
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
;; Made by Lessy / Saber
#Include configuration.ahk
If (GetConfigVersion() != 5)
{
MsgBox, Your config.ini file is out of date, please press "OK" then run "reset config.ahk"
ExitApp
}
UpdateGlobalsFromIni()
ReleaseHeldKeysAndMouse()
; Presses a given key (advised to only use for WASD) for a duration, similar to the JitBit function of the same name
KeyPress(key, duration:=0)
{
Send, {%key% down}
Sleep, (duration * Stats_movespeed_factor)
Send, {%key% up}
}
; Presses E
EPress(amount:=1)
{
Loop, %amount%
{
Send, {e down}
Send, {e up}
}
}
; Releases any potentially unreleased keys or clicks
ReleaseHeldKeysAndMouse()
{
Click, Up
For each, key in ["w","a","s","d","e", "space"]
Send, {%key% up}
}
; Helper function to assist in adding timers to different activities
SecondsSince(previous_time)
{
UpdateIniFromGlobals()
time_difference := A_NowUTC
EnvSub, time_difference, previous_time, Seconds
Return time_difference
}
; Helper function to assist in adding timers to different activities
MinutesSince(previous_time)
{
UpdateIniFromGlobals()
time_difference := A_NowUTC
EnvSub, time_difference, previous_time, Minutes
Return time_difference
}
; Checks to see if the "machine" (anything with an "E" dialogue) is ready while standing at it, returning True if you can activate it and False otherwise
IsMachineReady()
{
ImageSearch,,, 0, 0, A_ScreenWidth//2, A_ScreenHeight//3, *90 %A_ScriptDir%\images\cooldown_e.png
Return (ErrorLevel == 0)
}
; Clicks "Keep Old" or "Replace" if the window is open
KeepOrReplace(keep:=True)
{
MouseGetPos, MouseX, MouseY
ImageSearch, KeepX, KeepY, 0, A_ScreenHeight//2, A_ScreenWidth, A_ScreenHeight, *90 %A_ScriptDir%\images\keep.png
ImageSearch, ReplaceX, ReplaceY, 0, A_ScreenHeight//2, A_ScreenWidth, A_ScreenHeight, *90 %A_ScriptDir%\images\replace.png
If (ErrorLevel != 0)
Return False
Click, Up
If (keep)
{
MouseMove, KeepX, KeepY
} Else {
MouseMove, ReplaceX, ReplaceY
}
Sleep, 500
Click, Left
Sleep, 500
MouseMove, MouseX, MouseY
Return True
}
; Harvests the specified planter from the field it's currently in, returning True if the planter is ready to be re-placed, and False otherwise
HarvestPlanter(planter_number, harvest_unfinished_planter:=true)
{
current_planter := Planters_planter%planter_number%
Menu, Tray, Icon, %A_ScriptDir%\icons\planter_%current_planter%.ico
; if glitter is on cooldown and needed, skipping harvesting
If ((MinutesSince(Cooldowns_glitter) < 15) && Planters_planter%planter_number%_glitter)
Return False
For each, field in Planters_planter%planter_number%_fields
{
If (field == Planters_planter%planter_number%_current_field)
{
; cooldown isn't up yet, skipping harvesting
If (MinutesSince(Cooldowns_planter%planter_number%) < Planters_planter%planter_number%_reuse_time[each])
Return False
ResetCharacter(3)
%field%(0) ; dynamically calling the field macro with 0 field loops to navigate to the field
Sleep, 1000
; TODO: Re-write planters as objects / give them indices to allow unlimited chains and better redundancy
; This check below would be good in the case we didn't get to the field properly, but we can't technically do this due to the way we handle planters in memory on the chance re-planting is interrupted
If !IsMachineReady()
{
find_planter_movement := 100
Loop, 5
{
KeyPress("w", find_planter_movement)
Sleep, 500
If IsMachineReady()
Break
find_planter_movement += 100
KeyPress("d", find_planter_movement)
Sleep, 500
If IsMachineReady()
Break
find_planter_movement += 100
KeyPress("s", find_planter_movement)
Sleep, 500
If IsMachineReady()
Break
find_planter_movement += 100
KeyPress("a", find_planter_movement)
Sleep, 500
If IsMachineReady()
Break
find_planter_movement += 100
}
If (find_planter_movement == 2100)
Return False
}
EPress(5)
Sleep, 1000
harvested_unfinished_planter := False
ImageSearch, FoundX, FoundY, 0, 0, A_ScreenWidth, A_ScreenHeight, *90 %A_ScriptDir%\images\planter_still_growing.png
If (ErrorLevel == 0)
{
MouseGetPos, MouseX, MouseY
If harvest_unfinished_planter
{
FoundX -= 200
harvested_unfinished_planter := True
}
MouseMove, FoundX, FoundY
Sleep, 1000
Click, Left
MouseMove, MouseX, MouseY
If !(harvest_unfinished_planter)
{
Cooldowns_planter%planter_number% := A_NowUTC
EnvSub, Cooldowns_planter%planter_number%, Planters_planter%planter_number%_reuse_time[each], Minutes
EnvAdd, Cooldowns_planter%planter_number%, 15, Minutes
UpdateIniFromGlobals()
}
}
needs_to_be_placed_again := True
If (Planters_planter%planter_number%_fields.Length() == 1)
{
KeyPress(Hotkeys_planter%planter_number%)
Planters_planter%planter_number%_current_field := field
Cooldowns_planter%planter_number% := A_NowUTC
UpdateIniFromGlobals()
needs_to_be_placed_again := False
}
; Planters_planter#_current_field should continue to store the last planter for referencing where to place it next until it is placed
KeyPress("a", 600)
KeyPress("s", 200)
Sleep, 1000
If !(harvested_unfinished_planter) && ((Planters_planter%planter_number% == "pesticide") || (Planters_planter%planter_number% == "petal") || (Planters_planter%planter_number% == "plenty"))
{
UseItemFromInventory("micro-converter")
Sleep, 1000
}
CircleForLoot(14)
Return needs_to_be_placed_again
}
}
; planter is in an unregistered field or it's nowhere, assuming inventory
Planters_planter%planter_number%_current_field := "nowhere"
UpdateIniFromGlobals()
Return True
}
; Places down the specified planter in the next field it should go in
PlacePlanter(planter_number)
{
field_to_place_the_planter_in := Planters_planter%planter_number%_fields[1]
For each, field in Planters_planter%planter_number%_fields
{
If (field == Planters_planter%planter_number%_current_field) ; this was the previous field
{
If (Planters_planter%planter_number%_fields.Length() > each)
field_to_place_the_planter_in := Planters_planter%planter_number%_fields[each+1]
Break
}
}
current_planter := Planters_planter%planter_number%
Menu, Tray, Icon, %A_ScriptDir%\icons\planter_%current_planter%.ico
ResetCharacter(3)
%field_to_place_the_planter_in%(0) ; we are once again dynamically calling the field macro with 0 field loops to navigate to the field
KeyPress(Hotkeys_planter%planter_number%)
Planters_planter%planter_number%_current_field := field_to_place_the_planter_in
Cooldowns_planter%planter_number% := A_NowUTC
If (Planters_planter%planter_number%_glitter)
{
If UseItemFromInventory("glitter")
Cooldowns_glitter := A_NowUTC
}
UpdateIniFromGlobals()
Return True
}
; Harvests any ready planter, replanting them in the appropriate fields
ManagePlanters(harvest_unfinished_planters:=True)
{
ReconnectIfDisconnected()
If (HarvestPlanter(1, harvest_unfinished_planters))
PlacePlanter(1)
If (HarvestPlanter(2, harvest_unfinished_planters))
PlacePlanter(2)
If (HarvestPlanter(3, harvest_unfinished_planters))
PlacePlanter(3)
}
; Helper function that checks if you are connected to the game by seeing if your sprinklers on hotkey #1 are visible or not
IsConnected()
{
; there is no reason chrome should need to steal focus from the user - fix your problematic "feature", Google
If WinActive("ahk_exe chrome.exe") && WinExist("ahk_exe RobloxPlayerBeta.exe")
WinActivate, ahk_exe RobloxPlayerBeta.exe
ImageSearch,,, 0, A_ScreenHeight//2, A_ScreenWidth//2, A_ScreenHeight, *40 %A_ScriptDir%\images\reconnect_sprinkler.png
Return (ErrorLevel == 0)
}
; Helper function that claims a hive slot after reconnecting to the provided (or default) URL by launching it in your default web browser
Reconnect()
{
Menu, Tray, Icon, %A_ScriptDir%\icons\connection_problems.ico
If WinExist("ahk_exe RobloxPlayerBeta.exe")
PostMessage, 0x0112, 0xF060,,, ahk_exe RobloxPlayerBeta.exe
Run, %Stats_VIP_to_reconnect_to%
Cooldowns_wealthclock := A_NowUTC
FormatTime, CurrentMinute, A_NowUTC, m
If (CurrentMinute < 16)
Cooldowns_mondo := A_NowUTC
EnvAdd, Cooldowns_planter1, Stats_seconds_to_wait_on_reconnect, Seconds
EnvAdd, Cooldowns_planter2, Stats_seconds_to_wait_on_reconnect, Seconds
EnvAdd, Cooldowns_planter3, Stats_seconds_to_wait_on_reconnect, Seconds
UpdateIniFromGlobals()
Loop, %Stats_seconds_to_wait_on_reconnect%
{
Sleep, 1000
If (IsConnected())
Break
}
If !(IsConnected())
Return Reconnect()
; Rotating camera if we spawned in backwards, because apparently that's a thing now
ImageSearch,,, 0, A_ScreenHeight//2, A_ScreenWidth, A_ScreenHeight, *90 %A_ScriptDir%\images\reconnect_hiveblock.png
If (ErrorLevel != 0)
{
RotateCamera(4)
Sleep, 1000
ImageSearch,,, 0, A_ScreenHeight//2, A_ScreenWidth, A_ScreenHeight, *90 %A_ScriptDir%\images\reconnect_hiveblock.png
If (ErrorLevel != 0)
Return Reconnect()
}
to_sleep := Stats_seconds_to_wait_after_connect * 1000
Sleep, %to_sleep%
KeyPress("w", 2100)
(Stats_hive_slot < 3) ? KeyPress("d", (1200 * (3 - Stats_hive_slot))) : KeyPress("a", (1200 * (Stats_hive_slot - 3))) ; reversed-camera MoveToSlot() from the middle spawn-in location
Sleep, 1000
If !IsMachineReady()
Return Reconnect()
EPress()
MouseMove, A_ScreenWidth//2, A_ScreenHeight//2
ResetCharacter()
Return True
}
; Reconnects to the VIP provided in `config.ini` if disconnected
ReconnectIfDisconnected()
{
If !(IsConnected())
Return Reconnect()
}
; Checks to see if your bag is full
IsBagFull()
{
; PixelColor is F70017, but PixelSearch is unreliable
ImageSearch,,, A_ScreenWidth//2, 0, A_ScreenWidth, A_ScreenHeight//4, *90 %A_ScriptDir%\images\bagfull.png
Return (ErrorLevel == 0)
}
; Rotates the camera one (or more) times
RotateCamera(times:=1)
{
If times == 0
Return True
camera_rotation_loops := Mod(Abs(times), 8)
Loop, %camera_rotation_loops%
{
KeyPress(times > 0 ? "," : ".")
}
}
; Zooms out one (or more) times
ZoomOut(times:=1)
{
Loop, %times%
{
KeyPress("o")
}
}
; Presses the jump key, releasing it momentarily (or longer after)
Jump(duration:=100)
{
Send, {Space down}
Sleep, %duration%
Send, {Space up}
}
; Resets your character one (or more) times
ResetCharacter(times:=1)
{
Loop, %times%
{
Send, {Escape}
Sleep, 200
Send, r
Sleep, 200
Send, {Enter}
Sleep, 9500
}
}
; Places down your sprinklers, jump-glitching to place more if needed
PlaceSprinklers()
{
RemainingSprinklers := Stats_sprinkler_amount
Loop
{
KeyPress("1")
RemainingSprinklers--
Sleep, 800
If (RemainingSprinklers < 1)
break
Jump()
Sleep, 700
}
}
; Rotates the camera to face your hive (ie. looking at all your bees)
FaceHive(should_face_hive:=true)
{
Loop, 4
{
Loop, 2
{
; sprinkler on hivecomb check
ImageSearch,,, 0, A_ScreenHeight//2, A_ScreenWidth//2, A_ScreenHeight, *90 %A_ScriptDir%\images\hivecomb.png
If (ErrorLevel == 0)
{
If(should_face_hive)
RotateCamera(4)
Return True
}
; gifted hiveslot check
KeyPress("o")
Sleep, 500
ImageSearch,,, 0, 0, A_ScreenWidth, A_ScreenHeight, %A_ScriptDir%\images\hivegift.png
KeyPress("i")
If (ErrorLevel == 0)
{
If(should_face_hive)
RotateCamera(4)
Return True
}
; rotating the camera & checking again
RotateCamera(4)
Sleep, 1000
}
ResetCharacter()
}
; Client crashed or frozen
Reconnect()
}
; Walks from the initial hiveslot to a new slot, assuming camera is facing away from the hive
MoveToSlot(new_slot)
{
distance_between_slots := 1200
(Stats_hive_slot < new_slot) ? KeyPress("d", (distance_between_slots * (new_slot - Stats_hive_slot))) : KeyPress("a", (distance_between_slots * (Stats_hive_slot - new_slot)))
}
; Walks from the hive to the red cannon and fires it
MoveToAndFireRedCannon()
{
FaceHive(false)
MoveToSlot(0)
KeyPress("s", 1000)
Jump()
KeyPress("a", 1500)
; Not sure how Exit handles all situations
; Sleep, 500
; If !IsMachineReady()
; Exit
EPress(5)
}
; Helper function that checks to see if you're stuck in a shop / dispenser
IsStuck()
{
Loop, Files, %A_ScriptDir%\errors\shop_*.png
{
; checks top-right quadrant of screen for honey cost of various shops interfaces
; for a full-screen check, change co-ordinates to: 0, 0, A_ScreenWidth, A_ScreenHeight
ImageSearch,,, A_ScreenWidth//2, 0, A_ScreenWidth, A_ScreenHeight//2, *90 %A_LoopFileFullPath%
If (ErrorLevel == 0)
Return True
}
Return False
}
; Helper function that presses "E" to get out of a shop that you might be stuck in, then waits for the shop UI to close
UnStick()
{
Sleep, 100
EPress()
Sleep, 1000
If (IsStuck())
Reconnect()
}
; Closes out of any shops or dispensers that you may be stuck in
UnStickIfStuck()
{
If (IsStuck())
UnStick()
}
; Empties the hive balloon - does not reset your character first
EmptyHiveBalloon(reset_after_emptying:=false)
{
Menu, Tray, Icon, %A_ScriptDir%\icons\balloon.ico
If (MinutesSince(Cooldowns_balloon) <= 2)
Return False
If (MinutesSince(Cooldowns_whirligig) > 1)
{
FaceHive()
} Else {
Sleep, 2000
}
ImageSearch,,, A_ScreenWidth//3, 0, A_ScreenWidth, A_ScreenHeight//3, *90 %A_ScriptDir%\images\can_make_honey_from_balloon.png
If (ErrorLevel != 0)
Return False
If !IsMachineReady()
Return False
EPress()
Cooldowns_balloon := A_NowUTC
UpdateIniFromGlobals()
Loop, 1200
{
Sleep, 500
ImageSearch,,, A_ScreenWidth//3, 0, A_ScreenWidth, A_ScreenHeight//3, *90 %A_ScriptDir%\images\making_honey_from_balloon.png
If (ErrorLevel != 0)
Break
}
If (reset_after_emptying)
{
ResetCharacter()
}
Cooldowns_balloon := A_NowUTC
UpdateIniFromGlobals()
Return True
}
; Uses a Whirligig or resets if it's on cooldown, returns True if one is used and False otherwise
WhirligigOrReset(camera_rotations:=0)
{
If (MinutesSince(Cooldowns_whirligig) > 5)
{
If (UseItemFromInventory("whirligig"))
{
Cooldowns_whirligig := A_NowUTC
UpdateIniFromGlobals()
RotateCamera(camera_rotations)
Sleep, 1000
Return True
}
} Else {
ResetCharacter()
Return False
}
}
CircleForLoot(circles:=5, repeats:=0)
{
loot_movement_amount := 100
Loop, %circles%
{
KeyPress("w", loot_movement_amount/2)
KeyPress("d", loot_movement_amount)
KeyPress("s", loot_movement_amount)
KeyPress("a", loot_movement_amount)
KeyPress("w", loot_movement_amount/2)
loot_movement_amount += 100
}
If (repeats > 0)
{
Loop, %circles%
{
loot_movement_amount -= 100
KeyPress("w", loot_movement_amount/2)
KeyPress("d", loot_movement_amount)
KeyPress("s", loot_movement_amount)
KeyPress("a", loot_movement_amount)
KeyPress("w", loot_movement_amount/2)
}
new_repeats := repeats - 1
CircleForLoot(circles, new_repeats)
}
}
; Grabs wealth clock during Beesmas, then resets, skipping if on cooldown automatically
WealthClock()
{
If (MinutesSince(Cooldowns_wealthclock) < 60)
Return False
Menu, Tray, Icon, %A_ScriptDir%\icons\clock.ico
ResetCharacter(3) ; extra resets prevent haste problems & bear morph reset glitches
FaceHive(false)
Sleep, 500
MoveToSlot(5.5)
KeyPress("w", 5000)
RotateCamera(-2)
Sleep, 500
Send, {w down}
Jump(17000*Stats_movespeed_factor)
Send, {w up}
Sleep, 1500
If !IsMachineReady()
Return False
EPress(20)
Cooldowns_wealthclock := A_NowUTC
UpdateIniFromGlobals()
Return True
}
; Grabs ant pass, then resets, skipping if on cooldown automatically
AntPass()
{
If (MinutesSince(Cooldowns_antpass) < 120)
Return False
Menu, Tray, Icon, %A_ScriptDir%\icons\ant.ico
ResetCharacter()
FaceHive()
KeyPress("w", 100)
KeyPress("w", 700)
KeyPress("a", 100)
KeyPress("a", 8000)
KeyPress("w", 100)
KeyPress("w", 400)
Jump()
KeyPress("w", 1000)
Jump()
KeyPress("w", 1000)
KeyPress("d", 100)
KeyPress("d", 2000)
KeyPress("w", 1500)
KeyPress("s", 400)
KeyPress("a", 400)
Sleep, 500
Jump()
KeyPress("w", 2100)
KeyPress("a", 8000)
KeyPress("d", 300)
Loop, 5
{
KeyPress("d", 100)
EPress()
}
Cooldowns_antpass := A_NowUTC
UpdateIniFromGlobals()
Sleep, 1000
UnStickIfStuck()
Return True
}
; Plays Memory Match - not yet impelmented
MemoryMatch()
{
; 5.1 Memory Match 2 hours
; 5.2 Mega Memory Match 4 hours
; 5.3 Night Memory Match 8 hours - only at night
; 5.4 Extreme Memory Match 8 hours
; 5.5 Winter Memory Match 4 hours
}
; Enough Jump Power required (gummy boots / clogs / mountaintop)
; Too many haste token bees / bear bee can cause runs where bugs or fields are missed
; Walks in a pattern conducive to activating vicious spikes in applicable fields
; Grabs some pollen in Polar Bear's quest fields on the way through & turns in Polar quests
; Paths inspired by e_IoI (mush-spider-straw-cactus-pumpkin-pine-polar-rose-sunf-dand-clover-bluf-bamboo-pineapple)
; Does a bug run starting from any slot
BugRun()
{
ResetCharacter(3)
FaceHive(false)
MoveToSlot(3)
Cooldowns_bugrun := A_NowUTC
UpdateIniFromGlobals()
Menu, Tray, Icon, %A_ScriptDir%\icons\mushroom.ico
KeyPress("w", 10000)
KeyPress("s", 100)
PlaceSprinklers()
Sleep, 500
ImageSearch,,, A_ScreenWidth//2, A_ScreenHeight//4, A_ScreenWidth, A_ScreenHeight, *90 %A_ScriptDir%\errors\you_must_be_standing_in_a_field_to_build_a_Sprinkler.png
If (ErrorLevel == 0)
Return False
Loop, 4
{
Sleep, 100
KeyPress("s", 900)
KeyPress("d", 200)
KeyPress("w", 1000)
KeyPress("a", 200)
}
Menu, Tray, Icon, %A_ScriptDir%\icons\spider.ico
Sleep, 500
Jump()
KeyPress("w", 4400)
KeyPress("d", 1600)
KeyPress("w", 1200)
KeyPress("d", 2000)
KeyPress("s", 1800)
KeyPress("a", 900)
Loop, 6
{
Sleep, 500
KeyPress("w", 600)
KeyPress("a", 600)
KeyPress("s", 400)
KeyPress("d", 500)
}
Menu, Tray, Icon, %A_ScriptDir%\icons\strawberry.ico
KeyPress("w", 2500)
KeyPress("a", 2000)
Jump()
KeyPress("a", 3000)
Jump()
KeyPress("a", 3000)
KeyPress("s", 1000)
Loop, 5
{
Sleep, 100
KeyPress("d", 800)
KeyPress("w", 700)
KeyPress("a", 700)
KeyPress("s", 800)
}
Menu, Tray, Icon, %A_ScriptDir%\icons\cactus.ico
KeyPress("a", 1000)
KeyPress("s", 3500)
Jump()
KeyPress("a", 1700)
KeyPress("w", 6100)
Menu, Tray, Icon, %A_ScriptDir%\icons\vicious.ico
KeyPress("d", 4500)
KeyPress("a", 200)
Send, {s down}{a down}
Sleep, 1200 * Stats_movespeed_factor
Send, {s up}{a up}
KeyPress("a", 1400)
Menu, Tray, Icon, %A_ScriptDir%\icons\cactus.ico
Loop, 5
{
Sleep, 500
KeyPress("w", 500)
KeyPress("d", 600)
KeyPress("s", 300)
KeyPress("a", 500)
}
Menu, Tray, Icon, %A_ScriptDir%\icons\pumpkin.ico
KeyPress("w", 4000)
KeyPress("s", 300)
PlaceSprinklers()
Sleep, 500
ImageSearch,,, A_ScreenWidth//2, A_ScreenHeight//4, A_ScreenWidth, A_ScreenHeight, *90 %A_ScriptDir%\errors\you_must_be_standing_in_a_field_to_build_a_Sprinkler.png
If (ErrorLevel == 0)
Return True
Loop, 4
{
Sleep, 100
KeyPress("a", 400)
KeyPress("s", 400)
KeyPress("d", 500)
KeyPress("w", 500)
}
Sleep, 2000
Menu, Tray, Icon, %A_ScriptDir%\icons\pine.ico
KeyPress("a", 3000)
Jump()
KeyPress("a", 4000)
KeyPress("d", 200)
Loop, 6
{
Sleep, 100
KeyPress("w", 500)
KeyPress("d", 600)
KeyPress("s", 600)
KeyPress("a", 500)
}
Menu, Tray, Icon, %A_ScriptDir%\icons\polar.ico
KeyPress("w", 2000)
KeyPress("d", 12000)
KeyPress("s", 6969)
KeyPress("a", 1200)
RotateCamera(-1)
KeyPress("w", 400)
RotateCamera(1)
Loop
{
Loop, 3
{
Sleep, 1000
EPress()
Sleep, 1000
Loop, 10
{
Click, Left
Sleep, 100
}
}
ImageSearch, FoundX, FoundY, 0, 0, A_ScreenWidth, A_ScreenHeight, *90 %A_ScriptDir%\errors\dialogue_polar.png
If (ErrorLevel == 0)
{
MouseMove, FoundX, FoundY
} else {
break
}
}
Menu, Tray, Icon, %A_ScriptDir%\icons\rose.ico
RotateCamera(3)
KeyPress("w", 600)
Jump()
KeyPress("w", 200)
Jump()
KeyPress("w", 7000)
RotateCamera(-3)
Menu, Tray, Icon, %A_ScriptDir%\icons\vicious.ico
KeyPress("d", 1000)
KeyPress("w", 2300)
KeyPress("s", 300)
KeyPress("d", 2500)
KeyPress("d", 1000)
KeyPress("a", 1500)
Menu, Tray, Icon, %A_ScriptDir%\icons\rose.ico
Loop, 6
{
Sleep, 500
KeyPress("s", 500)
KeyPress("a", 500)
KeyPress("w", 400)
KeyPress("d", 400)
}
Menu, Tray, Icon, %A_ScriptDir%\icons\sunf.ico
KeyPress("s", 2500)
KeyPress("w", 100)
KeyPress("d", 6000)
KeyPress("a", 3000)
KeyPress("d", 300)
PlaceSprinklers()
Sleep, 500
ImageSearch,,, A_ScreenWidth//2, A_ScreenHeight//4, A_ScreenWidth, A_ScreenHeight, *90 %A_ScriptDir%\errors\you_must_be_standing_in_a_field_to_build_a_Sprinkler.png
If (ErrorLevel == 0)
Return True
Loop, 5
{
Sleep, 100
KeyPress("d", 600)
KeyPress("s", 100)
KeyPress("a", 600)
KeyPress("w", 100)
}
Menu, Tray, Icon, %A_ScriptDir%\icons\dandelion.ico
KeyPress("d", 13000)
KeyPress("a", 300)
KeyPress("s", 800)
KeyPress("a", 1000)
PlaceSprinklers()
Sleep, 500
ImageSearch,,, A_ScreenWidth//2, A_ScreenHeight//4, A_ScreenWidth, A_ScreenHeight, *90 %A_ScriptDir%\errors\you_must_be_standing_in_a_field_to_build_a_Sprinkler.png
If (ErrorLevel == 0)
Return True
Loop, 5
{
Sleep, 100
KeyPress("a", 600)
KeyPress("s", 100)
KeyPress("d", 500)
KeyPress("w", 100)
}
Menu, Tray, Icon, %A_ScriptDir%\icons\clover.ico
KeyPress("d", 2500)
KeyPress("w", 500)
KeyPress("s", 10)
Sleep, 500
Jump()
KeyPress("d", 3000)
Sleep, 500
Jump()
KeyPress("d", 2500)
Menu, Tray, Icon, %A_ScriptDir%\icons\vicious.ico
KeyPress("s", 1800)
KeyPress("a", 1000)
Loop, 5
{
Sleep, 500
KeyPress("w", 500)
KeyPress("d", 600)
KeyPress("s", 600)
KeyPress("a", 500)
}
Menu, Tray, Icon, %A_ScriptDir%\icons\bluf.ico
KeyPress("w", 5000)
KeyPress("s", 200)
Loop, 5
{
Sleep, 100
KeyPress("a", 600)
KeyPress("s", 700)
KeyPress("d", 500)
KeyPress("w", 500)
}
Menu, Tray, Icon, %A_ScriptDir%\icons\bamboo.ico
KeyPress("w", 2500)
KeyPress("d", 5500)
KeyPress("a", 1200)
Sleep, 500
Jump()
KeyPress("w", 600)
KeyPress("a", 500)
KeyPress("w", 500)
KeyPress("a", 500)
KeyPress("w", 500)
KeyPress("a", 500)
KeyPress("w", 4500)
KeyPress("s", 300)
Loop, 6
{
Sleep, 100
KeyPress("a", 600)
KeyPress("s", 500)
KeyPress("d", 500)
KeyPress("w", 700)
}
Menu, Tray, Icon, %A_ScriptDir%\icons\pineapple.ico
KeyPress("w", 1500)
KeyPress("d", 6000)
Jump(21000) ; allows haste to expire & prevents new token generation
KeyPress("s", 3500)
KeyPress("a", 50)
Sleep, 500
Jump()
KeyPress("d", 1500)
KeyPress("w", 10000)
KeyPress("s", 300)
PlaceSprinklers()
Loop, 6
{
Sleep, 100
KeyPress("a", 600)
KeyPress("s", 800)
KeyPress("d", 800)
KeyPress("w", 600)
}
UnStickIfStuck()
}
; Automatically skips if it's not time for Mondo or it's already dead
; MAKE SURE YOUR COMPUTER CLOCK IS SET PROPERLY
; Kills Mondo chick & loots the items
Mondo()
{
If (MinutesSince(Cooldowns_mondo) < 40)
Return False
FormatTime, CurrentMinute, A_NowUTC, m
If (CurrentMinute >= 14)
Return False
Menu, Tray, Icon, %A_ScriptDir%\icons\mondo.ico
Cooldowns_mondo := A_NowUTC
UpdateIniFromGlobals()
ResetCharacter(3)
MoveToAndFireRedCannon()
RotateCamera(4)
ZoomOut(5)
Sleep, 2200
KeyPress("w", 3200)
RotateCamera(2)
ClickedChatOff := False
ImageSearch, ChatX, ChatY, 0, 0, 200, 200, *90 %A_ScriptDir%\images\chat_active.png
If (ErrorLevel == 0)
{
MouseMove, ChatX, ChatY
Click, Down
Click, Up
ClickedChatOff = True
MouseMove, A_ScreenWidth//2, A_ScreenHeight//2
}
Loop
{
/*
TODO: add additional death checks to ensure stability if grabbing tokens
Loop, 4
{
Sleep, 2800
KeyPress("a", 350)
Sleep, 350
KeyPress("d", 500)
}
*/
Sleep, 5000
ImageSearch,,, 0, 0, A_ScreenWidth, 120, *40 %A_ScriptDir%\images\mondobuff.png
If (ErrorLevel == 0)
{
; loot
KeyPress("a", 700)
KeyPress("w", 500)
Loop, 5
{
Loop, 4
{
KeyPress("s", 1300)
KeyPress("a", 200)
KeyPress("w", 1300)
KeyPress("a", 200)
}
Loop, 4
{
KeyPress("s", 1300)
KeyPress("d", 200)
KeyPress("w", 1300)
KeyPress("d", 200)
}
}
break
}
FormatTime, CurrentMinute, A_NowUTC, m
If (CurrentMinute >= 15)
break
}