×

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
  • /
  • [Module API] Errors
« ‹ 13 / 17 › »
[Module API] Errors
Bushmeister
« Consul »
1423066500000
    • Bushmeister#0000
    • Profil
    • Derniers messages
    • Tribu
#241
  0
Safwanrockz a dit :
Bushmeister a dit :
Why tfm.exec.removeObject(id) and tfm.exec.moveObject(id, x, y) don't work? What's the problem?
a dit :

tfm.exec.addShamanObject(54, 400, 200, 0, 0, 0, false)
tfm.exec.addShamanObject(54, 450, 200, 0, 0, 0, false)
tfm.exec.addShamanObject(54, 500, 200, 0, 0, 0, false)
tfm.exec.moveObject(54,200,100)


Because the ID argument in tfm.exec.moveObject() is the ID of the object which is returned from the function tfm.exec.addShamanObject();
id=tfm.exec.addShamanObject(54, 400, 200, 0, 0, 0, false)
tfm.exec.moveObject(id,200,100)

thanks a lot!
Bushmeister
« Consul »
1423224660000
    • Bushmeister#0000
    • Profil
    • Derniers messages
    • Tribu
#242
  0
os.date() doesn't work correctly.
When I tried to get current date(day month year)
print(os.date("%d.%m.%Y"))
I have got
Fri Feb 06 13:06:14 CET 2015
not
06/02/2015
What's the problem? Are there any other variants to get current date?

upd:
I made this, but I'm not sure, will it work correctly or not.
a dit :
function getRegDate()
function getMonth()
for i, k in pairs(months) do
month=string.match(date, i)
--print(month)
if month~=nil then
month=k
return month
end
end
end
months={["Jan"]="01",["Feb"]="02",["Mar"]="03",["Apr"]="04",["May"]="05",["Jun"]="06",["Jul"]="07",["Aug"]="08",["Sep"]="09",["Oct"]="10",["Nov"]="11",["Dec"]="12"}
date=os.date("!*t")
day=string.sub(date, string.find(date, "([%d]+)"))
month1=getMonth()
year=string.match(date, "%d%d%d%d")
newDate=day.."/"..month1.."/"..year
return newDate
end

Dernière modification le 1423246200000
Safwanrockz
« Censeur »
1423323900000
    • Safwanrockz#0095
    • Profil
    • Derniers messages
    • Tribu
#243
  0
Your script is working but I don't see why you're nesting functions. :x
Byer
« Citoyen »
1423619580000
    • Byer#2511
    • Profil
    • Derniers messages
    • Tribu
#244
  0
Help!

tfm.exec.newGame('#0')
xml=''
function eventNewGame()
xml=tfm.get.room.xmlMapInfo.xml
end
tfm.exec.newGame(xml:gsub('/><Z>','G="0" /><Z>'))
Kmlcan
« Citoyen »
1423659420000
    • Kmlcan#0000
    • Profil
    • Derniers messages
    • Tribu
#245
  0
byersackn a dit :
Help!

tfm.exec.newGame('#0')
xml=''
function eventNewGame()
xml=tfm.get.room.xmlMapInfo.xml
end
tfm.exec.newGame(xml:gsub('/&gt;&lt;Z&gt;','G="0" /&gt;&lt;Z&gt;'))

This won't work since you are using tfm.exec.newGame twice. You have to do something so it must work three seconds later from the last newGame. Also you can't use # tag in your tribe house.

    lastLoadTime = os.time()
    tfm.exec.newGame(333333)
    function eventNewGame()
      xml = tfm.get.room.xmlMapInfo.xml
    end

    function eventLoop()
      if lastLoadTime and (os.time() - lastLoadTime >= 3000) then
        tfm.exec.newGame(xml:gsub('<C><P ', '<C><P G="0,0"'))
        lastLoadTime = nil
      end
    end
Byer
« Citoyen »
1423686420000
    • Byer#2511
    • Profil
    • Derniers messages
    • Tribu
#246
  0
Kmlcan a dit :
byersackn a dit :
Help!

tfm.exec.newGame('#0')
xml=''
function eventNewGame()
xml=tfm.get.room.xmlMapInfo.xml
end
tfm.exec.newGame(xml:gsub('/&gt;&lt;Z&gt;','G="0" /&gt;&lt;Z&gt;'))

