×

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
  • /
  • Abdeltif's scripts
1 / 6 › »
Abdeltif's scripts
Abdeltif
« Citoyen »
1383487980000
    • Abdeltif#0000
    • Profil
    • Derniers messages
    • Tribu
#1
  0
  • Scripts
  • Utilities
  • The team
Here i'l store my minor scripts that I don't deserve a whole thread about them.
My first minigame : Be smart ! :
The minigame is to reach the cheese using the canons
But be aware of the falling boxes !
Updated Be Smart
• The number of lives you have is shown in your score, when you die you lose a life, when you win you win some.
• When the life counter reachs 0, you will be eliminated.
• You automaticly get to 350, 550 at the begining of the round (behind the cannon spawn)

--------------------------------------------------------------------------------------------------------

Menu Pad
Menu Pad is simply some commands ordered in a text area
You don't need to !thing , you just click some words and write some options in the appearing popups and it will serve you as you wish.!
Discover this your self .
MADE BY ABDELTIF AND HOPHIPMICE .

--------------------------------------------------------------------------------------------------------


I was such a noob *-*
UTILITIES

Here you'll find some useful set of functions (custom APIs) that can help you in specific cases.
Note : * means that some functions depend on other custom ones, meaning you need the whole script for 1 function to work properly.


Abd's String Utils - Working on more functions
Description :
Most description is commented in the script itself but if you didn't get the hang of it, click on the spoilers.
Mpattern(arg1, arg2)
What this function basicly does, is it gets all the captures from a string that follow a given set of patterns (matches)
Because you have to define the number of matches when using string.match and because the set "().()" only gets you the location of the match, I made this.
arg1 : The string you're working with
arg2 : The set of patterns + the capture, note : You can only put 1 capture "()" but it's intentional and will be "upgraded" in the future.

Example :

local matches = { Mpattern( "Errors ruin my day the most.", '(%a+)') }
print(matches[1])
print(matches[3])


It will be "upgraded" soon ;)

str_tbl_check(tbl, str)
This function is VERY SPECIFIC, 90% of the time you will not need it , but in case you do :> here is what it does :
You got a table {"o", "7", "a", "m", "a","z",7,"e"} and a string "amaze"
The numbers in this table are ignored, either they are in a string or not.
the function checks for the word "amaze" in the table, in the same order (1,2,3,4,5) or (2,3,4,5,6,7), if it finds it without any letters in bettween the word, it will return true, or else, it will return false
so str_tbl_check({"o", "7", "a", "m", "a","z",7,"e"}, "amaze") will return true.
but str_tbl_check({"o", "7", "a", "m", "a","z","lol","e"}, "amaze") will return false.
it's very specific and it's going to be updated too .

Abd's math utils*- Working on more functions
Description :
This is most self explanatory, but just incase AGAIN you don't understand these gray lovely comments I'll explain them (;-;), click on the spoilers.
Math.sum(...)
It takes infinite number of arguments and add them
Mosly useful when you use it with table.unpack(tbl)
example :

local tbl = {1,5,8,3,1,7,3,8,2,4,6,8,2,5,1,6,4,86,32,564,21,2,1,56,164}
sum = math.sum(table.unpack(tbl))
print(sum) -- prints the sum

math.sumup(...)
Ok I agree with you if you don't understand this one.
let's say we got these arguments : 1 , 2 , 3 , 4 , 5
what this function returns is : 1 , 1+2 , 1+2+3 , 1+2+3+4 , 1+2+3+4+5
another example :/

local tbl = {1,2,3,4}
local results = {math.sumup(table.unpack(tbl))}
print(table.concat(tbl, " ,")) -- prints 1 , 3 , 6 , 10

For a reverse result, use a for loop and inverse all the results, and resort the table.


math.upwards(...)
Checks if the given arguments are , in an upward sequence ? example
math.upwards(1,2,3,4,5,6,7,8,9,10) -- true
math.upwards(1,2,4,5,6,7,8,9,10) -- false
math.downwards does the opposite thing.

Now to the main one
Math.addto(end, start)
Example : end = 10, start = 5 : it will do this : 5 + 6 + 7 + 8 + 9 + 10
end = 10, start = nil : It will do this : 1 + 2 + 3 + 4 + ... + 10
for a reverse result do this : -(math.addto(end, start))


I DID IT !!!!!!!!!!!
Abdeltif-Creator
Bethdacat-Module Manager
Pawgold-Helper

Dernière modification le 1451392500000
Fluffypuffeh
« Citoyen »
1383489360000
    • Fluffypuffeh#0000
    • Profil
    • Derniers messages
    • Tribu
