×

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
  • /
  • [Script] Lua's Maps
[Script] Lua's Maps
Endeav0r
« Citoyen »
1498401060000
    • Endeav0r#0000
    • Profil
    • Derniers messages
    • Tribu
#1
  1
  • Lua's maps
  • Code
Bien le bonsoir ou bien le bonjour à vous chers lecteurs !

On se retrouve aujourd'hui pour un petit module composés de maps utilisant les fonctionnalités du lua.
Ce module a été fait par Endeav0r et Athesdrake.


Les maps actuellement disponibles sont :

N°Nom de la map
1Alibaba's cavern

Nous ajouterons des maps de temps en temps.
Si vous avez des suggestions de maps, ou autre, nous sommes à votre écoute.
La liste des suggestions acceptés sera mise ici;


Pour voir la description d'une map, faites la commande !description.
N’hésitez pas a relancer le lua si un bug se présente. Si certains mécanismes ne fonctionnent pas, vérifiez votre connexion, ça peut venir de là.
Contactez-nous si un bug persiste.
Pour tester nos maps, lua il vous suffit de taper /lua en jeu puis de copier/coller le code ci-dessous dans l'écran qui apparaît !
Une fois le code introduit, il vous suffit de valider.


Code
Code Lua

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
nombre_de_pieces = 50 -- Changez pour augmenter/diminuer le nombre de pièces dans la caverne. (attention, ça peut vite dépasser la limite de caractères pour une map et évitez de dépasser 50 si votre pc n'est pas très performant)

table.foreach({"AutoNewGame", "AutoShaman", "AutoTimeLeft", "AfkDeath", "DebugCommand"}, function(_,v) tfm.exec["disable"..v](true) end) -- disable

map = [[<C><P Ca="" D="x_deadmeat/x_pictos/d_1078-fs8.png,0,150;x_deadmeat/x_zone/x_30.jpg,-1175,-400" L="1200" /><Z><S><S L="800" H="50" X="800" N="" Y="375" T="10" P="0,0,0.3,0.2,0,0,0,0" /><S P="1,0,0,0,0,1,0,0" L="30" X="425" N="" Y="251" T="10" H="200" /><S L="10" o="324650" X="500" H="10" Y="-73" T="13" P="1,0,0.3,0.2,0,1,0,0" /><S L="10" H="215" X="520" Y="-171" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="10" H="224" X="479" Y="-165" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S c="4" L="740" H="328" X="804" Y="195" T="5" P="0,0,0.3,0.2,0,0,0,0" /><S L="64" H="10" X="501" Y="-58" T="0" P="0,0,0.3,27,0,0,0,0" /><S L="119" H="22" X="496" Y="-311" T="0" P="0,0,0.3,0.2,45,0,0,0" /><S L="87" X="502" H="10" Y="-60" T="0" lua="1" P="0,0,0.3,0.2,0,0,0,0" /><S L="39" H="10" X="454" Y="-264" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="10" H="85" X="444" Y="-299" T="0" P="0,0,0.3,0.2,10,0,0,0" /><S P="0,0,0.3,0,0,0,0,0" L="40" H="400" c="4" Y="150" T="10" X="425" /><S c="2" L="400" X="-2" H="54" Y="399" T="7" P="0,0,0.1,0.2,-20,0,0,0" /><S L="400" H="54" X="115" Y="365" T="7" P="0,0,0.1,0.2,20,0,0,0" /><S L="400" X="200" H="54" Y="379" T="7" P="0,0,0.1,0.2,0,0,0,0" /><S H="40" L="775" X="810" c="1" N="" Y="20" T="10" P="0,0,0.3,0,-180,0,0,0" /><S P="0,0,0.3,0,0,0,0,0" N="" L="40" X="1180" c="1" Y="200" T="10" H="400" /><S X="425" L="40" H="400" c="4" N="" Y="0" T="10" P="0,0,0.3,0,0,0,0,0" /><S T="0" X="643" Y="330" L="24" H="25" P="1,0,0.3,0.2,0,0,0,0" i="0,0,../images/celousco/interfaces/or.png" /><S T="0" X="689" Y="244" L="24" H="25" P="1,0,0.3,0.2,0,0,0,0" i="0,0,../images/celousco/interfaces/or.png" /><S T="0" X="703" Y="274" L="24" H="25" P="1,0,0.3,0.2,0,0,0,0" i="0,0,../images/celousco/interfaces/or.png" /><S T="0" X="673" Y="274" L="24" H="25" P="1,0,0.3,0.2,0,0,0,0" i="0,0,../images/celousco/interfaces/or.png" /><S T="0" X="659" Y="302" L="24" H="25" P="1,0,0.3,0.2,0,0,0,0" i="0,0,../images/celousco/interfaces/or.png" /><S T="0" X="719" Y="302" L="24" H="25" P="1,0,0.3,0.2,0,0,0,0" i="0,0,../images/celousco/interfaces/or.png" /><S T="0" X="689" Y="302" L="24" H="25" P="1,0,0.3,0.2,0,0,0,0" i="0,0,../images/celousco/interfaces/or.png" /><S T="0" X="733" Y="330" L="24" H="25" P="1,0,0.3,0.2,0,0,0,0" i="0,0,../images/celousco/interfaces/or.png" /><S T="0" X="703" Y="330" L="24" H="25" P="1,0,0.3,0.2,0,0,0,0" i="0,0,../images/celousco/interfaces/or.png" /><S T="0" X="673" Y="330" L="24" H="25" P="1,0,0.3,0.2,0,0,0,0" i="0,0,../images/celousco/interfaces/or.png" /><S T="0" X="673" Y="330" L="24" H="25" P="1,0,0.3,0.2,0,0,0,0" i="0,0,../images/celousco/interfaces/or.png" /><S T="0" X="673" Y="330" L="24" H="25" P="1,0,0.3,0.2,0,0,0,0" i="0,0,../images/celousco/interfaces/or.png" /><S T="0" X="673" Y="330" L="24" H="25" P="1,0,0.3,0.2,0,0,0,0" i="0,0,../images/celousco/interfaces/or.png" />%s<S T="12" X="802" Y="195" L="719" H="314" P="0,0,0.3,0.2,0,0,0,0" o="6A7495" N="" c="4" lua="2" /></S><D><DS Y="334" X="157" /></D><O /><L><JP M1="2" M2="1" AXIS="1,0" /><JP M1="1" M2="0" AXIS="0,1" LIM1="undefined" LIM2="50" /></L></Z></C>]]
tfm.exec.newGame(string.format(map, string.rep([[<S T="0" X="1000" Y="330" L="24" H="25" P="1,0,0.3,0.2,0,0,0,0" i="0,0,../images/celousco/interfaces/or.png" />]], nombre_de_pieces)))
ui.setMapName("Lua's map #1 <n>- <bv>The Ali Baba's cavern\n")

aft = {}
open = false

function eventChatMessage(name, msg)
if msg:gsub("%s", ""):lower():match("sé?e?same?ouvre%-?toi") then
open = true
tfm.exec.removePhysicObject(1)
after(1, function() tfm.exec.removePhysicObject(2) end)
end
end

function eventPlayerDied(name)
tfm.exec.respawnPlayer(name)
end

function eventNewPlayer(name)
if open then
tfm.exec.removePhysicObject(1)
tfm.exec.removePhysicObject(2)
end
ui.setMapName("Lua's map #1 <n>- <bv>The Ali Baba's cavern\n")
tfm.exec.respawnPlayer(name)
end

function after(temps, func) -- Exécute une fonction après le temps donné
table.insert(aft, {t=os.time()+temps*1000, f=func})
end

function eventLoop(t1, t2)
for key,data in ipairs(aft) do
if data.t<=os.time() then
data.f()
table.remove(aft, key)
end
end
end

function eventChatCommand(name, cmd)
if cmd=="description" or cmd=="desc" then
ui.addTextPopup(1, "<u><b>The Ali Baba's cavern</b></u>\n\n\n<i>La caverne d'Ali Baba</i>\n\nCette map est une reproduction de la caverne d'Ali Baba. Il suffit de dire \"Sésame ouvre-toi\" pour ourvrir la porte et accéder au trésor!", name, 200, 100, 400, 200)
end
end

function eventTextAreaCallback(id, name, callback)
local arg = {}
for a in callback:gmatch("[^$]+") do -- Sépare le callback avec les '$' (ex: 'test$1' → {'test', '1'})
table.insert(arg, a)
end
if arg[1]=="call" then -- apelle une fonction avec tous les arguments donné (ex: 'fctGeniale$test$n$N35' → fctGeniale('test', name, 35))
local sub = {}
for i=arg[2]=="ui" and 4 or 3, #arg do
if arg[i]=="n" then
table.insert(sub, name)
elseif arg[i]:sub(0,1)=="N" then
table.insert(sub, tonumber(arg[i]:sub(2)))
else
table.insert(sub, arg[i])
end
end
if arg[2]=="ui" then
ui[arg[3]](table.unpack(sub))
return
end
_G[arg[2]](table.unpack(sub))
end
end

ui.addTextPopup = function(id, txt, name, x, y, largeur, hauteur) -- Popup où l'on peut mettre des balises <a href>
ui.addTextArea(id*100+0, " ", name, x-1, y-1, largeur-1, hauteur-1, 0x648FA4, 0x648FA4, 1, true)
ui.addTextArea(id*100+1, " ", name, x+1, y+1, largeur , hauteur , 0x0E1417, 0x0E1417, 1, true)
ui.addTextArea(id*100+2, txt, name, x , y , largeur , hauteur , 0x324650, 0x324650, 1, true)

local x2, y2, l2, h2, tx2 = x+largeur*0.15, y+hauteur-21, largeur*0.7, 15, string.format("<p align='center'><a href='event:call$ui$removePop$N%d$n'>%s", id, "Fermer cette fenêtre")
ui.addTextArea(id*100+3, " ", name, x2-1, y2-1, l2-1, h2-1, 0x5D7D90, 0x5D7D90, 1, true)
ui.addTextArea(id*100+4, " ", name, x2+1, y2+1, l2 , h2 , 0x0E1417, 0x0E1417, 1, true)
ui.addTextArea(id*100+5, tx2, name, x2 , y2 , l2 , h2 , 0x324650, 0x324650, 1, true)
end

ui.removePop = function(id, name) -- Enlève le TextPopup
for i=id*100, id*100+5 do
ui.removeTextArea(i, name)
end
end

Athesdrake
« Citoyen »
1498401180000
    • Athesdrake#0000
    • Profil
    • Derniers messages
    • Tribu
#2
  0
Historique :

25/06/17 - Première map
Evancal
« Censeur »
1498499880000
    • Evancal#0000
    • Profil
    • Derniers messages
    • Tribu
#3
  0
Sympa la map d'Ali Baba. x)
Bonne continuation.
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • [Script] Lua's Maps
© Atelier801 2018

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

Version 1.27