This won't work since you are using tfm.exec.newGame twice. You have to do something so it must work three seconds later from the last newGame. Also you can't use # tag in your tribe house.

    lastLoadTime = os.time()
    tfm.exec.newGame(333333)
    function eventNewGame()
      xml = tfm.get.room.xmlMapInfo.xml
    end

    function eventLoop()
      if lastLoadTime and (os.time() - lastLoadTime &gt;= 3000) then
        tfm.exec.newGame(xml:gsub('&lt;C&gt;&lt;P ', '&lt;C&gt;&lt;P G="0,0"'))
        lastLoadTime = nil
      end
    end

If I wanted to strip
tfm.exec.newGame(333333)
Minstens
« Censeur »
1424887140000
    • Minstens#0000
    • Profil
    • Derniers messages
    • Tribu
#247
  0
I'm or lua is broken?
Shamousey
« Consul »
1424888760000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#248
  0
Minstens a dit :
I'm or lua is broken?

It's fixed now.
Eternity
« Citoyen »
1424988000000
    • Eternity#0622
    • Profil
    • Derniers messages
    • Tribu
#249
  0
Lua is broken again.

And commands in #utility aren't working, Shamousey.

Dernière modification le 1424989260000
Velspar
« Citoyen »
1425246900000
    • Velspar#0000
    • Profil
    • Derniers messages
    • Tribu
#250
  0
Randomly getting this error at times,

Runtime Error : Destruction demandée par la partie.

Doesnt seem to be anything since i can re-run the script with no errors...
Safwanrockz
« Censeur »
1425249120000
    • Safwanrockz#0095
    • Profil
    • Derniers messages
    • Tribu
#251
  0
Some module functions/features aren't working at the meantime. They were fixed but apparently seem to be broken yet again.
Shamousey
« Consul »
1425258780000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#252
  0
velspar a dit :
Randomly getting this error at times,

Runtime Error : Destruction demandée par la partie.

Doesnt seem to be anything since i can re-run the script with no errors...

That particular issue seems to be when the server tries to close the script when there's no-one in the room. It's a recent thing that's not the script's fault, hopefully it'll be fixed soon.
Viliusr
« Citoyen »
1426179300000
    • Viliusr#0000
    • Profil
    • Derniers messages
    • Tribu
#253
  0
Lua broken.
Viliusr
« Citoyen »
1426346580000
    • Viliusr#0000
    • Profil
    • Derniers messages
    • Tribu
#254
  0
CAN SOMEONE FIX LUA ALREADY???
Woebegone
« Citoyen »
1426347480000
    • Woebegone#8377
    • Profil
    • Derniers messages
    • Tribu
#255
  0
viliusr a dit :
CAN SOMEONE FIX LUA ALREADY???

It usually fixes eventually, so be patient.
Shamousey
« Consul »
1426360560000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#256
  0
It should be working fine now - if it's not working in your tribehouse then it's temporarily broken on the satellite server the room is running on. Try making sure the room is empty from other people, then rejoin it and try again.
Viliusr
« Citoyen »
1426365480000
    • Viliusr#0000
    • Profil
    • Derniers messages
    • Tribu
#257
  0
Still does not work. I am alone in the tribehouse. What do you mean 'satellite server'?
Velspar
« Citoyen »
1426795320000
    • Velspar#0000
    • Profil
    • Derniers messages
    • Tribu
#258
  0
"The function table.getn is deprecated!"
Cant seem to find any reason for this, good nor bad(Everything runs perfectly fine)...

Wondering if this is some sorta bug, or my script needs fixing.
Id share the script, but I prefer finding my own mistakes, if any :P
Alexpp
« Citoyen »
1426795620000
    • Alexpp#0000
    • Profil
    • Derniers messages
    • Tribu
#259
  0
try replace « table.getn(xyz) » to « #xyz »
Velspar
« Citoyen »
1426796220000
    • Velspar#0000
    • Profil
    • Derniers messages
    • Tribu
#260
  0
Alexpp a dit :
try replace « table.getn(xyz) » to « #xyz »

Gives me this error: "Init Error : Velspar.lua:87: attempt to get length of number"
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • [Module API] Errors
« ‹ 13 / 17 › »
© Atelier801 2018

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

Version 1.27