×

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 Requests
« ‹ 103 / 160 › »
Script Requests
Frozenjord
« Citoyen »
1443277980000
    • Frozenjord#0656
    • Profil
    • Derniers messages
    • Tribu
#2041
  0
Right, I can assure you it does work. Make sure YOUR username is in the script (on the 2nd line). Type /lua, paste and submit. Double clicking causes you to move towards the position you double-clicked.

EDIT: Just use this script.
interval = 2

data = {
name = "Hpocks",
clicked = true,
timestamp = os.time()
}

system.bindMouse(data.name, true)

function eventMouse(name, x, y)
data.clicked = not data.clicked
if data.clicked and data.timestamp < os.time()-500 then
if x-tfm.get.room.playerList[data.name].x > 0 then
tfm.exec.movePlayer(name, 0, 0, false, 85, 0, true)
else
tfm.exec.movePlayer(name, 0, 0, false, -85, 0, true)
end
data.timestamp = os.time()
end
end

function eventLoop()
if not data.clicked then
interval = interval - 1
if interval == 0 then
data.clicked = not data.clicked
interval = 2
end
end
end

Dernière modification le 1443278160000
Velspar
« Citoyen »
1443280440000
    • Velspar#0000
    • Profil
    • Derniers messages
    • Tribu
#2042
  0
How can you delete grounds that were made in the xml?
Something like #crowdsurf. Been working around this for a few hours, I cant figure it out.
Shamousey
« Consul »
1443280860000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#2043
  0
velspar a dit :
How can you delete grounds that were made in the xml?
Something like #crowdsurf. Been working around this for a few hours, I cant figure it out.

You can't (unless the grounds use the lua="" attribute as described in the Module FAQ). What's more likely is they get the map's XML and then reload the map using addPhysicObject or something similar to put the grounds back under the module's control.
Velspar
« Citoyen »
1443284280000
    • Velspar#0000
    • Profil
    • Derniers messages
    • Tribu
#2044
  0
Shamousey a dit :
velspar a dit :
How can you delete grounds that were made in the xml?
Something like #crowdsurf. Been working around this for a few hours, I cant figure it out.

You can't (unless the grounds use the lua="" attribute as described in the Module FAQ). What's more likely is they get the map's XML and then reload the map using addPhysicObject or something similar to put the grounds back under the module's control.

But how can I reload the map without getting that 3 second error?
For my particular situation, the best I could come up with is: Going through the xml, and taking the grounds I want off of the xml, then play the new xml. I have no idea how to get around that 3 second error.
Fakedobyer
« Citoyen »
1443292200000
    • Fakedobyer#0000
    • Profil
    • Derniers messages
#2045
  0
a script that does
who has the title "X" wins cheese

please


I am using translator

Velspar
« Citoyen »
1443293100000
    • Velspar#0000
    • Profil
    • Derniers messages
    • Tribu
#2046
  0
fakedobyer a dit :
a script that does
who has the title "X" wins cheese
please

I am using translator


This should work. The FAQ and Documentation thread doesnt give any ID's for titles, so I assume youll just need to put the title between the " "s. I never worked with titles, so I may be wrong on that.

Script
title = "X"
for name, player in pairs(tfm.get.room.playerlist) do
&nbsp;&nbsp;&nbsp;&nbsp;if player.title == title then
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tfm.exec.giveCheese(name)
&nbsp;&nbsp;&nbsp;&nbsp;end
end
Xleepy
« Citoyen »
1443294300000
    • Xleepy#4866
    • Profil
    • Derniers messages
    • Tribu
#2047
  0
script for fake message in tribe house? (like: [Cake] i like trains)
is it even possible
Shamousey
« Consul »
1443295080000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#2048
  0
bibsho a dit :
script for fake message in tribe house? (like: [Cake] i like trains)
is it even possible

It's not possible to post messages to the regular chat with scripts in your tribe house.
Xleepy
« Citoyen »
1443295620000
    • Xleepy#4866
    • Profil
    • Derniers messages
    • Tribu
#2049
  0
Shamousey a dit :
bibsho a dit :
script for fake message in tribe house? (like: [Cake] i like trains)
is it even possible

It's not possible to post messages to the regular chat with scripts in your tribe house.

oh ok
Izupen
« Citoyen »
1443313200000
    • Izupen#0000
    • Profil
    • Derniers messages
    • Tribu
#2050
  0
wouldnt that be cool if there was a script to make a certain player invisible?
Bloomfire
« Citoyen »
1443357060000
    • Bloomfire#0000
    • Profil
    • Derniers messages
#2051
  0
A script to wish someone happy birthday with fire works around the words?

Dernière modification le 1443357120000
Velspar
« Citoyen »
1443369540000
    • Velspar#0000
    • Profil
    • Derniers messages
    • Tribu
#2052
  0
Bloomfire a dit :
A script to wish someone happy birthday with fire works around the words?

I hope this is ok. Just mess around with the values if you want it different.

*If you get confused after pasting, just select the text back till you see everything. Or press the 'home' button.*
Script

--What do you want to say? Make sure its between " " or ' 's
local Text = "Happy Birthday!"
--How big do you want the text to be?
local Size = 50
--What color should the text be? Similar to outfits, just add the # in the beginning. Make sure its between " " or ' 's
local Color = '#ee0000'
--These are the amount of pixels from the left/top part of the screen.
local PositionFromTheLeft = 150
local PositionFromTheTop = 150
--How many 'fireworks' should appear every second.
local Fireworks = 5

