×

Langue

Fermer
Atelier 801
  • Forums
  • Dev Tracker
  • Connexion
    • English Français
      Português do Brasil Español
      Türkçe Polski
      Magyar Română
      العربية Skandinavisk
      Nederlands Deutsch
      Bahasa Indonesia Русский
      中文 Filipino
      Lietuvių kalba 日本語
      Suomi עברית
      Italiano Česky
      Hrvatski Slovensky
      Български Latviešu
      Estonian
  • Langue
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • Lua Kodları Tartışma & Yardımlaşma Başlığı
« ‹ 10 / 388 › »
Lua Kodları Tartışma & Yardımlaşma Başlığı
Fatihmilano
« Citoyen »
1392919680000
    • Fatihmilano#0000
    • Profil
    • Derniers messages
    • Tribu
#181
  1
Oyga a dit :
Tonumber oldu demek hmm...

Yeni bir şey ekledim, basit şimdi eklediklerim, yine gereksiz ama boş boş duracağıma yapayım dedim.
a dit :
time=0

addText = ui.addTextArea

function ui.addTextArea(i, m, n, x, y, w, h, c1, c2, o, f, ce)
if ce then
x = x - w / 2
y = y - h / 2
end
addText(i, m, n, x, y, w, h, c1, c2, o, f)
end
function eventLoop()
if stop then return end
ui.addTextArea(2,"<p align='center'><font face='System'><J>Bu script <VP>Transforcips <J>ve <VP>Oyga <J>tarafından yapılmıştır!</font></p>",nil,400,100,400,50,1,1,1,true,true)
ui.addTextArea(1,"<p align='center'><b><font color='#FFEE00' size='50'> <font face='Comic Sans MS'><p align='center'><b>"..time.."</b></p></font><br><TI><font face='Comic Sans MS'><a href='event:stop'>[Durdur]</a> <a href='event:start'>[Devam et]</a> <a href='event:basadon'>[Başa dön]</a></font>",nil,400,200,400,200,1,1,1,true,true)
time=time+1
end
function eventTextAreaCallback(id,name,cb)
if cb=="stop" then
stop = true
end
if cb=="start" then
stop = false
end
if cb=="basadon" then
time=0
stop = false
end
end

function eventChatCommand(player,command)
if command=="sayaç" then
ui.addPopup(1,2,"Sayacı kontrol et!",nil,-6,20,nil,true)
end
if command=="sayaç-" then
ui.addPopup(2,2,"Bir sayı yaz!",nil,-6,20,nil,true)
end
if command=="sayaç+" then
ui.addPopup(3,2,"Bir sayı yaz!",nil,-6,20,nil,true)
end
end

function eventPopupAnswer(id,player,answer)
if id == 1 then
time=tonumber(answer) or time
end
if id == 2 then
time=time-tonumber(answer) or time
stop = false
end
if id == 3 then
time=time+tonumber(answer) or time
stop = false
end
end

!sayaç+: Sayaca belirlenen sayıyı ekler.
!sayaç-: Sayaçtan belirlenen sayıyı çıkartır.
!sayaç: Sayacın süresini belirler.

Bence birazcık daha geliştirdikten sonra bir konu aç.
Oyga
« Citoyen »
1392919800000
    • Oyga#0000
    • Profil
    • Derniers messages
    • Tribu
#182
  0
Fatihmilano a dit :
Yeni bir şey ekledim, basit şimdi eklediklerim, yine gereksiz ama boş boş duracağıma yapayım dedim.

!sayaç+ Sayaca belirlenen sayıyı ekler.
!sayaç- Sayaçtan belirlenen sayıyı çıkartır.
!sayaç Sayacın süresini belirler.

Buna gerek yok ama, ben komutla hiçbirşey yapmıyorum. :P
Kmlcan
« Citoyen »
1392919920000
    • Kmlcan#0000
    • Profil
    • Derniers messages
    • Tribu
#183
  0
a dit :
function main()
ui.addTextArea(1, ("<p align='center'><%s><a href='event:stop'>Durdur/Başlat</a> <G>- <J><a href='event:clear'>Sıfırla</a>"):format(stop and "R" or "J"), nil, 200, 135, 400, nil, 0, 1, 0.9, true)
end

function eventLoop()
local k2
t = (t and not stop and t + 0.5) or (t and stop and t) or 0.5
k1 = tostring(math.floor(t/60))
k2 = tostring(math.floor(t%60))
k1, k2 = #k1 < 2 and "0"..k1 or k1, #k2 < 2 and "0"..k2 or k2
v = k1..":"..k2
ui.addTextArea(0, "<J><p align='center'><font size='24'>Timerinator</font>\n<N><font size='18'>"..v.."\n</font>Bu muhteşem şey <VP>Kmlcan <N>tarafından yapılmıştır.", nil, 200, 50, 400, nil, 0, 1, 0.9, true)
end

