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

cover

Известный
Проверенный
245
268
пробовал эмуляцию клавиш через User32.dll не вышло на семёрке

можно я думаю зделать так бот запускать 0ADC: test_cheat "bbon" а во втором скрипте эмуляция этих клавиш ну или проще запуск бота по гарячим клавишам и также эмуляция их
Скачай MGFUNCS, и используй опкод
0DBF: emul_key_press VK_LEFT is_up 0
 

Dark_Knight

Me, me and me.
Друг
4,068
2,083
Код:
0C5A: samp textdraw 1@ get_string_to 2@
Не забудь только память выделить.
 

hnnssy

Известный
Друг
2,684
2,752
Не проверял. Подправишь сам если что.
Код:
{$CLEO}
0000:

wait 0
0B34: samp register_client_command "shahtaon" to_label @shahtaon
0B34: samp register_client_command "shahtaoff" to_label @shahtaoff
wait 5000
chatmsg "{FF0000}>{483D8B}=============================={FF0000}<" 6908265
chatmsg "{FF0000}>{483D8B}A'i^o` ?a`o~o`??: {8470FF}C,a`a~?o'?a*i'{FF0000}<" 6908265
chatmsg "{FF0000}>{483D8B}Сервер: {8470FF}server{FF0000}<" 6908265
chatmsg "{FF0000}>{483D8B}A`a^o`i^?: {8470FF}Shtebon{FF0000}<" 6908265
chatmsg "{FF0000}>{483D8B}{8470FF}/shahtaon /shahtaoff{FF0000}<" 6908265
chatmsg "{FF0000}>{483D8B}=============================={FF0000}<" 6908265
0DBA: 30@ = new_cleo_thread from_label @chatcheck



while true
wait 0
0BFD: 1@ = get_global_var "BOTSTATE"
if
1@ == 1
then



repeat
wait 0
0BFD: 1@ = get_global_var "BOTSTATE"
if
1@ == 1
then
0AB3: var 740 = 3
05D3: AS_actor $PLAYER_ACTOR goto_point 585.501 857.967 -43.0016 mode 6 time 5000 ms
end
until 00EC: actor $PLAYER_ACTOR 0 near_point 585.501 857.967 radius 3.0 3.0




repeat
wait 0
0BFD: 1@ = get_global_var "BOTSTATE"
if
1@ == 1
then
Actor.StorePos($PLAYER_ACTOR, 3@, 4@, 5@)
0DB4: 6@ = nearset marker to position x 3@ y 4@ radius 100.0
wait 100
0DB3:  marker 6@ position to x 7@ y 8@ z 9@ //IF AND SET
0AB3: var 740 = 3
05D3: AS_actor $PLAYER_ACTOR goto_point 7@ 8@ 9@ mode 6 time 3000 ms // versionA
end
until 00EC: actor $PLAYER_ACTOR 0 near_point 7@ 8@ radius 3.0 3.0
wait 1500

end
end






:shahtaon  //вкл бота
1@ = 1
0ACC: show_text_lowpriority "BOT Shahta ~g~ON" time 1000
018C: play_sound 1052 at 0.0 0.0 0.0
SAMP.CmdRet


:shahtaoff  //выкл бота
1@ = 0  
0ACC: show_text_lowpriority "BOT Shahta ~g~OFF" time 1000
0AB3: var 740 = 0
0687: clear_actor $PLAYER_ACTOR task
018C: play_sound 1052 at 0.0 0.0 0.0
SAMP.CmdRet

:chatcheck
0000:

0AC8: 0@ = allocate_memory_size 144
0AC8: 1@ = allocate_memory_size 32
while true
wait 0
0B75: samp get_chat_string 99 text_to 0@ prefix_to 1@ color_to 2@ prefix_color_to 0
// кол-во строк в чате - 100, начиная 0 => номер последней 99
if or
  // 2@ == 0xff5030ff // цвет, шестнадцатеричная система счисления, формат: RRGGBBAA
  0C18: 0 = strstr string1 0@ string2 "тойте"
  0C18: 0 = strstr string1 0@ string2 "новитесь"
  0C18: 0 = strstr string1 0@ string2 "ут?"
then
  wait 2000
  0BFC: set_global_var "BOTSTATE" = 0

  wait 2000
  0AF9: samp say_msg "Что?"
  wait 2000
  0AF9: samp say_msg "?что надо?"
  wait 10000
  0BFC: set_global_var "BOTSTATE" = 1
   
end
end
 

Slamdunk

Известный
33
8
существует ли опкод, который будет выполнять перемещение мышки по координатам?
 

Xample

Новичок
89
1
Не проверял. Подправишь сам если что.
Код:
{$CLEO}
0000:

wait 0
0B34: samp register_client_command "shahtaon" to_label @shahtaon
0B34: samp register_client_command "shahtaoff" to_label @shahtaoff
wait 5000
chatmsg "{FF0000}>{483D8B}=============================={FF0000}<" 6908265
chatmsg "{FF0000}>{483D8B}A'i^o` ?a`o~o`??: {8470FF}C,a`a~?o'?a*i'{FF0000}<" 6908265
chatmsg "{FF0000}>{483D8B}Сервер: {8470FF}server{FF0000}<" 6908265
chatmsg "{FF0000}>{483D8B}A`a^o`i^?: {8470FF}Shtebon{FF0000}<" 6908265
chatmsg "{FF0000}>{483D8B}{8470FF}/shahtaon /shahtaoff{FF0000}<" 6908265
chatmsg "{FF0000}>{483D8B}=============================={FF0000}<" 6908265
0DBA: 30@ = new_cleo_thread from_label @chatcheck



