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

Dreytix

Новичок
23
2
Вообщем, пытался сделать скрипт, который бы мне флудил кнопкой N очень много раз в секунду (вручную получается до 10 раз, но так можно и мозоли натереть, а дома на аризоне я пытаюсь ловить часто), но получается совсем другое, флудит не так как надо, всегда по разному и только если зажата кнопка активации, темболее это уж конченный нубокод ибо я не знал как сделать что-то типо loop'а, или как там, while true, может кто поможет.

Код:
// This file was decompiled using SASCM.ini published by GTAG (http://gtag.gtagaming.com/opcode-database) on 14.6.2013
{$CLEO .cs}

//-------------MAIN---------------
0000: NOP

:NONAME_2
wait 0
   SAMP.Available
jf @NONAME_2

:NONAME_15
wait 0
if
   not SAMP.ChatInputOpened
jf @NONAME_527
if
key_down 85
jf @NONAME_527
0C72: set_virtual_key 78 down 1
wait 5
0C72: set_virtual_key 78 down 0
wait 5
0C72: set_virtual_key 78 down 1
wait 5
0C72: set_virtual_key 78 down 0
wait 5
0C72: set_virtual_key 78 down 1
wait 5
0C72: set_virtual_key 78 down 0
wait 5
0C72: set_virtual_key 78 down 1
wait 5
0C72: set_virtual_key 78 down 0
wait 5
0C72: set_virtual_key 78 down 1
wait 5
0C72: set_virtual_key 78 down 0
wait 5
0C72: set_virtual_key 78 down 1
wait 5
0C72: set_virtual_key 78 down 0
wait 5
0C72: set_virtual_key 78 down 1
wait 5
0C72: set_virtual_key 78 down 0
wait 5
0C72: set_virtual_key 78 down 1
wait 5
0C72: set_virtual_key 78 down 0
wait 5
0C72: set_virtual_key 78 down 1
wait 5
0C72: set_virtual_key 78 down 0
wait 5
0C72: set_virtual_key 78 down 1
wait 5
0C72: set_virtual_key 78 down 0
wait 5
0C72: set_virtual_key 78 down 1
wait 5
0C72: set_virtual_key 78 down 0
wait 5
0C72: set_virtual_key 78 down 1
wait 5
0C72: set_virtual_key 78 down 0
wait 5
0C72: set_virtual_key 78 down 1
wait 5
0C72: set_virtual_key 78 down 0
wait 5
0C72: set_virtual_key 78 down 1
wait 5
0C72: set_virtual_key 78 down 0
wait 5
0C72: set_virtual_key 78 down 1
wait 5
0C72: set_virtual_key 78 down 0
wait 5
0C72: set_virtual_key 78 down 1
wait 5
0C72: set_virtual_key 78 down 0
wait 5
0C72: set_virtual_key 78 down 1
wait 5
0C72: set_virtual_key 78 down 0
wait 5
0C72: set_virtual_key 78 down 1
wait 5
0C72: set_virtual_key 78 down 0
wait 5
0C72: set_virtual_key 78 down 1
wait 5
0C72: set_virtual_key 78 down 0
wait 5
0C72: set_virtual_key 78 down 1
wait 5
0C72: set_virtual_key 78 down 0
wait 5
0C72: set_virtual_key 78 down 1
wait 5
0C72: set_virtual_key 78 down 0
wait 5
0C72: set_virtual_key 78 down 1
wait 5
0C72: set_virtual_key 78 down 0
wait 5
0C72: set_virtual_key 78 down 1
wait 5
0C72: set_virtual_key 78 down 0
wait 5
0C72: set_virtual_key 78 down 1
wait 5
0C72: set_virtual_key 78 down 0
wait 5

:NONAME_527
goto @NONAME_15
 

Coghweel

Новичок
76
0
CLEO:
while true
wait 0
if and
not SAMP.ChatInputOpened
key_down 85
then
wait 200
    repeat
    wait 0
    0B56: set_game_key 11 state 255
    until key_down 85
wait 200
end
end
 
Последнее редактирование:

iTz_WEEZY

