JavaScript: Sending multiple commands at once
Posted: 06 Oct 2018 16:46
So I'm trying to make an herbing script for the web client, and I need it to send multiple commands at the same time. Right now my code looks something like this:
gwc.connection.send("disembark");
if (gwc.gmcp.data.room.id == "6fTEU.") {
gwc.connection.send("n");
gwc.connection.send("n");
gwc.connection.send("search here for herbs");
}
In Mudlet, all I'd have to do is use "sendAll". Is there any way I can condense potentially hundreds of commands into one line of JS?
gwc.connection.send("disembark");
if (gwc.gmcp.data.room.id == "6fTEU.") {
gwc.connection.send("n");
gwc.connection.send("n");
gwc.connection.send("search here for herbs");
}
In Mudlet, all I'd have to do is use "sendAll". Is there any way I can condense potentially hundreds of commands into one line of JS?