#2
  0
Can you describe this minigame?
Abdeltif
« Citoyen »
1383490680000
    • Abdeltif#0000
    • Profil
    • Derniers messages
    • Tribu
#3
  0
Fluffypuffeh a dit :
Can you describe this minigame?

Done
[E] I edited the script a bit .
Abdeltif
« Citoyen »
1383557100000
    • Abdeltif#0000
    • Profil
    • Derniers messages
    • Tribu
#4
  0
[E] Added a timing system for "Be smart" minigame.
So at first it says : Get ready !
When it starts it says : Go go go !
[E] Added some pop ups .
Abdeltif
« Citoyen »
1385742180000
    • Abdeltif#0000
    • Profil
    • Derniers messages
    • Tribu
#5
  0
New script :
a dit :
function eventChatCommand(playerName, cmd)
if cmd:sub(0,1) == "p" then
ui.addTextArea(0, [[<font color="#99eec9" size="25">>]]..playerName..[[</font> : <font color="#bebb9f" size="25">]]..cmd:sub(3)..[[</u></font>]], nil,x,y,nil,nil,nil,nil,0.5, true)
elseif cmd == "rpop" then
ui.removeTextArea(0)
end
end


system.disableChatCommandDisplay("p", true)
system.disableChatCommandDisplay("rpop", true)

-- do "!p word" for a popup

Do !p word for inserting a word in the room // like chat command but with textAreas

To remove the chat do !rpop
Safwanrockz
« Censeur »
1385743080000
    • Safwanrockz#0095
    • Profil
    • Derniers messages
    • Tribu
#6
  0
Why is the last argument of ui.addTextArea boolean? It's supposed to be float.
e/ Also there is no variable x nor y?
Abdeltif
« Citoyen »
1385747160000
    • Abdeltif#0000
    • Profil
    • Derniers messages
    • Tribu
#7
  0
1st . nil x and nil y automaticly takes it as 50 ( 50 x and 50 y )
seconde , for that true :
http://i.imgur.com/kYvd2co.png
http://i.imgur.com/6s5XZWK.png
http://i.imgur.com/1ftAKiy.png
-- Thoose are for lua members only

http://i.imgur.com/KGjwzLm.png
-- The new things in popUp and textArea
Safwanrockz
« Censeur »
1385748720000
    • Safwanrockz#0095
    • Profil
    • Derniers messages
    • Tribu
#8
  0
Giving x and y strings nil value automatically setst he textarea to 50, so yeah. Plus it's the first time I hear about this fixedpos boolean. (don't even know what it does :v)
Abdeltif
« Citoyen »
1385748960000
    • Abdeltif#0000
    • Profil
    • Derniers messages
    • Tribu
#9
  0
Safwanrockz a dit :
Giving x and y strings nil value automatically setst he textarea to 50, so yeah. Plus it's the first time I hear about this fixedpos boolean. (don't even know what it does :v)

Looks like you didin't check the news :3
Have fun saf!


++ It makes the pop moves with you if the map is long or hight
Safwanrockz
« Censeur »
1385749080000
    • Safwanrockz#0095
    • Profil
    • Derniers messages
    • Tribu
#10
  0
Ohh, useful for minigames that need long maps.
e/ I only use the documentation on CFM and it wasn't updated xD
Abdeltif
« Citoyen »
1385749320000
    • Abdeltif#0000
    • Profil
    • Derniers messages
    • Tribu
#11
  0
Safwanrockz a dit :
Ohh, useful for minigames that need long maps.
e/ I only use the documentation on CFM and it wasn't updated xD

There is one there ? ._.
Also , I updated it a bit for no mess
I added !t to set a pop up under that one so mice communicate :
a dit :
function eventChatCommand(playerName, cmd)
if cmd:sub(0,1) == "p" then
ui.addTextArea(0, [[<font color="#99eec9" size="25">>]]..playerName..[[</font> : <font color="#bebb9f" size="25">]]..cmd:sub(3)..[[</u></font>]], nil,x,y,nil,nil,nil,nil,0.5, true)
elseif cmd == "rpop" then
ui.removeTextArea(0)
ui.removeTextArea(1)
elseif cmd:sub(0,1) == "t" then
ui.addTextArea(1, [[<font color="#99eec9" size="25">>]]..playerName..[[</font> : <font color="#bebb9f" size="25">]]..cmd:sub(3)..[[</u></font>]], nil,x,100,nil,nil,nil,nil,0.5, true)
elseif cmd:sub(0,4) == "kill" then
tfm.exec.killPlayer(cmd:sub(6))
end
end


