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

AWRage

Активный
642
141
Можно ли использовать задержку в хуках?
Если нет, то можно ли обойти данное ограничение?
 

zwhoz

Известный
106
11
Как сделать такую активацию: В чате выбивает сообщение, например "PayDay" и чтобы от этого текста активировался таймер.
{$CLEO}
{$NOSOURCE}
{$INCLUDE SF}
if not 31@ = samp.Base()
then
end_thread
else
while not samp.Available()
wait 100
end
end

const
PosX = 0@
PosY = 1@
Second = 2@
Red = 3@
Green = 4@
Blue = 5@
Shadow = 6@
Alpha = 7@
ARGB = 8@
FontName = 9@
FontHeight = 10@
FontCreate = 11@
FontOffset = 12@
File = 13@
Key_Activation = 14@
Command = 16@
Message = 17@
Message_delay = 18@
end

var
PosY : int
PosY_offset : int
FontHeight : int
FontOffset : int
19@ : int
28@ : int
29@ : int
30@ : int
32@ : int
Message_delay : int
Second : int
end

0000:
if 0AAB: file_exists "CLEO\timer.ini"
then
gosub @load_setting
else
gosub @write_setting
gosub @load_setting
end


0B67: render a Alpha r Red g Green b Blue to_argb ARGB
0B6D: render FontCreate = create_font FontName height FontHeight flags 0x5

while true
wait 0
32@ = 0
if and
0ab0: Key_Activation
8B21: samp is_chat_opened
then
while 0ab0: Key_Activation
wait 0
end
30@ = Second
Second *= 1000
29@ = Second
32@ = 0
0ac8: 27@ = 32
while 32@ <= Second
wait 0
28@ = 32@
28@ -= 29@
28@ /= 1000
28@ *= -1
0ad3: 27@ = "%d" 28@
0B6F: render font FontCreate draw_text 27@ pos PosX PosY color ARGB
end
32@ = 0
19@ = Message_delay
Message_delay *= 1000
while 32@ <= Message_delay
wait 0
0B6F: render font FontCreate draw_text Message pos PosX PosY color ARGB
end
Message_delay = 19@
0ac9: 27@
32@ = 0
Second = 30@
end
end

:reload_setting
0B6E: render release_font FontCreate
0B63: samp unregister_client_command Command
gosub @load_setting
0B67: render a Alpha r Red g Green b Blue to_argb ARGB
0B6D: render FontCreate = create_font FontName height FontHeight flags 0x0C
samp.CmdRet()

:RenderText


return

:load_setting
0ac8: FontName = 128
0ac8: Command = 128
0ac8: Message = 128
0AF0: PosX = get_int_from_ini_file "CLEO\timer.ini" section "Timer" key "PositionX"
0AF0: PosY = get_int_from_ini_file "CLEO\timer.ini" section "Timer" key "PositionY"
0AF4: FontName = read_string_from_ini_file "CLEO\timer.ini" section "Timer" key "FontName"
0AF4: Command = read_string_from_ini_file "CLEO\timer.ini" section "Timer" key "Command"
0AF4: Message = read_string_from_ini_file "CLEO\timer.ini" section "Timer" key "Message"
0AF0: FontHeight = read_string_from_ini_file "CLEO\timer.ini" section "Timer" key "FontHeight"
0AF0: Second = read_string_from_ini_file "CLEO\timer.ini" section "Timer" key "Second"
0AF0: Message_delay = read_string_from_ini_file "CLEO\timer.ini" section "Timer" key "Message_delay"
0AF0: Key_Activation = get_int_from_ini_file "CLEO\timer.ini" section "Timer" key "Key_Activation"
0AF0: Red = get_int_from_ini_file "CLEO\timer.ini" section "Color" key "R"
0AF0: Green = get_int_from_ini_file "CLEO\timer.ini" section "Color" key "G"
0AF0: Blue = get_int_from_ini_file "CLEO\timer.ini" section "Color" key "B"
0AF0: Alpha = get_int_from_ini_file "CLEO\timer.ini" section "Color" key "A"
0b34: Command @reload_setting
return

