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

Xuli4

Новичок
22
0
CLEO:
alloc 1@ 128
128 - кол-во символов
Я определённо что-то не так делаю...
CLEO:
{$CLEO .cs}
0000: NOP
if not 0@ = SAMP.Base()    
then 0A93: end_custom_thread
end                        
while not SAMP.Available() 
        wait 100          
end 
gosub @KEY_SCAN                     
:KEY_SCAN                          
wait 0                            
if 0AB0:   key_pressed 121        
jf @KEY_SCAN                           
wait 100                            
alloc 1@ 128      
0B75: samp get_chat_string 99 text_to 1@ prefix_to 2@ color_to 3@ prefix_color_to 4@
chatmsg "%s" -1 1@
jump @KEY_SCAN
 

Perojek)0

Известный
205
3
Я определённо что-то не так делаю...
CLEO:
{$CLEO .cs}
0000: NOP
if not 0@ = SAMP.Base()    
then 0A93: end_custom_thread
end                        
while not SAMP.Available() 
        wait 100          
end 
gosub @KEY_SCAN                     
:KEY_SCAN                          
wait 0                            
if 0AB0:   key_pressed 121        
jf @KEY_SCAN                           
wait 100                            
alloc 1@ 128      
0B75: samp get_chat_string 99 text_to 1@ prefix_to 2@ color_to 3@ prefix_color_to 4@
chatmsg "%s" -1 1@
jump @KEY_SCAN
CLEO:
{$CLEO}
{$INCLUDE SF}
0000:

repeat
    wait 300
until 0AFA:  is_samp_available

0BE1: raknet setup_outcoming_rpc_hook @hook

while true
wait 0
end

:hook
0BE5: raknet 3@ = get_hook_param PARAM_PACKETID
if
3@==93
then
0BE5: raknet 4@ = get_hook_param PARAM_BITSTREAM                     
0AC8: 7@ = allocate_memory_size 150
0BE7: raknet 5@ = bit_stream_read 4@ type BS_TYPE_INT
0BE7: raknet 6@ = bit_stream_read 4@ type BS_TYPE_INT
0BE8: raknet bit_stream 4@ read_array 7@ size 6@
0C1E: array 7@ element 6@ el_size 1 = 0
0AF8: samp add_message_to_chat "%s" color -1 7@
0AC9: free_allocated_memory 7@
end
0BE0: raknet hook_ret true
 

BlackKnigga

Известный
BH Team
922
445
Я определённо что-то не так делаю...
CLEO:
{$CLEO .cs}
0000: NOP
if not 0@ = SAMP.Base()    
then 0A93: end_custom_thread
end                        
while not SAMP.Available() 
        wait 100          
end 
gosub @KEY_SCAN                     
:KEY_SCAN                          
wait 0                            
if 0AB0:   key_pressed 121        
jf @KEY_SCAN                           
wait 100                            
alloc 1@ 128      
0B75: samp get_chat_string 99 text_to 1@ prefix_to 2@ color_to 3@ prefix_color_to 4@
chatmsg "%s" -1 1@
jump @KEY_SCAN
Скорее всего у тебя просто на момент проверки не было 99-ой строки. Можешь взять хук который выше, но он продублирует сообщение как только оно придет.
 

Xuli4

Новичок
22
0
аааа сложна.. кароче не получилось( может есть какой-то опкод который выявляет рестарт сервера? тоесть мне нужно что-то типо такого:
[неизвестная мне команда которая выявляет рестарт сервера]
jump @какая-то точка
в общем нужно чтоб при рестарте сервака происходил джамп на какую-то метку. Надеюсь понятно объяснил)
 

Xuli4

Новичок
22
0
0B4F: samp 1@ = get_gamestate
if 1@ == 4
then
//
end
Не пашет что-то
CLEO:
{$CLEO .cs}
0000: NOP
if not 0@ = SAMP.Base()    
then 0A93: end_custom_thread
end                        
while not SAMP.Available() 
        wait 100          
