Вопросы по CLEO-скриптингу

kennex

Известный
69
25

Karbun

Участник
112
3
Парни, на сервере есть мини-игра, где надо кликать на стрелочки, которые появляются:
P9vprDT.png


И я хочу реализовать, чтобы скрипт сам кликал на эти стрелочки, поможете найти ошибку?
CLEO:
{$CLEO}
0000:

while not Samp.Available()
wait 100
end




while true
wait 0
if 0C5D: samp textdraw 2116 is_exists
then
    
     if 0C18: 24@ = strstr string1 2116 string2 "LD_BEAT:up"
     then
     for 15@ = 2117 to 2120
     0C5A: samp textdraw 15@ get_string_to 10@
         if 0C18: 24@ = strstr string1 10@ string2 "LD_BEAT:up"
         then
         wait 500
         0BCA: samp send_click_textdraw 15@
         end
     end
     end

     if 0C18: 24@ = strstr string1 2116 string2 "LD_BEAT:left"
     then
     for 15@ = 2117 to 2120
     0C5A: samp textdraw 15@ get_string_to 10@
         if 0C18: 24@ = strstr string1 10@ string2 "LD_BEAT:left"
         then
         wait 500
         0BCA: samp send_click_textdraw 15@
         end
     end
     end

     if 0C18: 24@ = strstr string1 2116 string2 "LD_BEAT:right"
     then
     for 15@ = 2117 to 2120
     0C5A: samp textdraw 15@ get_string_to 10@
         if 0C18: 24@ = strstr string1 10@ string2 "LD_BEAT:right"
         then
         wait 500
         0BCA: samp send_click_textdraw 15@
         end
     end
     end

     if 0C18: 24@ = strstr string1 2116 string2 "LD_BEAT:down"
     then
     for 15@ = 2117 to 2120
     0C5A: samp textdraw 15@ get_string_to 10@
         if 0C18: 24@ = strstr string1 10@ string2 "LD_BEAT:down"
         then
         wait 500
         0BCA: samp send_click_textdraw 15@
         end
     end
     end
end    
end
ID ТЕКСТДРАВА: 2116
Текст из текстдрава: LD_BEAT:left
--------------------------------------------------------
ID ТЕКСТДРАВА: 2117
Текст из текстдрава: LD_BEAT:right
--------------------------------------------------------
ID ТЕКСТДРАВА: 2118
Текст из текстдрава: LD_BEAT:down
--------------------------------------------------------
ID ТЕКСТДРАВА: 2119
Текст из текстдрава: LD_BEAT:up
--------------------------------------------------------
ID ТЕКСТДРАВА: 2120
Текст из текстдрава: LD_BEAT:up
 

Karbun

Участник
112
3
Поправил, но всё-равно где-то ошибка:
CLEO:
{$CLEO}
0000:

while not Samp.Available()
wait 100
end




while true
wait 0
if 0C5D: samp textdraw 2116 is_exists
then
     0C5A: samp textdraw 2116 get_string_to 15@
     if 0C18: 24@ = strstr string1 15@ string2 "LD_BEAT:up"
     then
     for 15@ = 2117 to 2120
     0C5A: samp textdraw 15@ get_string_to 10@
         if 0C18: 24@ = strstr string1 10@ string2 "LD_BEAT:up"
         then
         wait 500
         0BCA: samp send_click_textdraw 15@
         end
     end
     end

     if 0C18: 24@ = strstr string1 15@ string2 "LD_BEAT:left"
     then
     for 15@ = 2117 to 2120
     0C5A: samp textdraw 15@ get_string_to 10@
         if 0C18: 24@ = strstr string1 10@ string2 "LD_BEAT:left"
         then
         wait 500
         0BCA: samp send_click_textdraw 15@
         end
     end
     end

     if 0C18: 24@ = strstr string1 15@ string2 "LD_BEAT:right"
     then
     for 15@ = 2117 to 2120
     0C5A: samp textdraw 15@ get_string_to 10@
         if 0C18: 24@ = strstr string1 10@ string2 "LD_BEAT:right"
         then
         wait 500
         0BCA: samp send_click_textdraw 15@
         end
     end
     end

     if 0C18: 24@ = strstr string1 15@ string2 "LD_BEAT:down"
     then
     for 15@ = 2117 to 2120
     0C5A: samp textdraw 15@ get_string_to 10@
         if 0C18: 24@ = strstr string1 10@ string2 "LD_BEAT:down"
         then
         wait 500
         0BCA: samp send_click_textdraw 15@
         end
     end
     end
end    
end
 

hnnssy

Известный
Друг
2,684
2,750
память под текст текстдрава не выделена
дальше не смотрел

и зачем столько кода?
получаешь текст 2116 текстдрава, потом получаешь текст следующих трёх и сравниваешь его с 2116, если совпадает, кликаешь
4 цикла там не нужно
 
Последнее редактирование модератором:

Karbun

Участник
112
3
Память я выделил, но всё-равно чего-то нехватает.
CLEO:
{$CLEO}
0000:

while not Samp.Available()
wait 100
end

alloc 15@ = 256
alloc 10@ = 256
alloc 24@ = 256

