{$CLEO .cs}
{$USE bitwise}
0000:
WAIT 15000
0AC8: 0@ = allocate_memory_size 10 // undeleteable memory region containing the cmdname3 // autodaoda+1 = 9 + 1 = 10 <<<
0AD3: 0@ = string_format "autodaoda"
0AC7: 27@ = var 27@ pointer
0AC7: 26@ = var 26@ pointer
0AB1: @registerClientCommand 3 _CommandName 0@ _TogglingVar 26@ _ParamsPtrToVar 27@
27@ = 0 // null ptr
26@ = 0 // default disabled
// we will not free memory region 0@ // let it remain at the memory forever since we need it
WHILE TRUE
WAIT 0
IF 26@ <> 0
THEN
26@ = 0 // disable indication of the cmd
0B12: 29@ = 29@ XOR 1
IF 0039: 29@ == 1
THEN
32@ = 0
33@ = 0
0AD1: show_formatted_text_highpriority "~g~ON" 1000
ELSE
32@ = 0
33@ = 0
0AD1: show_formatted_text_highpriority "~r~OFF" 1000
END
END
IF 29@ == 1
THEN
IF 32@ > 8500
THEN
0AB1: @Set_Virtual_Key 2 KeyOffSet 0x59 state 255
WAIT 30
0AB1: @Set_Virtual_Key 2 KeyOffSet 0x59 state 0
32@ = 0
END
IF 0AB1: @isDialogOpen 0
THEN
0AB1: @Set_current_dialog_list_item 1 ItemNumber 0
0AB1: @CLOSE_DIALOG 1 1
END
END
END
0A93: terminate_this_custom_script