1.6 KiB
1.6 KiB
Lal2.js — main() (satır 30)
function main(c) {
var p = getPlayer(c);
if (!p || !p.isPlayer()) return;
var msg = "";
try { msg = String(c.getValue("message") || ""); } catch (e) {}
if (msg.length > 0 && !isKaplaCommand(msg)) return;
try { if (msg.length > 0) c.cancel(); } catch (e1) {}
if (lower(p.getName()) !== lower(OWNER)) {
p.send("\u00a7cBu sistemi sadece " + OWNER + " kullanabilir.");
return;
}
var text = trim(removeCommand(msg));
if (text.length === 0) {
openMenu(c, p);
return;
}
if (lower(text) === "reset" || lower(text) === "temiz") {
mappet.set(STATE_KEY, "0");
mappet.set(PHASE_KEY, "idle");
mappet.set(PULL_KEY, "0");
p.send("\u00a7a[Kapla] Aktif yayilim loop'u durduruldu. Zaten degisen bloklar siradaki restore olmadan kalabilir.");
return;
}
if (lower(text) === "menu" || lower(text) === "ayar") {
openMenu(c, p);
return;
}
if (lower(text) === "geri" || lower(text) === "cek" || lower(text) === "\u00e7ek" || lower(text) === "cekk" || lower(text) === "geri cek" || lower(text) === "geri \u00e7ek") {
pullBackNow(c, p);
return;
}
if (String(mappet.get(STATE_KEY)) === "1") {
p.send("\u00a7c[Kapla] Zaten aktif bir yayilim var. Menuden Geri Cek yapabilir veya Kapla reset yazabilirsin.");
return;
}
startFromText(c, p, text);
}