while true
wait 0
if 0C5D: samp textdraw 2116 is_exists
then
     0C5A: samp textdraw 2116 get_string_to 15@
     if 0C18: 24@ = strstr string1 15@ string2 "LD_BEAT:up"
     then
     for 15@ = 2117 to 2120
     0C5A: samp textdraw 15@ get_string_to 10@
         if 0C18: 24@ = strstr string1 10@ string2 "LD_BEAT:up"
         then
         wait 500
         0BCA: samp send_click_textdraw 15@
         end
     end
     end

     if 0C18: 24@ = strstr string1 15@ string2 "LD_BEAT:left"
     then
     for 15@ = 2117 to 2120
     0C5A: samp textdraw 15@ get_string_to 10@
         if 0C18: 24@ = strstr string1 10@ string2 "LD_BEAT:left"
         then
         wait 500
         0BCA: samp send_click_textdraw 15@
         end
     end
     end

     if 0C18: 24@ = strstr string1 15@ string2 "LD_BEAT:right"
     then
     for 15@ = 2117 to 2120
     0C5A: samp textdraw 15@ get_string_to 10@
         if 0C18: 24@ = strstr string1 10@ string2 "LD_BEAT:right"
         then
         wait 500
         0BCA: samp send_click_textdraw 15@
         end
     end
     end

     if 0C18: 24@ = strstr string1 15@ string2 "LD_BEAT:down"
     then
     for 15@ = 2117 to 2120
     0C5A: samp textdraw 15@ get_string_to 10@
         if 0C18: 24@ = strstr string1 10@ string2 "LD_BEAT:down"
         then
         wait 500
         0BCA: samp send_click_textdraw 15@
         end
     end
     end
end    
end
Ну а насчет циклов, я их уберу когда работать станет
 

BlackKnigga

Известный
BH Team
922
445
Память я выделил, но всё-равно чего-то нехватает.
CLEO:
{$CLEO}
0000:

while not Samp.Available()
wait 100
end

alloc 15@ = 256
alloc 10@ = 256
alloc 24@ = 256

while true
wait 0
if 0C5D: samp textdraw 2116 is_exists
then
     0C5A: samp textdraw 2116 get_string_to 15@
     if 0C18: 24@ = strstr string1 15@ string2 "LD_BEAT:up"
     then
     for 15@ = 2117 to 2120
     0C5A: samp textdraw 15@ get_string_to 10@
         if 0C18: 24@ = strstr string1 10@ string2 "LD_BEAT:up"
         then
         wait 500
         0BCA: samp send_click_textdraw 15@
         end
     end
     end

     if 0C18: 24@ = strstr string1 15@ string2 "LD_BEAT:left"
     then
     for 15@ = 2117 to 2120
     0C5A: samp textdraw 15@ get_string_to 10@
         if 0C18: 24@ = strstr string1 10@ string2 "LD_BEAT:left"
         then
         wait 500
         0BCA: samp send_click_textdraw 15@
         end
     end
     end

     if 0C18: 24@ = strstr string1 15@ string2 "LD_BEAT:right"
     then
     for 15@ = 2117 to 2120
     0C5A: samp textdraw 15@ get_string_to 10@
         if 0C18: 24@ = strstr string1 10@ string2 "LD_BEAT:right"
         then
         wait 500
         0BCA: samp send_click_textdraw 15@
         end
     end
     end

     if 0C18: 24@ = strstr string1 15@ string2 "LD_BEAT:down"
     then
     for 15@ = 2117 to 2120
     0C5A: samp textdraw 15@ get_string_to 10@
         if 0C18: 24@ = strstr string1 10@ string2 "LD_BEAT:down"
         then
         wait 500
         0BCA: samp send_click_textdraw 15@
         end
     end
     end
end   
end
Ну а насчет циклов, я их уберу когда работать станет
Пока ты их не уберешь работать не станет. Зачем они тут вообще?
 

Karbun

Участник
112
3
Так и не получается найти ошибку....:help:

Попробовал сделать вот так, вроде нажимает, но, похоже с ошибками:
CLEO:
{$CLEO}
0000:

while not Samp.Available()
wait 100
end

while true
wait 0
if 0C5D: samp textdraw 2116 is_exists
then
     0C5A: samp textdraw 2116 get_string_to 15@
     0C5A: samp textdraw 2117 get_string_to 16@
     0C5A: samp textdraw 2118 get_string_to 17@
     0C5A: samp textdraw 2119 get_string_to 18@
     0C5A: samp textdraw 2120 get_string_to 19@
    
     if
        0039: 16@ == 15@
        then
        wait 500
        0BCA: samp send_click_textdraw 2117
        end
     if
        0039: 17@ == 15@
        then
        wait 500
        0BCA: samp send_click_textdraw 2118
        end
    if
        0039: 18@ == 15@
        then
        wait 500
        0BCA: samp send_click_textdraw 2119
        end
    if
        0039: 19@ == 15@
        then
        wait 500
        0BCA: samp send_click_textdraw 2120
        end
end
end
 
Последнее редактирование модератором:

BlackKnigga

Известный
BH Team
922
445
Попробовал сделать вот так, вроде нажимает, но, похоже с ошибками:
CLEO:
{$CLEO}
0000:

while not Samp.Available()
wait 100
end

while true
wait 0
if 0C5D: samp textdraw 2116 is_exists
then
     0C5A: samp textdraw 2116 get_string_to 15@
     0C5A: samp textdraw 2117 get_string_to 16@
     0C5A: samp textdraw 2118 get_string_to 17@
     0C5A: samp textdraw 2119 get_string_to 18@
     0C5A: samp textdraw 2120 get_string_to 19@
   
     if
        0039: 16@ == 15@
        then
        wait 500
        0BCA: samp send_click_textdraw 2117
        end
     if
        0039: 17@ == 15@
        then
        wait 500
        0BCA: samp send_click_textdraw 2118
        end
    if
        0039: 18@ == 15@
        then
        wait 500
        0BCA: samp send_click_textdraw 2119
        end
    if
        0039: 19@ == 15@
        then
        wait 500
        0BCA: samp send_click_textdraw 2120
        end
end
end
Не выделил память под текст. И строки сравнивай опкодом 0c14.