JappaWakka c0101a122a Replaced script steps thing with @script.delay
@Script.Delay(ScriptPath,DelayType,DelayValue)
Executes a script file after something happened (like having moved a certain amount of steps)

@Script.ClearDelay(ScriptPath,DelayType,DelayValue)
Clears the register created with @script.delay, preventing the script from being executed.

<script.delay(ReturnType)>
Returns a different thing depending on what you write for ReturnType:
"type" - returns what kind of trigger the script delay uses (only "steps" atm)
"script" - returns the script that will be executed after the delay ended
"value" - returns when the trigger ends, like how many steps are left for example
2023-10-30 13:28:30 +01:00

49 lines
2.4 KiB
VB.net

Namespace ScriptVersion2
Partial Class ScriptCommander
' --------------------------------------------------------------------------------------------------------------------------
' Contains the @script commands.
' --------------------------------------------------------------------------------------------------------------------------
Private Shared Sub DoScript(ByVal subClass As String)
Dim command As String = ScriptComparer.GetSubClassArgumentPair(subClass).Command
Dim argument As String = ScriptComparer.GetSubClassArgumentPair(subClass).Argument
If Core.CurrentScreen.Identification = Screen.Identifications.OverworldScreen Then
Select Case command.ToLower()
Case "start"
CType(Core.CurrentScreen, OverworldScreen).ActionScript.StartScript(argument, 0, True, False, "ScriptCommand")
Case "text"
CType(Core.CurrentScreen, OverworldScreen).ActionScript.StartScript(argument, 1, True, False, "ScriptCommand")
Case "run"
CType(Core.CurrentScreen, OverworldScreen).ActionScript.StartScript(argument, 2, True, False, "ScriptCommand")
Case "delay"
If argument.Contains(",") = True Then
ActionScript.UnregisterID("SCRIPTDELAY", "str")
ActionScript.UnregisterID("SCRIPTDELAY")
Core.Player.ScriptDelaySteps = 0
Dim args() As String = argument.Split(CChar(","))
Select Case args(1).ToLower
Case "steps"
Core.Player.ScriptDelaySteps = CInt(args(2))
End Select
ActionScript.RegisterID("SCRIPTDELAY", "str", CStr(args(1) & ";" & args(0)))
End If
IsReady = True
Case "cleardelay"
ActionScript.UnregisterID("SCRIPTDELAY", "str")
ActionScript.UnregisterID("SCRIPTDELAY")
Core.Player.ScriptDelaySteps = 0
IsReady = True
End Select
End If
IsReady = True
End Sub
End Class
End Namespace