- 651
- 347

Здравствуйте, необходим скрипт, желательно на LUA, чтобы при нажатии на кнопку "1" на клавиатуре, нажимался текстдрав с числом 1. ID текстдравов приложил, также, если ты нажимаешь Enter, то нажимает на "Submit".
require 'lib.moonloader'
function main()
if not isSampLoaded() then return end
while not isSampAvailable() do wait(100) end
while true do wait(0)
if not sampIsChatInputActive() and not isSampfuncsConsoleActive() and not sampIsDialogActive() then -- Если закрыт чат, закрыта консоль SF и не открыт диалог-окно
if isKeyDown(48) then -- Клавиша 0
sampSendClickTextdraw(2057)
end
if isKeyDown(49) then -- Клавиша 1
sampSendClickTextdraw(2058)
end
if isKeyDown(50) then -- Клавиша 2
sampSendClickTextdraw(2053)
end
if isKeyDown(51) then -- Клавиша 3
sampSendClickTextdraw(2052)
end
if isKeyDown(52) then -- Клавиша 4
sampSendClickTextdraw(2056)
end
if isKeyDown(53) then -- Клавиша 5
sampSendClickTextdraw(2051)
end
if isKeyDown(54) then -- Клавиша 6
sampSendClickTextdraw(2049)
end
if isKeyDown(55) then -- Клавиша 7
sampSendClickTextdraw(2055)
end
if isKeyDown(56) then -- Клавиша 8
sampSendClickTextdraw(2054)
end
if isKeyDown(57) then -- Клавиша 9
sampSendClickTextdraw(2050)
end
if isKeyDown(13) then -- Клавиша Enter
sampSendClickTextdraw(648)
end
end
end
end
да я уже отредачил же)Он написал в раздел помощь, а не работа и услуги
Trinity.Сервер какой?, мне нужно лично протестировать то что я сделал по твоему описанию, чтобы не кидать тебе недоделанное.
Проверяй работоспособность.
Lua:require 'lib.moonloader' function main() if not isSampLoaded() then return end while not isSampAvailable() do wait(100) end while true do wait(0) if not sampIsChatInputActive() and not isSampfuncsConsoleActive() and not sampIsDialogActive() then -- Если закрыт чат, закрыта консоль SF и не открыт диалог-окно if isKeyDown(48) then -- Клавиша 0 sampSendClickTextdraw(2057) end if isKeyDown(49) then -- Клавиша 1 sampSendClickTextdraw(2058) end if isKeyDown(50) then -- Клавиша 2 sampSendClickTextdraw(2053) end if isKeyDown(51) then -- Клавиша 3 sampSendClickTextdraw(2052) end if isKeyDown(52) then -- Клавиша 4 sampSendClickTextdraw(2056) end if isKeyDown(53) then -- Клавиша 5 sampSendClickTextdraw(2051) end if isKeyDown(54) then -- Клавиша 6 sampSendClickTextdraw(2049) end if isKeyDown(55) then -- Клавиша 7 sampSendClickTextdraw(2055) end if isKeyDown(56) then -- Клавиша 8 sampSendClickTextdraw(2054) end if isKeyDown(57) then -- Клавиша 9 sampSendClickTextdraw(2050) end if isKeyDown(13) then -- Клавиша Enter sampSendClickTextdraw(648) end end end end
Значит ID текстдравов не те указал я, попробуй поменять.Trinity.
Не работает, в логе всё нормально.
Окей.Значит ID текстдравов не те указал я, попробуй поменять.
Значит ID текстдравов не те указал я, попробуй поменять.
require 'lib.moonloader'
function main()
if not isSampLoaded() then return end
while not isSampAvailable() do wait(100) end
while true do wait(0)
if not sampIsChatInputActive() and not isSampfuncsConsoleActive() and not sampIsDialogActive() then -- Если закрыт чат, закрыта консоль SF и не открыт диалог-окно
if isKeyDown(48) then -- Клавиша 0
sampSendClickTextdraw(642)
end
if isKeyDown(49) then -- Клавиша 1
sampSendClickTextdraw(643)
end
if isKeyDown(50) then -- Клавиша 2
sampSendClickTextdraw(638)
end
if isKeyDown(51) then -- Клавиша 3
sampSendClickTextdraw(637)
end
if isKeyDown(52) then -- Клавиша 4
sampSendClickTextdraw(641)
end
if isKeyDown(53) then -- Клавиша 5
sampSendClickTextdraw(636)
end
if isKeyDown(54) then -- Клавиша 6
sampSendClickTextdraw(634)
end
if isKeyDown(55) then -- Клавиша 7
sampSendClickTextdraw(640)
end
if isKeyDown(56) then -- Клавиша 8
sampSendClickTextdraw(639)
end
if isKeyDown(57) then -- Клавиша 9
sampSendClickTextdraw(635)
end
if isKeyDown(13) then -- Клавиша Enter
sampSendClickTextdraw(649)
end
end
end
end
Окей.
Lua:require 'lib.moonloader' function main() if not isSampLoaded() then return end while not isSampAvailable() do wait(100) end while true do wait(0) if not sampIsChatInputActive() and not isSampfuncsConsoleActive() and not sampIsDialogActive() then -- Если закрыт чат, закрыта консоль SF и не открыт диалог-окно if isKeyJustPressed(48) then -- Клавиша 0 sampSendClickTextdraw(642) end if isKeyJustPressed(49) then -- Клавиша 1 sampSendClickTextdraw(643) end if isKeyJustPressed(50) then -- Клавиша 2 sampSendClickTextdraw(638) end if isKeyJustPressed(51) then -- Клавиша 3 sampSendClickTextdraw(637) end if isKeyJustPressed(52) then -- Клавиша 4 sampSendClickTextdraw(641) end if isKeyJustPressed(53) then -- Клавиша 5 sampSendClickTextdraw(636) end if isKeyDown(54) then -- Клавиша 6 sampSendClickTextdraw(634) end if isKeyJustPressed(55) then -- Клавиша 7 sampSendClickTextdraw(640) end if isKeyJustPressed(56) then -- Клавиша 8 sampSendClickTextdraw(639) end if isKeyJustPressed(57) then -- Клавиша 9 sampSendClickTextdraw(635) end if isKeyJustPressed(13) then -- Клавиша Enter sampSendClickTextdraw(649) end end end end
Короче, я поменял, скрипт реагирует на нажатия, но если я нажму на клавиатуре "1", то он 4 раза введет 1 (пин-код состоит из 4-ёх чисел). Как фиксить?
Тема актуальна.
require 'lib.moonloader'
function main()
if not isSampLoaded() then return end
while not isSampAvailable() do wait(100) end
while true do wait(0)
if not sampIsChatInputActive() and not isSampfuncsConsoleActive() and not sampIsDialogActive() then -- Если закрыт чат, закрыта консоль SF и не открыт диалог-окно
if isKeyDown(48) then -- Клавиша 0
sampSendClickTextdraw(642) wait(1000)
end
if isKeyDown(49) then -- Клавиша 1
sampSendClickTextdraw(643) wait(1000)
end
if isKeyDown(50) then -- Клавиша 2
sampSendClickTextdraw(638) wait(1000)
end
if isKeyDown(51) then -- Клавиша 3
sampSendClickTextdraw(637) wait(1000)
end
if isKeyDown(52) then -- Клавиша 4
sampSendClickTextdraw(641) wait(1000)
end
if isKeyDown(53) then -- Клавиша 5
sampSendClickTextdraw(636) wait(1000)
end
if isKeyDown(54) then -- Клавиша 6
sampSendClickTextdraw(634) wait(1000)
end
if isKeyDown(55) then -- Клавиша 7
sampSendClickTextdraw(640) wait(1000)
end
if isKeyDown(56) then -- Клавиша 8
sampSendClickTextdraw(639) wait(1000)
end
if isKeyDown(57) then -- Клавиша 9
sampSendClickTextdraw(635) wait(1000)
end
if isKeyDown(13) then -- Клавиша Enter
sampSendClickTextdraw(649) wait(1000)
end
end
end
end
Lua:require 'lib.moonloader' function main() if not isSampLoaded() then return end while not isSampAvailable() do wait(100) end while true do wait(0) if not sampIsChatInputActive() and not isSampfuncsConsoleActive() and not sampIsDialogActive() then -- Если закрыт чат, закрыта консоль SF и не открыт диалог-окно if isKeyDown(48) then -- Клавиша 0 sampSendClickTextdraw(642) wait(1000) end if isKeyDown(49) then -- Клавиша 1 sampSendClickTextdraw(643) wait(1000) end if isKeyDown(50) then -- Клавиша 2 sampSendClickTextdraw(638) wait(1000) end if isKeyDown(51) then -- Клавиша 3 sampSendClickTextdraw(637) wait(1000) end if isKeyDown(52) then -- Клавиша 4 sampSendClickTextdraw(641) wait(1000) end if isKeyDown(53) then -- Клавиша 5 sampSendClickTextdraw(636) wait(1000) end if isKeyDown(54) then -- Клавиша 6 sampSendClickTextdraw(634) wait(1000) end if isKeyDown(55) then -- Клавиша 7 sampSendClickTextdraw(640) wait(1000) end if isKeyDown(56) then -- Клавиша 8 sampSendClickTextdraw(639) wait(1000) end if isKeyDown(57) then -- Клавиша 9 sampSendClickTextdraw(635) wait(1000) end if isKeyDown(13) then -- Клавиша Enter sampSendClickTextdraw(649) wait(1000) end end end end
local textdraw = {
[48] = 642,
[49] = 643,
[50] = 638,
[51] = 637,
[52] = 641,
[53] = 636,
[54] = 634,
[55] = 640,
[56] = 639,
[57] = 635,
[13] = 649
}
function main()
if not isSampLoaded() then return end
while not isSampAvailable() do wait(100) end
while true do
wait(0)
if not sampIsChatInputActive() and not isSampfuncsConsoleActive() and not sampIsDialogActive() then
for key, value in ipairs(textdraw) do
if isKeyJustPressed(key) then
sampSendClickTextdraw(value)
end
end
end
end
end
Флуда не будет при нажатии??Lua:local textdraw = { [48] = 642, [49] = 643, [50] = 638, [51] = 637, [52] = 641, [53] = 636, [54] = 634, [55] = 640, [56] = 639, [57] = 635, [13] = 649 } function main() if not isSampLoaded() then return end while not isSampAvailable() do wait(100) end while true do wait(0) if not sampIsChatInputActive() and not isSampfuncsConsoleActive() and not sampIsDialogActive() then for key, value in ipairs(textdraw) do if isKeyJustPressed(key) then sampSendClickTextdraw(value) end end end end end
ТакФлуда не будет при нажатии??
PS: Люблю говнокодить!:monkey:
Вообще не работает, лог в порядке.Lua:local textdraw = { [48] = 642, [49] = 643, [50] = 638, [51] = 637, [52] = 641, [53] = 636, [54] = 634, [55] = 640, [56] = 639, [57] = 635, [13] = 649 } function main() if not isSampLoaded() then return end while not isSampAvailable() do wait(100) end while true do wait(0) if not sampIsChatInputActive() and not isSampfuncsConsoleActive() and not sampIsDialogActive() then for key, value in ipairs(textdraw) do if isKeyJustPressed(key) then sampSendClickTextdraw(value) end end end end end
Всё также плохо, нажимаю, он с задержкой нажимает, он просто вводит одно и то же число, независимо, куда я нажимал.Флуда не будет при нажатии??
PS: Люблю говнокодить!:monkey:
Мой то код проверил? Выше глянь: https://blast.hk/threads/24459/#post-253594Так
Вообще не работает, лог в порядке.
Всё также плохо, нажимаю, он с задержкой нажимает, он просто вводит одно и то же число, независимо, куда я нажимал.
Актуально.
require 'lib.moonloader'
function main()
if not isSampLoaded() then return end
while not isSampAvailable() do wait(100) end
while true do wait(0)
if not sampIsChatInputActive() and not isSampfuncsConsoleActive() and not sampIsDialogActive() then -- Если закрыт чат, закрыта консоль SF и не открыт диалог-окно
if isKeyJustPressed(48) then -- Клавиша 0
sampSendClickTextdraw(642) wait(1000)
end
if isKeyJustPressed(49) then -- Клавиша 1
sampSendClickTextdraw(643) wait(1000)
end
if isKeyJustPressed(50) then -- Клавиша 2
sampSendClickTextdraw(638) wait(1000)
end
if isKeyJustPressed(51) then -- Клавиша 3
sampSendClickTextdraw(637) wait(1000)
end
if isKeyJustPressed(52) then -- Клавиша 4
sampSendClickTextdraw(641) wait(1000)
end
if isKeyJustPressed(53) then -- Клавиша 5
sampSendClickTextdraw(636) wait(1000)
end
if isKeyJustPressed(54) then -- Клавиша 6
sampSendClickTextdraw(634) wait(1000)
end
if isKeyJustPressed(55) then -- Клавиша 7
sampSendClickTextdraw(640) wait(1000)
end
if isKeyJustPressed(56) then -- Клавиша 8
sampSendClickTextdraw(639) wait(1000)
end
if isKeyJustPressed(57) then -- Клавиша 9
sampSendClickTextdraw(635) wait(1000)
end
if isKeyJustPressed(13) then -- Клавиша Enter
sampSendClickTextdraw(649) wait(1000)
end
end
end
end
Да, ID текстдравов не меняются.ид тд статический?
Он одно и тоже число набирает, только сейчас с большой задержкой.Lua:require 'lib.moonloader' function main() if not isSampLoaded() then return end while not isSampAvailable() do wait(100) end while true do wait(0) if not sampIsChatInputActive() and not isSampfuncsConsoleActive() and not sampIsDialogActive() then -- Если закрыт чат, закрыта консоль SF и не открыт диалог-окно if isKeyJustPressed(48) then -- Клавиша 0 sampSendClickTextdraw(642) wait(1000) end if isKeyJustPressed(49) then -- Клавиша 1 sampSendClickTextdraw(643) wait(1000) end if isKeyJustPressed(50) then -- Клавиша 2 sampSendClickTextdraw(638) wait(1000) end if isKeyJustPressed(51) then -- Клавиша 3 sampSendClickTextdraw(637) wait(1000) end if isKeyJustPressed(52) then -- Клавиша 4 sampSendClickTextdraw(641) wait(1000) end if isKeyJustPressed(53) then -- Клавиша 5 sampSendClickTextdraw(636) wait(1000) end if isKeyJustPressed(54) then -- Клавиша 6 sampSendClickTextdraw(634) wait(1000) end if isKeyJustPressed(55) then -- Клавиша 7 sampSendClickTextdraw(640) wait(1000) end if isKeyJustPressed(56) then -- Клавиша 8 sampSendClickTextdraw(639) wait(1000) end if isKeyJustPressed(57) then -- Клавиша 9 sampSendClickTextdraw(635) wait(1000) end if isKeyJustPressed(13) then -- Клавиша Enter sampSendClickTextdraw(649) wait(1000) end end end end