Selamlar, bugün sizlere geliştirmiş olduğum asistan skriptimi tanıtacağım.
• NEDİR BU ASİSTAN SKRİPTİ? •
➳ Asistan sistemi, başlıkta da belirttiğim üzere kendi destek ekibinizi yaratmanıza yarayan bir sistem. Aslında mantık olarak bir rehberin cevap vermesi gereken şeylere cevap veren bir bot da diyebiliriz.
➳ Peki nasıl çalışıyor bu sistem?
Aslında rehberlerinizin yaptığı gibi mesajların içinde geçen anahtar kelimeleri seçerek onlara cevap veriyor.
➳ "Nasıl yani?" dediğinizi duyar gibiyim...
Şöyle açıklayayım; önceden belirlenen anahtar kelimeleri içeren bir mesaj gönderilirse o anahtar kelimelere uygun ve yine önceden belirlenen cevabı oyuncuya mesaj olarak gönderen bir sistemdir.
➳ Örneğin; anahtar kelimelerimiz "ench" ve "nere" olsun. Cevabımız da "Ench'e gitmek için /warp ench yazabilirsiniz." olsun. Oyuncu sohbete "Acaba ench nerede" yazarsa anahtar kelimelerimizin tamamını içerdiği için cevap oyuncuya mesaj olarak gidecek.
➳ NOT: Eğer sohbete gönderilen mesajlar tüm anahtar kelimeleri içermiyorsa cevap gönderilmez.
• PEKİ NASIL AYARLAYACAĞIZ BUNCA ŞEYİ? •
➳ Kulağa garip gelse de, skripti kullanmak için yapmanız gereken tek şey; skripti "plugins/Skript/scripts" klasörüne attıktan sonra reload çekmek ve ardından /asistan komutu girmek. :)
➳ Sohbete gelen bilgi mesajlarını ve prefix'i ayarlamak içinse skripti çalıştırdıktan sonra "plugins/Asistan/Ayarlar.yml" konumuna girip dilediğiniz ayarları yapmak. :)
➳ Otomatik cevapları ve anahtar kelimeleri oyun içinden ya da "plugins/Asistan/Mesajlar.yml" konumundan düzenleyebilirsiniz.
➳ NOT: Eğer cevapları yaml dosyasından ayarlarsanız yine yaml dosyası içindeki "cevapsayi" kısmına kaç tane cevap olduğunu girmeyi unutmayın!
• BUNCA VERİYİ NASIL DATABASE'E YEDEKLEYECEĞİZ? •
➳ Tüm cevaplar yaml dosyasına kayıt ediliyor ve skript her load edildiğinde tekrardan yükleniyor. Bu yüzden herhangi bir database kullanmanıza gerek yok. :)
• NASIL KURACAĞIZ? •
➳ Skripti sadece normal şekilde kurup reload atın, ardından plugins klasörünüzün içine "Asistan" isimli bir dosya açılacak. Tüm ayarlamaları buradan yapabilirsiniz. Skript içinde hiçbir şeyi değiştirmenize gerek yoktur.
• EE YOK MU FOTOĞRAF VİDEO BİR ŞEY? •
➳ Buyrun o zaman iyi seyirler. :)
• GEREKLİ ADDONLAR •
➳ TuSKe
➳ Skript-Yaml
• DİPNOT •
➳ Tavsiye ettiğim skript versiyonu: 2.2
➳ LÜTFEN İZİNSİZ PAYLAŞMAYINIZ!
Kod:
on load:
delete {cevap::*}
delete {anahtar::*}
load yaml "plugins/Asistan/ayarlar.yml" as "ayar"
if yaml "ayar" is empty:
set yaml value "prefix" from "ayar" to "&8[&6Asistan&8] »&f"
set yaml value "yetki" from "ayar" to "sk.admin"
set yaml value "yetkiyok" from "ayar" to "Bunun için yetkin yok!"
set yaml value "silindi" from "ayar" to "Seçilen cevap başarıyla silindi!"
set yaml value "anahtarkelime" from "ayar" to "Lütfen anahtar kelimeler girin. Ekleme işiniz bittiğinde &c""bitir"" &fyazın."
set yaml value "cevap" from "ayar" to "Lütfen bir cevap girin. Eğer vazgeçerseniz &c""iptal"" &fyazın."
set yaml value "iptal" from "ayar" to "İşlem iptal edildi."
set yaml value "basarili" from "ayar" to "İşlem başarıyla tamamlandı."
set yaml value "hata" from "ayar" to "Bilinmeyen bir hata oluştu, lütfen tekrar deneyin."
set yaml value "eklendi" from "ayar" to "Anahtar kelime eklendi."
set yaml value "bulunamadi" from "ayar" to "Aradığınız cevap bulunamadı."
set yaml value "maksimum" from "ayar" to "En fazla 45 cevap ekleyebilirsiniz."
save yaml "ayar"
set {prefix} to yaml value "prefix" from "ayar"
set {yetki} to yaml value "yetki" from "ayar"
set {yetkinyok} to yaml value "yetkinyok" from "ayar"
set {silindi} to yaml value "silindi" from "ayar"
set {anahtarkelime} to yaml value "anahtarkelime" from "ayar"
set {cevap} to yaml value "cevap" from "ayar"
set {iptal} to yaml value "iptal" from "ayar"
set {basarili} to yaml value "basarili" from "ayar"
set {hata} to yaml value "hata" from "ayar"
set {eklendi} to yaml value "eklendi" from "ayar"
set {bulunamadi} to yaml value "bulunamadi" from "ayar"
set {max} to yaml value "maksimum" from "ayar"
load yaml "plugins/Asistan/mesajlar.yml" as "mesaj"
if yaml "mesaj" is empty:
set yaml value "cevapsayi" from "mesaj" to 0
save yaml "mesaj"
set {cevaplar} to yaml value "cevapsayi" from "mesaj"
if yaml "mesaj" isn't empty:
set {_a} to 0
loop {cevaplar} times:
add 1 to {_a}
set {cevap::%{_a}%} to yaml value "%{_a}%" from "mesaj"
set {anahtar::%{_a}%::*} to yaml list "anahtar%{_a}%" from "mesaj"
function check(p: player, n: number, m: text):
set {_z} to 0
loop {anahtar::%{_n}%::*}:
add 1 to {_z}
if {anahtar::%{_n}%::%{_z}%} isn't "<none>":
add 1 to {kelime1::%{_p}%::%{_n}%}
if "%{_m}%" contains "%{anahtar::%{_n}%::%{_z}%}%":
add 1 to {kelime2::%{_p}%::%{_n}%}
function cevapekle(p: player, t: text):
if {asistan::%{_p}%::ekle} is 1:
set {asistan::%{_p}%::cevap} to {_t}
send "%{prefix}% %{anahtarkelime}%" to {_p}
set {asistan::%{_p}%::ekle} to 2
stop
if {asistan::%{_p}%::ekle} is 2:
add {_t} to {asistan::%{_p}%::anahtar::*}
send "%{prefix}% %{eklendi}%" to {_p}
stop
function checknumber(p: player):
set {_z} to 0
loop {cevaplar} times:
add 1 to {_z}
if {cevap::%{_z}%} isn't set:
set {asistan::%{_p}%::cevapno} to {_z}
stop
function cevapbitir(p: player):
add 1 to {cevaplar}
set yaml value "cevapsayi" from "mesaj" to {cevaplar}
checknumber({_p})
set {cevap::%{asistan::%{_p}%::cevapno}%} to "%{asistan::%{_p}%::cevap}%"
set yaml value "%{asistan::%{_p}%::cevapno}%" from "mesaj" to "%{cevap::%{asistan::%{_p}%::cevapno}%}%"
loop {asistan::%{_p}%::anahtar::*}:
add "%loop-value%" to {anahtar::%{asistan::%{_p}%::cevapno}%::*}
add "%loop-value%" to yaml list "anahtar%{asistan::%{_p}%::cevapno}%" from "mesaj"
save yaml "mesaj"
send "%{prefix}% %{basarili}% (Cevap no: %{asistan::%{_p}%::cevapno}%)" to {_p}
delete {asistan::%{_p}%::*}
if {gui::%{_p}%} is set:
delete {gui::%{_p}%}
execute {_p} command "asistan"
stop
on chat:
set {kelime1::%player%::*} to 0
set {kelime2::%player%::*} to 0
set {_z} to 0
set {_x} to 0
loop {cevaplar} times:
add 1 to {_x}
check(player, {_x}, "%message%")
if {kelime1::%player%::%{_x}%} = {kelime2::%player%::%{_x}%}:
wait 0.5 seconds
send "%{prefix}% %{cevap::%{_x}%}%"
stop
if {asistan::%player%::ekle} is set:
cancel event
if message is "iptal":
delete {asistan::%player%::*}
send "%{prefix}% %{iptal}%"
stop
if message is "bitir":
if {asistan::%player%::ekle} is 2:
if size of {asistan::%player%::anahtar::*} > 0:
cevapbitir(player)
else:
delete {asistan::%player%::*}
send "%{prefix}% %{hata}%"
else:
delete {asistan::%player%::*}
send "%{prefix}% %{hata}%"
else:
cevapekle(player, "%message%")
command /asistan [<text>] [<text>] [<integer>]:
trigger:
if player have the permission "%{yetki}%":
if arg-1 and arg-2 and arg-3 isn't set:
create a gui with virtual chest with 6 rows named "&l» ASISTAN":
delete {asistan::%player%::gui}
make gui integers from 0 to 44 with black stained glass pane named "&8"
make gui integers from 45 to 53 with red stained glass pane named "&8"
make gui 53 with barrier named "&c&lKAPAT":
close player's inventory view
stop
make gui 52 with green wool block named "&a&lCEVAP EKLE":
close player's inventory view
set {gui::%player%} to 1
execute player command "asistan cevap ekle"
stop
set {_z} to -1
set {_x} to 0
loop {cevaplar} times:
add 1 to {_z}
add 1 to {_x}
set {asistan::%player%::%{_z}%} to {_x}
make gui {_z} with book named "&f&lCEVAP ##%{_x}%" with lore "||&f&l» Cevap:||&c %{cevap::%{_x}%}%||&6||&f&l» Anahtarlar:||&c %{anahtar::%{_x}%::*}%||&6||&4» Silmek için tıklayın!":
close player's inventory view
wait 1 tick
execute player command "asistan gui sil %{asistan::%player%::%{_z}%}%"
stop
open last gui to player
if arg-1 is "gui":
if arg-2 is "sil":
if arg-3 is set:
set {asistan1::%player%} to arg-3
create a gui with virtual chest with 5 rows named "&l» ASISTAN » SIL":
make gui integers from 0 to 44 with black stained glass pane named "&8"
make gui 13 with book named "&f&lCEVAP ##%arg-3%" with lore "||&f&l» Cevap:||&c %{cevap::%arg-3%}%||&6||&f&l» Anahtarlar:||&c %{anahtar::%arg-3%::*}%"
make gui 12 with red stained glass pane named "&c&lSIL":
close player's inventory view
wait 1 tick
execute player command "asistan cevap sil %{asistan1::%player%}%"
execute player command "asistan"
make gui 14 with green stained glass pane named "&a&lGERI DON":
close player's inventory view
wait 1 tick
execute player command "asistan"
make gui 31 with barrier named "&c&lKAPAT":
close player's inventory view
stop
open last gui to player
if arg-1 is "cevap":
if arg-2 is "ekle":
if {cevaplar} < 45:
set {asistan::%player%::ekle} to 1
send "%{prefix}% %{cevap}%"
else:
send "%{prefix}% %{max}%"
if arg-2 is "sil":
if arg-3 is set:
if {cevap::%arg-3%} is set:
delete {cevap::%arg-3%}
delete {anahtar::%arg-3%::*}
delete yaml value "%arg-3%" from "mesaj"
delete yaml list "anahtar%arg-3%" from "mesaj"
set {_x} to arg-3
set {_y} to 0
loop {cevaplar} times:
add 1 to {_y}
if {_y} >= {_x}:
set {_z} to ({_y} + 1)
if {cevap::%{_z}%} is set:
set {cevap::%{_y}%} to "%{cevap::%{_z}%}%"
set yaml value "%{_y}%" from "mesaj" to "%{cevap::%{_y}%}%"
delete {cevap::%{_z}%}
delete yaml value "%{_z}%" from "mesaj"
set {_d} to 0
loop {anahtar::%{_z}%::*}:
add 1 to {_d}
add {anahtar::%{_z}%::%{_d}%} to {anahtar::%{_y}%::*}
add {anahtar::%{_z}%::%{_d}%} to yaml list "anahtar%{_y}%" from "mesaj"
delete {anahtar::%{_z}%::*}
delete yaml list "anahtar%{_z}%" from "mesaj"
remove 1 from {cevaplar}
set yaml value "cevapsayi" from "mesaj" to {cevaplar}
send "%{prefix}% %{silindi}% (%arg-3%)"
save yaml "mesaj"
stop
else:
send "%{prefix}% %{bulunamadi}%"
stop
else:
send "%{prefix}% /asistan cevap sil <cevap no>"
stop
else:
send "%{prefix}% %{yetkinyok}%"
stop
on join:
delete {asistan::%player%::*}
delete {asistan1::%player%::*}