Need help with afk bot.

Everlight

Active member
Joined
Dec 8, 2018
Messages
32
Reaction score
5
So ye, i tried make anti afk bot, on .lua but it's not working i don't know what im doing wrong. There is like table/gui where u need select GREEN text, and if u select wrong it u will write numbers in gui. So i need auto pressing TEXT, TEXT is GREEN.
Code:
ev = require 'lib.samp.events'

function ev.onShowDialog(dialogId,style,title,button1,button2,text)
if title.find('AFK r') then
lin = {}
for s in text:gmatch("[^\r\n]+") do
table.insert(lin, s)
end
for k,v in ipairs(lin) do
if v:find('{47AB3F}') then
sampSendDialogResponse(dialogId,1,k+1,'')
end
end
end
end
 

Attachments

  • sa-mp-038.png
    sa-mp-038.png
    82.1 KB · Views: 30

Parazitas

God
Joined
Jan 2, 2017
Messages
3,116
Solutions
5
Reaction score
882
Location
Lithuania
Simple code , low requirements.
PHP:
{$CLEO .cs}

0000: NOP

wait 10000

while true   
wait 0

if
0B4C:  samp is_dialog_active -1 // any dialog
then  
    0AC8: 0@ = allocate_memory_size 260
    0BD8: samp get_dialog_caption 0@
    if
    0C29: $NOT_USED = stristr string1 0@ string2 "AFK rëþimas" 
    then 
        0B54: samp 1@ = listbox_items_count
        1@ -= 1 
        for 0@ = 0 to 1@
            alloc 2@ = 256
            0B5B: samp get_listbox_item 0@ text_to 2@ 

            0AF8: "%s" -1 2@

            free 2@
        end
    end
end

end
 

Everlight

Active member
Joined
Dec 8, 2018
Messages
32
Reaction score
5
Simple code , low requirements.
PHP:
{$CLEO .cs}

0000: NOP

wait 10000

while true  
wait 0

if
0B4C:  samp is_dialog_active -1 // any dialog
then 
    0AC8: 0@ = allocate_memory_size 260
    0BD8: samp get_dialog_caption 0@
    if
    0C29: $NOT_USED = stristr string1 0@ string2 "AFK rëþimas"
    then
        0B54: samp 1@ = listbox_items_count
        1@ -= 1
        for 0@ = 0 to 1@
            alloc 2@ = 256
            0B5B: samp get_listbox_item 0@ text_to 2@

            0AF8: "%s" -1 2@

            free 2@
        end
    end
end

end
Will you help me? with it? i still can't figure it out..
 
Top