Hallo,
ich bastel an einem String, dass meine Planeten reaktivieren kann.
Und händisch kann ich natürlich den String zu ActivateBuiliding(Position As String, Status As Boolean) eingeben,
aber ich hätte es gern automatisch.
Der Compiler ist mit meiner Ausführung zufrieden,
aber die Ausführung erzeugt leider einen BlueScreen, der meiner Lesweise nach etwas mit dem String zu tun hat.
Kann mir jemand einen Verbesserungvorschlag machen? Danke.
Die Fehlermeldung dazu:Code:#UseInterface Web; Var Kolo1 As New CMyColony(XXXXX); //Kolonie eintragen //unveränderliche Variablen Var ScriptName As String = "PlanetOn"; Var form As New CHtmlForm(New CScriptUrl()); Var tab As New CTable(2); Var row As CTableRow = tab.AddRow(); Var Action As CBaseColonyManager; Var IntA As Integer = 0; Var IntB As Integer = 0; Var KoloPos As String; form.Add(tab); While(IntAB < 70) { KoloPos = CStr(IntA) + '|' + CStr(IntB); If(Kolo1.StockRoom.Amount(EGoodsType.Deuterium > 100)) { Kolo1.Action.ActivateBuilding(KoloPos, True); row = tab.AddRow(); row.Cells.Item(0).Add('Gebäude aktiviert.'); row.Cells.Item(1).Add(KoloPos); } IntB = IntB + 1; If(IntB = 10){IntB = 0; IntA = IntA + 1;} IntAB = (IntA * 10) + IntB; } Response.Add(form);
Das Script hat einen Laufzeitfehler verursacht. Zeile: 21, Spalte: 5, Token: 'Kolo1', Script: 'PlanetOn'
[IndexOutOfRangeException: Index was outside the bounds of the array.]
at stne.TPlanetMap.get_Item(Int32 x, Int32 y) in d:\source\dragon\dev1\projects\stne\game\Core\MapL ib.cs:line 284
at stne.ScriptTypes.CBaseColonyManager.GetFieldID(Str ing Position) in d:\source\dragon\dev1\projects\stne\game\Scripting \Objects.cs:line 2422
at stne.ScriptTypes.CBaseColonyManager.ActivateBuildi ng(String Position, Boolean Status) in d:\source\dragon\dev1\projects\stne\game\Scripting \Objects.cs:line 2428
[TargetInvocationException: Exception has been thrown by the target of an invocation.]
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeIn ternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at larne.Scripting.Legacy.TScriptObjectMemberNative.G etValueInternal(TLarneScriptContext Context, Object obj, Object[] Index) in d:\source\dragon\dev1\projects\shared\larne.script ing\legacy\Script.cs:line 2671
at larne.Scripting.Legacy.TScriptObjectMemberNative.G etValue(TLarneScriptContext Context, TCodeExpressionObjectMember CallExp, Object obj, Object[] Index) in d:\source\dragon\dev1\projects\shared\larne.script ing\legacy\Script.cs:line 2660
at larne.Scripting.Legacy.Expressions.TCodeExpression ObjectMember.Get(TLarneScriptContext Context) in d:\source\dragon\dev1\projects\shared\larne.script ing\legacy\ScriptExpressions.cs:line 376
at larne.Scripting.Legacy.Commands.TCodeCommandExpres sionCall.Process(TLarneScriptContext Context) in d:\source\dragon\dev1\projects\shared\larne.script ing\legacy\ScriptCommands.cs:line 80
at larne.Scripting.Legacy.TLarneScriptContext.Execute Internal() in d:\source\dragon\dev1\projects\shared\larne.script ing\legacy\Script.cs:line 1198
[Exception: Das Script hat einen Laufzeitfehler verursacht. Zeile: 21, Spalte: 5, Token: 'Kolo1', Script: 'PlanetOn']
at larne.Scripting.Legacy.TLarneScriptContext.Execute Internal() in d:\source\dragon\dev1\projects\shared\larne.script ing\legacy\Script.cs:line 1213
at larne.Scripting.Legacy.TLarneScriptContext.Execute (Int32 StartLine) in d:\source\dragon\dev1\projects\shared\larne.script ing\legacy\Script.cs:line 1250
at larne.Scripting.Legacy.TLarneScriptContext.Execute () in d:\source\dragon\dev1\projects\shared\larne.script ing\legacy\Script.cs:line 1285
at stne.TLarneScript.ExecuteInternal() in d:\source\dragon\dev1\projects\stne\game\Core\Temp 3.cs:line 600
at stne.TLarneScript.ExecuteInQueue() in d:\source\dragon\dev1\projects\stne\game\Core\Temp 3.cs:line 549
at stne.wf_ScriptEdit.act_SaveSource(Boolean IsConfigSource) in d:\source\dragon\dev1\projects\stne\game\WebForms\ ScriptEdit.cs:line 864
at stne.wf_ScriptEdit.ExecuteAction() in d:\source\dragon\dev1\projects\stne\game\WebForms\ ScriptEdit.cs:line 117
at stne.TstneBasePage.CallExecuteAction() in d:\source\dragon\dev1\projects\stne\game\Core\WebC ontrols.cs:line 229
at stne.TstneGamePage.CallExecuteAction() in d:\source\dragon\dev1\projects\stne\game\Core\WebC ontrols.cs:line 1061
at stne.wf_ScriptEdit.Run() in d:\source\dragon\dev1\projects\stne\game\WebForms\ ScriptEdit.cs:line 98
at stne.wf_Game.Page_Load(Object sender, EventArgs e) in d:\source\dragon\dev1\projects\stne\game\Game.aspx .cs:line 142
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Assembly: larne.scripting.dll
Time: 07.03.2017 13:34:33
Server: DE3
User-ID: 32018
STNE-Version: 1.0.74.1559
Compiled at: 06.02.2017 19:44:52
Compiled from: Dragon