Files

35 lines
898 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.
# NPC.js — loop() (satır 534)
[← NPC.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 {
// Komutan oyunda degilse korumayi kapat
mappet.set("nano_koru_active", false);
}
}
startLoop(ctx);
}
```