:write_setting
File = file.Open("Cleo\timer.ini", "wt")
0AF1: 57 = get_int_from_ini_file "CLEO\timer.ini" section "Timer" key "PositionX"
0AF1: 296 = get_int_from_ini_file "CLEO\timer.ini" section "Timer" key "PositionY"
0AF1: 15 = get_int_from_ini_file "CLEO\timer.ini" section "Timer" key "FontHeight"
0AF1: 5 = get_int_from_ini_file "CLEO\timer.ini" section "Timer" key "Second"
0AF1: 2 = get_int_from_ini_file "CLEO\timer.ini" section "Timer" key "Message_delay"
0AF5: write_string "Tahoma" to_ini_file "CLEO\timer.ini" section "Timer" key "FontName"
0AF5: write_string "timer" to_ini_file "CLEO\timer.ini" section "Timer" key "Command"
0AF5: write_string "Текст" to_ini_file "CLEO\timer.ini" section "Timer" key "Message"
0AF1: 89 = get_int_from_ini_file "CLEO\timer.ini" section "Timer" key "Key_Activation"
0AF1: 16 = get_int_from_ini_file "CLEO\timer.ini" section "Color" key "R"
0AF1: 255 = get_int_from_ini_file "CLEO\timer.ini" section "Color" key "G"
0AF1: 16 = get_int_from_ini_file "CLEO\timer.ini" section "Color" key "B"
0AF1: 255 = get_int_from_ini_file "CLEO\timer.ini" section "Color" key "A"
file.Close(File)
return
 

fiendshadow

3LFhocV726q7pKWWky2vv3W38Dm9sGJV86
Проверенный
455
121
Как сделать такую активацию: В чате выбивает сообщение, например "PayDay" и чтобы от этого текста активировался таймер.
{$CLEO}
{$NOSOURCE}
{$INCLUDE SF}
if not 31@ = samp.Base()
then
end_thread
else
while not samp.Available()
wait 100
end
end

const
PosX = 0@
PosY = 1@
Second = 2@
Red = 3@
Green = 4@
Blue = 5@
Shadow = 6@
Alpha = 7@
ARGB = 8@
FontName = 9@
FontHeight = 10@
FontCreate = 11@
FontOffset = 12@
File = 13@
Key_Activation = 14@
Command = 16@
Message = 17@
Message_delay = 18@
end

var
PosY : int
PosY_offset : int
FontHeight : int
FontOffset : int
19@ : int
28@ : int
29@ : int
30@ : int
32@ : int
Message_delay : int
Second : int
end

0000:
if 0AAB: file_exists "CLEO\timer.ini"
then
gosub @load_setting
else
gosub @write_setting
gosub @load_setting
end


0B67: render a Alpha r Red g Green b Blue to_argb ARGB
0B6D: render FontCreate = create_font FontName height FontHeight flags 0x5

while true
wait 0
32@ = 0
if and
0ab0: Key_Activation
8B21: samp is_chat_opened
then
while 0ab0: Key_Activation
wait 0
end
30@ = Second
Second *= 1000
29@ = Second
32@ = 0
0ac8: 27@ = 32
while 32@ <= Second
wait 0
28@ = 32@
28@ -= 29@
28@ /= 1000
28@ *= -1
0ad3: 27@ = "%d" 28@
0B6F: render font FontCreate draw_text 27@ pos PosX PosY color ARGB
end
32@ = 0
19@ = Message_delay
Message_delay *= 1000
while 32@ <= Message_delay
wait 0
0B6F: render font FontCreate draw_text Message pos PosX PosY color ARGB
end
Message_delay = 19@
0ac9: 27@
32@ = 0
Second = 30@
end
end

:reload_setting
0B6E: render release_font FontCreate
0B63: samp unregister_client_command Command
gosub @load_setting
0B67: render a Alpha r Red g Green b Blue to_argb ARGB
0B6D: render FontCreate = create_font FontName height FontHeight flags 0x0C
samp.CmdRet()

:RenderText


return

:load_setting
0ac8: FontName = 128
0ac8: Command = 128
0ac8: Message = 128
0AF0: PosX = get_int_from_ini_file "CLEO\timer.ini" section "Timer" key "PositionX"
0AF0: PosY = get_int_from_ini_file "CLEO\timer.ini" section "Timer" key "PositionY"
0AF4: FontName = read_string_from_ini_file "CLEO\timer.ini" section "Timer" key "FontName"
0AF4: Command = read_string_from_ini_file "CLEO\timer.ini" section "Timer" key "Command"
0AF4: Message = read_string_from_ini_file "CLEO\timer.ini" section "Timer" key "Message"
0AF0: FontHeight = read_string_from_ini_file "CLEO\timer.ini" section "Timer" key "FontHeight"
0AF0: Second = read_string_from_ini_file "CLEO\timer.ini" section "Timer" key "Second"
0AF0: Message_delay = read_string_from_ini_file "CLEO\timer.ini" section "Timer" key "Message_delay"
0AF0: Key_Activation = get_int_from_ini_file "CLEO\timer.ini" section "Timer" key "Key_Activation"
0AF0: Red = get_int_from_ini_file "CLEO\timer.ini" section "Color" key "R"
0AF0: Green = get_int_from_ini_file "CLEO\timer.ini" section "Color" key "G"
0AF0: Blue = get_int_from_ini_file "CLEO\timer.ini" section "Color" key "B"
0AF0: Alpha = get_int_from_ini_file "CLEO\timer.ini" section "Color" key "A"
0b34: Command @reload_setting
return

:write_setting
File = file.Open("Cleo\timer.ini", "wt")
0AF1: 57 = get_int_from_ini_file "CLEO\timer.ini" section "Timer" key "PositionX"
0AF1: 296 = get_int_from_ini_file "CLEO\timer.ini" section "Timer" key "PositionY"
0AF1: 15 = get_int_from_ini_file "CLEO\timer.ini" section "Timer" key "FontHeight"
0AF1: 5 = get_int_from_ini_file "CLEO\timer.ini" section "Timer" key "Second"
0AF1: 2 = get_int_from_ini_file "CLEO\timer.ini" section "Timer" key "Message_delay"
0AF5: write_string "Tahoma" to_ini_file "CLEO\timer.ini" section "Timer" key "FontName"
0AF5: write_string "timer" to_ini_file "CLEO\timer.ini" section "Timer" key "Command"
0AF5: write_string "Текст" to_ini_file "CLEO\timer.ini" section "Timer" key "Message"
0AF1: 89 = get_int_from_ini_file "CLEO\timer.ini" section "Timer" key "Key_Activation"
0AF1: 16 = get_int_from_ini_file "CLEO\timer.ini" section "Color" key "R"
0AF1: 255 = get_int_from_ini_file "CLEO\timer.ini" section "Color" key "G"
0AF1: 16 = get_int_from_ini_file "CLEO\timer.ini" section "Color" key "B"
0AF1: 255 = get_int_from_ini_file "CLEO\timer.ini" section "Color" key "A"
file.Close(File)
return
Что я только что прочитал, святые пятки. ЧТО ЭТО ?!
Сабж: Получаешь текст из чата - ставишь условие, а-ля " Если словечко PayDay есть в чатике, тогдашечки включаем таймер ", андустенд ?
 

ShawGluz

Известный
70
4
Hi, is fast a question, i have cleo which shows my date and time but the hour have my state and i want the hour with cmd /hora, as change that?
 

Woofing Giraffe

Активный
402
49
Hi, is fast a question, i have cleo which shows my date and time but the hour have my state and i want the hour with cmd /hora, as change that?
If I understand correctly, then here's an example
CLEO:
{$CLEO .cs}

0000:
:1
wait 0
    SAMP.Available()
jf @1
alloc 1@ 128
0B34: "hora" @cmd

while true
    wait 0
    call @GetTime 0 3@ 4@ 5@ 6@ 7@ 8@ 9@ 10@
    if 14@ == true
    then
        format 1@ "[%d.%d.%d %.2d:%.2d:%.2d]" 6@ 4@ 3@ 13@ 8@ 9@
    else
        format 1@ "[%d.%d.%d %.2d:%.2d:%.2d]" 6@ 4@ 3@ 7@ 8@ 9@ // 7@ - Current hour
    end
    // Show it on display
end

:cmd
0B35: samp 11@ = get_last_command_params
0AD4: 12@ = scan_string 11@ format "%d" 13@
14@ = true
cmdret

:GetTime
0AA2: 0@ = load_library "kernel32.dll" // IF and SET
0AA4: 1@ = get_proc_address "GetLocalTime" library 0@ // IF and SET
alloc 2@ 32
0AA5: call 1@ num_params 1 pop 0 2@ 
0A8D: 3@ = read_memory 2@ size 2 virtual_protect 0
2@ += 2
0A8D: 4@ = read_memory 2@ size 2 virtual_protect 0
2@ += 2
0A8D: 5@ = read_memory 2@ size 2 virtual_protect 0
2@ += 2
0A8D: 6@ = read_memory 2@ size 2 virtual_protect 0
2@ += 2
0A8D: 7@ = read_memory 2@ size 2 virtual_protect 0
2@ += 2
0A8D: 8@ = read_memory 2@ size 2 virtual_protect 0
2@ += 2
0A8D: 9@ = read_memory 2@ size 2 virtual_protect 0
2@ += 2
0A8D: 10@ = read_memory 2@ size 2 virtual_protect 0
2@ -= 30
ret 8 3@ 4@ 5@ 6@ 7@ 8@ 9@ 10@
 

itsLegend

Фонд борьбы за жуков 🐞
Администратор
2,695
1,448
Киньте код, с помощью которого можно узнать ID пикапа.
Вы задаете настолько глупые вопросы и настолько нагло, что аж противно.
Ня:
Код:
//переменная Pickups =
Для переменная i От 0 До MAX_PICKUPS делать:
    Если Pickups[i]->iIsListed == 0 То:
        continue;
    Вывод: "Ид пикапа: "; i
Конец Для
[/i]
Смесь псевдокода с другими языками.
В следующий раз(пост) по данной теме я могу скинуть несколько опкодов, если Вы в них нуждаетесь и не имеет единого понятия, что такое Sanny Builder и "Поиск опкодов" в функциях ранее указанной программы.
 
  • Нравится
Реакции: unInstance и DarkP1xel

AWRage

Активный
642
141
Вы задаете настолько глупые вопросы и настолько нагло, что аж противно.
Ня:
Код:
//переменная Pickups =
Для переменная i От 0 До MAX_PICKUPS делать:
    Если Pickups[i]->iIsListed == 0 То:
        continue;
    Вывод: "Ид пикапа: "; i
Конец Для
[/i]
Смесь псевдокода с другими языками.
В следующий раз(пост) по данной теме я могу скинуть несколько опкодов, если Вы в них нуждаетесь и не имеет единого понятия, что такое Sanny Builder и "Поиск опкодов" в функциях ранее указанной программы.
Извиняюсь за свой глупый вопрос. Я задал вопрос о том, как получить ID пикапа, потому что никогда не работал с ними. А когда получил ответ о переборе пулов, то в конец запутался. Спасибо за код)
 

ShawGluz

Известный
70
4
If I understand correctly, then here's an example
CLEO:
{$CLEO .cs}

0000:
:1
wait 0
    SAMP.Available()
jf @1
alloc 1@ 128
0B34: "hora" @cmd

while true
    wait 0
    call @GetTime 0 3@ 4@ 5@ 6@ 7@ 8@ 9@ 10@
    if 14@ == true
    then
        format 1@ "[%d.%d.%d %.2d:%.2d:%.2d]" 6@ 4@ 3@ 13@ 8@ 9@
    else
        format 1@ "[%d.%d.%d %.2d:%.2d:%.2d]" 6@ 4@ 3@ 7@ 8@ 9@ // 7@ - Current hour
    end
    // Show it on display
end

:cmd
0B35: samp 11@ = get_last_command_params
0AD4: 12@ = scan_string 11@ format "%d" 13@
14@ = true
cmdret

:GetTime
0AA2: 0@ = load_library "kernel32.dll" // IF and SET
0AA4: 1@ = get_proc_address "GetLocalTime" library 0@ // IF and SET
alloc 2@ 32
0AA5: call 1@ num_params 1 pop 0 2@
0A8D: 3@ = read_memory 2@ size 2 virtual_protect 0
2@ += 2
0A8D: 4@ = read_memory 2@ size 2 virtual_protect 0
2@ += 2
0A8D: 5@ = read_memory 2@ size 2 virtual_protect 0
2@ += 2
0A8D: 6@ = read_memory 2@ size 2 virtual_protect 0
2@ += 2
0A8D: 7@ = read_memory 2@ size 2 virtual_protect 0
2@ += 2
0A8D: 8@ = read_memory 2@ size 2 virtual_protect 0
2@ += 2
0A8D: 9@ = read_memory 2@ size 2 virtual_protect 0
2@ += 2
0A8D: 10@ = read_memory 2@ size 2 virtual_protect 0
2@ -= 30
ret 8 3@ 4@ 5@ 6@ 7@ 8@ 9@ 10@

But does not show me the date