Hello! This is my first time posting, so please forgive me if this is a dumb question. I'm trying to cade an autosplitter for use in Livesplit. (I've edited other autosplitters in the past, but this is the first I've tried to do one closer to from scratch) After saving it and trying to run it however, I get this error on the Event Viewer.
" 'init' method compilation errors:
Line 149, Col 3: error CS1026: ) expected
Line 149, Col 3: error CS1002: ; expected
at LiveSplit.ASL.ASLMethod..ctor(String code, String name, Int32 script_line)
at LiveSplit.ASL.ASLParser.Parse(String code)
at LiveSplit.UI.Components.ASLComponent.LoadScript()
at LiveSplit.UI.Components.ASLComponent.UpdateScript() "
The line it's referring to is the second to last curly brace at the bottom, I'm not sure exactly what I'm doing wrong, but any help would be super appreciated!
" 'init' method compilation errors:
Line 149, Col 3: error CS1026: ) expected
Line 149, Col 3: error CS1002: ; expected
at LiveSplit.ASL.ASLMethod..ctor(String code, String name, Int32 script_line)
at LiveSplit.ASL.ASLParser.Parse(String code)
at LiveSplit.UI.Components.ASLComponent.LoadScript()
at LiveSplit.UI.Components.ASLComponent.UpdateScript() "
The line it's referring to is the second to last curly brace at the bottom, I'm not sure exactly what I'm doing wrong, but any help would be super appreciated!
C#:
init
{
vars.basePointer = IntPtr.Zero; // Emulator virtual memory base pointer
settings.SplitEnabled;
settings.StartEnabled;
settings.ResetEnabled;
// Update split status
vars.UpdateSplit = (Func<string, bool>)((split) => {
if (!vars.splits[split])
{
vars.LogSplit(split);
vars.splits[split] = true;
return settings[split];
}
else
return false;
});
// Sets memory pointers
vars.UpdatePointers = (Action) (() => {
// SLUS_208.60 [PS2] [NTSC-U] Nightmare Before Christmas Oogie's Revenge
vars.chapterTimePtr = 0x00414B40;
vars.timePtr = 0x00414B48;
vars.chapterPtr = 0x004F2614;
vars.healthPtr = 0x004A6BFC;
vars.bosshpPtr = 0x004A93B8;
// pcsx2
vars.basePointer = 0x20000000;
break;
});
// Updates game values
vars.UpdateValues = (Action) (() => {
uint chapterTime = 0; // Chapter Timer
uint time = 0; // In Game Timer
ushort chapter = 0; // Chapter ID
byte health = 0; // Character health
ushort bosshp = 0; // bosshp
memory.ReadValue<uint>(new IntPtr(vars.basePointer + vars.chapterTimePtr), out chapterTime);
memory.ReadValue<uint>(new IntPtr(vars.basePointer + vars.timePtr), out time);
memory.ReadValue<ushort>(new IntPtr(vars.basePointer + vars.chapterPtr), out chapter);
memory.ReadValue<byte>(new IntPtr(vars.basePointer + vars.healthPtr), out health);
memory.ReadValue<ushort>(new IntPtr(vars.basePointer + vars.bosshpPtr), out bosshp);
current.chapterTime= chapterTime;
current.time = time;
current.chapter = chapter;
current.health = health;
current.bosshp = bosshp;
// Initialise values
vars.UpdatePointer();
vars.UpdateValues();
}
}