-
Notifications
You must be signed in to change notification settings - Fork 0
/
oval.html
960 lines (912 loc) · 38.9 KB
/
oval.html
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
<html><head>
<!-- Standard Meta -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<!-- start of scripts section -->
<script src="https://cdn.jsdelivr.net/npm/jquery@3.3.1/dist/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/fomantic-ui@2.8.7/dist/semantic.min.css">
<script src="https://cdn.jsdelivr.net/npm/fomantic-ui@2.8.7/dist/semantic.min.js"></script>
<!-- start of rextester API for R -->
<script>
$(function(){
$("#header").load("https://raw.githubusercontent.com/iKrazy/OvalSite/main/assets/html/header.html");
$("#footer").load("https://raw.githubusercontent.com/iKrazy/OvalSite/main/assets/html/footer.html");
});
$(document).ready(function(){
$("#OVALMYSPELLDIV").hide();
////////////////////////////////////////////
//shitty way of grabbing input box text and replacing in
//health
OVALMYHEALTH.addEventListener("focusout", function (e) {
ovalscript = document.getElementsByName('ovalscript')[0].innerHTML;
document.getElementsByName('ovalscript')[0].innerHTML=ovalscript.replace(/\nHealth = .*/, '\nHealth = ' + this.value);
});
//shitty way of grabbing input box text and replacing in
//health
OVALMYACC.addEventListener("focusout", function (e) {
ovalscript = document.getElementsByName('ovalscript')[0].innerHTML;
document.getElementsByName('ovalscript')[0].innerHTML=ovalscript.replace(/\nAccuracy = .*/, '\nAccuracy = ' + this.value);
});
//shitty way of grabbing input box text and replacing in sheet
//defense
OVALMYDEF.addEventListener("focusout", function (e) {
ovalscript = document.getElementsByName('ovalscript')[0].innerHTML;
document.getElementsByName('ovalscript')[0].innerHTML=ovalscript.replace(/\nDefense = .*/, '\nDefense = ' + this.value);
});
//shitty way of grabbing input box text and replacing in sheet
//melee
OVALMYMELEE.addEventListener("focusout", function (e) {
ovalscript = document.getElementsByName('ovalscript')[0].innerHTML;
document.getElementsByName('ovalscript')[0].innerHTML=ovalscript.replace(/\nMelee = .*/, '\nMelee = ' + this.value);
});
//shitty way of grabbing input box text and replacing in sheet
//ranging
OVALMYRANGE.addEventListener("focusout", function (e) {
ovalscript = document.getElementsByName('ovalscript')[0].innerHTML;
document.getElementsByName('ovalscript')[0].innerHTML=ovalscript.replace(/\nRanging = .*/, '\nRanging = ' + this.value);
});
//shitty way of grabbing input box text and replacing in sheet
//psychic
OVALMYPSY.addEventListener("focusout", function (e) {
ovalscript = document.getElementsByName('ovalscript')[0].innerHTML;
document.getElementsByName('ovalscript')[0].innerHTML=ovalscript.replace(/\nPsychic = .*/, '\nPsychic = ' + this.value);
});
////////////////////////////////////////////
//shitty way of grabbing input box text and replacing in
//type
OVALMYTYPE.addEventListener("change", function (e) {
ovalscript = document.getElementsByName('ovalscript')[0].innerHTML;
if (this.value === "0") {
var mytype = "M"
} else if (this.value === "1") {
var mytype = "R"
} else if (this.value === "2") {
var mytype = "P"
};
document.getElementsByName('ovalscript')[0].innerHTML=ovalscript.replace(/\nType = \"[a-zA-Z]\"/g, '\nType = \"' + mytype + '\"');
if (OVALMYTYPE.value === '2') {
$("#OVALMYSPELLDIV").show();
}
else
{
$("#OVALMYSPELLDIV").hide();
var presetspell = "None"
ovalscript = document.getElementsByName('ovalscript')[0].innerHTML;
document.getElementsByName('ovalscript')[0].innerHTML=ovalscript.replace(/\nSpell = .*/, '\nSpell = \"' + presetspell + '\"');
document.getElementById('OVALMYSPELL').value = presetspell
}
});
//shitty way of grabbing input box text and replacing in
//e preset
OVALMYSPELL.addEventListener("change", function (e) {
var presetspell = "None"
if (OVALMYSPELL.value === "None"){
var presetspell = "None"
} else if (OVALMYSPELL.value === "Lesser Earth"){
var presetspell = "Lesser Earth"
} else if (OVALMYSPELL.value === "Lesser Water"){
var presetspell = "Lesser Water"
} else if (OVALMYSPELL.value === "Lesser Wind"){
var presetspell = "Lesser Wind"
} else if (OVALMYSPELL.value === "Lesser Fire"){
var presetspell = "Lesser Fire"
} else if (OVALMYSPELL.value === "Lesser Lightning"){
var presetspell = "Lesser Lightning"
} else if (OVALMYSPELL.value === "Greater Earth"){
var presetspell = "Greater Earth"
} else if (OVALMYSPELL.value === "Greater Water"){
var presetspell = "Greater Water"
} else if (OVALMYSPELL.value === "Greater Wind"){
var presetspell = "Greater Wind"
} else if (OVALMYSPELL.value === "Greater Fire"){
var presetspell = "Greater Fire"
} else if (OVALMYSPELL.value === "Greater Lightning"){
var presetspell = "Greater Lightning"
} else if (OVALMYSPELL.value === "Lesser Bind"){
var presetspell = "Lesser Bind"
} else if (OVALMYSPELL.value === "Greater Bind"){
var presetspell = "Greater Bind"
} else if (OVALMYSPELL.value === "Lesser Lifesteal"){
var presetspell = "Lesser Lifesteal"
} else if (OVALMYSPELL.value === "Lesser Freeze"){
var presetspell = "Lesser Freeze"
} else if (OVALMYSPELL.value === "Greater Lifesteal"){
var presetspell = "Greater Lifesteal"
} else if (OVALMYSPELL.value === "Greater Freeze"){
var presetspell = "Greater Freeze"
};
ovalscript = document.getElementsByName('ovalscript')[0].innerHTML;
document.getElementsByName('ovalscript')[0].innerHTML=ovalscript.replace(/\nSpell = .*/, '\nSpell = \"' + presetspell + '\"');
document.getElementById('OVALMYSPELL').value = presetspell
});
//shitty way of grabbing input box text and replacing in
//hitmax
OVALMYMAX.addEventListener("focusout", function (e) {
ovalscript = document.getElementsByName('ovalscript')[0].innerHTML;
document.getElementsByName('ovalscript')[0].innerHTML=ovalscript.replace(/\nHitMax = .*/, '\nHitMax = ' + this.value);
});
//shitty way of grabbing input box text and replacing in sheet
//hitmin
OVALMYMIN.addEventListener("focusout", function (e) {
ovalscript = document.getElementsByName('ovalscript')[0].innerHTML;
document.getElementsByName('ovalscript')[0].innerHTML=ovalscript.replace(/\nHitMin = .*/, '\nHitMin = ' + this.value);
});
//shitty way of grabbing input box text and replacing in sheet
//attackspeed
OVALMYSPEED.addEventListener("focusout", function (e) {
ovalscript = document.getElementsByName('ovalscript')[0].innerHTML;
document.getElementsByName('ovalscript')[0].innerHTML=ovalscript.replace(/\nAttackSpeed = .*/, '\nAttackSpeed = ' + this.value + ' # Attack Speed in ticks (Seconds*2)');
});
//shitty way of grabbing input box text and replacing in sheet
//meleedefense
OVALMYMELEEDEF.addEventListener("focusout", function (e) {
ovalscript = document.getElementsByName('ovalscript')[0].innerHTML;
document.getElementsByName('ovalscript')[0].innerHTML=ovalscript.replace(/\nMeleeDefense = .*/, '\nMeleeDefense = ' + this.value);
});
//shitty way of grabbing input box text and replacing in sheet
//rangingdefense
OVALMYRANGEDEF.addEventListener("focusout", function (e) {
ovalscript = document.getElementsByName('ovalscript')[0].innerHTML;
document.getElementsByName('ovalscript')[0].innerHTML=ovalscript.replace(/\nRangingDefense = .*/, '\nRangingDefense = ' + this.value);
});
//shitty way of grabbing input box text and replacing in sheet
//psychicdef
OVALMYPSYDEF.addEventListener("focusout", function (e) {
ovalscript = document.getElementsByName('ovalscript')[0].innerHTML;
document.getElementsByName('ovalscript')[0].innerHTML=ovalscript.replace(/\nPsychicDefense = .*/, '\nPsychicDefense = ' + this.value);
});
//shitty way of grabbing input box text and replacing in sheet
//meleeacc
OVALMYMELEEACC.addEventListener("focusout", function (e) {
ovalscript = document.getElementsByName('ovalscript')[0].innerHTML;
document.getElementsByName('ovalscript')[0].innerHTML=ovalscript.replace(/\nMeleeAccuracy = .*/, '\nMeleeAccuracy = ' + this.value);
});
//shitty way of grabbing input box text and replacing in sheet
//rangingacc
OVALMYRANGEACC.addEventListener("focusout", function (e) {
ovalscript = document.getElementsByName('ovalscript')[0].innerHTML;
document.getElementsByName('ovalscript')[0].innerHTML=ovalscript.replace(/\nRangingAccuracy = .*/, '\nRangingAccuracy = ' + this.value);
});
//shitty way of grabbing input box text and replacing in sheet
//psychicacc
OVALMYPSYACC.addEventListener("focusout", function (e) {
ovalscript = document.getElementsByName('ovalscript')[0].innerHTML;
document.getElementsByName('ovalscript')[0].innerHTML=ovalscript.replace(/\nPsychicAccuracy = .*/, '\nPsychicAccuracy = ' + this.value);
});
////////////////////////////////////////////
//shitty way of grabbing input box text and replacing in
//healing preset
OVALMYHEALPRESET.addEventListener("change", function (e) {
if (OVALMYHEALPRESET.value === "Squid") {
var presethealamount = "24"
var presethealquantity = "28"
} else if (OVALMYHEALPRESET.value === "Sturgeon") {
var presethealamount = "23"
var presethealquantity = "28"
} else if (OVALMYHEALPRESET.value === "Tigerfish") {
var presethealamount = "20"
var presethealquantity = "28"
} else if (OVALMYHEALPRESET.value === "Lg HP Pot") {
var presethealamount = "20"
var presethealquantity = "28"
} else if (OVALMYHEALPRESET.value === "Barracuda") {
var presethealamount = "18"
var presethealquantity = "28"
} else if (OVALMYHEALPRESET.value === "Crab") {
var presethealamount = "15"
var presethealquantity = "28"
} else if (OVALMYHEALPRESET.value === "Lobster") {
var presethealamount = "12"
var presethealquantity = "28"
} else if (OVALMYHEALPRESET.value === "Sm HP Pot") {
var presethealamount = "10"
var presethealquantity = "28"
} else if (OVALMYHEALPRESET.value === "None") {
var presethealamount = "0"
var presethealquantity = "0"
};
ovalscript = document.getElementsByName('ovalscript')[0].innerHTML;
document.getElementsByName('ovalscript')[0].innerHTML=ovalscript.replace(/\nHealingAmount = .*/, '\nHealingAmount = ' + presethealamount);
document.getElementById('OVALMYHEALAMT').value = presethealamount
ovalscript = document.getElementsByName('ovalscript')[0].innerHTML;
document.getElementsByName('ovalscript')[0].innerHTML=ovalscript.replace(/\nHealingQuantity = .*/, '\nHealingQuantity = ' + presethealquantity + ' # Number of food brought per trip');
document.getElementById('OVALMYHEALQUANT').value = presethealquantity
});
//shitty way of grabbing input box text and replacing in sheet
//healamount
OVALMYHEALAMT.addEventListener("focusout", function (e) {
ovalscript = document.getElementsByName('ovalscript')[0].innerHTML;
document.getElementsByName('ovalscript')[0].innerHTML=ovalscript.replace(/\nHealingAmount = .*/, '\nHealingAmount = ' + this.value);
});
//shitty way of grabbing input box text and replacing in sheet
//healquantity
OVALMYHEALQUANT.addEventListener("focusout", function (e) {
ovalscript = document.getElementsByName('ovalscript')[0].innerHTML;
document.getElementsByName('ovalscript')[0].innerHTML=ovalscript.replace(/\nHealingQuantity = .*/, '\nHealingQuantity = ' + this.value + ' # Number of food brought per trip');
});
////////////////////////////////////////////
//shitty way of grabbing input box text and replacing in
//e preset
MILFMYPRESET.addEventListener("change", function (e) {
if (MILFMYPRESET.value === "3") {
var presetlvl = "424"
var presettype = "P"
var presettypedropdown = "2"
var presethp = "999"
var presetmax = "40"
var presetspeed = "4"
var presetacc = "225"
var presetdef = "165"
var presetmel = "1"
var presetran = "1"
var presetpsy = "310"
var presettox = "F"
} else if (MILFMYPRESET.value === "4") {
var presetlvl = "440"
var presettype = "R"
var presettypedropdown = "1"
var presethp = "999"
var presetmax = "41"
var presetspeed = "4"
var presetacc = "205"
var presetdef = "215"
var presetmel = "1"
var presetran = "340"
var presetpsy = "1"
var presettox = "F"
} else if (MILFMYPRESET.value === "0") {
var presetlvl = "392"
var presettype = "P"
var presettypedropdown = "2"
var presethp = "999"
var presetmax = "33"
var presetspeed = "4"
var presetacc = "150"
var presetdef = "150"
var presetmel = "1"
var presetran = "1"
var presetpsy = "270"
var presettox = "F"
} else if (MILFMYPRESET.value === "1") {
var presetlvl = "291"
var presettype = "R"
var presettypedropdown = "1"
var presethp = "650"
var presetmax = "30"
var presetspeed = "4"
var presetacc = "155"
var presetdef = "110"
var presetmel = "1"
var presetran = "250"
var presetpsy = "1"
var presettox = "F"
} else if (MILFMYPRESET.value === "2") {
var presetlvl = "368"
var presettype = "M"
var presettypedropdown = "0"
var presethp = "850"
var presetmax = "28"
var presetspeed = "2"
var presetacc = "190"
var presetdef = "195"
var presetmel = "240"
var presetran = "1"
var presetpsy = "1"
var presettox = "F"
} else if (MILFMYPRESET.value === "6") {
var presetlvl = "403"
var presettype = "P"
var presettypedropdown = "2"
var presethp = "999"
var presetmax = "35"
var presetspeed = "3"
var presetacc = "160"
var presetdef = "175"
var presetmel = "9999"
var presetran = "1"
var presetpsy = "280"
var presettox = "T"
} else if (MILFMYPRESET.value === "5") {
var presetlvl = "1170"
var presettype = "M"
var presettypedropdown = "0"
var presethp = "3500"
var presetmax = "69"
var presetspeed = "4"
var presetacc = "280"
var presetdef = "350"
var presetmel = "550"
var presetran = "1"
var presetpsy = "1"
var presettox = "F"
};
ovalscript = document.getElementsByName('ovalscript')[0].innerHTML;
document.getElementsByName('ovalscript')[0].innerHTML=ovalscript.replace(/\nE.CombatLevel = .*/, '\nE.CombatLevel = ' + presetlvl + ' # Use 0 if you don\'t want xp stats');
document.getElementById('MILFMYCBTLVL').value = presetlvl
ovalscript = document.getElementsByName('ovalscript')[0].innerHTML;
document.getElementsByName('ovalscript')[0].innerHTML=ovalscript.replace(/\nE.Type = \"[a-zA-Z]*\"/, '\nE.Type = \"' + presettype + '\"');
document.getElementById('MILFMYTYPE').value = presettypedropdown
ovalscript = document.getElementsByName('ovalscript')[0].innerHTML;
document.getElementsByName('ovalscript')[0].innerHTML=ovalscript.replace(/\nE.Health = .*/, '\nE.Health = ' + presethp);
document.getElementById('MILFMYHEALTH').value = presethp
ovalscript = document.getElementsByName('ovalscript')[0].innerHTML;
document.getElementsByName('ovalscript')[0].innerHTML=ovalscript.replace(/\nE.HitMax = .*/, '\nE.HitMax = ' + presetmax);
document.getElementById('MILFMYMAX').value = presetmax
ovalscript = document.getElementsByName('ovalscript')[0].innerHTML;
document.getElementsByName('ovalscript')[0].innerHTML=ovalscript.replace(/\nE.AttackSpeed = .*/, '\nE.AttackSpeed = ' + presetspeed + ' # Use 2 for Zenitsu\. Otherwise use 4');
document.getElementById('MILFMYSPEED').value = presetspeed
ovalscript = document.getElementsByName('ovalscript')[0].innerHTML;
document.getElementsByName('ovalscript')[0].innerHTML=ovalscript.replace(/\nE.Accuracy = .*/, '\nE.Accuracy = ' + presetacc);
document.getElementById('MILFMYACC').value = presetacc
ovalscript = document.getElementsByName('ovalscript')[0].innerHTML;
document.getElementsByName('ovalscript')[0].innerHTML=ovalscript.replace(/\nE.Defense = .*/, '\nE.Defense = ' + presetdef);
document.getElementById('MILFMYDEF').value = presetdef
ovalscript = document.getElementsByName('ovalscript')[0].innerHTML;
document.getElementsByName('ovalscript')[0].innerHTML=ovalscript.replace(/\nE.Melee .*/, '\nE.Melee = ' + presetmel);
document.getElementById('MILFMYMELEE').value = presetmel
ovalscript = document.getElementsByName('ovalscript')[0].innerHTML;
document.getElementsByName('ovalscript')[0].innerHTML=ovalscript.replace(/\nE.Ranging = .*/, '\nE.Ranging = ' + presetran);
document.getElementById('MILFMYRANGE').value = presetran
ovalscript = document.getElementsByName('ovalscript')[0].innerHTML;
document.getElementsByName('ovalscript')[0].innerHTML=ovalscript.replace(/\nE.Psychic = .*/, '\nE.Psychic = ' + presetpsy);
document.getElementById('MILFMYPSY').value = presetpsy
ovalscript = document.getElementsByName('ovalscript')[0].innerHTML;
document.getElementsByName('ovalscript')[0].innerHTML=ovalscript.replace(/\nToxic = [a-zA-Z]*/, '\nToxic = ' + presettox);
document.getElementById('GOOBY').value = presettox
});
//shitty way of grabbing input box text and replacing in
//e combat lvl
MILFMYCBTLVL.addEventListener("change", function (e) {
ovalscript = document.getElementsByName('ovalscript')[0].innerHTML;
document.getElementsByName('ovalscript')[0].innerHTML=ovalscript.replace(/\nE.CombatLevel = .*/, '\nE.CombatLevel = ' + this.value + ' # Use 0 if you don\'t want xp stats');
});
//shitty way of grabbing input box text and replacing in
//e combat style
MILFMYTYPE.addEventListener("change", function (e) {
ovalscript = document.getElementsByName('ovalscript')[0].innerHTML;
if (this.value === "0") {
var enemytype = "M"
} else if (this.value === "1") {
var enemytype = "R"
} else if (this.value === "2") {
var enemytype = "P"
};
document.getElementsByName('ovalscript')[0].innerHTML=ovalscript.replace(/\nE.Type = \"[a-zA-Z]*\"/, '\nE.Type = \"' + enemytype + '\"');
});
//shitty way of grabbing input box text and replacing in sheet
//e health
MILFMYHEALTH.addEventListener("focusout", function (e) {
ovalscript = document.getElementsByName('ovalscript')[0].innerHTML;
document.getElementsByName('ovalscript')[0].innerHTML=ovalscript.replace(/\nE.Health = .*/, '\nE.Health = ' + this.value);
});
//shitty way of grabbing input box text and replacing in sheet
//e max damage
MILFMYMAX.addEventListener("focusout", function (e) {
ovalscript = document.getElementsByName('ovalscript')[0].innerHTML;
document.getElementsByName('ovalscript')[0].innerHTML=ovalscript.replace(/\nE.HitMax = .*/, '\nE.HitMax = ' + this.value);
});
//shitty way of grabbing input box text and replacing in sheet
//e attackspeed
MILFMYSPEED.addEventListener("focusout", function (e) {
ovalscript = document.getElementsByName('ovalscript')[0].innerHTML;
document.getElementsByName('ovalscript')[0].innerHTML=ovalscript.replace(/\nE.AttackSpeed = .*/, '\nE.AttackSpeed = ' + this.value + ' # Use 2 for Zenitsu\. Otherwise use 4');
});
//shitty way of grabbing input box text and replacing in sheet
//e accuracy
MILFMYACC.addEventListener("focusout", function (e) {
ovalscript = document.getElementsByName('ovalscript')[0].innerHTML;
document.getElementsByName('ovalscript')[0].innerHTML=ovalscript.replace(/\nE.Accuracy = .*/, '\nE.Accuracy = ' + this.value);
});
//shitty way of grabbing input box text and replacing in sheet
//e defense
MILFMYDEF.addEventListener("focusout", function (e) {
ovalscript = document.getElementsByName('ovalscript')[0].innerHTML;
document.getElementsByName('ovalscript')[0].innerHTML=ovalscript.replace(/\nE.Defense = .*/, '\nE.Defense = ' + this.value);
});
//shitty way of grabbing input box text and replacing in sheet
//e melee
MILFMYMELEE.addEventListener("focusout", function (e) {
ovalscript = document.getElementsByName('ovalscript')[0].innerHTML;
document.getElementsByName('ovalscript')[0].innerHTML=ovalscript.replace(/\nE.Melee .*/, '\nE.Melee = ' + this.value);
});
//shitty way of grabbing input box text and replacing in sheet
//e ranging
MILFMYRANGE.addEventListener("focusout", function (e) {
ovalscript = document.getElementsByName('ovalscript')[0].innerHTML;
document.getElementsByName('ovalscript')[0].innerHTML=ovalscript.replace(/\nE.Ranging = .*/, '\nE.Ranging = ' + this.value);
});
//shitty way of grabbing input box text and replacing in sheet
//e psychic
MILFMYPSY.addEventListener("focusout", function (e) {
ovalscript = document.getElementsByName('ovalscript')[0].innerHTML;
document.getElementsByName('ovalscript')[0].innerHTML=ovalscript.replace(/\nE.Psychic = .*/, '\nE.Psychic = ' + this.value);
});
////////////////////////////////////////////
//shitty way of grabbing input box text and replacing in sheet
//toxic punk hazard gooby shit
GOOBY.addEventListener("change", function (e) {
ovalscript = document.getElementsByName('ovalscript')[0].innerHTML;
document.getElementsByName('ovalscript')[0].innerHTML=ovalscript.replace(/\nToxic = [a-zA-Z]/, '\nToxic = ' + this.value);
});
////////////////////////////////////////////
//shitty way of grabbing input box text and replacing in sheet
//number of iterations dev tool
SIMCOUNT.addEventListener("change", function (e) {
ovalscript = document.getElementsByName('ovalscript')[0].innerHTML;
if (SIMCOUNT.value === "0") {
var ddsimcount = "1"
} else if (SIMCOUNT.value === "1") {
var ddsimcount = "5000"
} else if (SIMCOUNT.value === "2") {
var ddsimcount = "7500"
} else if (SIMCOUNT.value === "3") {
var ddsimcount = "10000"
};
document.getElementsByName('ovalscript')[0].innerHTML=ovalscript.replace(/\nSimulateFightsV2\([0-9]*/, '\nSimulateFightsV2\(' + ddsimcount);
});
////////////////////////////////////////////
$("button").click(function(){
var to_compile = {
"LanguageChoice": "31",
"Program": $("#ovalgithubpull").val(),
"Input": "",
"CompilerArgs" : ""
};
$(this).removeClass('black ui button').addClass('ui secondary double loading button');
setTimeout(function () {
$(this).removeClass('ui double loading button').addClass('ui inverted basic button');
}.bind(this), 6000);
$.ajax ({
url: "https://rextester.com/rundotnet/api",
type: "POST",
data: to_compile
}).done(function(data) {
<!-- document.getElementsByName('ovaloutput')[0].value=JSON.stringify(data, null, '\n'); -->
stringed = JSON.stringify(data, null, '\n');
replaced = stringed.replace(/\\n/g, '\n');
finalformat = replaced.replace(/\\/g, '');
trim = finalformat.replace(/\[1\]/g, '');
trimtwo = trim.replace(/"Result\"\: \" /g, '"Result\"\:\n');
trimthree = trimtwo.replace(/ "/g, '');
trimfour = trimthree.replace(/"/g, '');
trimfive = trimfour.replace(/\{\n\n/g, '');
document.getElementsByName('ovaloutput')[0].innerHTML=trimfive.replace(/\n\n,.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*/g, '');
}).fail(function(data, err) {
document.getElementsByName('ovaloutput')[0].value="fail " + JSON.stringify(data) + " " + JSON.stringify(err);
});
var elmntToView = document.getElementById("GOOBY");
elmntToView.scrollIntoView({behavior: "smooth"});
});
});
// Restricts input for the given textbox to the given inputFilter.
function setInputFilter(textbox, inputFilter) {
["input", "keydown", "keyup", "mousedown", "mouseup", "select", "contextmenu", "drop"].forEach(function(event) {
textbox.addEventListener(event, function() {
if (inputFilter(this.value)) {
this.oldValue = this.value;
this.oldSelectionStart = this.selectionStart;
this.oldSelectionEnd = this.selectionEnd;
} else if (this.hasOwnProperty("oldValue")) {
this.value = this.oldValue;
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
} else {
this.value = "";
}
});
});
}
</script>
<!-- end of rextester API for R -->
<!-- end of scripts section -->
<!-- start of extra style section -->
<link rel="stylesheet" type="text/css" href="assets/css/allpages.css">
<style type="text/css">
<!-- start of page specific styling -->
.main.container {
min-height: 100%;
}
.ui.input>input {
width: 100%;
padding: 0 0 0 0;
height: 30px;
text-align:center;
}
select.ui.dropdown {
height: 30px;
border-radius: .28571429rem;
padding: 0 0 0 0;
width: 37px;
}
.one.wide.column {
min-width: min-content;
align-self: flex-end;
white-space: pre-line;
}
.ui.centered.grid>.column:not(.aligned):not(.justified):not(.row), .ui.centered.grid>.row>.column:not(.aligned):not(.justified), .ui.grid .centered.row>.column:not(.aligned):not(.justified) {
text-align: center;
}
.ui.transparent.inverted.input {
border: 1px solid rgba(255,255,255,.15);
border-radius: .28571429rem;
}
.ui.selection.dropdown {
min-width: min-content;
padding: 0 .4em 0 .4em;
min-height: 32;
}
a {
color: rgb(208 251 255 / 90%);
transition: 0.3s;
}
a:hover {
color: rgb(134 238 249);
transition: 0.3s;
}
<!-- end of page specific styling -->
</style>
<!-- end of extra style section -->
<title>DTS - Combat Calc</title>
</head>
<body>
<!-- start of navbar header section -->
<div id="header"></div>
<!-- end of navbar header section -->
<div class="flex-wrapper">
<!-- start of main body section -->
<div class="ui inverted segment" style="width: -webkit-fill-available;">
<div class="ui main text container" style="text-align:center; vertical-align:middle; min-height: 0;">
<h1 class="ui inverted header">Oval's R Combat Simulator</h1>
<p>End to end Combat Simulator built in R</p>
<p>All information can be found on your Character Stats Page, our <a href="gearcompare" target="_blank">Gear Simulator</a>, or on <a href="https://damascus.fandom.com/wiki/Enemies" target="_blank">the Wiki</a> </p>
<div class="ui centered grid">
</div>
</div>
<div class="ui inverted segment">
<div class="ui main text container" style="text-align:center; vertical-align:middle; min-height: 0;margin-top:0;margin-bottom:0;">
<h1 class="ui inverted header"><div class="ui inverted horizontal section divider">Player Skill Stats</div></h1>
</div>
<!-- Player Char Stats -->
<div class="ui equal width centered grid" style="margin-top:-40px;">
<div class="one wide column">
Health
<div class="ui inverted transparent input">
<input type="text" placeholder="99" id="OVALMYHEALTH">
</div>
</div>
<div class="one wide column">
Accuracy
<div class="ui inverted transparent input">
<input type="text" placeholder="93" id="OVALMYACC">
</div>
</div>
<div class="one wide column">
Defense
<div class="ui inverted transparent input">
<input type="text" placeholder="97" id="OVALMYDEF">
</div>
</div>
<div class="one wide column">
Melee
<div class="ui inverted transparent input">
<input type="text" placeholder="96" id="OVALMYMELEE">
</div>
</div>
<div class="one wide column">
Ranging
<div class="ui inverted transparent input">
<input type="text" placeholder="99" id="OVALMYRANGE">
</div>
</div>
<div class="one wide column">
Psychic
<div class="ui inverted transparent input">
<input type="text" placeholder="69" id="OVALMYPSY">
</div>
</div>
</div>
<div class="ui main text container" style="text-align:center; vertical-align:middle; min-height: 0;margin-top:20;margin-bottom:0;">
<h1 class="ui inverted header"><div class="ui inverted horizontal section divider">Player Armor/Weapon Stats</div></h1>
</div>
<div class="ui equal width centered grid" style="margin-top:-40px;">
<div class="one wide column" data-tooltip="Use M or R or P for Melee, Ranging, Psychic respectively" data-position="center">
Combat Style
<select class="ui inverted selection dropdown" id="OVALMYTYPE">
<option value="0">Melee</option>
<option value="1">Ranging</option>
<option value="2">Psychic</option>
</select>
</div>
<div class="one wide column" id="OVALMYSPELLDIV">
Spell
<select class="ui inverted selection dropdown" id="OVALMYSPELL">
<option>None</option>
<option>Lesser Earth</option>
<option>Lesser Water</option>
<option>Lesser Wind</option>
<option>Lesser Fire</option>
<option>Lesser Bind</option>
<option>Lesser Lightning</option>
<option>Greater Earth</option>
<option>Greater Water</option>
<option>Greater Wind</option>
<option>Greater Fire</option>
<option>Greater Bind</option>
<option>Greater Lightning</option>
<option>Lesser Lifesteal</option>
<option>Lesser Freeze</option>
<option>Greater Lifesteal</option>
<option>Greater Freeze</option>
</select>
</div>
<div class="one wide column">
Max Damage
<div class="ui inverted transparent input">
<input type="text" placeholder="89" id="OVALMYMAX">
</div>
</div>
<div class="one wide column">
Min Damage
<div class="ui inverted transparent input">
<input type="text" placeholder="51" id="OVALMYMIN">
</div>
</div>
<div class="one wide column" data-tooltip="Speed in ticks, if copying from your Character Stats, then multiply by 2" data-position="center">
Attack Speed
<div class="ui inverted transparent input">
<input type="text" placeholder="3" id="OVALMYSPEED">
</div>
</div>
<div class="one wide column">
Melee Defense
<div class="ui inverted transparent input">
<input type="text" placeholder="175" id="OVALMYMELEEDEF">
</div>
</div>
<div class="one wide column">
Ranging Defense
<div class="ui inverted transparent input">
<input type="text" placeholder="200" id="OVALMYRANGEDEF">
</div>
</div>
<div class="one wide column">
Psychic Defense
<div class="ui inverted transparent input">
<input type="text" placeholder="60" id="OVALMYPSYDEF">
</div>
</div>
<div class="one wide column">
Melee Accuracy
<div class="ui inverted transparent input">
<input type="text" placeholder="29" id="OVALMYMELEEACC">
</div>
</div>
<div class="one wide column">
Ranging Accuracy
<div class="ui inverted transparent input">
<input type="text" placeholder="-10" id="OVALMYRANGEACC">
</div>
</div>
<div class="one wide column">
Psychic Accuracy
<div class="ui inverted transparent input">
<input type="text" placeholder="-26" id="OVALMYPSYACC">
</div>
</div>
</div>
<div class="ui main text container" style="text-align:center; vertical-align:middle; min-height: 0;margin-top:20;margin-bottom:0;">
<h1 class="ui inverted header"><div class="ui inverted horizontal section divider">Healing Stats</div></h1>
</div>
<!-- Heal Stats -->
<div class="ui equal width centered grid" style="margin-top:-40px;">
<div class="one wide column">
Healing Preset
<select class="ui inverted selection dropdown" id="OVALMYHEALPRESET">
<option>Squid</option>
<option>Sturgeon</option>
<option>Tigerfish</option>
<option>Lg HP Pot</option>
<option>Barracuda</option>
<option>Crab</option>
<option>Lobster</option>
<option>Sm HP Pot</option>
<option>None</option>
</select>
</div>
<div class="one wide column" data-tooltip="How much does your food heal for? EX: Large HP Pots heal for 20, Squid heals for 24" data-position="center">
Healing Amount
<div class="ui inverted transparent input">
<input type="text" placeholder="24" id="OVALMYHEALAMT">
</div>
</div>
<div class="one wide column" data-tooltip="How much food are you bringing?" data-position="center">
Healing Quantity
<div class="ui inverted transparent input">
<input type="text" placeholder="28" id="OVALMYHEALQUANT">
</div>
</div>
</div>
</div>
<div class="ui main text container" style="text-align:center; vertical-align:middle; min-height: 0;margin-top:20;margin-bottom:0;">
<h1 class="ui inverted header"><div class="ui inverted horizontal section divider">Enemy Stats</div></h1>
</div>
<div class="ui equal width centered grid" style="margin-top:-40px;">
<div class="one wide column">
Enemy Preset
<select class="ui inverted selection dropdown" id="MILFMYPRESET">
<option hidden>Default (Jaime Goliver)</option>
<option value="0">Tikitama</option>
<option value="1">Jaime Goliver</option>
<option value="2">Zenitsu</option>
<option value="3">Jealous Witch</option>
<option value="4">Dead Eye Jones</option>
<option value="5">Demon Prince</option>
<option value="6">Cursed Yeti</option>
</select>
</div>
<div class="one wide column">
Enemy Combat Level
<div class="ui inverted transparent input">
<input type="text" placeholder="291" id="MILFMYCBTLVL">
</div>
</div>
<div class="one wide column" data-tooltip="Use M or R or P for Melee, Ranging, Psychic respectively" data-position="center">
Enemy Combat Style
<select class="ui inverted selection dropdown" id="MILFMYTYPE">
<option hidden>Ranging</option>
<option value="0">Melee</option>
<option value="1">Ranging</option>
<option value="2">Psychic</option>
</select>
</div>
<div class="one wide column">
Enemy Health
<div class="ui inverted transparent input">
<input type="text" placeholder="650" id="MILFMYHEALTH">
</div>
</div>
<div class="one wide column">
Enemy Max Damage
<div class="ui inverted transparent input">
<input type="text" placeholder="30" id="MILFMYMAX">
</div>
</div>
<div class="one wide column">
Enemy Attack Speed
<div class="ui inverted transparent input">
<input type="text" placeholder="4" id="MILFMYSPEED" data-tooltip="Speed in ticks, if your number is in seconds then multiply by 2." data-position="center">
</div>
</div>
<div class="one wide column">
Enemy Accuracy
<div class="ui inverted transparent input">
<input type="text" placeholder="155" id="MILFMYACC">
</div>
</div>
<div class="one wide column">
Enemy Defense
<div class="ui inverted transparent input">
<input type="text" placeholder="110" id="MILFMYDEF">
</div>
</div>
<div class="one wide column">
Enemy Melee
<div class="ui inverted transparent input">
<input type="text" placeholder="1" id="MILFMYMELEE">
</div>
</div>
<div class="one wide column">
Enemy Ranging
<div class="ui inverted transparent input">
<input type="text" placeholder="250" id="MILFMYRANGE">
</div>
</div>
<div class="one wide column">
Enemy Psychic
<div class="ui inverted transparent input">
<input type="text" placeholder="1" id="MILFMYPSY">
</div>
</div>
</div>
<div class="ui main text container" style="text-align:center; vertical-align:middle; min-height: 0;margin-top:20;margin-bottom:0;">
<h1 class="ui inverted header"><div class="ui inverted horizontal section divider">Punk Hazard Poison</div></h1>
</div>
<!-- toxic -->
<div class="ui equal width centered grid" style="margin-top:-40px;">
<div class="one wide column" data-tooltip="Use T if fighting on Punk Hazard without full Hazmat equipped, otherwise use F" data-position="center">
Punk Hazard
<select class="ui inverted selection dropdown" id="GOOBY">
<option hidden>F</option>
<option>T</option>
<option>F</option>
</select>
</div>
</div>
<div class="ui inverted horizontal section divider"><button class="ui inverted basic button" id="run" style="width: 100px;">Run</button></div>
<div class="ui centered grid" style="padding-left:50px;padding-right:50px;">
<div class="ui main text container" style="margin: 90 0 0 0;" data-tooltip="Use the top section to change the values above" data-inverted="" data-position="bottom center">
<textarea id="ovalgithubpull" name="ovalscript" style="height: 500px; width: 700px;margin-top:-50px; color: rgba(255,255,255,.9); background: #1b1c1d; text-align:center;resize: none;margin-left: -30px;background: rgb(0 0 0 / 8%);overflow-x: hidden;" readonly></textarea>
<script> $("#ovalgithubpull").load("https://raw.githubusercontent.com/iKrazy/OvalSite/main/assets/oval/OvalCombatCalculator.r"); </script>
</div>
<div class="ui main text container" style="margin: 90 0 0 0;" data-tooltip="It can take up to 20s to load" data-inverted="" data-position="bottom center">
<textarea id="code" name="ovaloutput" style="height: 500px; width: 700px; color: rgba(255,255,255,.9); background: #1b1c1d;margin-top:-50px; text-align:center;resize: none;padding-top:20px;background: rgb(0 0 0 / 8%);" readonly></textarea>
</div>
</div>
<div class="ui equal width centered grid" style="margin-top:-80px;">
<div class="ui main text container" style="margin: 90 0 0 0;" data-tooltip="Lower the number if your sim is getting killed" data-inverted="" data-position="bottom center">
<div class="one wide column">
Number of Iterations
<div class="ui inverted transparent input">
<select class="ui inverted selection dropdown" id="SIMCOUNT">
<option hidden>10000</option>
<option value="0">1</option>
<option value="1">5000</option>
<option value="2">7500</option>
<option value="3">10000</option>
</select>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- end of main body section -->
<!-- start of end footer section -->
<div id="footer"></div>
<!-- end of end footer section -->
</body>
<script>
// Install input filters.
setInputFilter(document.getElementById("OVALMYHEALTH"), function(value) {
return /^-?\d*$/.test(value); });
setInputFilter(document.getElementById("OVALMYACC"), function(value) {
return /^-?\d*$/.test(value); });
setInputFilter(document.getElementById("OVALMYDEF"), function(value) {
return /^-?\d*$/.test(value); });
setInputFilter(document.getElementById("OVALMYMELEE"), function(value) {
return /^-?\d*$/.test(value); });
setInputFilter(document.getElementById("OVALMYRANGE"), function(value) {
return /^-?\d*$/.test(value); });
setInputFilter(document.getElementById("OVALMYPSY"), function(value) {
return /^-?\d*$/.test(value); });
setInputFilter(document.getElementById("OVALMYMAX"), function(value) {
return /^-?\d*$/.test(value); });
setInputFilter(document.getElementById("OVALMYMIN"), function(value) {
return /^-?\d*$/.test(value); });
setInputFilter(document.getElementById("OVALMYSPEED"), function(value) {
return /^-?\d*$/.test(value); });
setInputFilter(document.getElementById("OVALMYMELEEDEF"), function(value) {
return /^-?\d*$/.test(value); });
setInputFilter(document.getElementById("OVALMYRANGEDEF"), function(value) {
return /^-?\d*$/.test(value); });
setInputFilter(document.getElementById("OVALMYPSYDEF"), function(value) {
return /^-?\d*$/.test(value); });
setInputFilter(document.getElementById("OVALMYMELEEACC"), function(value) {
return /^-?\d*$/.test(value); });
setInputFilter(document.getElementById("OVALMYRANGEACC"), function(value) {
return /^-?\d*$/.test(value); });
setInputFilter(document.getElementById("OVALMYPSYACC"), function(value) {
return /^-?\d*$/.test(value); });
setInputFilter(document.getElementById("OVALMYHEALAMT"), function(value) {
return /^-?\d*$/.test(value); });
setInputFilter(document.getElementById("OVALMYHEALQUANT"), function(value) {
return /^-?\d*$/.test(value); });
setInputFilter(document.getElementById("MILFMYCBTLVL"), function(value) {
return /^-?\d*$/.test(value); });
setInputFilter(document.getElementById("MILFMYHEALTH"), function(value) {
return /^-?\d*$/.test(value); });
setInputFilter(document.getElementById("MILFMYMAX"), function(value) {
return /^-?\d*$/.test(value); });
setInputFilter(document.getElementById("MILFMYSPEED"), function(value) {
return /^-?\d*$/.test(value); });
setInputFilter(document.getElementById("MILFMYACC"), function(value) {
return /^-?\d*$/.test(value); });
setInputFilter(document.getElementById("MILFMYDEF"), function(value) {
return /^-?\d*$/.test(value); });
setInputFilter(document.getElementById("MILFMYMELEE"), function(value) {
return /^-?\d*$/.test(value); });
setInputFilter(document.getElementById("MILFMYRANGE"), function(value) {
return /^-?\d*$/.test(value); });
setInputFilter(document.getElementById("MILFMYPSY"), function(value) {
return /^-?\d*$/.test(value); });
</script></html>