Files

53 lines
1.6 KiB
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.
# Grim2.js — main() (satır 30)
[← Grim2.js](index.md) · [← Master](../../wiki.md)
```javascript
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 && !isAcilCommand(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[Acil] 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[Acil] Zaten aktif bir yayilim var. Menuden Geri Cek yapabilir veya Acil reset yazabilirsin.");
return;
}
startFromText(c, p, text);
}
```