-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWSST_2_Release.ts
989 lines (886 loc) · 27.3 KB
/
WSST_2_Release.ts
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
#WORLD SST
#THINGS TO DO:
# 1. COMBINE WSSM AND WSST BUST LISTS
# 2. FIND WAY TO RANDOMIZE EWARP TO PRE-BUILT BUYER LIST
# - COULD BE OPTIONAL, WITH THE STANDBY BEING THE BRUTE FORCE MODE FOR EARLY GAME
:vars
setVar $count 0
setVar $script "(world_SST)"
setVar $scriptname "$playerName's World SST"
setVar $version "v. 1.0"
setVar $bust_list GAMENAME & "-bust_list" & ".txt"
setArray $busts SECTORS
setArray $buyers SECTORS
setVar $class0 1
setVar $divisor 30
setVar $restock "YES"
setVar $this_ship 5
setVar $other_ship 6
setVar $short_xport 6
setVar $check_dist "YES"
setVar $search_mode "Brute Force"
setVar $last_visit 0
setVar $rpr 2
setVar $rpr_count 1
setVar $checked_other "NO"
setVar $fig_wave 9876
:chk_list_exist
echo ansi_15 "*$playerName's World SST Loading..."
echo ansi_15 "*Checking Bust List..."
fileExists $exists $bust_list
if ($exists)
setVar $bust_exist "YES"
else
setVar $bust_exist "NO"
end
if ($bust_exist = "YES")
echo ansi_15 "*Would you Like to clear your busts ? (" ansi_12 "Y" ansi_15 "/" ansi_12 "N" ansi_15 ") : "
getConsoleInput $choice SINGLEKEY
if ($choice = "y")
setVar $void_clear "YES"
:clear_busts
setVar $count 1
while ($count <= SECTORS)
setVar $busts[$count] 0
add $count 1
end
delete $bust_list
elseif ($choice = "n")
setVar $void_clear "NO"
:read_busts
setVar $count 1
while ($sector <> EOF)
read $bust_list $sector $count
if ($sector = EOF)
setVar $sector ""
goto :done_read_bust
end
setVar $busts[$sector] 1
add $count 1
end
:done_read_bust
setVar $count 1
end
end
setVar $count 1
#:build_xxb_list
#echo ansi_15 "*Building Port List..."
#setVar $count 1
#setVar $port_count 0
# while ($count <= SECTORS)
# getSector $count $sect
# if ($sect.port.buy_equip = "YES") AND ($sect.port.class <> 0)
# add $port_count 1
# setVar $buyers[$count] 1
# #echo ansi_15 "*Port Class : " $sect.port.class
# end
# add $count 1
# end
#echo ansi_15 "*List Created : " $port_count " xxB Ports found! "
#This is the Quick-Jump Array
#to allow TWX to randomly jump to a number in that array and have it be a
#xxB port
#this needs to be refined - to have a full-spectrum array (sector sized)
#for easier manipulability
# (i.e. adding a port to the array when seen)
#:create_jump_array
#echo ansi_15 "*Creating Quick-Jump Port Array..."
#setVar $count 1
#setVar $jump_count 0
#setArray $jump_buyers $port_count
# while ($count <= SECTORS)
# if ($buyers[$count] = 1)
# add $jump_count 1
# setVar $jump_buyers[$jump_count] $count
# end
# add $count 1
# end
setVar $count 1
# echo ansi_15 "*Quick-Jump Array Created! "
echo ansi_15 "*Loading Menu..."
:main
getLength $scriptname $max
getLength $version $len
goSub :checkmax
:ansimenu
killalltriggers
echo "[2J"
echo ANSI_6 "**-" ansi_2 "=" ansi_9 "("
setVar $text $scriptname
goSub :addspc
setVar $scriptdisplay $text
echo ansi_15 $scriptdisplay ansi_9 ")" ansi_2 "=" ansi_6 "-*"
echo ANSI_6 "-" ansi_2 "=" ansi_9 "("
setVar $text $version
goSub :addspc
setvar $verdisplay $text
echo ansi_15 $verdisplay ansi_9 ")" ansi_2 "=" ansi_6 "-**"
echo ansi_14 "1." ansi_15 " Class 0 Location : " ansi_9 "[" ansi_6 $class0 ansi_9 "]*"
echo ansi_14 "2." ansi_15 " Steal Divisor : " ansi_9 "[" ansi_6 $divisor ansi_9 "]*"
echo ansi_14 "3." ansi_15 " Restock : " ansi_9 "[" ansi_6 $restock ansi_9 "]*"
echo ansi_14 "4." ansi_15 " This Ship : " ansi_9 "[" ansi_6 $this_ship ansi_9 "]*"
echo ansi_14 "5." ansi_15 " Other Ship : " ansi_9 "[" ansi_6 $other_ship ansi_9 "]*"
echo ansi_14 "6." ansi_15 " Runs Per Refurb : " ansi_9 "[" ansi_6 $rpr ansi_9 "]*"
echo ansi_14 "7." ansi_15 " Fig Attack Wave : " ansi_9 "[" ansi_6 $fig_wave ansi_9 "]*"
#echo ansi_14 "8." ansi_15 " Search Mode : " ansi_9 "[" ansi_6 $search_mode ansi_9 "]*"
echo ansi_14 "C." ansi_15 " Run Script **"
getConsoleInput $choice SINGLEKEY
if ($choice = 1)
echo ansi_15 "*Enter Class 0 Location : "
getConsoleInput $class0
echo "[2J"
goto :ansimenu
elseif ($choice = 2)
echo ansi_15 "*Enter Steal Divisor : "
getConsoleInput $divisor
echo "[2J"
goto :ansimenu
elseif ($choice = 3)
if ($restock = "YES")
setVar $restock "NO"
else
setVar $restock "YES"
end
echo "[2J"
goto :ansimenu
elseif ($choice = 4)
echo ansi_15 "*Enter This Ship : "
getConsoleInput $this_ship
echo "[2J"
goto :ansimenu
elseif ($choice = 5)
echo ansi_15 "*Enter Other Ship : "
getConsoleInput $other_ship
echo "[2J"
goto :ansimenu
elseif ($choice = 6)
echo ansi_15 "*How Many Runs Before Refurbing : "
getConsoleInput $rpr
echo "[2J"
goto :ansimenu
elseif ($choice = 7)
echo ansi_15 "*How Many Figs Per Attack : "
getConsoleInput $fig_wave
echo "[2J"
goto :ansimenu
elseif ($choice = 8)
if ($search_mode = "Brute Force")
setVar $search_mode "Port List"
else
setVar $search_mode "Brute Force"
end
echo "[2J"
goto :ansimenu
elseif ($choice = "c")
if ($other_ship <> 0) AND ($rpr <> 0) AND ($this_ship <> 0)
goto :begin_script
else
echo "[2J"
goto :ansimenu
end
else
echo "[2J"
goto :ansimenu
end
:begin_script
send "w z n * "
setVar $count 0
getWord CURRENTLINE $location 1
if ($location <> "Command")
echo ansi_15 "*Not at the Command Prompt*"
halt
end
:get_curr_sector
getText CURRENTLINE $sector "]:[" "] (?"
setVar $starting_sector $sector
send "cunq"
send "x"
setTextLineTrigger getrange :getrange "has a transport range"
setTextLineTrigger getship :getship "Corp"
setTextLineTrigger done :donecheck "Exit Transporter"
pause
:getrange
killalltriggers
setVar $line CURRENTLINE
getText $line $x_range "of " " hops."
:check_x_triggers
killalltriggers
setTextLineTrigger getship :get_ship "Corp"
setTextLineTrigger done :done_x_check "Exit Transporter"
pause
:get_ship
killalltriggers
setVar $line CURRENTLINE
getWord $line $temp_ship 1
getWordPos $line $corp_pos "Corp"
cutText $line $temp_dist ($corp_pos + 24) 3
stripText $temp_dist " "
if ($temp_ship = $other_ship)
if ($temp_dist <> 0)
if ($temp_dist > $x_range)
echo ansi_15 "*Other Ship (" $other_ship ") too far away!*"
halt
end
end
send "qwn" $other_ship "*"
echo ansi_15 "*Locked On Other Ship!*"
# send "q"
goto :locate_1_port
end
goto :check_x_triggers
:done_x_check
killalltriggers
echo ansi_15 "*Other Ship Not Found! [" $other_ship "]*"
halt
#This is the Brute Force method of searching for ports - the simple Scan, find xxB
#repeat, find, trade, etc
#the Advanced locate port-thru DB feature will be implemented at a later date
#after bruce force is fully functional
#Brute Force is meant to work in any circumstance, even early game with little or no
#ZTM Data
:locate_1_port
setArray $pair 2
killalltriggers
send "sh"
waitFor "Long Range Scan"
setTextLineTrigger done_1_scan :done_1_scan "Warps to Sector(s)"
pause
:done_1_scan
killalltriggers
setVar $pair_count 0
#echo ansi_15 "****" $sector "****"
getSector $sector $sect
if (($sect.port.buy_equip = "YES") and ($sector > 10) and ($sector <> STARDOCK))
if ($sect.port.class <> 0)
if ($busts[$sector] = 0)
add $pair_count 1
setVar $buyers[$sector] 1
setVar $pair[$pair_count] $sector
end
end
end
:check_adj
setVar $count 1
setVar $warpcount SECTOR.WARPCOUNT[$sector]
setArray $adj_warp $warpcount
:check_adj_loop
while ($count <= $warpcount)
setVar $adj_warp[$count] SECTOR.WARPS[$sector][$count]
setVar $temp_sect $adj_warp[$count]
getDistance $dist $temp_sect $sector
getSector $temp_sect $sect
if ($dist > 1)
# echo ansi_15 "*Sector " $temp_sect " is a One-Way*"
add $count 1
goto :check_adj_loop
end
if (($sect.port.buy_equip = "YES") and ($temp_sect > 10) and ($temp_sect <> STARDOCK))
if ($sect.port.class <> 0)
if ($sect.port.exists = 1)
setVar $buyers[$temp_sect] 1
if ($busts[$temp_sect] = 0)
add $pair_count 1
setVar $pair[$pair_count] $temp_sect
if ($pair_count = 2)
goto :check_pair
end
end
end
end
end
add $count 1
end
:check_safety
if ($pair_count = 0)
# echo ansi_15 "*No xxB Ports Found!*"
goto :search_move
elseif ($pair_count = 1)
if ($pair[1] = $sector)
goto :search_move
end
#pause
if ($pair[1] <> $last_visit)
# echo ansi_15 "*Only 1 xxB Port Found - Warping..."
# echo ansi_15 "* xxB 1 : " $pair[1] "*"
send "m" $pair[1] " * z a " $fig_wave " * z n "
if ($pair[1] > 10) AND ($pair[1] <> STARDOCK)
send " f 1 * c d "
end
setVar $last_visit $sector
setVar $sector $pair[1]
else
:get_rnd_adj
# echo ansi_15 "*xxB = Last Visit - Getting Random Sector..."
if ($warpcount = 1)
echo ansi_15 "*In Dead End - Warping Out..."
setvar $last_visit $sector
send "m" $adj_warp[1] " * z a " $fig_wave " * z n "
if ($adj_warp[1] > 10) AND ($adj_warp[1] <> STARDOCK)
send " f 1 * c d "
end
setVar $sector $adj_warp[1]
else
getRnd $rnd_adj 1 $warpcount
if ($adj_warp[$rnd_adj] = $last_visit)
goto :get_rnd_adj
end
setVar $last_visit $sector
setVar $sector $adj_warp[$rnd_adj]
send "m" $adj_warp[$rnd_adj] " * z a " $fig_wave " * z n "
if ($adj_warp[$rnd_adj] > 10) AND ($adj_warp[$rnd_adj] <> STARDOCK)
send " f 1 * c d "
end
end
end
goto :locate_1_port
end
:search_move
killalltriggers
setVar $high_warp 0
setVar $high_sect 0
setVar $warpcount SECTOR.WARPCOUNT[$sector]
setVar $sect_array $warpcount
setVar $warp_array $warpcount
setVar $count 1
send "sd"
waitFor "Relative Density Scan"
:d_scan_Triggers
killalltriggers
setTextLineTrigger 1 :get_sector "==>"
setTextTrigger 2 :done_d_scan "]:["
pause
:get_sector
killalltriggers
#send "'dscan trig*"
setVar $line CURRENTLINE
getWordPos $line $sect_pos "Sector"
cutText $line $adj_sect ($sect_pos + 7) 8
stripText $adj_sect "("
stripText $adj_sect ")"
stripText $adj_sect " "
stripText $adj_sect "="
stripText $adj_sect ">"
getWordPos $line $warp_pos "Warps"
cutText $line $warps ($warp_pos + 7) 3
stripText $warps " "
#echo ansi_15 "*Sector : " $adj_sect " <Warps > : " $warps
#setVar $sect_array[$count] $sector
if ($warps > $high_warp)
if ($warpcount = 1)
setVar $high_sect $adj_sect
setVar $high_warp $warps
end
if ($adj_sect <> $last_visit)
setVar $high_sect $adj_sect
setVar $high_warp $warps
# send "'New High Warp : " $high_sect " " $high_warp "*"
end
end
add $count 1
goto :d_scan_triggers
:done_d_scan
killalltriggers
setVar $count 1
#send "'high sect : " $high_sect "*"
setVar $move_target $high_sect
:check
setvar $count 1
#echo ansi_15 "*Script Error : Should not get Here [1]*"
:move_target
killalltriggers
#send "m " $move_target " * z a " $fig_wave " * z n "
send "m " $move_target " * z a " $fig_wave " * * "
if ($move_target > 10) AND ($move_target <> STARDOCK)
send " f 1 * c d *"
end
setVar $last_visit $sector
#thinking of having a no-match array, like a 'don't go there, nothin to be found'
#but content with just avoidin the last sector, for now
setVar $sector $move_target
#send "'sector : " $sector " going to locate_1_port*"
goto :locate_1_port
#Note : At the Moment, I have not planned to incorporate a breadth-wide search routine
#to the Brute-Force method
#In a sense, so far the Brute Force method is going to be a Wssm Routine with SST instead
#of SSM with the 250ms delay
:check_pair
#echo ansi_15 "*Arrived : Check Pair!"
#echo ansi_15 "*Port 1 : " $pair[1]
#echo ansi_15 "*Port 2 : " $pair[2]
#echo "**"
#send "'pair located : " $pair[1] " and " $pair[2] "*"
:check_distance
if ($pair[1] <> $sector)
send "cf" $pair[1] "*" $pair[2] "*"
send "f" $pair[2] "*" $pair[1] "*q"
waitfor "<Computer deactivated>"
goto :get_path_dist
else
send "cf" $pair[2] "*" $pair[1] "*q"
waitfor "<Computer deactivated>"
goto :get_path_dist
end
:get_path_dist
killalltriggers
getDistance $p_length $pair[2] $pair[1]
getDistance $p_length_2 $pair[1] $pair[2]
if ($p_length > 2)
send "'dist_error 1 : " $p_length "*"
setVar $move_target $pair[2]
goto :move_target
elseif ($p_length_2 > 2) AND ($pair[1] <> $sector)
send "'dist error 2 : " $p_length_2 "*"
setVar $move_target $pair[1]
goto :move_target
end
:pass_test
killalltriggers
#send "'distance check : passed*"
goto :set_up
:set_up
send "w"
send "m" $pair[2] "* z a " $fig_wave " * z n "
if ($pair[2] > 10) AND ($pair[2] <> STARDOCK)
send " f 1 * c d "
end
setVar $this_ship_sector $pair[2]
#send "'ship 1 : moved " $pair[2] "*"
if ($pair[1] <> $sector)
send "x " $other_ship " * q m " $pair[1] " * z a " $fig_wave " * z n "
if ($pair[1] > 10) AND ($pair[1] <> STARDOCK)
send " f 1 * c d "
end
setVar $other_ship_sector $pair[1]
# send "'ship 2 : moved " $pair[1] "*"
send "x " $this_ship " * q "
# setVar $curr_ship $other_ship
else
# send "'ship 2 : already at port*"
setVar $other_ship_sector $pair[1]
setVar $curr_ship $this_ship
end
:upgrade
send "o 3 33 * q "
#send "'port 1 : upgraded*"
send " j y "
send " x " $other_ship "* q o 3 33 * q "
send " j y "
#send "'port 2 : upgraded*"
send " x " $this_ship "* q "
#-----------------------------SST ROUTINE---------------------------------#
:begin_sst
#send "'beginning sst *"
send "i"
waitFor "Rank and Exp"
getWord CURRENTLINE $exp 5
stripText $exp ","
setVar $steal_holds_exp ($exp / $divisor)
waitFor "Total Holds"
getWord CURRENTLINE $total_holds 4
if ($steal_holds_exp > $total_holds)
setVar $steal_holds_this $total_holds
else
setVar $steal_holds_this $steal_holds_exp
end
setVar $steal_holds_other $steal_holds_this
killalltriggers
setVar $count 1
:chk_other_holds
if ($rpr > 1)
send "xi" $other_ship "** q "
waitFor "Total Holds"
getWord CURRENTLINE $chk_other_holds 4
if ($chk_other_holds = 0)
goto :chk_other_holds
send "'ERROR : holds read at 0, rechecking*"
end
if ($steal_holds_exp > $chk_other_holds)
setVar $steal_holds_other $chk_other_holds
end
end
#if ($chk_other_holds < $steal_holds)
# setVar $steal_holds $chk_other_holds
#end
:msg
#send "'exp : " $exp " stealing " $steal_holds_exp " holds, divisor : " $divisor " *"
:main_sst
setVar $curr_ship $this_ship
send "p r * sz"
setTextTrigger fake :busted_sst "Do you want instructions (Y/N)"
setTextTrigger good :contmain "Which product?"
pause
:contmain
KillAllTriggers
#send "p r * s 3 " $steal_holds_this " * "
send " 3 " $steal_holds_this " * "
setTextTrigger 1 :success_sst "Success!"
setTextTrigger 2 :busted_sst "Suddenly you're Busted!"
pause
:success_sst
killalltriggers
send " x " $other_ship " * q "
setVar $curr_ship $other_ship
send "p r * sz"
setTextTrigger fake :busted_sst "Do you want instructions (Y/N)"
setTextTrigger good :contsst "Which product?"
pause
:contsst
KillAllTriggers
#send " p r * s 3 " $steal_holds_other " * "
send " 3 " $steal_holds_other " * "
setTextTrigger 1 :success_2_sst "Success!"
setTextTrigger 2 :busted_sst "Suddenly you're Busted!"
pause
:success_2_sst
killalltriggers
send " x " $this_ship " * q "
setVar $curr_ship $this_ship
#send " p t * * 0 * z n 0 * z n "
send " p t * * 0 * 0 * "
send "p r * s 3 " $steal_holds_this " * "
setTextTrigger 1 :success_3_sst "Success!"
setTextTrigger 2 :busted_sst "Suddenly you're Busted!"
pause
:success_3_sst
killalltriggers
send " x " $other_ship " * q "
setVar $curr_ship $other_ship
#send " p t * * 0 * z n 0 * z n "
send " p t * * 0 * 0 * "
send "p r * s 3 " $steal_holds_other " * "
setTextTrigger 1 :success_2_sst "Success!"
setTextTrigger 2 :busted_sst "Suddenly you're Busted!"
pause
:busted_sst
killalltriggers
if ($curr_ship = $other_ship)
setVar $bust_sector $other_ship_sector
else
setVar $bust_sector $this_ship_sector
end
setVar $busts[$bust_sector] 1
write $bust_list $bust_sector
setVar $bust_ship $curr_ship
#send "'busted : ship " $curr_ship " in sector " $bust_sector "! *"
:refurb
setVar $count 1
if ($curr_ship = $this_ship)
setVar $tow_target $other_ship_sector
else
setVar $tow_target $this_ship_sector
end
#send "'tow target sector : " $tow_target "*"
:move_to_tow
getDistance $dist $bust_sector $tow_target
if ($dist > 1)
goto :move_2
else
#send "'tow target adj*"
send " m " $tow_target " * z n "
goto :lock_move
end
:move_2
#send "'tow target not adj!*"
getCourse $short_course $bust_sector $tow_target
send " m " $short_course[1] " * z n m " $short_course[2] " * z n m " $short_course[3] " * * "
goto :lock_move
:lock_move
if ($curr_ship <> $this_ship)
send " x " $this_ship " * q "
end
send " w n " $other_ship " *"
echo ansi_15 "*Locked And Ready to Refurb Holds!*"
if ($rpr > 1)
goto :multiple_runs
end
goto :move_terra
:multiple_runs
setVar $rpr_count ($rpr_count + 1)
if ($rpr_count >= $rpr)
setVar $rpr_count 0
goto :move_terra
end
# send "'beginning run " $rpr_count " - total before refurb : " $rpr "*"
setVar $sector $tow_target
goto :locate_1_port
:move_terra
setVar $sector $tow_target
setVar $dest $class0
setVar $figattack $fig_wave
goSub :lawn_mow
send "/"
waitFor "Creds"
getWord CURRENTLINE $chk_sect 2
stripText $chk_sect "Turns"
stripText $chk_sect #179
if ($chk_sect <> $class0)
# send "'error : Not In Sector 1 - instead in sector " $chk_sect "!*"
send "'error : not at class 0*"
pause
end
#send "'Arrived : Refurb Sector 1*"
send "w"
:re_furb
if ($bust_ship <> $this_ship)
send " x * " $other_ship " * q "
setVar $curr_ship $other_ship
else
setVar $curr_ship $this_ship
end
:dock_refurb_port
send "pt"
waitFor "You have"
getWord CURRENTLINE $credits 3
stripText $credits ","
:dock_triggers_check_limpet
setTextTrigger chk_1 :limpet "and removal? :"
setTextTrigger chk_2 :clean "Commerce report"
pause
:limpet
killalltriggers
send "y"
goto :dock_refurb_2
:clean
killalltriggers
goto :dock_refurb_2
:dock_refurb_2
waitFor "Cargo holds"
getWord CURRENTLINE $holds_needed 10
send "a" $holds_needed "*y"
if ($restock = "YES")
waitFor "Fighters"
getWord CURRENTLINE $fig_price 4
getWord CURRENTLINE $figs_avail 8
#send "'figs avail : " $figs_avail "*"
if ($figs_avail = 0)
goto :buy
end
if ($credits < 800000)
# send "'not buying figs : insufficient credits*"
goto :buy
end
setVar $avail_credits ($credits - 800000)
setVar $pos_buy_figs ($avail_credits / $fig_price)
if ($figs_avail < $pos_buy_figs)
setVar $pos_buy_figs $figs_avail
# send "'buying : " $pos_buy_figs "*"
end
send "b" $pos_buy_figs "*"
end
:buy
# send "'buying : " $holds_needed " holds*"
#OPTIONAL ADD ON : BUY SHIELDS
send "q"
if ($rpr > 1)
if ($checked_other = "NO")
echo ansi_15 "*Checking Other Ship..."
# send "'checking other ship*"
if ($curr_ship = $this_ship)
if ($class0 = 1)
send " x * " $other_ship " * q "
else
send " x " $other_ship " * q "
end
setVar $curr_ship $other_ship
setVar $checked_other "YES"
SetVar $WaitLine "[" & $class0 & "]"
WaitFor $WaitLine
# send "'(furb_trig)*"
# waitFor "(furb_trig)"
goto :dock_refurb_port
elseif ($curr_ship = $other_ship)
if ($class0 = 1)
send " x * " $this_ship " * q "
else
send " x " $this_ship " * q "
end
setVar $curr_ship $this_ship
setVar $checked_other "YES"
SetVar $WaitLine "[" & $class0 & "]"
WaitFor $WaitLine
# send "'(furb_trig)*"
# waitFor "(furb_trig)"
goto :dock_refurb_port
end
end
end
if ($curr_ship <> $this_ship)
send " x * " $this_ship " * q "
end
send " w n " $other_ship " * "
#send "'furbed : tow locked : ready to roll out*"
:get_next_target
getRnd $random_jump 11 SECTORS
if ($busts[$random_jump] = 1)
goto :get_next_target
end
:move_to_random
setVar $checked_other "NO"
setVar $sector $class0
setVar $dest $random_jump
setVar $figattack $fig_wave
goSub :lawn_mow
send "/"
waitFor "Creds"
getWord CURRENTLINE $chk_sect 2
stripText $chk_sect "Turns"
stripText $chk_sect #179
if ($chk_sect <> $random_jump)
send "'error : Not In Sector " $random_jump " - instead in sector " $chk_sect "!*"
pause
end
#send "'Arrived : Jump Sector : " $random_jump "*"
setVar $sector $random_jump
goto :locate_1_port
#----------------------------SUBROUTINES---------------------------------#
:addspc
getLength $text $len
if ($len < $max)
setVar $spaces ($max - $len)
if ($spaces = 1)
setVar $text " " & $text
else
setVar $spaces ($spaces / 2)
setVar $cnt 0
:addfront
if ($cnt < $spaces)
add $cnt 1
setVar $text " " & $text
goto :addfront
end
setVar $cnt 0
:addback
if ($cnt < $spaces)
add $cnt 1
setVar $text $text & " "
goto :addback
end
getLength $text $len
if ($len < $max)
setVar $text " " & $text
end
end
end
return
:checkMax
if ($len > $max)
setVar $max $len
end
return
#LAWNMOWING SUB #
:lawn_mow
killalltriggers
setVar $currsect $sector
send "cf" $currsect "*" $dest "*"
:triggers
killalltriggers
setTextLineTrigger chk :length "The shortest path"
pause
:length
killalltriggers
setVar $line CURRENTLINE
getText $line $length "ath (" " hops"
setArray $plength $length
:triggers1
killalltriggers
setTextLineTrigger 1 :course ">"
pause
:course
killalltriggers
setVar $line CURRENTLINE
getWord $line $chk 1
if ($chk <> $currsect)
setTextLineTrigger 2 :course
pause
end
stripText $line ">"
stripText $line "("
stripText $line ")"
setVar $count 1
setVar $count1 1
:gethops
if ($count <= $length)
add $count 1
getWord $line $hop $count
if ($hop <> 0)
setVar $plength[$count1] $hop
add $count1 1
goto :gethops
else
subtract $count 2
goto :2ndline
end
end
:2ndline
setVar $count2 1
killalltriggers
setTextLineTrigger chk :chkline
pause
:chkline
setVar $line CURRENTLINE
getWord $line $test 1
if ($test <> "0")
stripText $line ">"
stripText $line "("
stripText $line ")"
setVar $newlength ($length - $count)
else
goto :donecalc
end
:gethops2
if ($count2 <= $newlength)
getWord $line $hop $count2
if ($hop = 0)
setVar $count2 ($count2 - 1)
goto :3rdline
end
setVar $plength[$count1] $hop
add $count1 1
add $count2 1
goto :gethops2
end
:3rdline
setVar $count3 1
killalltriggers
setTextLineTrigger chk1 :chkline1
pause
:chkline1
setVar $line CURRENTLINE
getWord $line $test 1
if ($test <> "0")
stripText $line ">"
stripText $line "("
stripText $line ")"
setVar $newlength1 ($newlength - $count2)
else
goto :donecalc
end
:gethops3
if ($count3 <= $newlength1)
getWord $line $hop $count3
setVar $plength[$count1] $hop
add $count1 1
add $count3 1
goto :gethops3
end
:donecalc
send "q"
setVar $count 0
setVar $count1 0
#send "'(charge) " $sector " -> " $dest " [" $length " hops]*"
:blast
killalltriggers
if ($count < $length)
add $count 1
if ($plength[$count] = STARDOCK) OR ($plength[$count] < 11)
send "m" $plength[$count] " * z n "
setDelayTrigger go_blast1 :blast 100
pause
else
send "m" $plength[$count] " * z a " $figattack " * z n f z q z 1 * z q z c z q z d * "
setDelayTrigger go_blast :blast 100
pause
end
end
:done
return