×

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
  • /
  • [TASK] Coding tasks
1 / 2 › »
[TASK] Coding tasks
Abdeltif
« Citoyen »
1392485460000
    • Abdeltif#0000
    • Profil
    • Derniers messages
    • Tribu
#1
  0
Want to challenge yourself?
Want to practice lua coding?
Well then you found us !
We (The Tasks Managers: Abdeltif and Hophipmice) have created a bunch of exercises for you to practise coding on it !
You may find some transformice based tasks or some old-school tasks !

Rules ↨
↑ Do not use another player's scripts .
↑ We can answer you here if you had a mistake or rate it for you if it was right ;)


Ok, now let's go to the main part , the tasks : Tasks.pasted
You may only do the tasks here:
Task 1
Task 2
Task 3
Task 4
Task 5
We don't want the tasks to be spoiled when users post them here, okay ?
I'll check the answers with a couple of friends ;)
Abdeltif
« Citoyen »
1392485460000
    • Abdeltif#0000
    • Profil
    • Derniers messages
    • Tribu
#2
  0
Reserved post
Bushmeister
« Consul »
1392488040000
    • Bushmeister#0000
    • Profil
    • Derniers messages
    • Tribu
#3
  0
task2 Video
Abdeltif
« Citoyen »
1392488520000
    • Abdeltif#0000
    • Profil
    • Derniers messages
    • Tribu
#4
  0
Bushmeister a dit :
task2 Video

hmm.
Impressive way.
but it won't work on other shaman objects.
Like a small box or anything similar.
That's the problem, try to find a way to get only the first object, what ever it was, dispawned
That object was removed cause it id is 2 and for it position in the map, since it's the first object it will be 2
That's not what we need .
we want ANY object to be removed when spawning it after 3 seconds
The first one .
Safwanrockz
« Censeur »
1392492540000
    • Safwanrockz#0095
    • Profil
    • Derniers messages
    • Tribu
#5
  0
Task 1:
a dit :
names = {"Abdeltif", "Hophipmice", "Shamousey", "Evilsantah","Jordynl","Sydoline"}

for k,v in pairs(names) do
if v:sub(1,1)~="S" then
print(v)
end
end

~
Task 2:
a dit :

for k,v in pairs(tfm.get.room.playerList) do
tfm.exec.setShaman(k)
end

t = 0
var = {}

function eventSummoningEnd(name, otype, x, y, angle, xv, yv, statics)
if t==0 then
t=t+1
end
table.insert(var,statics.id)
end

function eventLoop()
tfm.exec.setUIMapName(t)
if t>=1 and t<2 then
t=t+0.1
if t>=1.5 and t<1.6 then tfm.exec.removeObject(var[1]) end
end
end

~
Task 4:
a dit :

pressed={}
for k,v in pairs(tfm.get.room.playerList) do
pressed[k]=false
tfm.exec.bindKeyboard(k,32,true,true)
tfm.exec.bindKeyboard(k,32,false,true)
end

function eventKeyboard(name, keycode, down, x, y)
if down then
pressed[name]=true
else
pressed[name]=false
end
end
function eventLoop()
for name,p in pairs(tfm.get.room.playerList) do
if pressed[name]==true then
tfm.exec.addShamanObject(32,200,200)
end
end
end

 
Abdeltif
« Citoyen »
1392492900000
    • Abdeltif#0000
    • Profil
    • Derniers messages
    • Tribu
#6
  0
Safwanrockz a dit :
Task 1:

~
Task 2:

~
Task 4:
 

Task 1:
Okay !

Task 2:

It's a smart way though, good idea

Task 4:
All the script is okay
But the object to spawn must be a balloon , not a rune ;)
Safwanrockz
« Censeur »
1392493020000
    • Safwanrockz#0095
    • Profil
    • Derniers messages
    • Tribu
#7
  0
Yeah I used runes because I've forgotten the ID of the balloon, so I used the space key ID. xD
Abdeltif
« Citoyen »
1392493020000
    • Abdeltif#0000
    • Profil
    • Derniers messages
    • Tribu
#8
  0
Safwanrockz a dit :
Yeah I used runes because I've forgotten the ID of the balloon, so I used the space key ID. xD

Balloon Id : 28 ;)
Safwanrockz
« Censeur »
1392493260000
    • Safwanrockz#0095
    • Profil
    • Derniers messages
    • Tribu
#9
  0
Abdeltif a dit :
Balloon Id : 28 ;)

Spawning runes instead of balloons wouldn't harm the fact my script was working fine, would it?
Abdeltif
« Citoyen »
1392493260000
    • Abdeltif#0000
    • Profil
    • Derniers messages
    • Tribu
#10
  0
Safwanrockz a dit :
Spawning runes instead of balloons wouldn't harm the fact my script was working fine, would it?

nope
Anyway,
There is a new task,
Task5
Go try your luck ;)
Tailtong
« Citoyen »
1392494700000
    • Tailtong#0000
    • Profil
    • Derniers messages
    • Tribu
#11
  0
task 3
http://pastebin.com/e1mf34zs
Jordy
« Consul »
1392495720000
    • Jordy#0015
    • Profil
    • Derniers messages
    • Tribu
#12
  0
Too much spoilers. This is no fun. :(
Abdeltif
« Citoyen »
1392556620000
    • Abdeltif#0000
    • Profil
    • Derniers messages
    • Tribu
#13
  0
Jordynl a dit :
Too much spoilers. This is no fun. :(

hmm
I'll find a way to avoid that jordy ;)

Tailtong a dit :
task 3
http://pastebin.com/e1mf34zs

GJ tail
Abdeltif
« Citoyen »
1392558540000
    • Abdeltif#0000
    • Profil
    • Derniers messages
    • Tribu
#14
  0
Daily task :

When using main function, the hand can be printed only once !
If it's called again, it won't be printed.
You are only able to define 1 local variable.
To make more sence, you can also store variables inside that variables.
Also, you may not define another function.

a dit :

function main(hand)

end
for i=1,8 do
main("hello")
main("stuff")
main("hello")
main("shaman")
end

.
Laagaadoo
« Citoyen »
1392558840000
    • Laagaadoo#0000
    • Profil
    • Derniers messages
    • Tribu
#15
  0
Task 1: http://gw.gd/qqhy
Task 2: http://gw.gd/BKRj
Task 3: http://gw.gd/Y2w1
Task 4: http://gw.gd/ez2Q
Task 5: http://gw.gd/HS2l
Abdeltif
« Citoyen »
1392560220000
    • Abdeltif#0000
    • Profil
    • Derniers messages
    • Tribu
#16
  0
Laagaadoo a dit :
Task 1: http://gw.gd/qqhy
Task 2: http://gw.gd/BKRj
Task 3: http://gw.gd/Y2w1
Task 4: http://gw.gd/ez2Q
Task 5: http://gw.gd/HS2l

dun forget ddaily task
I'll check those and edit this post a soon as possible ;)

task 1 : correct
task 2 :
Sorry; but it's supposed to remove the first object spawned.
Task 3 : Good job !
At least someone followed the fact that sayo need to be under saya, but change the y and don't pay attention that it won't be under saya when there is no saya ;)
Anyway, goodjob ;)
Task 4 : Good job ! That's the correct way ;)
Task 5 :
First thing first , the stats are saved as for all the players, if someone dies it will be counted for everyone
Also, the shaman slot doesn't add ;p
Laagaadoo
« Citoyen »
1392562020000
    • Laagaadoo#0000
    • Profil
    • Derniers messages
    • Tribu
#17
  0
Abdeltif a dit :
dun forget ddaily task
I'll check those and edit this post a soon as possible ;)

task 1 : correct
task 2 :
Sorry; but it's supposed to remove the first object spawned.
Task 3 : Good job !
At least someone followed the fact that sayo need to be under saya, but change the y and don't pay attention that it won't be under saya when there is no saya ;)
Anyway, goodjob ;)
Task 4 : Good job ! That's the correct way ;)
Task 5 :
First thing first , the stats are saved as for all the players, if someone dies it will be counted for everyone
Also, the shaman slot doesn't add ;p

Task 2: http://gw.gd/Crse

I'm thinking in a solution to task 5
Abdeltif
« Citoyen »
1392562800000
    • Abdeltif#0000
    • Profil
    • Derniers messages
    • Tribu
#18
  0
Laagaadoo a dit :
Task 2: http://gw.gd/Crse

I'm thinking in a solution to task 5

okay for task2
Though there was an easier way

Go find a solution for task 5 ;)
Moepl
« Citoyen »
1392567660000
    • Moepl#0095
    • Profil
    • Derniers messages
#19
  0
Abdeltif a dit :

You are only able to define 1 local variable.
To make more sence, you can also store variables inside that variables.

Heh, that does not make much sense to be honest.

Consider this:

local myOnlyVariable=_G
myOnlyVariable.yolo="another variable"
print(yolo) --huh?

=>You are not restricting the number of variables at all...
Personally, I wouldn't allow tables if you want to restrict the number of variables.
Abdeltif
« Citoyen »
1392569340000
    • Abdeltif#0000
    • Profil
    • Derniers messages
    • Tribu
#20
  0
Moepl a dit :
Heh, that does not make much sense to be honest.

Consider this:

local myOnlyVariable=_G
myOnlyVariable.yolo="another variable"
print(yolo) --huh?

=&gt;You are not restricting the number of variables at all...
Personally, I wouldn't allow tables if you want to restrict the number of variables.

O, M, G
Well, Hmm, is it even possible to do it without tables ? lol
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • [TASK] Coding tasks
1 / 2 › »
© Atelier801 2018

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

Version 1.27