system.disableChatCommandDisplay("p", true)
system.disableChatCommandDisplay("rpop", true)

-- do "!p word" for a popup at 50 y
-- do "!t word" for a popup at 100 y

.
Thewildnes
« Citoyen »
1385760120000
    • Thewildnes#0000
    • Profil
    • Derniers messages
    • Tribu
#12
  0
Pro Scripts ! :D
Omitopicah
« Citoyen »
1385845860000
    • Omitopicah#0000
    • Profil
    • Derniers messages
#13
  0
Pro Scripts ! _*
Abdeltif
« Citoyen »
1385847780000
    • Abdeltif#0000
    • Profil
    • Derniers messages
    • Tribu
#14
  0
thanks ! :D
Omitopicah
« Citoyen »
1385849040000
    • Omitopicah#0000
    • Profil
    • Derniers messages
#15
  0
1
Abdeltif a dit :
thanks ! :D

TY
Abdeltif
« Citoyen »
1385883900000
    • Abdeltif#0000
    • Profil
    • Derniers messages
    • Tribu
#16
  0
Updated the scripts ,
a dit :
function eventChatCommand(playerName, cmd)
local Stats = [[<font color="#f564ae" size="23">]]..playerName..[[</font>]]
if cmd:sub(0,1) == "p" then
ui.addTextArea(1, [[<font color="#99999f" size="25">>]]..playerName..[[</font> : <font color="#00f98a" size="25">]]..cmd:sub(3)..[[</u></font>]], nil,x,y,nil,nil,nil,nil,0.5, true)
elseif cmd == "rpop" then
ui.removeTextArea(1)
ui.removeTextArea(2)
ui.removeTextArea(3)
elseif cmd:sub(0,1) == "t" then
ui.addTextArea(2, [[<font color="#99eec9" size="25">>]]..playerName..[[</font> : <font color="#bebb9f" size="25">]]..cmd:sub(3)..[[</u></font>]], nil,x,100,nil,nil,nil,nil,0.5, true)
elseif cmd:sub(0,1) == "a" then
ui.addTextArea(3, [[<font color="#6e3ea5" size="25">>]]..playerName..[[</font> : <font color="#993a3d" size="25">]]..cmd:sub(3)..[[</u></font>]], nil,x,150,nil,nil,nil,nil,0.5, true)
elseif cmd:sub(0,4) == "kill" then
tfm.exec.killPlayer(cmd:sub(6))
end
end


system.disableChatCommandDisplay("p", true)
system.disableChatCommandDisplay("a", true)
system.disableChatCommandDisplay("kill", true)
system.disableChatCommandDisplay("t", true)
system.disableChatCommandDisplay("rpop", true)

-- do "!p word" for a popup at 50 y
-- do "!t word" for a popup at 100 y
-- do "!a word" for a popup at 100 y
Abdeltif
« Citoyen »
1386259560000
    • Abdeltif#0000
    • Profil
    • Derniers messages
    • Tribu
#17
  0
Hehehe , look who got a new script to share today ! :3
This :
a dit :
t = 0
function eventChatCommand(playerName, cmd)
local ppX = tfm.get.room.playerList[playerName].x
local ppY = tfm.get.room.playerList[playerName].y
if cmd:sub(0,4) == "part" then
tfm.exec.displayParticle(cmd:sub(6), ppX+(-20), ppY+20, 5, 0.05, 0, 0, nil)
end
end

system.disableChatCommandDisplay("part", true)


function eventLoop()
t = t + 0.5
if t==5 then
t = 0
tfm.exec.displayParticle(5, 50, 50, 1, 0, 0, 0, nil)
tfm.exec.displayParticle(5, 50, 60, 1, 2, 0.2, 0, nil)
tfm.exec.displayParticle(5, 200, 100, 1, 1, -0.2, 0, nil)
end
end

Do !part number(between 0 and 37) to make a particle appear !
for example : !part 5 to throw a heart
!part 6 to throw a bubble

En'joy
Abdeltif
« Citoyen »
1386357120000
    • Abdeltif#0000
    • Profil
    • Derniers messages
    • Tribu
#18
  0
Update :
a dit :
t = 0

