//{} -> b_n, b_e, b_s, b_w, t_n, t_e, t_s, t_w public static void Builder(ushort[] b) { for (int i = 0; i < b.Length; i++) { ActionsBlocks.Init(b[i]); string condConstructor = ""; for (int c = 0; c < b.Length; c++) { condConstructor += Helpers.IDConvert2(b[c]); if (c != b.Length - 1) { condConstructor += ","; } } //Trigger 0------ ActionsBlocks.AddTrigger(b[i], 1); int k = i % 2 == 0 ? 1 : -1; ActionsBlocks.AddAction(b[i], 0, 1, b[i + k] + " 0 0 0"); //-> Action 0 int j = i / 4 <= 0.75 ? 4 : -4; int l = j == 4 ? 1 : -1; ActionsBlocks.AddAction(b[i], 0, 1, b[i + k + j] + " 0 " + l + " 0 0," + condConstructor); //-> Action 1 //----------------- //Trigger 1------ ActionsBlocks.AddTrigger(b[i], 3); int p = i / 4 <= 0.75 ? 1 : -1; ActionsBlocks.AddAction(b[i], 1, 1, "0 0 " + p + " 0 " + condConstructor); //-> Action 1 //----------------- } }
public void Execute(Player p, string[] args) { if (p.Rank < CmdsPermissions.get(5)) { p.SendMessage("You don't have the permission to use this command."); return; } try { ushort ID = 0; if (args.Length > 2) { ID = Helpers.IDConvert(ushort.Parse(args[2])); } switch (args[1]) { case "create": ActionsBlocks.Init(ID); break; case "remove": ActionsBlocks.Remove(ID); break; case "addtrigger": ActionsBlocks.AddTrigger(ID, byte.Parse(args[3])); break; case "removetrigger": ActionsBlocks.RemoveTrigger(ID, int.Parse(args[3])); break; case "removeaction": ActionsBlocks.RemoveAction(ID, int.Parse(args[3]), int.Parse(args[4])); break; case "addaction": string strArg = ""; for (int i = 5; i < args.Length; i++) { strArg += args[i] + " "; } ActionsBlocks.AddAction(ID, int.Parse(args[3]), byte.Parse(args[4]), strArg); break; case "list": Helpers.SendTextBlockToPlayer(p, ActionsBlocks.getList(p)); break; case "actionslist": Helpers.SendTextBlockToPlayer(p, ActionsBlocks.getActionsList(p, ID)); break; case "door": ushort[] tempD = new ushort[8]; int iincr = 0; for (int i = 2; i <= 9; i++) { tempD[iincr++] = Helpers.IDConvert(ushort.Parse(args[i])); } ActionBlocks.Door.Builder(tempD); break; default: help(p); break; } } catch { help(p); } }