while true
wait 0
0BFD: 1@ = get_global_var "BOTSTATE"
if
1@ == 1
then



repeat
wait 0
0BFD: 1@ = get_global_var "BOTSTATE"
if
1@ == 1
then
0AB3: var 740 = 3
05D3: AS_actor $PLAYER_ACTOR goto_point 585.501 857.967 -43.0016 mode 6 time 5000 ms
end
until 00EC: actor $PLAYER_ACTOR 0 near_point 585.501 857.967 radius 3.0 3.0




repeat
wait 0
0BFD: 1@ = get_global_var "BOTSTATE"
if
1@ == 1
then
Actor.StorePos($PLAYER_ACTOR, 3@, 4@, 5@)
0DB4: 6@ = nearset marker to position x 3@ y 4@ radius 100.0
wait 100
0DB3:  marker 6@ position to x 7@ y 8@ z 9@ //IF AND SET
0AB3: var 740 = 3
05D3: AS_actor $PLAYER_ACTOR goto_point 7@ 8@ 9@ mode 6 time 3000 ms // versionA
end
until 00EC: actor $PLAYER_ACTOR 0 near_point 7@ 8@ radius 3.0 3.0
wait 1500

end
end






:shahtaon  //вкл бота
1@ = 1
0ACC: show_text_lowpriority "BOT Shahta ~g~ON" time 1000
018C: play_sound 1052 at 0.0 0.0 0.0
SAMP.CmdRet


:shahtaoff  //выкл бота
1@ = 0 
0ACC: show_text_lowpriority "BOT Shahta ~g~OFF" time 1000
0AB3: var 740 = 0
0687: clear_actor $PLAYER_ACTOR task
018C: play_sound 1052 at 0.0 0.0 0.0
SAMP.CmdRet

:chatcheck
0000:

0AC8: 0@ = allocate_memory_size 144
0AC8: 1@ = allocate_memory_size 32
while true
wait 0
0B75: samp get_chat_string 99 text_to 0@ prefix_to 1@ color_to 2@ prefix_color_to 0
// кол-во строк в чате - 100, начиная 0 => номер последней 99
if or
  // 2@ == 0xff5030ff // цвет, шестнадцатеричная система счисления, формат: RRGGBBAA
  0C18: 0 = strstr string1 0@ string2 "тойте"
  0C18: 0 = strstr string1 0@ string2 "новитесь"
  0C18: 0 = strstr string1 0@ string2 "ут?"
then
  wait 2000
  0BFC: set_global_var "BOTSTATE" = 0

  wait 2000
  0AF9: samp say_msg "Что?"
  wait 2000
  0AF9: samp say_msg "?что надо?"
  wait 10000
  0BFC: set_global_var "BOTSTATE" = 1
  
end
end


как все просто) и будет работать?)
 

DarkExorcist

Новичок
77
3
Хотелось бы узнать как считывать текст диалогов длинного содержания, ибо 0BD7: samp get_dialog_text 0@ принимает значение (null)
 

DarkExorcist

Новичок
77
3
В общем, я понял что надо выделять память, но вот вопрос, сколько надо памяти для такого: http://imgdepo.ru/show/7707182 диалога, ибо сколько не выделаю, все одно и тоже считывает.
 

hnnssy

Известный
Друг
2,684
2,752
В общем, я понял что надо выделять память, но вот вопрос, сколько надо памяти для такого: http://imgdepo.ru/show/7707182 диалога, ибо сколько не выделаю, все одно и тоже считывает.
Вот рабочий код. Запишет в первую строку файла заглавие диалога и далее сам текст.
Код:
alloc 0@ 4096
0C11: memset destination 0@ value 0x0 size 4096
alloc 1@ 128
0C11: memset destination 1@ value 0x0 size 128
0BD7: samp get_dialog_text 0@
0BD8: samp get_dialog_caption 1@
0A9A: 30@ = openfile "CLEO/dialog.txt" mode "wt"  // IF and SET
0AD3: 1@ = format "%s%c" 1@ 10
0AD8: write_string_to_file 30@ from 1@ //IF and SET
0AD8: write_string_to_file 30@ from 0@ //IF and SET
0A9B: closefile 30@
 
Последнее редактирование модератором:

SantaBarbara228

Известный
29
4
Как сделать автоответчик? Ну допустим мне пишут /pm Вы тут? и авто ответ им приходил
 

Alex7227

Новичок
28
0
Ребята как добавить ещё координаты?
Код:
{$CLEO .cs}
0000:

:activation_goto_point
wait 0
if and
Player.Defined($PLAYER_ACTOR)
0ab0: 49 // Кнопка 1
else_jump @end_goto_point
wait 300
goto @goto_point

:goto_point
wait 0
05D3: AS_actor $PLAYER_ACTOR goto_point 1755.1747 -1904.0111 13.5641 mode 4 time 1000 ms
if or
00EC:   actor $PLAYER_ACTOR sphere 0 near_point 1755.1747 -1904.0111 13.5641 radius 1.5 1.5
0ab0: 52 // Кнопка 4
else_jump @goto_point
Actor.StorePos($PLAYER_ACTOR, 1@ 2@ 3@)
05D3: AS_actor $PLAYER_ACTOR goto_point 1@ 2@ 3@ mode 4 time 1000 ms
0AF8: samp add_message_to_chat "Работа скрипта остановлена, либо актёр на указанных координатах." color -1
goto @end_goto_point


:end_goto_point
goto @activation_goto_point