--Below shouldnt be edited.
ui.addTextArea(0, '<b><font color="'..Color..'" size="'..Size..'">'..Text..'</font></b>', nil, PositionFromTheLeft, PositionFromTheTop, 0, 0, 0x000000, 0x000000, 1, true)
function eventLoop()for a=0,Fireworks,1 do local b={0,1,2,4,9,11,13}local c={x=PositionFromTheLeft+math.random(-Size,Size*10),y=PositionFromTheTop+math.random(-Size,Size*2)}for a=0,math.random(3,6),1 do tfm.exec.displayParticle(b[math.random(#b)],c.x,c.y,math.random(-1,1),math.random(-1,1),0,0,nil)end end end

Dernière modification le 1443375120000
Hpocks
« Citoyen »
1443371220000
    • Hpocks#0000
    • Profil
    • Derniers messages
    • Tribu
#2053
  0
Jamesqwartz a dit :
Right, I can assure you it does work. Make sure YOUR username is in the script (on the 2nd line). Type /lua, paste and submit. Double clicking causes you to move towards the position you double-clicked.

EDIT: Just use this script.
interval = 2

data = {
name = "Hpocks",
clicked = true,
timestamp = os.time()
}

system.bindMouse(data.name, true)

function eventMouse(name, x, y)
data.clicked = not data.clicked
if data.clicked and data.timestamp &lt; os.time()-500 then
if x-tfm.get.room.playerList[data.name].x &gt; 0 then
tfm.exec.movePlayer(name, 0, 0, false, 85, 0, true)
else
tfm.exec.movePlayer(name, 0, 0, false, -85, 0, true)
end
data.timestamp = os.time()
end
end

function eventLoop()
if not data.clicked then
interval = interval - 1
if interval == 0 then
data.clicked = not data.clicked
interval = 2
end
end
end

I didnt ask for clicking, I meant tapping a button. So double tapping the right arrow springs you right, and vise versa.
Velspar
« Citoyen »
1443375060000
    • Velspar#0000
    • Profil
    • Derniers messages
    • Tribu
#2054
  0
hpocks a dit :
Can I have a code that when you double tap in a direction, a token spawns under you and allows you to boost in that direction with a .5 second cooldown.
Also a tiny guide on how to use the script for tribe house :P

Assuming you just want something to use. All you need to do is input your values.
Use the /lua command in your tribe house, if you have 1000+ gathered cheese, and your tribe rank can use /np.
Copy whats in the spoiler, and paste it in the box.

*You cant spawn any tokens such as boosters, springs, +1s, skulls, etc. With the Module API.*
Script

--Name of the player using this boost. Make sure your name is in " " or ' 's, and first letter capped.
local MasterName = 'Velspar'
--The power of the boost.
local BoostPower = 50

--Dont edit anything below.
local a={last=0,count=0,rightKeys={39,68},leftKeys={37,65,81},timerP=0,timerC=0,boost=BoostPower}for b,c in pairs(a.leftKeys)do tfm.exec.bindKeyboard(MasterName,c,true,true)end;for b,c in pairs(a.rightKeys)do tfm.exec.bindKeyboard(MasterName,c,true,true)end;function eventLoop()a.timerC=a.timerC+0.5;a.timerP=a.timerP-0.5;if a.timerP<=0 then a.count=0 end end;function eventKeyboard(d,e,f,g,h)if a.timerC>=1 and a.timerP>0 and a.count==1 and e==a.last then tfm.exec.movePlayer(MasterName,0,0,true,boost,0,true)a.timerC=0 else a.last=e;a.timerP=0.5;a.count=1;for b,c in pairs(a.leftKeys)do if c==e then boost=-BoostPower end end;for b,c in pairs(a.rightKeys)do if c==e then boost=BoostPower end end end end
Crazyboy
« Citoyen »
1443409620000
    • Crazyboy#5402
    • Profil
    • Derniers messages
#2055
  0
I have no idea if this has anything do do with this thread but can anybody tell me how to say underlined text in the chat like M̷̲̲̲̲̲̲̲̲̲̲̿̿̿̿̿e̷̲̲̲̲̲̲̲̲̲̲̿̿̿̿̿r̷̲̲̲̲̲̲̲̲̲̲̿̿̿̿̿p̷̲̲̲̲̲̲̲̲̲̲̿̿̿̿̿ It looks cool but I have no idea how to do it :c
Gekkeiju
« Citoyen »
1443426360000
    • Gekkeiju#0000
    • Profil
    • Derniers messages
    • Tribu
#2056
  0
mlg9 a dit :
I have no idea if this has anything do do with this thread but can anybody tell me how to say underlined text in the chat like M̷̲̲̲̲̲̲̲̲̲̲̿̿̿̿̿e̷̲̲̲̲̲̲̲̲̲̲̿̿̿̿̿r̷̲̲̲̲̲̲̲̲̲̲̿̿̿̿̿p̷̲̲̲̲̲̲̲̲̲̲̿̿̿̿̿ It looks cool but I have no idea how to do it :c

Shamousey a dit :

It's not possible to post messages to the regular chat with scripts in your tribe house.

As Shamousey says, you cannot control the text on the chat with lua in your tribe house.

Dernière modification le 1443496080000
Hpocks
« Citoyen »
1443468060000
    • Hpocks#0000
    • Profil
    • Derniers messages
    • Tribu
#2057
  0
velspar a dit :
hpocks a dit :
Can I have a code that when you double tap in a direction, a token spawns under you and allows you to boost in that direction with a .5 second cooldown.
Also a tiny guide on how to use the script for tribe house :P

Assuming you just want something to use. All you need to do is input your values.
Use the /lua command in your tribe house, if you have 1000+ gathered cheese, and your tribe rank can use /np.
Copy whats in the spoiler, and paste it in the box.

*You cant spawn any tokens such as boosters, springs, +1s, skulls, etc. With the Module API.*
Script

--Name of the player using this boost. Make sure your name is in " " or ' 's, and first letter capped.
local MasterName = 'Velspar'
--The power of the boost.
local BoostPower = 50

--Dont edit anything below.
local a={last=0,count=0,rightKeys={39,68},leftKeys={37,65,81},timerP=0,timerC=0,boost=BoostPower}for b,c in pairs(a.leftKeys)do tfm.exec.bindKeyboard(MasterName,c,true,true)end;for b,c in pairs(a.rightKeys)do tfm.exec.bindKeyboard(MasterName,c,true,true)end;function eventLoop()a.timerC=a.timerC+0.5;a.timerP=a.timerP-0.5;if a.timerP<=0 then a.count=0 end end;function eventKeyboard(d,e,f,g,h)if a.timerC>=1 and a.timerP>0 and a.count==1 and e==a.last then tfm.exec.movePlayer(MasterName,0,0,true,boost,0,true)a.timerC=0 else a.last=e;a.timerP=0.5;a.count=1;for b,c in pairs(a.leftKeys)do if c==e then boost=-BoostPower end end;for b,c in pairs(a.rightKeys)do if c==e then boost=BoostPower end end end end

Beautiful...

Can it be possible to have a map rotation with this? (Of course ill give you the maps)
And also, can it be possible so there are no shamans to prevent the double tap ability?
And another, can you make the frame of time for hte doubletap shorter, so it doesnt get confused as much with adjusting the mouse and boosting (or just give me the factor for that and let me play around with it myself)

EDIT: Even better than a map rotation, just a place to put a map in so it plays that map automatically with no shamans, just so you dont have to be complicated with things.

EDIT2: Can I put multiple names in, or even better just make it so everyone in the room gets the ability, or is that just a module thing where you need to name the specific player/players (I dont know this stuff at all...)

EDIT3: The boost lags a tiny bit, is this just another unpreventable lua thing?
Its ok if this isnt readily available.

Also, the token thing was just an idea of how to possibly do it.
Thanks for the coding!

Dernière modification le 1443468840000
Velspar
« Citoyen »
1443468600000
    • Velspar#0000
    • Profil
    • Derniers messages
    • Tribu
#2058
  0
Map rotation is very much so possible.
Not sure what you mean by the shamans, but you can disable the game from setting one on its own.
Or if dont you want the shaman to be able to get a boost? Idk, most likely its possible though.

You can send a message to me if you want. Might be a few more back and forths for this.

Just noticing those edits...

The first one, great idea.
The second one, yea we can do everyone.
The third, not sure what you mean, it never lagged for me.

Dernière modification le 1443469320000
Gekkeiju
« Citoyen »
1443518160000
    • Gekkeiju#0000
    • Profil
    • Derniers messages
    • Tribu
#2059
  0
hpocks a dit :

This would be what you want?
All players in the room have the ability to boost themselves(Even someone who comes after you run the script).
You can load a map by saying "!mapcode" in the chat. (e.g !12 for vanillas) (e.g !@500000)
An arrow appears as a token when a player is boosted.

here is the code.
[spoiler]
speed=50 --change this as you like

players={}
keyCodes={
[39]={v=speed, r=270},
[68]={v=speed, r=270},
[37]={v=-speed, r=90},
[65]={v=-speed, r=90},
[81]={v=-speed, r=90} --why...
}

function eventNewPlayer(name)
players[name]={
lastTime=os.time(),
flag=false
}

for i,code in pairs(keyCodes) do
tfm.exec.bindKeyboard(name, i, true, true)
end
end

function eventKeyboard(name,code,down,x,y)
local p=players[name]
local time=os.time()
if p.lastKey==code and p.flag and os.difftime(time, p.lastTime)<400 then
tfm.exec.addShamanObject(0,x,y-40, keyCodes
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
.r)
tfm.exec.movePlayer(name,0,0,true,keyCodes[code].v,0,true)
p.flag=false
p.lastTime=time
else
p.flag=p.flag or os.difftime(time, p.lastTime) > 1000
if p.flag then
p.lastKey=code
p.lastTime=time
end
end
end

function eventChatCommand(name, command)
tfm.exec.newGame(command)
end

for name,player in pairs(tfm.get.room.playerList) do
eventNewPlayer(name)
end
tfm.exec.disableAutoShaman(true)
[/spoiler]

--your edit3
That lag is actually unavoidable because of the Internet lag. The lag can become lager when the player's location is further away from France.

Dernière modification le 1443518520000
Velspar
« Citoyen »
1443529560000
    • Velspar#0000
    • Profil
    • Derniers messages
    • Tribu
#2060
  0
@Gekkeiju

Was all worked out. I gotta learn to use os.time() more often though xP

Noticed the --why next to key 81, I just learned about this. https://en.wikipedia.org/wiki/AZERTY
Some of keys are switched around on other keyboards.

The lag was just me not using os.time(), sometimes the eventLoop will update right in the middle of your double press, resetting everything. I never really used os.time, so its definitely a habit I need to break.

For the sake of boredom... I revised the script we settled on...
Script
--Name of the player using this boost. &nbsp;
local _MASTERNAME = 'Velspar'
--The power of the boost.
local _BOOSTPOWER = 100
--What map to load?
local _MAP = '@6273323'


--Dont edit anything below.
tfm.exec.disableAfkDeath(true)
tfm.exec.disableAutoNewGame(true)
tfm.exec.disableAutoShaman(true)
tfm.exec.disableAutoTimeLeft(true)
tfm.exec.newGame(_MAP)

local playerList = {}
local keys = {
&nbsp;&nbsp;&nbsp;&nbsp;left = {37, 65, 81},
&nbsp;&nbsp;&nbsp;&nbsp;right = {39, 68}
}

function eventNewPlayer(playerName)
&nbsp;&nbsp;&nbsp;&nbsp;for _i, key in pairs(keys.left) do tfm.exec.bindKeyboard(playerName, key, true, true) end
&nbsp;&nbsp;&nbsp;&nbsp;for _i, key in pairs(keys.right) do tfm.exec.bindKeyboard(playerName, key, true, true) end
&nbsp;&nbsp;&nbsp;&nbsp;playerList[playerName] = {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;last = 0,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;timer = os.time(),
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;coolDown = os.time()+1000,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;boost = _BOOSTPOWER
&nbsp;&nbsp;&nbsp;&nbsp;}
end
function eventPlayerDied(playerName)
&nbsp;&nbsp;&nbsp;&nbsp;tfm.exec.respawnPlayer(playerName)
end
function eventPlayerWon(playerName, timeElapsed, timeElapsedSinceRespawn)
&nbsp;&nbsp;&nbsp;&nbsp;tfm.exec.respawnPlayer(playerName)
end
function eventKeyboard(playerName, keyCode, down, xPlayerPosition, yPlayerPosition)
&nbsp;&nbsp;&nbsp;&nbsp;local player = playerList[playerName]
&nbsp;&nbsp;&nbsp;&nbsp;if player.timer > player.coolDown and player.timer > os.time()-500 and keyCode == player.last then
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tfm.exec.movePlayer(playerName, 0, 0, true, player.boost, 0, true)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;player.coolDown = os.time()+1000
&nbsp;&nbsp;&nbsp;&nbsp;else
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;player.last = keyCode
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;player.timer = os.time()
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for _i, key in pairs(keys.left) do if key == keyCode then player.boost = -_BOOSTPOWER end end
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for _i, key in pairs(keys.right) do if key == keyCode then player.boost = _BOOSTPOWER end end
&nbsp;&nbsp;&nbsp;&nbsp;end
end
for name, _v in pairs(tfm.get.room.playerList) do
&nbsp;&nbsp;&nbsp;&nbsp;eventNewPlayer(name)
end
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • Script Requests
« ‹ 103 / 160 › »
© Atelier801 2018

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

Version 1.27