Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- clics = 0
- objectif = 1000
- prixpds = 10
- prixsouris = 100
- prixcdf = 250
- prixmdf = 750
- cpc = 1
- cps = 0
- -- ui.addTextArea(4, "<b>Mine de fromage</b> : " .. prixmdf .. " fromages appuyez sur '4' (pavé numérique) pour en acheter un!", nil, 0, 100)
- -- ui.addTextArea(3, "<b>Champs de fromage</b> : " .. prixcdf .. " fromages appuyez sur '3' (pavé numérique) pour en acheter un!", nil, 0, 75)
- -- ui.addTextArea(2, "<b>Souris</b> : " .. prixsouris .. " fromages appuyez sur '2' (pavé numérique) pour en acheter un!", nil, 0, 50)
- -- ui.addTextArea(1, "<b>Pointeur de Souris</b> : " .. prixpds .. " fromages appuyez sur '1' (pavé numérique) pour en acheter un!", nil, 0, 25)
- fromage = 0
- function eventLoop(currentTime, timeRemaining)
- prixpds = math.floor(prixpds)
- prixsouris = math.floor(prixsouris)
- prixcdf = math.floor(prixcdf)
- prixmdf = math.floor(prixmdf)
- print(cps)
- if objectif <= fromage then
- cps = cps + objectif / 100
- objectif = objectif * 1.5
- end
- ui.setMapName ("</b>• Fromages :<b> " .. fromage .. "</b>/" .. objectif .. "<n> <g>|</g></n> <j></fc></b><n>Totals de clics : <b>" .. clics .. "</b> <g>|</g> CPS : <b>".. cps .. "</b> <g>|</g> CPC : <b>".. cpc .. "</b>")
- fromage = fromage + cps / 2
- ui.addTextArea(4, "<b>Mine de fromage</b> : " .. prixmdf .. " fromages appuyez sur '4' (pavé numérique) pour en acheter un!", nil, 0, 100)
- ui.addTextArea(3, "<b>Champs de fromage</b> : " .. prixcdf .. " fromages appuyez sur '3' (pavé numérique) pour en acheter un!", nil, 0, 75)
- ui.addTextArea(2, "<b>Souris</b> : " .. prixsouris .. " fromages appuyez sur '2' (pavé numérique) pour en acheter un!", nil, 0, 50)
- ui.addTextArea(1, "<b>Pointeur de Souris</b> : " .. prixpds .. " fromages appuyez sur '1' (pavé numérique) pour en acheter un!", nil, 0, 25)
- end
- ui.addTextArea(0, "Cliquez <a href='event:clic1'>ici</a>!", nil, 350, 200)
- function eventTextAreaCallback(textAreaId, playerName, callback)
- print(playerName .. " clicked")
- fromage = fromage + cpc
- clics = clics + 1
- tfm.exec.setPlayerScore (playerName, 1, true)
- end
- function eventChatCommand(pseudo, message)
- if message:sub(0,4) == "help" then
- if message:sub(6) ~= "" then
- else
- ui.addPopup(0, 0, "Bienvenue sur <b>Cheese Clicker</b>!<br>Ton objectif seras de cliquer sur le rectangle au milieu (et plus précisement sur le 'ici'!<br>Tu feras gagnerais des Fromages à tout le monde, ces fromages peuvent être échanger contre des améliorations!", pseudo, 250, 150, 300)
- end
- end
- end
- function eventKeyboard(playerName, keyCode, down, xPlayerPosition, yPlayerPosition)
- if(keyCode == 97) then
- print(playerName .. " à essayé d'achéter Pointeur de souris.")
- if fromage >= prixpds then
- print(playerName .. " à achété Pointeur de Souris.")
- fromage = fromage - prixpds
- cpc = cpc + 0.1
- prixpds = prixpds * 1.2
- end
- end
- if(keyCode == 98) then
- print(playerName .. " à essayé d'achéter Souris.")
- if fromage >= prixsouris then
- print(playerName .. " à achété Souris.")
- fromage = fromage - prixsouris
- cps = cps + 1
- prixsouris = prixsouris * 1.1
- end
- end
- if(keyCode == 99) then
- print(playerName .. " à essayé d'achéter Ferme.")
- if fromage >= prixcdf then
- print(playerName .. " à achété Ferme.")
- fromage = fromage - prixcdf
- cps = cps + 4
- prixsouris = prixcdf * 1.1
- end
- end
- end
- for playerName in pairs(tfm.get.room.playerList) do
- tfm.exec.bindKeyboard(playerName, 97, true, true) -- on écoute l'évènement "touche espace pressée"
- tfm.exec.bindKeyboard(playerName, 98, true, true) -- on écoute l'évènement "touche espace pressée"
- tfm.exec.bindKeyboard(playerName, 99, true, true) -- on écoute l'évènement "touche espace pressée"
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement