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

Woofing Giraffe

Активный
402
49
Код:
{$CLEO}
0000:

:1
wait 500
    SAMP.Available()
jf @1
0AF8: samp add_message_to_chat "{00AAFF}[DRP-Helper]{8FDC78} Ne?eio oniaoii caa?o?ai." color -1
0B34: samp register_client_command "rep" to_label @Rep
0BDE: pause_thread 0

:Rep
0AF9: samp say_msg "/mn"
0B35: samp 0@ = get_last_command_params
0B4E: samp 1@ = get_current_dialog_id
0BC9: samp send_dialog_response dialog 1@ button 1 listitem 5 input 0@
0B43: samp cmd_ret
У меня работает. А вообще, по идее, надо все эти действия засунуть в цикл и сделать задержку между ними, т.к. сервер отвечает не мгновенно и некоторые опкоды могут не сработать.
 

AWRage

Активный
642
141
Код:
{$CLEO}
0000:

:1
wait 500
    SAMP.Available()
jf @1
0AF8: samp add_message_to_chat "{00AAFF}[DRP-Helper]{8FDC78} Ne?eio oniaoii caa?o?ai." color -1
0B34: samp register_client_command "rep" to_label @Rep
0BDE: pause_thread 0

:Rep
0AF9: samp say_msg "/mn"
0B35: samp 0@ = get_last_command_params
0B4E: samp 1@ = get_current_dialog_id
0BC9: samp send_dialog_response dialog 1@ button 1 listitem 5 input 0@
0B43: samp cmd_ret
У меня работает. А вообще, по идее, надо все эти действия засунуть в цикл и сделать задержку между ними, т.к. сервер отвечает не мгновенно и некоторые опкоды могут не сработать.
Я тоже так думал, но циклы в командах писать нельзя же?
 

Woofing Giraffe

Активный
402
49
Код:
{$CLEO}
0000:

:1
wait 500
    SAMP.Available()
jf @1
0AF8: samp add_message_to_chat "{00AAFF}[DRP-Helper]{8FDC78} Ne?eio oniaoii caa?o?ai." color -1
0B34: samp register_client_command "rep" to_label @Rep

while true
    wait 0
    if 2@ == true
    then
        0AF9: samp say_msg "/mn"
        wait 500
        0B4E: samp 1@ = get_current_dialog_id
        wait 500
        0BC9: samp send_dialog_response dialog 1@ button 1 listitem 5 input 0@
        2@ = false
    end
end

:Rep
0B35: samp 0@ = get_last_command_params
2@ = true
0B43: samp cmd_ret
 
  • Нравится
Реакции: AWRage

AWRage

Активный
642
141
Код:
{$CLEO}
0000:

:1
wait 500
    SAMP.Available()
jf @1
0AF8: samp add_message_to_chat "{00AAFF}[DRP-Helper]{8FDC78} Ne?eio oniaoii caa?o?ai." color -1
0B34: samp register_client_command "rep" to_label @Rep

while true
    wait 0
    if 2@ == true
    then
        0AF9: samp say_msg "/mn"
        wait 500
        0B4E: samp 1@ = get_current_dialog_id
        wait 500
        0BC9: samp send_dialog_response dialog 1@ button 1 listitem 5 input 0@
        2@ = false
    end
end

:Rep
0B35: samp 0@ = get_last_command_params
2@ = true
0B43: samp cmd_ret
Спасибо! :)
 

AWRage

Активный
642
141
Каким образом можно получить текст после команды /rep? Например, я пишу /rep Hello World! Как в переменную 10 записать эту строку и как проверить что она не пуста?
 

hnnssy

Известный
Друг
2,684
2,768
Каким образом можно получить текст после команды /rep? Например, я пишу /rep Hello World! Как в переменную 10 записать эту строку и как проверить что она не пуста?
0B35: samp 1@ = get_last_command_params

0C17: 1@ = strlen 0@
 
  • Нравится
Реакции: AWRage

AWRage

Активный
642
141
0BC9: samp send_dialog_response dialog 16 button 1 listitem 4 input "Hello World"
Этот опкод выбирает в диалоге ID 16 пункт и по идеи пишет в новом открывшемся диалоге - Hello World. Но, сервер не успевает обработать инфу (пинг), а клео работает слишком быстро. Получается, что этот опкод срабатывает перед открытием диалога. Можно как-то обойти данную "недоработку"?
 

DubStep_

Известный
292
52
0BC9: samp send_dialog_response dialog 16 button 1 listitem 4 input "Hello World"
Этот опкод выбирает в диалоге ID 16 пункт и по идеи пишет в новом открывшемся диалоге - Hello World. Но, сервер не успевает обработать инфу (пинг), а клео работает слишком быстро. Получается, что этот опкод срабатывает перед открытием диалога. Можно как-то обойти данную "недоработку"?
Он не так работает
 

AWRage

Активный
642
141
Он не так работает
А как? Вообщем, вот код.
Код:
{$CLEO}
0000:


const
   report = 0@
end
repeat
wait 500
until SAMP.Available
0AF8: samp add_message_to_chat "{00AAFF}[DRP-Helper]{8FDC78} Ñêðèïò óñïåøíî çàãðóæåí." color -1     // 16 195
0B34: samp register_client_command "rep" to_label @Rep

while true
wait 0
if and
report = true
0B4C: samp is_dialog_active 16
then
0BC9: samp send_dialog_response dialog 16 button 1 listitem 4 input "Hello World"
report = false
end
end

:Rep
0B35: samp 10@ = get_last_command_params
0C17: 11@ = strlen 10@
if 11@ == 0
then
0AF8: samp add_message_to_chat "{00AAFF}[DRP-Helper]{969696} Èñïîëüçóéòå: /rep [òåêñò]" color -1
report = false
else
0AF9: samp say_msg "/mn"
report = true
end
0B43: samp cmd_ret
 

itsLegend

Фонд борьбы за жуков 🐞
Администратор
2,696
1,469
  • Нравится
Реакции: Vovich

hnnssy