end 
repeat                        
wait 0
0B4F: samp 1@ = get_gamestate
if 1@ == 4
then
chatmsg "ëîë"  0x00FF66
end
until false
по идее должен спамить словом лол после рестарта но не спамит(
пробовал ещё так:
CLEO:
[B]{$CLEO .cs}
0000: NOP
if not 0@ = SAMP.Base()    
then 0A93: end_custom_thread
end                        
while not SAMP.Available() 
        wait 100          
end 
gosub @KEY_SCAN                          
:KEY_SCAN                                
wait 0                                  
if 0AB0:   key_pressed 121              
jf @KEY_SCAN                            
wait 100              
0B27: samp set_gamestate 1@
chatmsg "%d" -1 1@
jump @KEY_SCAN
в чат пишет 0 и выкидывает на экран коннекта. Я вижу как админы кому-то варны дают и так далее но ничего не происходит просто экран загрузки(на котором пальмы и море как при коннекте).
 
Последнее редактирование:

я воскрес

Активный
245
36
Не пашет что-то
CLEO:
{$CLEO .cs}
0000: NOP
if not 0@ = SAMP.Base()    
then 0A93: end_custom_thread
end                        
while not SAMP.Available() 
        wait 100          
end 
repeat                        
wait 0
0B4F: samp 1@ = get_gamestate
if 1@ == 4
then
chatmsg "ëîë"  0x00FF66
end
until false
по идее должен спамить словом лол после рестарта но не спамит(
по идее он у тебя спамит во время рестарта
 

Perojek)0

Известный
205
3
Поч не робит? Хочу получить iCursorPosition
CLEO:
0BAF: samp 0@ = get_input_info_ptr
0C0C: 1@ = struct 0@ offset 8 size 4
0C0C: 2@ = struct 1@ offset 17 size 4
struct stInputBox
{
void *pUnknown;
uint8_t bIsChatboxOpen;
uint8_t bIsMouseInChatbox;
uint8_t bMouseClick_related;
uint8_t unk;
DWORD dwPosChatInput[2];
uint8_t unk2[263];
int iCursorPosition;
uint8_t unk3;
int iMarkedText_startPos; // Highlighted text between this and iCursorPosition
uint8_t unk4[20];
int iMouseLeftButton;
};
хелп плиз
 

Perojek)0

Известный
205
3
Значение iCursorPosition почему-то не меняется. Выводит всегда 0.
Если я правильно понял, то этот параметр должен показывать позицию курсора в строке вывода. Это так или я в чём-то ошибся?)
CLEO:
0BAF: samp 0@ = get_input_info_ptr
0C0C: 1@ = struct 0@ offset 8 size 4
0C0C: 2@ = struct 1@ offset 287 size 4
 

Xuli4

Новичок
22
0
и почему
CLEO:
{$CLEO .cs}
0000: NOP
if not 0@ = SAMP.Base()    
then 0A93: end_custom_thread
end                        
while not SAMP.Available() 
        wait 100          
end 
gosub @KEY_SCAN                          
:KEY_SCAN                                
wait 0                                  
if 0AB0:   key_pressed 121              
jf @KEY_SCAN                            
wait 100              
0B27: samp set_gamestate 1@
chatmsg "%d" -1 1@
jump @KEY_SCAN
в чат пишет 0? Вроде же такого геймстата нету
 

BlackKnigga

Известный
BH Team
922
445
и почему
CLEO:
{$CLEO .cs}
0000: NOP
if not 0@ = SAMP.Base()    
then 0A93: end_custom_thread
end                        
while not SAMP.Available() 
        wait 100          
end 
gosub @KEY_SCAN                          
:KEY_SCAN                                
wait 0                                  
if 0AB0:   key_pressed 121              
jf @KEY_SCAN                            
wait 100              
0B27: samp set_gamestate 1@
chatmsg "%d" -1 1@
jump @KEY_SCAN
в чат пишет 0? Вроде же такого геймстата нету
Код:
GAMESTATE_NONE = 0
GAMESTATE_WAIT_CONNECT = 1
GAMESTATE_AWAIT_JOIN = 2
GAMESTATE_CONNECTED = 3
GAMESTATE_RESTARTING = 4
GAMESTATE_DISCONNECTED = 5
 

Xuli4

Новичок
22
0
омг я аутист... вместо 0B4F: samp 1@ = get_gamestate использовал 0B4F: samp 1@ = set_gamestate.... И ещё удивлялся почему не работает...