Известный
298
85
Вообщем, пытался сделать скрипт, который бы мне флудил кнопкой N очень много раз в секунду (вручную получается до 10 раз,

Всё не так, вот тебе
CLEO:
{$CLEO .cs}
0000:

repeat
wait 400
until 0AFA: is_samp_structures_available

:activation
wait 0
if
0AB0: key_pressed 114  // Активация (F3)
then
    if
    1@ == true
    then
    1@ = false
    print "Clicker [N] OFF" 500
    wait 1000
    else
    1@ = true
    print "Clicker [N] ON" 500
    wait 1000
    end
end

:emul
wait 0 
if
1@ == true
then
0C72: set_virtual_key 0x4E down TRUE
wait 10
0C72: set_virtual_key 0x4E down FALSE
wait 20
0C72: set_virtual_key 0x4E down TRUE
wait 10
0C72: set_virtual_key 0x4E down FALSE
wait 20
0C72: set_virtual_key 0x4E down TRUE
wait 10
0C72: set_virtual_key 0x4E down FALSE
wait 20
0C72: set_virtual_key 0x4E down TRUE
wait 10
0C72: set_virtual_key 0x4E down FALSE
wait 20
0C72: set_virtual_key 0x4E down TRUE
wait 10
0C72: set_virtual_key 0x4E down FALSE
wait 20
0C72: set_virtual_key 0x4E down TRUE
wait 10
0C72: set_virtual_key 0x4E down FALSE
wait 20
end
jump @activation
 

MISTER_GONWIK

Всефорумный гонщик
Всефорумный модератор
1,260
1,742
Всё не так, вот тебе
CLEO:
{$CLEO .cs}
0000:

repeat
wait 400
until 0AFA: is_samp_structures_available

:activation
wait 0
if
0AB0: key_pressed 114  // Активация (F3)
then
    if
    1@ == true
    then
    1@ = false
    print "Clicker [N] OFF" 500
    wait 1000
    else
    1@ = true
    print "Clicker [N] ON" 500
    wait 1000
    end
end

:emul
wait 0
if
1@ == true
then
0C72: set_virtual_key 0x4E down TRUE
wait 10
0C72: set_virtual_key 0x4E down FALSE
wait 20
0C72: set_virtual_key 0x4E down TRUE
wait 10
0C72: set_virtual_key 0x4E down FALSE
wait 20
0C72: set_virtual_key 0x4E down TRUE
wait 10
0C72: set_virtual_key 0x4E down FALSE
wait 20
0C72: set_virtual_key 0x4E down TRUE
wait 10
0C72: set_virtual_key 0x4E down FALSE
wait 20
0C72: set_virtual_key 0x4E down TRUE
wait 10
0C72: set_virtual_key 0x4E down FALSE
wait 20
0C72: set_virtual_key 0x4E down TRUE
wait 10
0C72: set_virtual_key 0x4E down FALSE
wait 20
end
jump @activation
циклы для лохов?
 
  • Нравится
Реакции: 4el0ve4ik

Clopster

Известный
143
96
0b76 не работает с переменными что ли? Или как тут их применять.
Он в строку так и пишет "%s", а должен был слово из .ini брать
CLEO:
0B76: samp set_chat_input_text "%s" 16@
 

4el0ve4ik

Известный
Всефорумный модератор
1,548
1,339
0b76 не работает с переменными что ли? Или как тут их применять.
Он в строку так и пишет "%s", а должен был слово из .ini брать
CLEO:
0B76: samp set_chat_input_text "%s" 16@
Используй форматирование строки, и попробуй вот так:
Код:
0B76: samp set_chat_input_text 16@
Вроде должно работать, к сожалению проверить сейчас не могу.
 
Последнее редактирование:

Garrus

Известный
159
20
У меня в скрипте используется 3 потока, с названиями thread1, thread2, thread3. В третьем потоке есть функция обновления скрипта в scm-функции. Я хотел бы сделать так, что при обновлении, скрипт завершал свою работу (все 3 потока) и загружался заново, из игры. Проблема в том, что операция эта завершается успешно через раз. То выкинет exception, то вообще крашнется. =\ Сами потоки завершаю следующим способом:
Код:
0AAA: 2@ = thread 'thread1' pointer
0C6E: destroy_custom_thread 2@
0AAA: 2@ = thread 'thread2' pointer
0C6E: destroy_custom_thread 2@
0A92: create_custom_thread "script.cs"
0AAA: 2@ = thread 'thread3' pointer
0C6E: destroy_custom_thread 2@
В чем проблемка?
 

ShadowBroker

Известный
110
27
Учусь писать не на метках, как сделать что бы в этом коде не было goto после лейблов? Только в конце один.
CLEO:
{$CLEO}

0000: NOP

while true
wait 0
    if Player.Defined($PLAYER_ACTOR)
    then
        if key_down 49
        then
            if Actor.HasWeapon($PLAYER_ACTOR, 22)
            then 01B9: set_actor $PLAYER_ACTOR armed_weapon_to 22
                else
                if Actor.HasWeapon($PLAYER_ACTOR, 23)
                then 01B9: set_actor $PLAYER_ACTOR armed_weapon_to 23
                    else
                    if Actor.HasWeapon($PLAYER_ACTOR, 24)
                    then 01B9: set_actor $PLAYER_ACTOR armed_weapon_to 24
                    end
                end
            end
        end
        if key_down 50
        then
            if Actor.HasWeapon($PLAYER_ACTOR, 30)
            then 01B9: set_actor $PLAYER_ACTOR armed_weapon_to 30
                else
                if Actor.HasWeapon($PLAYER_ACTOR, 31)
                then 01B9: set_actor $PLAYER_ACTOR armed_weapon_to 31
                end
            end
        end
        if key_down 51
        then
            if Actor.HasWeapon($PLAYER_ACTOR, 33)
            then 01B9: set_actor $PLAYER_ACTOR armed_weapon_to 33
                else
                if Actor.HasWeapon($PLAYER_ACTOR, 34)
                then 01B9: set_actor $PLAYER_ACTOR armed_weapon_to 34
                end
            end
        end
        if key_down 52
        then
            if Actor.HasWeapon($PLAYER_ACTOR, 25)
            then 01B9: set_actor $PLAYER_ACTOR armed_weapon_to 25
                else
                if Actor.HasWeapon($PLAYER_ACTOR, 27)
                then 01B9: set_actor $PLAYER_ACTOR armed_weapon_to 27
                end
            end
        end
    end
end
 

ShadowBroker

Известный
110
27
Вот что получается после компиляции
CLEO:
:Noname_2
wait 0
if
   Player.Defined($PLAYER_ACTOR)
jf @Noname_342
if
key_down 49
jf @Noname_126
if
   Actor.HasWeapon($PLAYER_ACTOR, 22)
jf @Noname_69
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 22
goto @Noname_126

:Noname_69
if
   Actor.HasWeapon($PLAYER_ACTOR, 23)
jf @Noname_101
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 23
goto @Noname_126

:Noname_101
if
   Actor.HasWeapon($PLAYER_ACTOR, 24)
jf @Noname_126
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 24

:Noname_126
if
key_down 50
jf @Noname_198
if
   Actor.HasWeapon($PLAYER_ACTOR, 30)
jf @Noname_173
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 30
goto @Noname_198

:Noname_173
if
   Actor.HasWeapon($PLAYER_ACTOR, 31)
jf @Noname_198
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 31

:Noname_198
if
key_down 51
jf @Noname_270
if
   Actor.HasWeapon($PLAYER_ACTOR, 33)
jf @Noname_245
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 33
goto @Noname_270

:Noname_245
if
   Actor.HasWeapon($PLAYER_ACTOR, 34)
jf @Noname_270
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 34

:Noname_270
if
key_down 52
jf @Noname_342
if
   Actor.HasWeapon($PLAYER_ACTOR, 25)
jf @Noname_317
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 25
goto @Noname_342

:Noname_317
if
   Actor.HasWeapon($PLAYER_ACTOR, 27)
jf @Noname_342
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 27

:Noname_342
goto @Noname_2

А вот в таком виде он служит мне долгое время, скрипт просто бегает по jf а goto только в конце, хотелось бы добиться такого в скомпилированном варианте написанном без меток.

CLEO:
:actor
wait 0
if Player.Defined($PLAYER_ACTOR)
jf @actor
goto @weapon11

:weapon11
if and
    not key_down 18
    key_down 49
jf @weapon21
if Actor.HasWeapon($PLAYER_ACTOR, 22)
jf @weapon12
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 0
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 22

:weapon12
if Actor.HasWeapon($PLAYER_ACTOR, 23)
jf @weapon13
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 0
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 23

:weapon13
if Actor.HasWeapon($PLAYER_ACTOR, 24)
jf @actor
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 0
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 24

:weapon21
if and
    not key_down 18
    key_down 50
jf @weapon31
if Actor.HasWeapon($PLAYER_ACTOR, 30)
jf @weapon22
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 0
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 30

:weapon22
if Actor.HasWeapon($PLAYER_ACTOR, 31)
jf @actor
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 0
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 31

:weapon31
if and
    not key_down 18
    key_down 51
jf @weapon41
if Actor.HasWeapon($PLAYER_ACTOR, 33)
jf @weapon32
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 0
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 33

:weapon32
if Actor.HasWeapon($PLAYER_ACTOR, 34)
jf @actor
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 0
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 34

:weapon41
if and
    not key_down 18
    key_down 52
jf @actor
if Actor.HasWeapon($PLAYER_ACTOR, 25)
jf @weapon42
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 0
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 25

:weapon42
if Actor.HasWeapon($PLAYER_ACTOR, 27)
jf @actor
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 0
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 27
goto @actor
 

hnnssy

Известный
Друг
2,684
2,753
Вот что получается после компиляции
CLEO:
:Noname_2
wait 0
if
   Player.Defined($PLAYER_ACTOR)
jf @Noname_342
if
key_down 49
jf @Noname_126
if
   Actor.HasWeapon($PLAYER_ACTOR, 22)
jf @Noname_69
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 22
goto @Noname_126

:Noname_69
if
   Actor.HasWeapon($PLAYER_ACTOR, 23)
jf @Noname_101
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 23
goto @Noname_126

:Noname_101
if
   Actor.HasWeapon($PLAYER_ACTOR, 24)
jf @Noname_126
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 24

:Noname_126
if
key_down 50
jf @Noname_198
if
   Actor.HasWeapon($PLAYER_ACTOR, 30)
jf @Noname_173
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 30
goto @Noname_198

:Noname_173
if
   Actor.HasWeapon($PLAYER_ACTOR, 31)
jf @Noname_198
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 31

:Noname_198
if
key_down 51
jf @Noname_270
if
   Actor.HasWeapon($PLAYER_ACTOR, 33)
jf @Noname_245
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 33
goto @Noname_270

:Noname_245
if
   Actor.HasWeapon($PLAYER_ACTOR, 34)
jf @Noname_270
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 34

:Noname_270
if
key_down 52
jf @Noname_342
if
   Actor.HasWeapon($PLAYER_ACTOR, 25)
jf @Noname_317
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 25
goto @Noname_342

:Noname_317
if
   Actor.HasWeapon($PLAYER_ACTOR, 27)
jf @Noname_342
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 27

:Noname_342
goto @Noname_2

А вот в таком виде он служит мне долгое время, скрипт просто бегает по jf а goto только в конце, хотелось бы добиться такого в скомпилированном варианте написанном без меток.

CLEO:
:actor
wait 0
if Player.Defined($PLAYER_ACTOR)
jf @actor
goto @weapon11

:weapon11
if and
    not key_down 18
    key_down 49
jf @weapon21
if Actor.HasWeapon($PLAYER_ACTOR, 22)
jf @weapon12
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 0
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 22

:weapon12
if Actor.HasWeapon($PLAYER_ACTOR, 23)
jf @weapon13
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 0
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 23

:weapon13
if Actor.HasWeapon($PLAYER_ACTOR, 24)
jf @actor
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 0
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 24

:weapon21
if and
    not key_down 18
    key_down 50
jf @weapon31
if Actor.HasWeapon($PLAYER_ACTOR, 30)
jf @weapon22
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 0
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 30

:weapon22
if Actor.HasWeapon($PLAYER_ACTOR, 31)
jf @actor
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 0
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 31

:weapon31
if and
    not key_down 18
    key_down 51
jf @weapon41
if Actor.HasWeapon($PLAYER_ACTOR, 33)
jf @weapon32
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 0
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 33

:weapon32
if Actor.HasWeapon($PLAYER_ACTOR, 34)
jf @actor
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 0
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 34

:weapon41
if and
    not key_down 18
    key_down 52
jf @actor
if Actor.HasWeapon($PLAYER_ACTOR, 25)
jf @weapon42
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 0
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 25

:weapon42
if Actor.HasWeapon($PLAYER_ACTOR, 27)
jf @actor
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 0
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 27
goto @actor
какая тебе в жопу разница как выглядит код после декомпиляции?