Текст драв + кнопка

Foxy01

Известный
Автор темы
283
125
Версия MoonLoader
.026-beta
Как активировать кнопку по текст драву?
(там 3 варианта N, H, Y)
gta_sa_gRo60cALZo.png
 
Решение
Крашит
SAMPFUNCS v5.4.1-final rel.21 (SA-MP 0.3.7-R1)
Compiled: Dec 24 2018 03:13:37

Copyright (c) 2013-2018, BlastHack Team <blast.hk>

Base address: 0x74630000.
Initializing opcodes...
Opcodes initialized successfully. Total opcodes: 382.
Hook "CTimer::GetRealTimeScale" installed.
Hook "CPad::Update" installed.
Hook "CCamera::RenderMotionBlur" installed.
Hook "CScriptThread::AddScriptToQueue" installed.
Hook "CScriptThread::RemoveScriptFromQueue" installed.
Hook "CScriptThread::Process" installed.
Hook "WinMainLoop" installed.
Hook "CLoadingScreen::RenderSplash" installed.
Hook "CVehicle::CVehicle" installed.
Hook "CVehicle::~CVehicle" installed.
Hook "CPed::CPed" installed.
Hook "CPed::~CPed" installed.
Initializing...

Foxy01

Известный
Автор темы
283
125
В беск. цикл кидаешь эту функцию https://wiki.blast.hk/ru/moonloader/lua/sampTextdrawGetString
И потом через text:find ищешь текст который надо и нажимаешь кнопки через https://wiki.blast.hk/ru/moonloader/lua/setVirtualKeyDown
Самое простое и тупое решение
Крашит
SAMPFUNCS v5.4.1-final rel.21 (SA-MP 0.3.7-R1)
Compiled: Dec 24 2018 03:13:37

Copyright (c) 2013-2018, BlastHack Team <blast.hk>

Base address: 0x74630000.
Initializing opcodes...
Opcodes initialized successfully. Total opcodes: 382.
Hook "CTimer::GetRealTimeScale" installed.
Hook "CPad::Update" installed.
Hook "CCamera::RenderMotionBlur" installed.
Hook "CScriptThread::AddScriptToQueue" installed.
Hook "CScriptThread::RemoveScriptFromQueue" installed.
Hook "CScriptThread::Process" installed.
Hook "WinMainLoop" installed.
Hook "CLoadingScreen::RenderSplash" installed.
Hook "CVehicle::CVehicle" installed.
Hook "CVehicle::~CVehicle" installed.
Hook "CPed::CPed" installed.
Hook "CPed::~CPed" installed.
Initializing plugins...
SF Plugin "FixReconnect.sf" loaded.
SF Plugin "Online_by_Alex_Root.sf" loaded.
samp.dll base addres: 0x03C20000
Hook "SAMP: CNetGame::CNetGame" installed.
Hook "SAMP: CDialog::Close" installed.
Hook "SAMP: QuitGame" installed.
Hook "SAMP: CCmdWindow::ProcessInput" installed.
[ML] (system) Session started.
[ML]
MoonLoader v.026.5-beta loaded.
[ML] Developers: FYP, hnnssy, EvgeN 1137

[ML] Copyright (c) 2016, BlastHack Team
[ML] https://www.blast.hk/moonloader/

