-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCOTM-OldBackup.asl
128 lines (115 loc) · 4.74 KB
/
COTM-OldBackup.asl
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
//Bloodstained: Curse of the Moon autosplitter by CptBrian(it's my first, UPDATING AFTER ROTN'S AUTOSPLITTER IS DONE)
//This ASL is compatible with COTM versions 1.1.2 and 1.1.0(Unleashed crack)
//[LiveSplit] Run as administrator, or this can't read COTM's memory. This can be done by default through Properties -> Compatibility.
//[LiveSplit] Edit Layout: Add -> Control -> Scriptable Auto Splitter
//[LiveSplit] Layout Settings: Scriptable AutoSplitter -> Browse for this .asl file
//[LiveSplit] Layout Settings: Timer(tab) -> Timing Method: Game Time -> Splits(tab) -> Both 'Column' Sections -> Timing Method: Game Time
//[LiveSplit] OK -> Now make sure to right-click your splits -> Compare Against -> Game Time ... & remember to save your Layout/Splits!
//Required to have 8 Splits (one for each stage)
//You should be able to split manually if you really want to, it shouldn't double-split the same split as it reads split number, stage, etc..
state("COTM", "1.1.2")
{
uint ILframes : "COTM.exe", 0x00483660, 0x18;
uint IGTframes : "COTM.exe", 0x00483660, 0x8, 0x28;
byte Stage : "COTM.exe", 0x00483660, 0x8, 0x88;
byte Music : "COTM.exe", 0x0048365C, 0x2BC;
byte Character : "COTM.exe", 0x00483660, 0x8, 0x20; //Not currently in use.
}
state("COTM", "1.1.0")
{
uint ILframes : "COTM.exe", 0x004835D0, 0x18;
uint IGTframes : "COTM.exe", 0x004835D0, 0x8, 0x28;
byte Stage : "COTM.exe", 0x004835D0, 0x8, 0x88;
byte Music : "COTM.exe", 0x004835CC, 0x2BC;
byte Character : "COTM.exe", 0x004835D0, 0x8, 0x20; //Not currently in use.
}
init
{
//print("ModuleMemorySize: " + modules.First().ModuleMemorySize.ToString());
//Lets DebugView show me the ModuleMemorySize of the game executable, which is useless because they're the same between versions.
byte[] exeMD5HashBytes = new byte[0];
using (var md5 = System.Security.Cryptography.MD5.Create())
{
using (var s = File.Open(modules.First().FileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
{
exeMD5HashBytes = md5.ComputeHash(s);
}
}
var MD5Hash = exeMD5HashBytes.Select(x => x.ToString("X2")).Aggregate((a, b) => a + b);
//print("MD5Hash: " + MD5Hash.ToString()); //Lets DebugView show me the MD5Hash of the game executable, which is actually useful.
if(MD5Hash == "951389C953020FC7B5DEF32E7BED129A"){
version = "1.1.2";
}
else if(MD5Hash == "E1E439BD3FE89DE97BE08B15505837E2"){
version = "1.1.0";
}
else{
version = "1.1.2";
}
}
isLoading
{
return true;
}
start
{
return current.IGTframes == 0 && old.ILframes == 0 && current.ILframes > 0 && current.Stage == 1;
}
reset
{
if(timer.CurrentSplitIndex > 0 && timer.CurrentSplitIndex < 8 && current.Stage == 1 && current.IGTframes == 0 && current.ILframes == 0){
return true;
}
//Resets timer if player starts over at Stage 1, but they've already split at least once, but will not reset if the player finished a run and didn't save their splits.
else if(current.Stage == 10 && timer.CurrentSplitIndex < 8){
return true;
}
//Resets timer if player enters Boss Rush lobby, but only if they don't have all 8 splits completed(autosplitter starts up on Boss Rush Glutton Train)
return false;
}
gameTime
{
if(current.ILframes == old.ILframes && current.ILframes > 0){
return; //Fixes wrong times caused by IL not resetting immediately after its value is added to IGT.
}
else{
return TimeSpan.FromTicks((current.IGTframes + current.ILframes)*166666L); //16.6666 ms~=1 frame
}
}
update
{
}
split
{
if(current.Stage == 2 && current.IGTframes > 0 && current.ILframes == 0 && old.ILframes > 0 && timer.CurrentSplitIndex == 0){
return true;
}
if(current.Stage == 3 && current.IGTframes > 0 && current.ILframes == 0 && old.ILframes > 0 && timer.CurrentSplitIndex == 1){
return true;
}
if(current.Stage == 4 && current.IGTframes > 0 && current.ILframes == 0 && old.ILframes > 0 && timer.CurrentSplitIndex == 2){
return true;
}
if(current.Stage == 5 && current.IGTframes > 0 && current.ILframes == 0 && old.ILframes > 0 && timer.CurrentSplitIndex == 3){
return true;
}
if(current.Stage == 6 && current.IGTframes > 0 && current.ILframes == 0 && old.ILframes > 0 && timer.CurrentSplitIndex == 4){
return true;
}
if(current.Stage == 7 && current.IGTframes > 0 && current.ILframes == 0 && old.ILframes > 0 && timer.CurrentSplitIndex == 5){
return true;
}
if(current.Stage == 8 && current.IGTframes > 0 && current.ILframes == 0 && old.ILframes > 0 && timer.CurrentSplitIndex == 6){
return true;
}
if(current.Stage == 9 && current.IGTframes > 0 && current.ILframes == 0 && old.ILframes > 0 && timer.CurrentSplitIndex == 6){
return true;
}
if(current.Stage == 8 && current.Music == 8 && timer.CurrentSplitIndex == 7){
return true;
}
if(current.Stage == 9 && current.Music == 8 && timer.CurrentSplitIndex == 7){
return true;
}
return false;
}