commit 1373446b3da5add164337026fc46b9c6ff407e02 Author: rubin Date: Sat Dec 31 12:50:55 2022 +0300 files add diff --git a/README.md b/README.md new file mode 100644 index 0000000..6d4142e --- /dev/null +++ b/README.md @@ -0,0 +1,10 @@ + +# **LUA xmas-clicker - Кликер новогодних шаров** +[![Cкачать](pictures/download.png)](bCraft.lua) +# [**Cкачать**](xmas-clicker.lua) + + +## **Кликер** +- *Само кликает на текстдравы ID=[19059, 19060, 19061, 19062, 19063]* +- *https://dev.prineside.com/ru/gtasa_samp_model_id/search/?q=XmasOrb* +- *Команда активации: /xmas [ms] - ms склько задержка между кликами* \ No newline at end of file diff --git a/pictures/download.png b/pictures/download.png new file mode 100644 index 0000000..7c13b4a Binary files /dev/null and b/pictures/download.png differ diff --git a/xmas-clicker.lua b/xmas-clicker.lua new file mode 100644 index 0000000..766be2e --- /dev/null +++ b/xmas-clicker.lua @@ -0,0 +1,48 @@ +clicker = false +wait_point = 0 +wait_clicker = 100 +plus_rand = 0 +model_xmas = { 19059, 19060, 19061, 19062, 19063 } + +function main() + while not isSampfuncsLoaded() do wait(100) end + repeat wait(0) until isSampAvailable() + + sampRegisterChatCommand("xmas", function(arg) + if arg:find("%d+") then + wait_clicker = tonumber(arg:match("(%d+)")) + end + + clicker = not clicker + local text = string.format("~Y~XMAS-CLICKER~n~%s", (clicker and "~G~ON~N~~Y~WAIT: "..wait_clicker or "~R~OFF")) + printStringNow(text, 1500) + end) + + while true do wait(0) + if clicker then + for a = 0, 2304 do + if sampTextdrawIsExists(a) then + local model = sampTextdrawGetModelRotationZoomVehColor(a) + if isVarInArr(model, model_xmas) then + if os.clock() * 1000 - wait_point > (wait_clicker + plus_rand) then + sampSendClickTextdraw(a) + plus_rand = math.random(50, 300) + wait_point = os.clock() * 1000 + end + end + end + end + end + end +end + +function isVarInArr(var, array) + local result = false + for i = 1, #array do + if array[i] == var then + result = true + break + end + end + return result +end \ No newline at end of file