[ML] (info) Working directory: C:\Games\GTA San Andreas1\moonloader
[ML] (system) Installing pre-game hooks...
[ML] (system) Hooks installed.
[ML] (system) Loading script 'C:\Games\GTA San Andreas1\moonloader\AutoReboot.lua'...
[ML] (system) ML-AutoReboot: Loaded successfully.
[ML] (system) Loading script 'C:\Games\GTA San Andreas1\moonloader\bot beta — êîïèÿ.lua'...
[ML] (system) bot beta — êîïèÿ.lua: Loaded successfully.
[ML] (system) Loading script 'C:\Games\GTA San Andreas1\moonloader\bot beta.lua'...
[ML] (system) bot beta.lua: Loaded successfully.
[ML] (system) Loading script 'C:\Games\GTA San Andreas1\moonloader\bot beta2.lua'...
[ML] (system) bot beta2.lua: Loaded successfully.
[ML] (system) Loading script 'C:\Games\GTA San Andreas1\moonloader\bot beta3.lua'...
[ML] (system) bot beta3.lua: Loaded successfully.
[ML] (system) Loading script 'C:\Games\GTA San Andreas1\moonloader\BufferCleanerAuto.lua'...
[ML] (system) BufferCleanerAuto.lua: Loaded successfully.
[ML] (system) Loading script 'C:\Games\GTA San Andreas1\moonloader\bypasser_2.lua'...
[ML] (system) bypasser_2.lua: Loaded successfully.
[ML] (system) Loading script 'C:\Games\GTA San Andreas1\moonloader\check-moonloader-updates.lua'...
[ML] (system) Check MoonLoader Updates: Loaded successfully.
[ML] (system) Loading script 'C:\Games\GTA San Andreas1\moonloader\colchik_v2.lua.lua'...
[ML] (system) colchik_v2.lua.lua: Loaded successfully.
[ML] (system) Loading script 'C:\Games\GTA San Andreas1\moonloader\Dont Close Input.lua'...
[ML] (system) Dont Close Input.lua: Loaded successfully.
[ML] (system) Loading script 'C:\Games\GTA San Andreas1\moonloader\reload_all.lua'...
[ML] (system) ML-ReloadAll: Loaded successfully.
[ML] (system) Loading script 'C:\Games\GTA San Andreas1\moonloader\SF Integration.lua'...
[ML] (system) SF Integration: Loaded successfully.
[ML] (system) Loading script 'C:\Games\GTA San Andreas1\moonloader\Sweet Connect.lua'...
[ML] (system) Sweet Connect.lua: Loaded successfully.
[ML] (system) Loading script 'C:\Games\GTA San Andreas1\moonloader\UltraFuck_2.4.luac'...
[ML] (system) UltraFuck: Loaded successfully.
[ML] (system) Installing post-load hooks...
[ML] (system) Hooks installed.
[ML] (system) Dont Close Input.lua: Script terminated. (100FAF2C)
Direct3DDevice9 hook installed.
Chat++ by BlackKnigga loaded!
Hook "SAMP: RakPeer::HandleRPCPacket" installed.
Initializing SAMP data...
Info initialized.
Pools initialized.
Player pool initialized.
Vehicle pool initialized.
Chat initialized.
Input initialized.
Death list initialized.
Dialog initialized.
Misc data initialized.
Scoreboard initialized.
RakNet initialized.
SAMPFUNCS v5.4.1-final rel.21 (SA-MP 0.3.7-R1) completely loaded!
[ML] (error) bot.lua: C:\Games\GTA San Andreas1\moonloader\bot.lua:11: attempt to yield across C-call boundary
stack traceback:
[C]: in function 'wait'
C:\Games\GTA San Andreas1\moonloader\bot.lua:11: in function 'callback'
...mes\GTA San Andreas1\moonloader\lib\samp\events\core.lua:79: in function <...mes\GTA San Andreas1\moonloader\lib\samp\events\core.lua:53>
[ML] (error) bot.lua: Script died due to an error. (100FB85C)
Kog:
sampev = require("lib.samp.events")

function sampev.onTextDrawSetString(id, text)
  if id == 2173 then
  if text:match("~w~PRESS_~g~H") then
  setVirtualKeyDown(VK_H, true)
  wait(500)
  setVirtualKeyDown(VK_H, false)
  elseif text:match("~w~PRESS_~g~Y") then
  setVirtualKeyDown(VK_Y, true)
  wait(500)
  setVirtualKeyDown(VK_Y, false)
  elseif text:match("~w~PRESS_~g~N") then
  setVirtualKeyDown(VK_N, true)
  wait(500)
  setVirtualKeyDown(VK_N, false)
  end
  end
  end
 
Последнее редактирование:

MaksQ

Известный
967
846
Крашит
SAMPFUNCS v5.4.1-final rel.21 (SA-MP 0.3.7-R1)
Compiled: Dec 24 2018 03:13:37

Copyright (c) 2013-2018, BlastHack Team <blast.hk>

Base address: 0x74630000.
Initializing opcodes...
Opcodes initialized successfully. Total opcodes: 382.
Hook "CTimer::GetRealTimeScale" installed.
Hook "CPad::Update" installed.
Hook "CCamera::RenderMotionBlur" installed.
Hook "CScriptThread::AddScriptToQueue" installed.
Hook "CScriptThread::RemoveScriptFromQueue" installed.
Hook "CScriptThread::Process" installed.
Hook "WinMainLoop" installed.
Hook "CLoadingScreen::RenderSplash" installed.
Hook "CVehicle::CVehicle" installed.
Hook "CVehicle::~CVehicle" installed.
Hook "CPed::CPed" installed.
Hook "CPed::~CPed" installed.
Initializing plugins...
SF Plugin "FixReconnect.sf" loaded.
SF Plugin "Online_by_Alex_Root.sf" loaded.
samp.dll base addres: 0x03C20000
Hook "SAMP: CNetGame::CNetGame" installed.
Hook "SAMP: CDialog::Close" installed.
Hook "SAMP: QuitGame" installed.
Hook "SAMP: CCmdWindow::ProcessInput" installed.
[ML] (system) Session started.
[ML]
MoonLoader v.026.5-beta loaded.
[ML] Developers: FYP, hnnssy, EvgeN 1137

[ML] Copyright (c) 2016, BlastHack Team
[ML] https://www.blast.hk/moonloader/