function eventTextAreaCallback(id, n, cb)
if cb == "stop" then
stop = not stop
main()
elseif cb == "clear" then
t = nil
end
end

main()
Oyga
« Citoyen »
1392919920000
    • Oyga#0000
    • Profil
    • Derniers messages
    • Tribu
#184
  0
Düzenlendi.

Dernière modification le 1407463200000
Fatihmilano
« Citoyen »
1392920040000
    • Fatihmilano#0000
    • Profil
    • Derniers messages
    • Tribu
#185
  0
Kmlcan a dit :
:)

Süreyi ileriye doğru götürmeyi sağlamışsın ama t% falan filan hiç anlamam.
Diğerinde süre belirleniyor yaaa .s.s.s.s
Kmlcan
« Citoyen »
1392920520000
    • Kmlcan#0000
    • Profil
    • Derniers messages
    • Tribu
#186
  0
a dit :
function main()
ui.addTextArea(1, "<p align='center'><J><a href='event:stop'>Durdur/Başlat</a> <G>- <J><a href='event:clear'>Sıfırla</a> <G>- <J><a href='event:change'>Değiştir</a>", nil, 200, 135, 400, nil, 0, 1, 0.9, true)
end

function eventLoop()
local k2
t = (t and not stop and t + 0.5) or (t and stop and t) or 0.5
k1 = tostring(math.floor(t/60))
k2 = tostring(math.floor(t%60))
k1, k2 = #k1 < 2 and "0"..k1 or k1, #k2 < 2 and "0"..k2 or k2
v = k1..":"..k2
ui.addTextArea(0, ("<J><p align='center'><font size='24'>Timerinator</font>\n<%s><font size='18'>"..v.."\n</font><N>Bu muhteşem şey <VP>Kmlcan <N>tarafından yapılmıştır."):format(stop and "R" or "N"), nil, 200, 50, 400, nil, 0, 1, 0.9, true)
end

function eventTextAreaCallback(id, n, cb)
if cb == "stop" then
stop = not stop
elseif cb == "clear" then
t = nil
elseif cb == "change" then
ui.addPopup(0, 2, "<p align='center'>Timerinator değerini değiştirin.", n, 200, 310, 400, true)
end
end

function eventPopupAnswer(id, n, a)
t = id == 0 and tonumber(a) and tonumber(a) or t
end

main()

Başka bir şey?
Fatihmilano
« Citoyen »
1392920520000
    • Fatihmilano#0000
    • Profil
    • Derniers messages
    • Tribu
#187
  0
Kmlcan a dit :
Başka bir şey?

Ekle/çıkar yap birde :p
Kmlcan
« Citoyen »
1392920700000
    • Kmlcan#0000
    • Profil
    • Derniers messages
    • Tribu
#188
  1
Ne için o?
a dit :
function main()
ui.addTextArea(1, "<p align='center'><J><a href='event:stop'>Durdur/Başlat</a> <G>- <J><a href='event:clear'>Sıfırla</a> <G>- <J><a href='event:change'>Değiştir</a>", nil, 200, 135, 400, nil, 0, 1, 0.9, true)
end

function eventLoop()
local k3
t = (t and not stop and t + 0.5) or (t and stop and t) or 0.5
k1 = tostring(math.floor((t/60)/60))
k2 = tostring(math.floor((t/60)%60))
k3 = tostring(math.floor(t%60))
k1, k2, k3 = #k1 < 2 and "0"..k1 or k1, #k2 < 2 and "0"..k2 or k2, #k3 < 2 and "0"..k3 or k3
v = k1..":"..k2..":"..k3
ui.addTextArea(0, ("<J><p align='center'><font size='24'>Timerinator</font>\n<%s><font size='18'>"..v.."\n</font><N>Bu muhteşem şey <VP>Kmlcan <N>tarafından yapılmıştır."):format(stop and "R" or "N"), nil, 200, 50, 400, nil, 0, 1, 0.9, true)
end

function eventTextAreaCallback(id, n, cb)
if cb == "stop" then
stop = not stop
elseif cb == "clear" then
t = nil
elseif cb == "change" then
ui.addPopup(0, 2, "<p align='center'>Timerinator değerini değiştirin.", n, 200, 310, 400, true)
end
end

function eventPopupAnswer(id, n, a)
t = id == 0 and tonumber(a) and tonumber(a) or t
end

main()

Saat de ekledim.
Fatihmilano
« Citoyen »
1392920820000
    • Fatihmilano#0000
    • Profil
    • Derniers messages
    • Tribu
#189
  0
Kmlcan a dit :
Ne için o?
Saat de ekledim.

En baştan kendim kodlamayı deneyeceğim senin ki gibi falan. Ben math.floor kullanmayı bilmiyorum yalnız :c
Oguzhandkr
« Citoyen »
1392921600000
    • Oguzhandkr#0000
    • Profil
    • Derniers messages
    • Tribu
#190
  0
Şamanın olmaması kodu şeysi ne?
Kmlcan
« Citoyen »
1392921600000
    • Kmlcan#0000
    • Profil
    • Derniers messages
    • Tribu
#191
  0
tfm.exec.diseybılAvtoŞemın(tru)
Oguzhandkr
« Citoyen »
1392921600000
    • Oguzhandkr#0000
    • Profil
    • Derniers messages
    • Tribu
#192
  0
Kmlcan a dit :
tfm.exec.diseybılAvtoŞemın(tru)

Ama hala şaman var. Ben de onu kullandım.

tfm.exec.disableAutoShaman(true)
Kmlcan
« Citoyen »
1392921720000
    • Kmlcan#0000
    • Profil
    • Derniers messages
    • Tribu
#193
  0
Eğer yeni oyun başladıktan sonra yaptıysan çalışmaz, newGame'den önce gelmeli o.
Oguzhandkr
« Citoyen »
1392921720000
    • Oguzhandkr#0000
    • Profil
    • Derniers messages
    • Tribu
#194
  0
Kmlcan a dit :
Eğer yeni oyun başladıktan sonra yaptıysan çalışmaz, newGame'den önce gelmeli o.

deniyorum. editlerim şimdi.

edit: çalıştı thanks
Kmlcan
« Citoyen »
1392923760000
    • Kmlcan#0000
    • Profil
    • Derniers messages
    • Tribu
#195
  0
Şimdi palette diye bir modül geldi, resim yapmak için.

/module palette veya /room *#palette
Oyga
« Citoyen »
1392924660000
    • Oyga#0000
    • Profil
    • Derniers messages
    • Tribu
#196
  1
Kmlcan a dit :
Şimdi palette diye bir modül geldi, resim yapmak için.

/module palette veya /room *#palette

OYGA ÇİZİYOR

••••••••••••••••••••••••
Basit bir os.date kulanımı
••••••••••••••••••••••••

Basit bir os.date kullanımı yaptım, size sunmak isterim:

a dit :
function eventLoop()
ui.addTextArea(2,"<p align='center'><font size='20' color='#FFEE00'>"..os.date().."",nil,200,100,400,50,1,1,1)
end

Zamanı FR ye ayarlı ama :p çünkü tig FR li.
Alpoliko
« Censeur »
1392925680000
    • Alpoliko#0000
    • Profil
    • Derniers messages
    • Tribu
#197
  0
function eventNewPlayer(name)
tfm.exec.bindKeyboard(name,32,true,true)
end

for name,player in pairs(tfm.get.room.playerList) do
eventNewPlayer(name)
end

function eventKeyboard(name,key,down,x,y)
if key==32 then
tfm.exec.addShamanObject(objenumarası,400,200,0,0,0,false)
end
end

Bu Niye Çalışmıyo
Oyga
« Citoyen »
1392925920000
    • Oyga#0000
    • Profil
    • Derniers messages
    • Tribu
#198
  0
Alpoliko a dit :
function eventNewPlayer(name)
tfm.exec.bindKeyboard(name,32,true,true)
end

for name,player in pairs(tfm.get.room.playerList) do
eventNewPlayer(name)
end

function eventKeyboard(name,key,down,x,y)
if key==32 then
tfm.exec.addShamanObject(objenumarası,400,200,0,0,0,false)
end
end

Bu Niye Çalışmıyo

"objenumarası" yazan yere Topic-627874 buradaki listeden bir obje numarası yaz.
Alpoliko
« Censeur »
1392925920000
    • Alpoliko#0000
    • Profil
    • Derniers messages
    • Tribu
#199
  0
Oyga a dit :
"objenumarası" yazan yere Topic-627874 buradaki listeden bir obje numarası yaz.

Off Bende Sorun Ne Diyodum Onu Değiştirmiycketim :(
Oyga
« Citoyen »
1392926280000
    • Oyga#0000
    • Profil
    • Derniers messages
    • Tribu
#200
  0
a dit :
for name,player in pairs(tfm.get.room.playerList) do
tfm.exec.bindKeyboard(name, 32, true, true)
end
function eventKeyboard(name, key, down, x, y)
if key == 32 then
tfm.exec.addShamanObject(obje numarası,x,y,0,0,0,false)
end
end

Böyle daha kısa, ve bu şekilde farenin tam ortasında obje çıkar.
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • Lua Kodları Tartışma & Yardımlaşma Başlığı
« ‹ 10 / 388 › »
© Atelier801 2018

Equipe Conditions Générales d'Utilisation Politique de Confidentialité Contact

Version 1.27