{$CLEO .cs}
0000: "Parazitas"
REPEAT
IF 8256: player $PLAYER_CHAR defined
THEN 0A93: end_custom_thread
END
WAIT 1500
UNTIL 0256: player $PLAYER_CHAR defined
0AC8: 31@ = allocate_memory_size 1024 // allocate memory to format command
0AD3: 31@ = string_format "asc" // format command name
0AC7: 30@ = var 30@ pointer
0AC7: 29@ = var 29@ pointer
0AB1: @registerClientCommand 3 _CommandName 31@ _TogglingVar 30@ _ParamsPtrToVar 29@
30@ = 0 // default disabled
29@ = 0 // null ptr
0A8C: write_memory 0x74542B size 8 value 0x9090909090909090 virtual_protect 1 // set to disable mouse focus and centering when gta window not focused
WHILE TRUE
WAIT 0
IF 0256: player $PLAYER_CHAR defined
THEN
////////////////////////////////////////////////////////// Command Check..
IF 30@ <> 0
THEN
30@ = 0 // disable indication of the cmd
IF 28@ == FALSE
THEN
28@ = TRUE
0A8C: write_memory 0x747FB6 size 1 value 1 virtual_protect 1 // set gta window do not freeze when not focused
0A8C: write_memory 0x74805A size 1 value 1 virtual_protect 1 // set gta window do not freeze when not focused
0A8C: write_memory 0x53EA88 size 6 value 0x909090909090 virtual_protect 1 // set gta window do not freeze when is minimized and not focused
0AD1: "~Y~Auto SignCheck: ~G~ON" 1337
ELSE
28@ = FALSE
0A8C: write_memory 0x747FB6 size 1 value 0 virtual_protect 1 // reset to original value in order to disable
0A8C: write_memory 0x74805A size 1 value 0 virtual_protect 1 // reset to original value in order to disable
0AD1: "~Y~Auto SignCheck: ~R~OFF" 1337
END
END
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
IF 28@ == TRUE
THEN
FOR 27@ = 95 TO 99
0AC8: 26@ = allocate_memory_size 1024 // allocate memory to obtain returned text
0AC8: 25@ = allocate_memory_size 1024 // allocate memory to obtain returned text
0AB1: @getChatString 1 ChatID 27@ _Returned: Text 26@ PrefixText 25@ Color 24@ PrefixColor 23@
0AC8: 22@ = allocate_memory_size 1024 // allocate memory to obtain returned text
0AB1: @delete_color_codes_from_text 2 text 26@ memory_to_store_characters_as_text 22@
0AC8: 21@ = allocate_memory_size 1024 // allocate memory to format text
0AD3: 21@ = format "Type /signcheck" // format chat text to find and compare
IF 0AB1: @if_text_contains 2 String1 22@ String2 21@ _Returned: text 20@
THEN
0209: 19@ = random_int_in_ranges 1000 2000 // generate random time - protect from admin detection
wait 19@ // normal people can't answer instantly , so that why we need add timer
0AC8: 18@ = allocate_memory_size 1024 // allocate memory to format text
0AD3: 18@ = format "/signcheck" // format text
0AB1: @process_chat_input 1 InputText 18@
wait 1000 // wait to prevent spam
END
END
IF 0AB1: @is_dialog_active 1 CheckingState TRUE // State: TRUE = active ; FALSE = closed
THEN
IF 0AB1: @get_dialog_caption 0 _Returned: Caption 27@
THEN
0AC8: 26@ = allocate_memory_size 1024 // allocate memory to obtain returned text
0AB1: @delete_color_codes_from_text 2 text 27@ memory_to_store_characters_as_text 26@
0AC8: 25@ = allocate_memory_size 1024 // allocate memory to format text
0AD3: 25@ = format "Sign check" // format text to find and compare
IF 0AB1: @if_text_contains 2 String1 26@ String2 25@ _Returned: text 24@
THEN
IF 0AB1: @get_dialog_text 0 _Returned: Text 23@
THEN
0AC8: 22@ = allocate_memory_size 1024 // allocate memory to obtain returned text
0AB1: @delete_color_codes_from_text 2 text 23@ memory_to_store_characters_as_text 22@
0AC8: 21@ = allocate_memory_size 1024 // allocate memory to obtain returned text
0AB1: @get_digits_to_print param_count 2 text 22@ memory_to_store_digits_as_text 21@
0AC8: 20@ = allocate_memory_size 1024 // allocate memory to format text
0AD3: 20@ = format "%s" 21@ // format text
0209: 19@ = random_int_in_ranges 1000 2000 // generate random time - protect from admin detection
wait 19@ // normal people can't answer instantly , so that why we need add timer
0AB1: @process_dialog_input 2 InputText 20@ Button 1 // 1 = Left , 0 = Right
wait 1000 // wait to prevent spam
END
END
END
END
END
END
END
:get_samp_version_id
// 0AB1: @get_samp_version_id 0 _returned: ID 0@
30@ = 0
IF 0AA2: 31@ = "samp.dll" // IF and SET
THEN
31@ += 0x128
0A8D: 29@ = read_memory 31@ size 4 virtual_protect 1
IF 29@ == 0x5542F47A
THEN // 0.3.7 R1
30@ = 1
END
IF 29@ == 0x59C30C94
THEN // 0.3.7 R2
30@ = 2
END
IF 29@ == 0x5A6A3130
THEN // 0.3.DL
30@ = 3
END
31@ -= 8 // reading samp.dll + 0x120
0A8D: 29@ = read_memory 31@ size 4 virtual_protect 1
IF 29@ == 0x5C0B4243
THEN // 0.3.7 R3
30@ = 4
END
IF 29@ == 0x5DD606CD
THEN // 0.3.7 R4
30@ = 5
END
IF 29@ == 0x6094ACAB
THEN // 0.3.7 R4 - v2
30@ = 6
END
IF 29@ == 0x6372C39E
THEN // 0.3.7 R5
30@ = 7
END
END
0AB2: ret 1 30@
:registerClientCommand
{
Credits:
Parazitas - UGBASE
kawa_operand - BlastHack
ajom - UGBASE
Usage:
0AC8: 31@ = allocate_memory_size 1024
0AD3: 31@ = string_format "vr"
0AC7: 30@ = var 30@ pointer
0AC7: 29@ = var 29@ pointer
0AB1: @registerClientCommand 3 _CommandName 31@ _TogglingVar 30@ _ParamsPtrToVar 29@
30@ = 0 // default disabled
29@ = 0 // null ptr
Note:
The Reference Pointers passed at _TogglingVar and _ParamPtrToVar are required to be treated as ReadOnly. Which means that the value of those two Reference Pointers should not be manually overwritten/changed.
I am having a problem with opcode 0AB1, it permanently writes on the main thread's local variables. Maybe its because I directly writes on the passed variable's memory pointer. An example case:
Passing _ParamPtrToVar = 31@ , _TogglingVar = 30@
Opcode 0AB1 31@ == Main Thread's 31@
Opcode 0AB1 30@ == Main Thread's 30@
Thats why I decided to use global variables since they aren't that exposed on scripts.
}
CONST
// WARNING:
// Do not use Local Variables
// Do not recycle/use the three variables on any operation inside the script because these variables will always be used by this function and doesn't override outside the function. I promise you that even if you replace this with a local variable, It will cause overwriting mistakes that will mess the operation
// You can Replace any of these variables into any UNIQUE GLOBAL VARIABLES
VAR1 = $2AFD
VAR2 = $2BEC
VAR3 = $2CDE
VAR4 = $2DCB
VAR5 = $2EBF
VAR6 = $2FAA
END
IF 0AA2: VAR4 = "samp.dll"
THEN
// ~~~~~~~~~~~~~ Create a New Callback Structure
{
51 // push ecx
56 // push esi
8B 74 24 0C // mov esi, [esp+0Ch]
89 34 25 11 11 11 11 // mov [11111111], esi // later: [11111111] becomes 1@
83 35 11 11 11 11 01 // xor [11111111], 01 // later: [11111111] becomes 2@
5E // pop esi
59 // pop ecx
C3 // retn
}
// Avoid using local variables by saving the values inside a global variables
008A: VAR1 = 0@
008A: VAR2 = 2@
008A: VAR3 = 1@
//
0AC8: VAR5 = allocate_memory_size 23 // undeleteable memory region
0084: VAR6 = VAR5
0A8C: write_memory VAR6 size 4 value 0x748B5651 virtual_protect 1
VAR6 += 4
0A8C: write_memory VAR6 size 4 value 0x34890C24 virtual_protect 1
VAR6 += 4
0A8C: write_memory VAR6 size 1 value 0x25 virtual_protect 1
VAR6++
// 0A8C: write_memory VAR2 size 4 value 0 virtual_protect 0 // null string // NOT WORKING due to this function's varibles overriding
0A8C: write_memory VAR6 size 4 value VAR2 virtual_protect 1
VAR6 += 4
0A8C: write_memory VAR6 size 2 value 0x3583 virtual_protect 1
VAR6 += 2
// 0A8C: write_memory VAR3 size 4 value 0 virtual_protect 0 // Zeroing TogglingVar // NOT WORKING due to this function's varibles overriding
0A8C: write_memory VAR6 size 4 value VAR3 virtual_protect 1
VAR6 += 4
0A8C: write_memory VAR6 size 4 value 0xC3595E01 virtual_protect 1
// ~~~~~~~~~~~~~ now callback struct VAR5 is ready
0AB1: @get_samp_version_id 0 _returned: ID 17@
IF 17@ > 0
THEN
IF 17@ == 1 // 0.3.7 R1
THEN
0A8E: VAR6 = VAR4 + 0x21A0E8 // SAMP_CHAT_INPUT_INFO_OFFSET
0A8D: VAR6 = read_memory VAR6 size 4 virtual_protect 1
VAR4 += 0x65AD0 // SAMP_REGISTER_CLIENT_CMD_OFFSET
END
IF 17@ == 2 // 0.3.7 R2
THEN
0A8E: VAR6 = VAR4 + 0x21A0F0 // SAMP_CHAT_INPUT_INFO_OFFSET
0A8D: VAR6 = read_memory VAR6 size 4 virtual_protect 1
VAR4 += 0x65BA0 // SAMP_REGISTER_CLIENT_CMD_OFFSET
END
IF 17@ == 3 // 0.3.DL
THEN
0A8E: VAR6 = VAR4 + 0x2ACA14 // SAMP_CHAT_INPUT_INFO_OFFSET
0A8D: VAR6 = read_memory VAR6 size 4 virtual_protect 1
VAR4 += 0x691B0 // SAMP_REGISTER_CLIENT_CMD_OFFSET
END
IF 17@ == 4 // 0.3.7 R3
THEN
0A8E: VAR6 = VAR4 + 0x26E8CC // SAMP_CHAT_INPUT_INFO_OFFSET
0A8D: VAR6 = read_memory VAR6 size 4 virtual_protect 1
VAR4 += 0x69000 // SAMP_REGISTER_CLIENT_CMD_OFFSET
END
IF 17@ == 5 // 0.3.7 R4
THEN
0A8E: VAR6 = VAR4 + 0x26E9FC // SAMP_CHAT_INPUT_INFO_OFFSET
0A8D: VAR6 = read_memory VAR6 size 4 virtual_protect 1
VAR4 += 0x69730 // SAMP_REGISTER_CLIENT_CMD_OFFSET
END
IF 17@ == 6 // 0.3.7 R4 - v2
THEN
0A8E: VAR6 = VAR4 + 0x26E9FC // SAMP_CHAT_INPUT_INFO_OFFSET
0A8D: VAR6 = read_memory VAR6 size 4 virtual_protect 1
VAR4 += 0x69770 // SAMP_REGISTER_CLIENT_CMD_OFFSET
END
IF 17@ == 7 // 0.3.7 R5
THEN
0A8E: VAR6 = VAR4 + 0x26EB84 // SAMP_CHAT_INPUT_INFO_OFFSET
0A8D: VAR6 = read_memory VAR6 size 4 virtual_protect 1
VAR4 += 0x69770 // SAMP_REGISTER_CLIENT_CMD_OFFSET
END
0AA6: call_method VAR4 struct VAR6 num_params 2 pop 0 VAR5 VAR1
END
END
0AB2: ret 0
:getChatString
{
0AC8: 0@ = allocate_memory_size 1024
0AC8: 1@ = allocate_memory_size 1024
0AB1: @getChatString 1 ChatID 99 _Returned: Text 0@ PrefixText 1@ Color 2@ PrefixColor 3@
}
IF 0AA2: 31@ = "samp.dll"
THEN
0AB1: @get_samp_version_id 0 _returned: ID 17@
IF 17@ > 0
THEN
IF 17@ == 1 // 0.3.7 R1
THEN
31@ += 0x21A0E4 // SAMP_CHAT_INFO_OFFSET
0A8D: 31@ readMem 31@ sz 4 vp 0
31@ += 0x132
0@ *= 0xFC
005A: 31@ += 0@
0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
0A8D: 25@ readMem 26@ sz 1 vp 0
IF NOT 25@ > 0
THEN 24@ = 0
ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
END
END
IF 17@ == 2 // 0.3.7 R2
THEN
31@ += 0x21A0EC // SAMP_CHAT_INFO_OFFSET
0A8D: 31@ readMem 31@ sz 4 vp 0
31@ += 0x132
0@ *= 0xFC
005A: 31@ += 0@
0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
0A8D: 25@ readMem 26@ sz 1 vp 0
IF NOT 25@ > 0
THEN 24@ = 0
ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
END
END
IF 17@ == 3 // 0.3.DL
THEN
31@ += 0x2ACA10 // SAMP_CHAT_INFO_OFFSET
0A8D: 31@ readMem 31@ sz 4 vp 0
31@ += 0x132
0@ *= 0xFC
005A: 31@ += 0@
0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
0A8D: 25@ readMem 26@ sz 1 vp 0
IF NOT 25@ > 0
THEN 24@ = 0
ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
END
END
IF 17@ == 4 // 0.3.7 R3
THEN
31@ += 0x26E8C8 // SAMP_CHAT_INFO_OFFSET
0A8D: 31@ readMem 31@ sz 4 vp 0
31@ += 0x132
0@ *= 0xFC
005A: 31@ += 0@
0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
0A8D: 25@ readMem 26@ sz 1 vp 0
IF NOT 25@ > 0
THEN 24@ = 0
ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
END
END
IF 17@ == 5 // 0.3.7 R4
THEN
31@ += 0x26E9F8 // SAMP_CHAT_INFO_OFFSET
0A8D: 31@ readMem 31@ sz 4 vp 0
31@ += 0x132
0@ *= 0xFC
005A: 31@ += 0@
0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
0A8D: 25@ readMem 26@ sz 1 vp 0
IF NOT 25@ > 0
THEN 24@ = 0
ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
END
END
IF 17@ == 6 // 0.3.7 R4 - v2
THEN
31@ += 0x26E9F8 // SAMP_CHAT_INFO_OFFSET
0A8D: 31@ readMem 31@ sz 4 vp 0
31@ += 0x132
0@ *= 0xFC
005A: 31@ += 0@
0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
0A8D: 25@ readMem 26@ sz 1 vp 0
IF NOT 25@ > 0
THEN 24@ = 0
ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
END
END
IF 17@ == 7 // 0.3.7 R5
THEN
31@ += 0x26EB80 // SAMP_CHAT_INFO_OFFSET
0A8D: 31@ readMem 31@ sz 4 vp 0
31@ += 0x132
0@ *= 0xFC
005A: 31@ += 0@
0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
0A8D: 25@ readMem 26@ sz 1 vp 0
IF NOT 25@ > 0
THEN 24@ = 0
ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
END
END
0AA3: 31@
END
END
0AB2: ret 4 30@ 29@ 27@ 24@
:process_chat_input
/*
0AC8: 1@ = allocate_memory_size 1024
0AD3: 1@ = format "text or /command"
0AB1: @process_chat_input 1 InputText 1@
*/
IF 0AA2: 31@ = "samp.dll"
THEN
0AB1: @get_samp_version_id 0 _returned: ID 17@
IF 17@ > 0
THEN
IF 17@ == 1 // 0.3.7 R1
THEN
0A8E: 30@ = 31@ + 0x21A0E8 // SAMP_CHAT_INPUT_INFO_OFFSET
0A8D: 29@ = readMem 30@ sz 4 vp 0 // pChatInput;
0A8E: 28@ = 29@ + 0x8 // pChatInput->pEditBox;
0A8D: 27@ = readMem 28@ sz 4 vp 0 // pEditBox;
0A8E: 26@ = 31@ + 0x80F60 // CDXUTEditBox::SetText
0A8E: 25@ = 31@ + 0x65D30 // PROCESS_INPUT
END
IF 17@ == 2 // 0.3.7 R2
THEN
0A8E: 30@ = 31@ + 0x21A0F0 // SAMP_CHAT_INPUT_INFO_OFFSET
0A8D: 29@ = readMem 30@ sz 4 vp 0 // pChatInput;
0A8E: 28@ = 29@ + 0x8 // pChatInput->pEditBox;
0A8D: 27@ = readMem 28@ sz 4 vp 0 // pEditBox;
0A8E: 26@ = 31@ + 0x81000 // CDXUTEditBox::SetText
0A8E: 25@ = 31@ + 0x65E00 // PROCESS_INPUT
END
IF 17@ == 3 // 0.3.DL
THEN
0A8E: 30@ = 31@ + 0x2ACA14 // SAMP_CHAT_INPUT_INFO_OFFSET
0A8D: 29@ = readMem 30@ sz 4 vp 0 // pChatInput;
0A8E: 28@ = 29@ + 0x8 // pChatInput->pEditBox;
0A8D: 27@ = readMem 28@ sz 4 vp 0 // pEditBox;
0A8E: 26@ = 31@ + 0x85000 // CDXUTEditBox::SetText
0A8E: 25@ = 31@ + 0x69410 // PROCESS_INPUT
END
IF 17@ == 4 // 0.3.7 R3
THEN
0A8E: 30@ = 31@ + 0x26E8CC // SAMP_CHAT_INPUT_INFO_OFFSET
0A8D: 29@ = readMem 30@ sz 4 vp 0 // pChatInput;
0A8E: 28@ = 29@ + 0x8 // pChatInput->pEditBox;
0A8D: 27@ = readMem 28@ sz 4 vp 0 // pEditBox;
0A8E: 26@ = 31@ + 0x84E70 // CDXUTEditBox::SetText
0A8E: 25@ = 31@ + 0x69260 // PROCESS_INPUT
END
IF 17@ == 5 // 0.3.7 R4
THEN
0A8E: 30@ = 31@ + 0x26E9FC // SAMP_CHAT_INPUT_INFO_OFFSET
0A8D: 29@ = readMem 30@ sz 4 vp 0 // pChatInput;
0A8E: 28@ = 29@ + 0x8 // pChatInput->pEditBox;
0A8D: 27@ = readMem 28@ sz 4 vp 0 // pEditBox;
0A8E: 26@ = 31@ + 0x855B0 // CDXUTEditBox::SetText
0A8E: 25@ = 31@ + 0x69990 // PROCESS_INPUT
END
IF 17@ == 6 // 0.3.7 R4 - v2
THEN
0A8E: 30@ = 31@ + 0x26E9FC // SAMP_CHAT_INPUT_INFO_OFFSET
0A8D: 29@ = readMem 30@ sz 4 vp 0 // pChatInput;
0A8E: 28@ = 29@ + 0x8 // pChatInput->pEditBox;
0A8D: 27@ = readMem 28@ sz 4 vp 0 // pEditBox;
0A8E: 26@ = 31@ + 0x855E0 // CDXUTEditBox::SetText
0A8E: 25@ = 31@ + 0x699D0 // PROCESS_INPUT
END
IF 17@ == 7 // 0.3.7 R5
THEN
0A8E: 30@ = 31@ + 0x26EB84 // SAMP_CHAT_INPUT_INFO_OFFSET
0A8D: 29@ = readMem 30@ sz 4 vp 0 // pChatInput;
0A8E: 28@ = 29@ + 0x8 // pChatInput->pEditBox;
0A8D: 27@ = readMem 28@ sz 4 vp 0 // pEditBox;
0A8E: 26@ = 31@ + 0x85580 // CDXUTEditBox::SetText
0A8E: 25@ = 31@ + 0x699D0 // PROCESS_INPUT
END
0AA8: call_function_method 26@ struct 27@ num_params 2 pop 0 _bSelected 0 _pszText 0@ _retVal 6@
0AA8: call_function_method 25@ struct 29@ num_params 0 pop 0 _retVal 7@
END
END
0AB2: 0
:is_dialog_active
{
Set TRUE if you wanna check when dialog is active
Set FALSE if you wanna check when dialog is closed
Usage:
IF 0AB1: @is_dialog_active 1 CheckingState FALSE // State: TRUE = active ; FALSE = closed
}
IF 0AA2: 31@ = "samp.dll"
THEN
0AB1: @get_samp_version_id 0 _returned: ID 17@
IF 17@ > 0
THEN
IF 17@ == 1 // 0.3.7 R1
THEN
0A8E: 30@ = 31@ + 0x21A0B8 // SAMP_DIALOG_INFO_OFFSET
0A8D: 30@ = readMem 30@ sz 4 vp 0
0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
0A8D: 29@ = readMem 29@ sz 4 vp 0
END
IF 17@ == 2 // 0.3.7 R2
THEN
0A8E: 30@ = 31@ + 0x21A0C0 // SAMP_DIALOG_INFO_OFFSET
0A8D: 30@ = readMem 30@ sz 4 vp 0
0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
0A8D: 29@ = readMem 29@ sz 4 vp 0
END
IF 17@ == 3 // 0.3.DL
THEN
0A8E: 30@ = 31@ + 0x2AC9E0 // SAMP_DIALOG_INFO_OFFSET
0A8D: 30@ = readMem 30@ sz 4 vp 0
0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
0A8D: 29@ = readMem 29@ sz 4 vp 0
END
IF 17@ == 4 // 0.3.7 R3
THEN
0A8E: 30@ = 31@ + 0x26E898 // SAMP_DIALOG_INFO_OFFSET
0A8D: 30@ = readMem 30@ sz 4 vp 0
0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
0A8D: 29@ = readMem 29@ sz 4 vp 0
END
IF 17@ == 5 // 0.3.7 R4
THEN
0A8E: 30@ = 31@ + 0x26E9C8 // SAMP_DIALOG_INFO_OFFSET
0A8D: 30@ = readMem 30@ sz 4 vp 0
0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
0A8D: 29@ = readMem 29@ sz 4 vp 0
END
IF 17@ == 6 // 0.3.7 R4 - v2
THEN
0A8E: 30@ = 31@ + 0x26E9C8 // SAMP_DIALOG_INFO_OFFSET
0A8D: 30@ = readMem 30@ sz 4 vp 0
0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
0A8D: 29@ = readMem 29@ sz 4 vp 0
END
IF 17@ == 7 // 0.3.7 R5
THEN
0A8E: 30@ = 31@ + 0x26EB50 // SAMP_DIALOG_INFO_OFFSET
0A8D: 30@ = readMem 30@ sz 4 vp 0
0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
0A8D: 29@ = readMem 29@ sz 4 vp 0
END
IF 0@ == TRUE
THEN
IF 29@ == TRUE
THEN 0485: return_true
ELSE 059A: return_false
END
ELSE
IF 29@ == FALSE
THEN 0485: return_true
ELSE 059A: return_false
END
END
END
END
0AB2: ret 0
:get_dialog_caption
{
0AB1: @get_dialog_caption 0 _Returned: Caption 1@
}
IF 0AA2: 31@ = "samp.dll"
THEN
0AB1: @get_samp_version_id 0 _returned: ID 17@
IF 17@ > 0
THEN
IF 17@ == 1 // 0.3.7 R1
THEN
0A8E: 30@ = 31@ + 0x21A0B8 // SAMP_DIALOG_INFO_OFFSET
0A8D: 30@ = readMem 30@ sz 4 vp 0
0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
0A8D: 29@ = readMem 29@ sz 4 vp 0
END
IF 17@ == 2 // 0.3.7 R2
THEN
0A8E: 30@ = 31@ + 0x21A0C0 // SAMP_DIALOG_INFO_OFFSET
0A8D: 30@ = readMem 30@ sz 4 vp 0
0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
0A8D: 29@ = readMem 29@ sz 4 vp 0
END
IF 17@ == 3 // 0.3.DL
THEN
0A8E: 30@ = 31@ + 0x2AC9E0 // SAMP_DIALOG_INFO_OFFSET
0A8D: 30@ = readMem 30@ sz 4 vp 0
0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
0A8D: 29@ = readMem 29@ sz 4 vp 0
END
IF 17@ == 4 // 0.3.7 R3
THEN
0A8E: 30@ = 31@ + 0x26E898 // SAMP_DIALOG_INFO_OFFSET
0A8D: 30@ = readMem 30@ sz 4 vp 0
0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
0A8D: 29@ = readMem 29@ sz 4 vp 0
END
IF 17@ == 5 // 0.3.7 R4
THEN
0A8E: 30@ = 31@ + 0x26E9C8 // SAMP_DIALOG_INFO_OFFSET
0A8D: 30@ = readMem 30@ sz 4 vp 0
0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
0A8D: 29@ = readMem 29@ sz 4 vp 0
END
IF 17@ == 6 // 0.3.7 R4 - v2
THEN
0A8E: 30@ = 31@ + 0x26E9C8 // SAMP_DIALOG_INFO_OFFSET
0A8D: 30@ = readMem 30@ sz 4 vp 0
0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
0A8D: 29@ = readMem 29@ sz 4 vp 0
END
IF 17@ == 7 // 0.3.7 R5
THEN
0A8E: 30@ = 31@ + 0x26EB50 // SAMP_DIALOG_INFO_OFFSET
0A8D: 30@ = readMem 30@ sz 4 vp 0
0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
0A8D: 29@ = readMem 29@ sz 4 vp 0
END
IF 29@ == TRUE
THEN
0A8E: 28@ = 30@ + 0x40 // SAMP_DIALOG_CAPTION_OFFSET
0485: dialog_open
0AB2: ret 1 28@
ELSE 059A: dialog closed
END
END
END
0AB2: ret 0
:if_text_contains
{
0AB1: @if_text_contains 2 String1 3@ String2 4@ _Returned: text 5@
}
0AB1: @strlen 1 string 0@ _Returned: length 31@
0AB1: @strlen 1 string 1@ _Returned: length 30@
//initial length check (the phrase can't be longer than the main text)
if 001D: 30@ > 31@ // (int)
then
059A: return_false
0AB2: ret 1 0
end
31@ -= 1
26@ = 0 // counter of the same chars in a row
for 29@ = 0 to 31@ // for each char of the main text (29@ = index)
0085: 24@ = 0@ // (int)
005A: 24@ += 29@ // (int)
0A8D: 28@ = read_memory 24@ size 1 virtual_protect 0
0085: 23@ = 1@ // (int)
005A: 23@ += 26@ // (int)
0A8D: 27@ = read_memory 23@ size 1 virtual_protect 0
if 003B: 28@ == 27@ // (int)
then
26@++
if 002D: 26@ >= 30@ // (int)
then
0485: return_true
0062: 24@ -= 30@ // (int)
24@ += 1
0AB2: ret 1 24@
end
else
if 26@ > 0
then
29@-- //check the same char again and assume it's the begining of the string but only if there was matching parts before (otherwise it would go back all the time and make infinite loop)
end
26@ = 0
end
end
059A: return_false
0AB2: ret 1 0
:delete_color_codes_from_text
{
0AC8: 1@ = allocate_memory_size 1024
0AB1: @delete_color_codes_from_text 2 text 0@ memory_to_store_characters_as_text 1@
}
5@ = FALSE // inbracket
0AB1: @strlen 1 string 0@ _length 31@
FOR 30@ = 0 TO 31@
0085: 29@ = 0@ // copy pointer
005A: 29@ += 30@ // add offset (as the loop progresses it becomes pointers to first-last character)
0A8D: 28@ = read_memory 29@ size 1 virtual_protect 1 // 28@ is the ascii number representing character
IF 28@ == 123
THEN 5@ = TRUE // inbracket
END
IF 5@ == FALSE // inbracket
THEN
0A8C: write_memory 1@ size 1 value 28@ virtual_protect 1
1@ += 1 // move to next address
END
IF 28@ == 125
THEN 5@ = FALSE // inbracket
END
END
0A8C: write_memory 1@ size 1 value 0 virtual_protect 1 // null-termination
0AB2: ret 0
:get_digits_to_print
{
0AC8: 1@ = allocate_memory_size 1024
0AB1: @get_digits_to_print param_count 2 text 0@ memory_to_store_digits_as_text 1@
}
0AB1: @strlen 1 string 0@ _length 31@
for 30@ = 0 to 31@
0085: 29@ = 0@ // copy pointer
005A: 29@ += 30@ // add offset (as the loop progresses it becomes pointers to first-last character)
0A8D: 28@ = read_memory 29@ size 1 virtual_protect 1 // 28@ is the ascii number representing character
if and
28@ >= 0x30 // '0'
28@ <= 0x39 // '9'
then
0A8C: write_memory 1@ size 1 value 28@ virtual_protect 1
1@ += 1 // move to next address
end
end
0A8C: write_memory 1@ size 1 value 0 virtual_protect 1 // null-termination
0AB2: ret 0
:strlen
{
Example: 0AB1: @strlen 1 string 0@ _Returned: length 31@
In: 0@ - text;
Out: 1@ - size;
}
for 1@ = 0 to 1024
0A8D: 2@ = read_memory 0@ size 1 virtual_protect 0
if not 2@ == 0
jf break
0@ += 1
end
0AB2: ret 1 1@
:get_dialog_text
{
0AB1: @get_dialog_text 0 _Returned: Text 1@
}
IF 0AA2: 31@ = "samp.dll"
THEN
0AB1: @get_samp_version_id 0 _Returned: ID 17@
IF 17@ > 0
THEN
IF 17@ == 1 // 0.3.7 R1
THEN
0A8E: 30@ = 31@ + 0x21A0B8 // SAMP_DIALOG_INFO_OFFSET
0A8D: 30@ = readMem 30@ sz 4 vp 0
0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
0A8D: 29@ = readMem 29@ sz 4 vp 0
END
IF 17@ == 2 // 0.3.7 R2
THEN
0A8E: 30@ = 31@ + 0x21A0C0 // SAMP_DIALOG_INFO_OFFSET
0A8D: 30@ = readMem 30@ sz 4 vp 0
0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
0A8D: 29@ = readMem 29@ sz 4 vp 0
END
IF 17@ == 3 // 0.3.DL
THEN
0A8E: 30@ = 31@ + 0x2AC9E0 // SAMP_DIALOG_INFO_OFFSET
0A8D: 30@ = readMem 30@ sz 4 vp 0
0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
0A8D: 29@ = readMem 29@ sz 4 vp 0
END
IF 17@ == 4 // 0.3.7 R3
THEN
0A8E: 30@ = 31@ + 0x26E898 // SAMP_DIALOG_INFO_OFFSET
0A8D: 30@ = readMem 30@ sz 4 vp 0
0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
0A8D: 29@ = readMem 29@ sz 4 vp 0
END
IF 17@ == 5 // 0.3.7 R4
THEN
0A8E: 30@ = 31@ + 0x26E9C8 // SAMP_DIALOG_INFO_OFFSET
0A8D: 30@ = readMem 30@ sz 4 vp 0
0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
0A8D: 29@ = readMem 29@ sz 4 vp 0
END
IF 17@ == 6 // 0.3.7 R4 - v2
THEN
0A8E: 30@ = 31@ + 0x26E9C8 // SAMP_DIALOG_INFO_OFFSET
0A8D: 30@ = readMem 30@ sz 4 vp 0
0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
0A8D: 29@ = readMem 29@ sz 4 vp 0
END
IF 17@ == 7 // 0.3.7 R5
THEN
0A8E: 30@ = 31@ + 0x26EB50 // SAMP_DIALOG_INFO_OFFSET
0A8D: 30@ = readMem 30@ sz 4 vp 0
0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
0A8D: 29@ = readMem 29@ sz 4 vp 0
END
IF 29@ == TRUE
THEN
0A8E: 28@ = 30@ + 0x34 // SAMP_DIALOG_TEXT_OFFSET
0A8D: 28@ = readMem 28@ sz 4 vp 0
28@ += 0x0
0485: dialog_open
0AB2: ret 1 28@
ELSE 059A: dialog closed
END
END
END
0AB2: ret 0
:process_dialog_input
/*
0AC8: 0@ = allocate_memory_size 1024
0AD3: 0@ = format "text"
0AB1: @process_dialog_input 2 InputText 0@ Button 1 // 1 = Left , 0 = Right
*/
IF 0AA2: 31@ = "samp.dll"
THEN
0AB1: @get_samp_version_id 0 _Returned: ID 17@
IF 17@ > 0
THEN
IF 17@ == 1 // 0.3.7 R1
THEN
0A8E: 30@ = 31@ + 0x21A0B8 // SAMP_DIALOG_INFO_OFFSET
0A8D: 29@ = readMem 30@ sz 4 vp 0 // pDialog;
0A8E: 28@ = 29@ + 0x24 // pDialog->pEditBox;
0A8D: 27@ = readMem 28@ sz 4 vp 0 // pEditBox;
0A8E: 26@ = 31@ + 0x80F60 // CDXUTEditBox::SetText
0A8E: 25@ = 31@ + 0x6C040 // SAMP_DIALOG_CLOSE_OFFSET
END
IF 17@ == 2 // 0.3.7 R2
THEN
0A8E: 30@ = 31@ + 0x21A0C0 // SAMP_DIALOG_INFO_OFFSET
0A8D: 29@ = readMem 30@ sz 4 vp 0 // pDialog;
0A8E: 28@ = 29@ + 0x24 // pDialog->pEditBox;
0A8D: 27@ = readMem 28@ sz 4 vp 0 // pEditBox;
0A8E: 26@ = 31@ + 0x81000 // CDXUTEditBox::SetText
0A8E: 25@ = 31@ + 0x6C0F0 // SAMP_DIALOG_CLOSE_OFFSET
END
IF 17@ == 3 // 0.3.DL
THEN
0A8E: 30@ = 31@ + 0x2AC9E0 // SAMP_DIALOG_INFO_OFFSET
0A8D: 29@ = readMem 30@ sz 4 vp 0 // pDialog;
0A8E: 28@ = 29@ + 0x24 // pDialog->pEditBox;
0A8D: 27@ = readMem 28@ sz 4 vp 0 // pEditBox;
0A8E: 26@ = 31@ + 0x85000 // CDXUTEditBox::SetText
0A8E: 25@ = 31@ + 0x700D0 // SAMP_DIALOG_CLOSE_OFFSET
END
IF 17@ == 4 // 0.3.7 R3
THEN
0A8E: 30@ = 31@ + 0x26E898 // SAMP_DIALOG_INFO_OFFSET
0A8D: 29@ = readMem 30@ sz 4 vp 0 // pDialog;
0A8E: 28@ = 29@ + 0x24 // pDialog->pEditBox;
0A8D: 27@ = readMem 28@ sz 4 vp 0 // pEditBox;
0A8E: 26@ = 31@ + 0x84E70 // CDXUTEditBox::SetText
0A8E: 25@ = 31@ + 0x6FF40 // SAMP_DIALOG_CLOSE_OFFSET
END
IF 17@ == 5 // 0.3.7 R4
THEN
0A8E: 30@ = 31@ + 0x26E9C8 // SAMP_DIALOG_INFO_OFFSET
0A8D: 29@ = readMem 30@ sz 4 vp 0 // pDialog;
0A8E: 28@ = 29@ + 0x24 // pDialog->pEditBox;
0A8D: 27@ = readMem 28@ sz 4 vp 0 // pEditBox;
0A8E: 26@ = 31@ + 0x855B0 // CDXUTEditBox::SetText
0A8E: 25@ = 31@ + 0x70660 // SAMP_DIALOG_CLOSE_OFFSET
END
IF 17@ == 6 // 0.3.7 R4 - v2
THEN
0A8E: 30@ = 31@ + 0x26E9C8 // SAMP_DIALOG_INFO_OFFSET
0A8D: 29@ = readMem 30@ sz 4 vp 0 // pDialog;
0A8E: 28@ = 29@ + 0x24 // pDialog->pEditBox;
0A8D: 27@ = readMem 28@ sz 4 vp 0 // pEditBox;
0A8E: 26@ = 31@ + 0x855E0 // CDXUTEditBox::SetText
0A8E: 25@ = 31@ + 0x70690 //SAMP_DIALOG_CLOSE
END
IF 17@ == 7 // 0.3.7 R5
THEN
0A8E: 30@ = 31@ + 0x26EB50 // SAMP_DIALOG_INFO_OFFSET
0A8D: 29@ = readMem 30@ sz 4 vp 0 // pDialog;
0A8E: 28@ = 29@ + 0x24 // pDialog->pEditBox;
0A8D: 27@ = readMem 28@ sz 4 vp 0 // pEditBox;
0A8E: 26@ = 31@ + 0x85580 // CDXUTEditBox::SetText
0A8E: 25@ = 31@ + 0x70630 // SAMP_DIALOG_CLOSE_OFFSET
END
0AA8: call_function_method 26@ struct 27@ num_params 2 pop 0 _bSelected 0 _pszText 0@ _retVal 6@
0AA8: call_function_method 25@ struct 29@ num_params 1 pop 0 Button 1@ _retVal 5@
END
END
0AB2: 0
:Chatmsg
/*
0AC8: 0@ = allocate_memory_size 1024
0AD3: 0@ = format "{FFFFFF}Auto Accept: {00FF00}ON"
0AB1: @Chatmsg 2 text 0@ color -1
*/
IF 0AA2: 31@ = "samp.dll"
THEN
0AB1: @get_samp_version_id 0 _returned: ID 17@
IF NOT 0@ < 1
THEN
IF 17@ == 1 // 0.3.7 R1
THEN
0A8E: 30@ = 31@ + 0x21A0E4 // SAMP_CHAT_INFO_OFFSET (R1)
0A8D: 30@ = readMem 30@ sz 4 vp 0 // pChat;
0A8E: 29@ = 31@ + 0x64010 // FUNC_ADDTOCHATWND (R1)
END
IF 17@ == 2 // 0.3.7 R2
THEN
0A8E: 30@ = 31@ + 0x21A0EC // SAMP_CHAT_INFO_OFFSET (R2)
0A8D: 30@ = readMem 30@ sz 4 vp 0 // pChat;
0A8E: 29@ = 31@ + 0x640E0 // FUNC_ADDTOCHATWND (R2)
END
IF 17@ == 3 // 0.3.DL
THEN
0A8E: 30@ = 31@ + 0x2ACA10 // SAMP_CHAT_INFO_OFFSET (DL)
0A8D: 30@ = readMem 30@ sz 4 vp 0 // pChat;
0A8E: 29@ = 31@ + 0x67650 // FUNC_ADDTOCHATWND (DL)
END
IF 17@ == 4 // 0.3.7 R3
THEN
0A8E: 30@ = 31@ + 0x26E8C8 // SAMP_CHAT_INFO_OFFSET (R3)
0A8D: 30@ = readMem 30@ sz 4 vp 0 // pChat;
0A8E: 29@ = 31@ + 0x67460 // FUNC_ADDTOCHATWND (R3)
END
IF 17@ == 5 // 0.3.7 R4
THEN
0A8E: 30@ = 31@ + 0x26E9F8 // SAMP_CHAT_INFO_OFFSET (R4)
0A8D: 30@ = readMem 30@ sz 4 vp 0 // pChat;
0A8E: 29@ = 31@ + 0x67BA0 // FUNC_ADDTOCHATWND (R4) 699D0
END
IF 17@ == 6 // 0.3.7 R4 - v2
THEN
0A8E: 30@ = 31@ + 0x26E9F8 // SAMP_CHAT_INFO_OFFSET (R4)
0A8D: 30@ = readMem 30@ sz 4 vp 0 // pChat;
0A8E: 29@ = 31@ + 0x67BE0 // FUNC_ADDTOCHATWND (R4)
END
IF 17@ == 7 // 0.3.7 R5
THEN
0A8E: 30@ = 31@ + 0x26EB80 // SAMP_CHAT_INFO_OFFSET (R4)
0A8D: 30@ = readMem 30@ sz 4 vp 0 // pChat;
0A8E: 29@ = 31@ + 0x67BE0 // FUNC_ADDTOCHATWND (R4)
END
IF OR
1@ == -1
1@ <= 0
THEN 1@ = 0xFFFFFFFF
END
0AA6: call 29@ struct 30@ num_params 5 pop 0 params 0 1@ 0 0@ 8
END
END
0AB2: 0
:isWindowMinimized
{
0AB1: @isWindowMinimized 0
}
0A8D: 31@ = read_memory 0xC97C1C size 4 virtual_protect 0 // window handle pointer
0A8D: 30@ = read_memory 0x85825C size 4 virtual_protect 0 // IsIconic call function pointer
0AA7: call_function 30@ num_params 1 pop 0 WindowHandle 31@ _Returned: State 29@
IF 29@ > 0
THEN 0485: return_true
ELSE 059A: return_false
END
0AB2: 0