[ML] (info) Working directory: C:\Games\GTA San Andreas1\moonloader
[ML] (system) Installing pre-game hooks...
[ML] (system) Hooks installed.
[ML] (system) Loading script 'C:\Games\GTA San Andreas1\moonloader\AutoReboot.lua'...
[ML] (system) ML-AutoReboot: Loaded successfully.
[ML] (system) Loading script 'C:\Games\GTA San Andreas1\moonloader\bot beta — êîïèÿ.lua'...
[ML] (system) bot beta — êîïèÿ.lua: Loaded successfully.
[ML] (system) Loading script 'C:\Games\GTA San Andreas1\moonloader\bot beta.lua'...
[ML] (system) bot beta.lua: Loaded successfully.
[ML] (system) Loading script 'C:\Games\GTA San Andreas1\moonloader\bot beta2.lua'...
[ML] (system) bot beta2.lua: Loaded successfully.
[ML] (system) Loading script 'C:\Games\GTA San Andreas1\moonloader\bot beta3.lua'...
[ML] (system) bot beta3.lua: Loaded successfully.
[ML] (system) Loading script 'C:\Games\GTA San Andreas1\moonloader\BufferCleanerAuto.lua'...
[ML] (system) BufferCleanerAuto.lua: Loaded successfully.
[ML] (system) Loading script 'C:\Games\GTA San Andreas1\moonloader\bypasser_2.lua'...
[ML] (system) bypasser_2.lua: Loaded successfully.
[ML] (system) Loading script 'C:\Games\GTA San Andreas1\moonloader\check-moonloader-updates.lua'...
[ML] (system) Check MoonLoader Updates: Loaded successfully.
[ML] (system) Loading script 'C:\Games\GTA San Andreas1\moonloader\colchik_v2.lua.lua'...
[ML] (system) colchik_v2.lua.lua: Loaded successfully.
[ML] (system) Loading script 'C:\Games\GTA San Andreas1\moonloader\Dont Close Input.lua'...
[ML] (system) Dont Close Input.lua: Loaded successfully.
[ML] (system) Loading script 'C:\Games\GTA San Andreas1\moonloader\reload_all.lua'...
[ML] (system) ML-ReloadAll: Loaded successfully.
[ML] (system) Loading script 'C:\Games\GTA San Andreas1\moonloader\SF Integration.lua'...
[ML] (system) SF Integration: Loaded successfully.
[ML] (system) Loading script 'C:\Games\GTA San Andreas1\moonloader\Sweet Connect.lua'...
[ML] (system) Sweet Connect.lua: Loaded successfully.
[ML] (system) Loading script 'C:\Games\GTA San Andreas1\moonloader\UltraFuck_2.4.luac'...
[ML] (system) UltraFuck: Loaded successfully.
[ML] (system) Installing post-load hooks...
[ML] (system) Hooks installed.
[ML] (system) Dont Close Input.lua: Script terminated. (100FAF2C)
Direct3DDevice9 hook installed.
Chat++ by BlackKnigga loaded!
Hook "SAMP: RakPeer::HandleRPCPacket" installed.
Initializing SAMP data...
Info initialized.
Pools initialized.
Player pool initialized.
Vehicle pool initialized.
Chat initialized.
Input initialized.
Death list initialized.
Dialog initialized.
Misc data initialized.
Scoreboard initialized.
RakNet initialized.
SAMPFUNCS v5.4.1-final rel.21 (SA-MP 0.3.7-R1) completely loaded!
[ML] (error) bot.lua: C:\Games\GTA San Andreas1\moonloader\bot.lua:11: attempt to yield across C-call boundary
stack traceback:
[C]: in function 'wait'
C:\Games\GTA San Andreas1\moonloader\bot.lua:11: in function 'callback'
...mes\GTA San Andreas1\moonloader\lib\samp\events\core.lua:79: in function <...mes\GTA San Andreas1\moonloader\lib\samp\events\core.lua:53>
[ML] (error) bot.lua: Script died due to an error. (100FB85C)
Kog:
sampev = require("lib.samp.events")

function sampev.onTextDrawSetString(id, text)
  if id == 2173 then
  if text:match("~w~PRESS_~g~H") then
  setVirtualKeyDown(VK_H, true)
  wait(500)
  setVirtualKeyDown(VK_H, false)
  elseif text:match("~w~PRESS_~g~Y") then
  setVirtualKeyDown(VK_Y, true)
  wait(500)
  setVirtualKeyDown(VK_Y, false)
  elseif text:match("~w~PRESS_~g~N") then
  setVirtualKeyDown(VK_N, true)
  wait(500)
  setVirtualKeyDown(VK_N, false)
  end
  end
  end
Lua:
sampev = require("lib.samp.events")
function sampev.onTextDrawSetString(id, text)
    if id == 2173 then
        if text:find("~w~PRESS_~g~H") then
            lua_thread.create(function()
                setVirtualKeyDown(VK_H, true)
                wait(500)
                setVirtualKeyDown(VK_H, false)
            end)
        elseif text:find("~w~PRESS_~g~Y") then
            lua_thread.create(function()
                setVirtualKeyDown(VK_Y, true)
                wait(500)
                setVirtualKeyDown(VK_Y, false)
            end)
        elseif text:find("~w~PRESS_~g~N") then
            lua_thread.create(function()
                setVirtualKeyDown(VK_N, true)
                wait(500)
                setVirtualKeyDown(VK_N, false)
            end)
        end
    end
end
 
  • Нравится
  • Вау
Реакции: Otvertka1337 и Foxy01