Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local map = '<C><P /><Z><S><S L="106" o="324650" H="36" X="53" Y="382" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S L="10" o="324650" H="64" X="316" Y="-282" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S L="227" o="324650" H="10" X="426" Y="-245" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S P="0,0,0.3,0.2,0,0,0,0" L="227" o="324650" X="434" Y="-317" T="12" H="10" /><S P="0,0,0.3,0.2,0,0,0,0" L="10" o="324650" X="542" Y="-279" T="12" H="64" /></S><D /><O /></Z></C>'
- local player = 'Eliaseeg'
- local help_pool = {
- -- NOMBRE, COSTO, DISPNIBLES
- {"Cursor", 50, 0},
- {"Vaca", 200, 0},
- {"Rata", 1000, 0},
- {"Granjero", 5000, 0},
- {"Máquina del tiempo", 100000, 0}
- }
- -- No toques nada de aquí!
- local mice = {}
- local cooldown = 0
- local cheesePerSecond = 0
- local cheese = 0
- local time = 0
- function main()
- tfm.exec.disableAutoShaman(true)
- tfm.exec.disableAutoTimeLeft(true)
- tfm.exec.disableAutoNewGame(true)
- tfm.exec.disableAfkDeath(true)
- startGame()
- end
- function startGame()
- cooldown = 0
- tfm.exec.newGame(map)
- table.foreach(tfm.get.room.playerList, eventNewPlayer)
- table.foreach(tfm.get.room.playerList, showGui)
- end
- function eventNewPlayer(name)
- if name == player then
- system.bindMouse(name, true)
- tfm.exec.movePlayer(name, 50, 345)
- else
- tfm.exec.movePlayer(name, 426, -276)
- end
- end
- function showGui(name)
- ui.addTextArea(0, "<font size='35'>"..cheese.."<G>$</G></font>", name, 10, 40, 200, 40, 0x191919, 0x191919, 0.6, true)
- ui.addTextArea(1, "", name, 10, 100, 200, 220, 0x191919, 0x191919, 0.6, false)
- ui.addTextArea(2, "<font size='15'><a href='event:".. help_pool[1][1] .."'>".. help_pool[1][1] ..": <G>".. help_pool[1][2] .."$</G></a></font></p>\n<font size='10'>"..help_pool[1][3], name, 510, 40, 280, 50, 0x191919, 0x191919, 0.6, true)
- ui.addTextArea(3, "<font size='15'><a href='event:".. help_pool[2][1] .."'>".. help_pool[2][1] ..": <G>".. help_pool[2][2] .."$</G></a></font></p>\n<font size='10'>"..help_pool[2][3], name, 510, 100, 280, 50, 0x191919, 0x191919, 0.6, true)
- ui.addTextArea(4, "<font size='15'><a href='event:".. help_pool[3][1] .."'>".. help_pool[3][1] ..": <G>".. help_pool[3][2] .."$</G></a></font></p>\n<font size='10'>"..help_pool[3][3], name, 510, 160, 280, 50, 0x191919, 0x191919, 0.6, true)
- ui.addTextArea(5, "<font size='15'><a href='event:".. help_pool[4][1] .."'>".. help_pool[4][1] ..": <G>".. help_pool[4][2] .."$</G></a></font></p>\n<font size='10'>"..help_pool[4][3], name, 510, 220, 280, 50, 0x191919, 0x191919, 0.6, true)
- ui.addTextArea(6, "<font size='15'><a href='event:".. help_pool[5][1] .."'>".. help_pool[5][1] ..": <G>".. help_pool[5][2] .."$</G></a></font></p>\n<font size='10'>"..help_pool[5][3], name, 510, 280, 280, 50, 0x191919, 0x191919, 0.6, true)
- end
- function eventTextAreaCallback(id, name, callback)
- if name ~= player then return end
- for i=1,5 do
- if callback == help_pool[i][1] and cooldown <= 0 then
- if cheese - help_pool[i][2] >= 0 then
- cooldown = 1
- help_pool[i][3] = help_pool[i][3] + 1
- cheese = cheese - help_pool[i][2]
- local newNumber = help_pool[i][2]+(help_pool[i][2]*25/100)
- help_pool[i][2] = round(newNumber, 0)
- updateTextArea(0, "<font size='35'>"..cheese.."<G>$</G></font>", name)
- updateTextArea(i+1, "<font size='15'><a href='event:"..help_pool[i][1].."'>".. help_pool[1][1] ..": <G>".. help_pool[i][2] .."$</G></a></font></p>\n<font size='10'>"..help_pool[i][3], name)
- end
- end
- end
- end
- function eventLoop()
- time = time + 0.5
- cooldown = cooldown - 0.5
- if (time >= 1) then
- tfm.exec.setUIMapName("<BV>CheeseClicker</BV> <G>|</G> " .. player .." tiene un apróximado de: <BV>" .. cheesePerSecond .. "</BV> quesos por segundo\n")
- if ((help_pool[1][3]) >= 1 or tonumber(help_pool[2][3]) >= 1 or tonumber(help_pool[3][3]) >= 1 or tonumber(help_pool[4][3]) >= 1 or tonumber(help_pool[5][3]) >= 1) then
- i = help_pool[1][3] + help_pool[2][3]*5 + help_pool[3][3]*10 + help_pool[4][3]*20 + help_pool[5][3]*50
- cheese = cheese + i
- cheesePerSecond = i
- end
- time = 0
- end
- updateTextArea(0, "<font size='35'>".. cheese .."<G>$</G></font>", k)
- end
- function eventChatCommand(name, command)
- local args = {}
- for arg in command:gmatch("[^%s]+") do
- table.insert(args, arg:lower())
- end
- if name ~= player then return end
- if args[1] == "save" then
- saveGame();
- elseif args[1] == "load" then
- new = table.concat(args)
- local loaded = string.split(new:sub(5), ":")
- loadGame(loaded[1], loaded[2], loaded[3], loaded[4], loaded[5], loaded[6])
- end
- end
- function saveGame()
- -- Quesos : Cursores : Vacas : Ratas : Granjero : Máquinas del tiempo
- line = cheese .. " : ".. help_pool[1][3] .. " : " .. help_pool[2][3] .. " : " .. help_pool[3][3] .. " : " .. help_pool[4][3] .. " : " .. help_pool[5][3] .. ""
- print("Here is your back up:")
- print(line)
- end
- function loadGame(cheeseVar, var1, var2, var3, var4, var5)
- startGame()
- cheese = cheeseVar
- help_pool[1][3], help_pool[2][3], help_pool[3][3], help_pool[4][3], help_pool[5][3] = tonumber(var1), tonumber(var2), tonumber(var3), tonumber(var4), tonumber(var5)
- updateTextArea(0, "<font size='35'>"..cheese.."<G>$</G></font>", name)
- updateTextArea(1, "", name)
- updateTextArea(2, "<font size='15'><a href='event:".. help_pool[1][1] .."'>".. help_pool[1][1] ..": <G>".. help_pool[1][2] .."$</G></a></font></p>\n<font size='10'>"..help_pool[1][3], name)
- updateTextArea(3, "<font size='15'><a href='event:".. help_pool[2][1] .."'>".. help_pool[2][1] ..": <G>".. help_pool[2][2] .."$</G></a></font></p>\n<font size='10'>"..help_pool[2][3], name)
- updateTextArea(4, "<font size='15'><a href='event:".. help_pool[3][1] .."'>".. help_pool[3][1] ..": <G>".. help_pool[3][2] .."$</G></a></font></p>\n<font size='10'>"..help_pool[3][3], name)
- updateTextArea(5, "<font size='15'><a href='event:".. help_pool[4][1] .."'>".. help_pool[4][1] ..": <G>".. help_pool[4][2] .."$</G></a></font></p>\n<font size='10'>"..help_pool[4][3], name)
- updateTextArea(6, "<font size='15'><a href='event:".. help_pool[5][1] .."'>".. help_pool[5][1] ..": <G>".. help_pool[5][2] .."$</G></a></font></p>\n<font size='10'>"..help_pool[5][3], name)
- end
- function eventMouse(name, x, y)
- if (x >= 4 and x <= 215) then
- if (y >= 94 and y <= 322) then
- cheese = cheese + 1
- updateTextArea(0, "<font size='35'>".. cheese .."<G>$</G></font>", name)
- tfm.exec.displayParticle(15, x, y, 0, 0, 0, 0)
- end
- end
- end
- function string.split(str, sep)
- local t={} ; i=1
- for str in string.gmatch(str, "([^"..sep.."]+)") do
- t[i] = str
- i = i + 1
- end
- return t
- end
- function round(num, idp)
- local mult = 10^(idp or 0)
- return math.floor(num * mult + 0.5) / mult
- end
- function updateTextArea(id, text)
- return table.foreach(tfm.get.room.playerList, function (k, v) ui.updateTextArea(id, text, k) end)
- end
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement