Files

28 lines
779 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 3NPC.js — loop() (satır 488)
[← 3NPC.js](index.md) · [← Master](../../wiki.md)
```javascript
function loop(ctx)
{
mappet.set("nano_loop_running", false);
var bringActive = mappet.get("nano_bring_active");
var koruActive = mappet.get("nano_koru_active");
if (!bringActive && !koruActive) return;
var soldiers = getSoldiers(ctx);
if (soldiers.size() === 0) return;
if (bringActive) handleBring(ctx, soldiers);
if (koruActive) {
var cName = mappet.get("nano_koru_commander");
var koruCommander = ctx.getServer().getPlayer(cName);
if (koruCommander) handleKoru(ctx, soldiers, koruCommander);
else mappet.set("nano_koru_active", false);
}
startLoop(ctx);
}
```