mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-28 07:56:20 -04:00
Cleanup /help botai, add /botai info.
This commit is contained in:
parent
10dea0a6be
commit
9c0a08f084
@ -35,7 +35,6 @@ namespace MCGalaxy.Commands
|
|||||||
if (who == null) { Player.SendMessage(p, "There is no bot " + message + "!"); return; }
|
if (who == null) { Player.SendMessage(p, "There is no bot " + message + "!"); return; }
|
||||||
if (p.level != who.level) { Player.SendMessage(p, who.name + " is in a different level."); return; }
|
if (p.level != who.level) { Player.SendMessage(p, who.name + " is in a different level."); return; }
|
||||||
who.SetPos(p.pos[0], p.pos[1], p.pos[2], p.rot[0], 0);
|
who.SetPos(p.pos[0], p.pos[1], p.pos[2], p.rot[0], 0);
|
||||||
//who.SendMessage("You were summoned by " + p.color + p.name + "&e.");
|
|
||||||
}
|
}
|
||||||
public override void Help(Player p)
|
public override void Help(Player p)
|
||||||
{
|
{
|
||||||
|
@ -47,6 +47,9 @@ namespace MCGalaxy.Commands
|
|||||||
case "del":
|
case "del":
|
||||||
HandleDelete(p, ai, args);
|
HandleDelete(p, ai, args);
|
||||||
break;
|
break;
|
||||||
|
case "info":
|
||||||
|
HandleInfo(p, ai);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
Help(p);
|
Help(p);
|
||||||
return;
|
return;
|
||||||
@ -77,7 +80,7 @@ namespace MCGalaxy.Commands
|
|||||||
}
|
}
|
||||||
|
|
||||||
File.WriteAllLines("bots/" + ai, outLines);
|
File.WriteAllLines("bots/" + ai, outLines);
|
||||||
Player.SendMessage(p, "Deleted the last waypoint from " + ai);
|
Player.SendMessage(p, "Deleted the last instruction from " + ai);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
Help(p); return;
|
Help(p); return;
|
||||||
@ -156,13 +159,28 @@ namespace MCGalaxy.Commands
|
|||||||
catch { Player.SendMessage(p, "Invalid parameter"); }
|
catch { Player.SendMessage(p, "Invalid parameter"); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void HandleInfo(Player p, string ai) {
|
||||||
|
if (!File.Exists("bots/" + ai)) {
|
||||||
|
Player.SendMessage(p, "There is no bot AI with that name."); return;
|
||||||
|
}
|
||||||
|
string[] lines = File.ReadAllLines("bots/" + ai);
|
||||||
|
foreach (string l in lines) {
|
||||||
|
if (l.Length == 0 || l[0] == '#') continue;
|
||||||
|
Player.SendMessage(p, l);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public override void Help(Player p) {
|
public override void Help(Player p) {
|
||||||
Player.SendMessage(p, "/botai <add/del> [AI name] <extra> - Adds or deletes [AI name]");
|
Player.SendMessage(p, "%T/botai del [name] %H- deletes that AI");
|
||||||
Player.SendMessage(p, "Extras: walk, teleport, wait, nod, speed, spin, reset, remove, reverse, linkscript, jump");
|
Player.SendMessage(p, "%T/botai del [name] last%H- deletes last instruction of that AI");
|
||||||
Player.SendMessage(p, "wait, nod and spin can have an extra '0.1 seconds' parameter");
|
Player.SendMessage(p, "%T/botai info [name] %H- prints list of instructions that AI has");
|
||||||
Player.SendMessage(p, "nod and spin can also take a 'third' speed parameter");
|
Player.SendMessage(p, "%T/botai add [name] [instruction] <args>");
|
||||||
Player.SendMessage(p, "speed sets a percentage of normal speed");
|
Player.SendMessage(p, "%HInstructions: %Swalk, teleport, wait, nod, speed, " +
|
||||||
Player.SendMessage(p, "linkscript takes a script name as parameter");
|
"spin, reset, remove, reverse, linkscript, jump");
|
||||||
|
Player.SendMessage(p, "%Hwait, nod, spin %S- optional arg specifies '0.1 seconds'");
|
||||||
|
Player.SendMessage(p, "%Hnod, spin %S- optional second arg specifies 'speed'");
|
||||||
|
Player.SendMessage(p, "%Hspeed %S- arg specifies percentage of normal speed");
|
||||||
|
Player.SendMessage(p, "%Hlinkscript %S- arg specifies another AI name");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user