Известный
Друг
2,684
2,768
ты лол что ли я менял на свой, я тебе кинул, ты сам зайди со своим ником, и попробуй.
Что б я не делал, оно нихуя не пашет(
Я тебе, сука, давал отдельно код для сравнения своего ника.
Увольте его отсюда плис.
 

#Frozen'ka

Известный
8
0
Код:
{$CLEO}
0000:

:1
wait 0
    SAMP.Available()
jf @1
0B34: "vinformer" @cmd
alloc 21@ 32
alloc 22@ 32
alloc 23@ 32
alloc 24@ 32
alloc 25@ 32
alloc 26@ 32
alloc 27@ 32
chatmsg "ñêðèïò çàãðóæåí àâòîð Äàñòàí" 52479  
if 8AE4: not directory_exists "Cleo\INI" // ???? ?? ?????
then
    0AE5: create_directory "Cleo\INI"// ???????
    SAMP.GetScreenResolution(0@, 28@)
    28@ /= 8
    28@ *= 3
    0AF1: write_int 0 to_ini_file "CLEO\INI\vinformer.ini" section "inform" key "PosX"
    0AF1: write_int 28@ to_ini_file "CLEO\INI\vinformer.ini" section "inform" key "PosY"  // ??????? ???? ? ?????????? ??????????
else
    if 0AAB: file_exists "CLEO\INI\vinformer.ini" // ???? ????? ????
    then
        0AF0: 15@ = get_int_from_ini_file "CLEO\INI\vinformer.ini" section "inform" key "PosX"
        0AF0: 16@ = get_int_from_ini_file "CLEO\INI\vinformer.ini" section "inform" key "PosY" // ???????? ??????
    else
        SAMP.GetScreenResolution(0@, 28@)
        28@ /= 8
        28@ *= 3
        0AF1: write_int 0 to_ini_file "CLEO\INI\vinformer.ini" section "inform" key "PosX"
        0AF1: write_int 28@ to_ini_file "CLEO\INI\vinformer.ini" section "inform" key "PosY" // ??????????
    end
end
Dialog.Create(29@, "{00CCFF}INFO OF VICTIM")
Dialog.SetRECT(29@, 15@, 16@, 200, 180)
Dialog.AddStatic(29@, 1, "Name:", 10, 10, 160, 24)
Dialog.AddStatic(29@, 2, "Ping:", 10, 30, 160, 24)
Dialog.AddStatic(29@, 3, "LVL:", 10, 50, 160, 24)
Dialog.AddStatic(29@, 4, "ID:", 10, 70, 160, 24)
Dialog.AddStatic(29@, 5, "HP:", 10, 90, 160, 24)
Dialog.AddStatic(29@, 6, "AP:", 10, 110, 160, 24)
Dialog.AddStatic(29@, 7, "SKIN:", 10, 130, 160, 24) // ??????? ??? ??????
Dialog.SetVisible(29@, 0) // ????????

while true
    wait 0
    if 10@ == true // ???? ??? ????? ????????????
    then
         Dialog.SetRECT(29@, 15@, 16@, 200, 180)
         1@ = SAMP.GetSAMPPlayerIDByActorHandle($PLAYER_ACTOR) // ???????? ID
         format 21@ "ID: %d" 1@
         0B65: samp 2@ = player 1@ score
         format 22@ "LVL: %d" 2@
         3@ = SAMP.GetPlayerNickname(1@)// ???????? ???
         format 23@ "NAME: %s" 3@
         4@ = SAMP.GetPlayerPing(1@) // ???????? ping
         format 24@ "PING: %d" 4@  
         5@ = Actor.Health($PLAYER_ACTOR)
         format 25@ "HP: %d" 5@
         6@ = SAMP.GetPlayerArmorByActorHandle($PLAYER_ACTOR) // ???????? ?????
         format 26@ "AP: %d" 6@                                      
         0665: get_actor $PLAYER_ACTOR model_to 7@ // ???????? ????
         format 27@ "SKIN: %d" 7@
         Dialog.SetControlText(29@, 4, 21@)
         Dialog.SetControlText(29@, 3, 22@)
         Dialog.SetControlText(29@, 1, 23@)
         Dialog.SetControlText(29@, 2, 24@)
         Dialog.SetControlText(29@, 5, 25@)
         Dialog.SetControlText(29@, 6, 26@)
         Dialog.SetControlText(29@, 7, 27@)
    end
end

:cmd
if 10@ == true
then
    10@ = false
    Dialog.SetVisible(29@, 0)
    chatmsg "îòêë" 52479
else
    10@ = true
    0AF0: 15@ = get_int_from_ini_file "CLEO\INI\vinformer.ini" section "inform" key "PosX"
    0AF0: 16@ = get_int_from_ini_file "CLEO\INI\vinformer.ini" section "inform" key "PosY" // ???????? ??????
    Dialog.SetRECT(29@, 15@, 16@, 200, 180)
    Dialog.SetVisible(29@, 1)
    chatmsg "âêë" 52479
end
SAMP.CmdRet()
Можете помочь, у меня не то получилось.
 

hnnssy

Известный
Друг
2,684
2,768
Код:
{$CLEO}
0000:

:1
wait 0
    SAMP.Available()
jf @1
0B34: "vinformer" @cmd
alloc 21@ 32
alloc 22@ 32
alloc 23@ 32
alloc 24@ 32
alloc 25@ 32
alloc 26@ 32
alloc 27@ 32
chatmsg "ñêðèïò çàãðóæåí àâòîð Äàñòàí" 52479 
if 8AE4: not directory_exists "Cleo\INI" // ???? ?? ?????
then
    0AE5: create_directory "Cleo\INI"// ???????
    SAMP.GetScreenResolution(0@, 28@)
    28@ /= 8
    28@ *= 3
    0AF1: write_int 0 to_ini_file "CLEO\INI\vinformer.ini" section "inform" key "PosX"
    0AF1: write_int 28@ to_ini_file "CLEO\INI\vinformer.ini" section "inform" key "PosY"  // ??????? ???? ? ?????????? ??????????
else
    if 0AAB: file_exists "CLEO\INI\vinformer.ini" // ???? ????? ????
    then
        0AF0: 15@ = get_int_from_ini_file "CLEO\INI\vinformer.ini" section "inform" key "PosX"
        0AF0: 16@ = get_int_from_ini_file "CLEO\INI\vinformer.ini" section "inform" key "PosY" // ???????? ??????
    else
        SAMP.GetScreenResolution(0@, 28@)
        28@ /= 8
        28@ *= 3
        0AF1: write_int 0 to_ini_file "CLEO\INI\vinformer.ini" section "inform" key "PosX"
        0AF1: write_int 28@ to_ini_file "CLEO\INI\vinformer.ini" section "inform" key "PosY" // ??????????
    end
end
Dialog.Create(29@, "{00CCFF}INFO OF VICTIM")
Dialog.SetRECT(29@, 15@, 16@, 200, 180)
Dialog.AddStatic(29@, 1, "Name:", 10, 10, 160, 24)
Dialog.AddStatic(29@, 2, "Ping:", 10, 30, 160, 24)
Dialog.AddStatic(29@, 3, "LVL:", 10, 50, 160, 24)
Dialog.AddStatic(29@, 4, "ID:", 10, 70, 160, 24)
Dialog.AddStatic(29@, 5, "HP:", 10, 90, 160, 24)
Dialog.AddStatic(29@, 6, "AP:", 10, 110, 160, 24)
Dialog.AddStatic(29@, 7, "SKIN:", 10, 130, 160, 24) // ??????? ??? ??????
Dialog.SetVisible(29@, 0) // ????????

while true
    wait 0
    if 10@ == true // ???? ??? ????? ????????????
    then
         Dialog.SetRECT(29@, 15@, 16@, 200, 180)
         1@ = SAMP.GetSAMPPlayerIDByActorHandle($PLAYER_ACTOR) // ???????? ID
         format 21@ "ID: %d" 1@
         0B65: samp 2@ = player 1@ score
         format 22@ "LVL: %d" 2@
         3@ = SAMP.GetPlayerNickname(1@)// ???????? ???
         format 23@ "NAME: %s" 3@
         4@ = SAMP.GetPlayerPing(1@) // ???????? ping
         format 24@ "PING: %d" 4@ 
         5@ = Actor.Health($PLAYER_ACTOR)
         format 25@ "HP: %d" 5@
         6@ = SAMP.GetPlayerArmorByActorHandle($PLAYER_ACTOR) // ???????? ?????
         format 26@ "AP: %d" 6@                                     
         0665: get_actor $PLAYER_ACTOR model_to 7@ // ???????? ????
         format 27@ "SKIN: %d" 7@
         Dialog.SetControlText(29@, 4, 21@)
         Dialog.SetControlText(29@, 3, 22@)
         Dialog.SetControlText(29@, 1, 23@)
         Dialog.SetControlText(29@, 2, 24@)
         Dialog.SetControlText(29@, 5, 25@)
         Dialog.SetControlText(29@, 6, 26@)
         Dialog.SetControlText(29@, 7, 27@)
    end
end

:cmd
if 10@ == true
then
    10@ = false
    Dialog.SetVisible(29@, 0)
    chatmsg "îòêë" 52479
else
    10@ = true
    0AF0: 15@ = get_int_from_ini_file "CLEO\INI\vinformer.ini" section "inform" key "PosX"
    0AF0: 16@ = get_int_from_ini_file "CLEO\INI\vinformer.ini" section "inform" key "PosY" // ???????? ??????
    Dialog.SetRECT(29@, 15@, 16@, 200, 180)
    Dialog.SetVisible(29@, 1)
    chatmsg "âêë" 52479
end
SAMP.CmdRet()
Можете помочь, у меня не то получилось.
Но... это же... мой... скрипт.