function eventChatCommand(playerName, cmd)
local ppX = tfm.get.room.playerList[playerName].x
local ppY = tfm.get.room.playerList[playerName].y
if cmd:sub(0,4) == "part" then
if tfm.get.room.playerList[playerName].isFacingRight then
tfm.exec.displayParticle(cmd:sub(6), ppX, ppY, 5, 0.05, 0, 0, nil)
tfm.exec.displayParticle(cmd:sub(6), ppX, ppY+10, 5, 0.05, 0, 0, nil)
tfm.exec.displayParticle(cmd:sub(6), ppX, ppY+20, 5, 0.05, 0, 0, nil)
tfm.exec.displayParticle(cmd:sub(6), ppX, ppY+30, 5, 0.05, 0, 0, nil)
else
tfm.exec.displayParticle(cmd:sub(6), ppX, ppY, -5, 0.05, 0, 0, nil)
tfm.exec.displayParticle(cmd:sub(6), ppX, ppY+10, -5, 0.05, 0, 0, nil)
tfm.exec.displayParticle(cmd:sub(6), ppX, ppY+20, -5, 0.05, 0, 0, nil)
tfm.exec.displayParticle(cmd:sub(6), ppX, ppY+30, -5, 0.05, 0, 0, nil)
end
end
end

system.disableChatCommandDisplay("part", true)
function eventLoop()
tfm.exec.displayParticle(math.random(0,37), 50, 50, 1, 0, 0, 0, nil)
tfm.exec.displayParticle(math.random(0,37), 50, 60, 1.2, 0, 0.02, 0, nil)
tfm.exec.displayParticle(math.random(0,37), 50, 70, 1.4, 0, 0, 0, nil)
tfm.exec.displayParticle(math.random(0,37), 50, 80, 1.6, 0, 0.04, 0, nil)
tfm.exec.displayParticle(math.random(0,37), 50, 90, 1.8, 0, 0, 0, nil)
tfm.exec.displayParticle(math.random(0,37), 50, 100, 2, 0, 0.06, 0, nil)
tfm.exec.displayParticle(math.random(0,37), 50, 110, 2.2, 0, 0, 0, nil)
tfm.exec.displayParticle(math.random(0,37), 50, 120, 2.4, 0, 0.08, 0, nil)
tfm.exec.displayParticle(math.random(0,37), 50, 130, 2.6, 0, 0, 0, nil)
tfm.exec.displayParticle(math.random(0,37), 50, 140, 2.8, 0, 0.1, 0, nil)
tfm.exec.displayParticle(math.random(0,37), 50, 150, 3, 0, 0, 0, nil)
tfm.exec.displayParticle(math.random(0,37), 50, 160, 3.2, 0, 0.12, 0, nil)
tfm.exec.displayParticle(math.random(0,37), 50, 170, 3.4, 0, 0., 0, nil)
tfm.exec.displayParticle(math.random(0,37), 50, 180, 3.6, 0, 0.14, 0, nil)
end

.
Safwanrockz
« Censeur »
1386360660000
    • Safwanrockz#0095
    • Profil
    • Derniers messages
    • Tribu
#19
  0
You know you can just use the "for" statement instead of this excessively long script. :x
Abdeltif
« Citoyen »
1386422640000
    • Abdeltif#0000
    • Profil
    • Derniers messages
    • Tribu
#20
  0
Safwanrockz a dit :
You know you can just use the "for" statement instead of this excessively long script. :x

Yus but diffirecnt places and deacted ids , impossible
Saving A script :
a dit :
t = 30

AnswearYes={}
AnswearNo={}

ui.addTextArea(0, [[<font size="18" color="#48f6ae">Time left : ]]..t..[[</font>]], nil, 400, 50, nil, nil, nil, nil, 0.7, true)
ui.addPopup(0,1,"<font size='20'><ROSE>IS ABD SMELLY ?</font>",nil)

function eventPopupAnswer(id,playerName,answer)
if answer=="yes" and id==0 and t>0 then
table.insert(AnswearYes, playerName)
elseif answer=="no" and id==0 then
table.insert(AnswearNo, playerName)
end
end

function eventLoop()
local X = table.concat(AnswearYes,",")
local Y = "<font size='18' color='#58ae66'> Players who voted yes are :".."</font><J>\n"..X.." ."
t=t-0.5
if t>=0 then
ui.updateTextArea(0, [[<font size="18" color="#48f6ae">Time left : ]]..t..[[</font>]])
end
if t==0 then
ui.addPopup(1,0,Y,nil,40,200)
tfm.exec.killPlayer(table.concat(AnswearNo))
end
end

.

Edit : It is possible to use a for loop for it :)

Dernière modification le 1419355620000
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • Abdeltif's scripts
1 / 6 › »
© Atelier801 2018

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

Version 1.27