Can someone fix this for me, it s not working on samp 0.3.7.
Here is the code:
{$CLEO .cs}
0000:
wait 5000
printf "~y~AutoDialogSelect -- ~g~LOADED" time 1000
0AB1: @get_samp_version_id 0 _returned: ID 31@
while true
wait 0
IF 0256: player $PLAYER_CHAR defined
then
IF 0AB1: @is_dialog_active 1 CheckingState true
then
wait 500
0AB1: @get_dialog_caption 1 SampVersionID 31@ _Returned: Caption 30@
alloc 29@ 100
format 29@ "Trucker: Choose"
if 0AB1: call_scm_func @IfTextContains 2 mainTextPointer 30@ pieceToFindPointer 29@ _returnedPointer 3@
then
wait 500
alloc 27@ 195
format 27@ "Foster Valley"
0AB1: @get_current_dialog_list_item_text 1 Item 2 _Returned: Text 26@
0AB1: @get_current_dialog_list_item_text 1 Item 5 _Returned: Text 21@
if 0AB1: call_scm_func @IfTextContains 2 mainTextPointer 26@ pieceToFindPointer 27@ _returnedPointer 1@
then
0AB1: @process_current_dialog_list_item 2 ListItem 2 Button 1 // 1 = Left , 0 = Right
end
free 27@
alloc 27@ 195
format 27@ "Esplanade North"
if 0AB1: call_scm_func @IfTextContains 2 mainTextPointer 21@ pieceToFindPointer 27@ _returnedPointer 2@
then
0AB1: @process_current_dialog_list_item 2 ListItem 5 Button 1
end
free 27@
end
free 29@
end
end
end
//if 0AB1: call_scm_func @IfTextContains 2 mainTextPointer 0@ pieceToFindPointer 1@ _returnedPointer 2@
:IfTextContains
{
0@ - the main text
1@ - piece of text to be found within the main text
}
0AB1: @StrLen 1 strPtr 0@ _length 31@
0AB1: @StrLen 1 strPtr 1@ _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
//0AB1: @StrLen 1 strPtr 0@ _length 31@
:StrLen
{
0@ - string pointer
}
30@ = 0
for 31@ = 0 to 100000
0A8D: 29@ = read_memory 0@ size 1 virtual_protect 0
if 29@ == 0
then
break
else
30@++
0@++
end
end
0AB2: ret 1 30@
: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@
: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 1 SampVersionID 31@ _Returned: Caption 1@
}
IF 0AA2: 31@ = "samp.dll"
THEN
IF 0@ > 0
THEN
IF 0@ == 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 0@ == 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 0@ == 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 0@ == 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 0@ == 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 0@ == 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 0@ == 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
:get_current_dialog_list_item_text
{
0AB1: @get_current_dialog_list_item_text 1 Item 1 _Returned: Text 0@
}
IF 0AA2: 2@ = "samp.dll"
THEN
0AB1: @get_samp_version_id 0 _returned: ID 17@
IF 17@ > 0
THEN
IF 7@ == 1 // 0.3.7 R1
THEN
0A8E: 3@ = 2@ + 0x21A0B8 // SAMP_DIALOG_INFO_OFFSET
0A8D: 3@ = readMem 3@ sz 4 vp 0
0A8E: 4@ = 3@ + 0x20 // SAMP_DIALOG_LIST_BOX_OFFSET
0A8D: 4@ = readMem 4@ sz 4 vp 0
0A8E: 5@ = 2@ + 0x86390 // SAMP_GET_DIALOG_LIST_ITEM_TEXT_OFFSET
END
IF 17@ == 2 // 0.3.7 R2
THEN
0A8E: 3@ = 2@ + 0x21A0C0 // SAMP_DIALOG_INFO_OFFSET
0A8D: 3@ = readMem 3@ sz 4 vp 0
0A8E: 4@ = 3@ + 0x20 // SAMP_DIALOG_LIST_BOX_OFFSET
0A8D: 4@ = readMem 4@ sz 4 vp 0
0A8E: 5@ = 2@ + 0x86430 // SAMP_GET_DIALOG_LIST_ITEM_TEXT_OFFSET
END
IF 17@ == 3 // 0.3.DL
THEN
0A8E: 3@ = 2@ + 0x2AC9E0 // SAMP_DIALOG_INFO_OFFSET
0A8D: 3@ = readMem 3@ sz 4 vp 0
0A8E: 4@ = 3@ + 0x20 // SAMP_DIALOG_LIST_BOX_OFFSET
0A8D: 4@ = readMem 4@ sz 4 vp 0
0A8E: 5@ = 2@ + 0x8A440 // SAMP_GET_DIALOG_LIST_ITEM_TEXT_OFFSET
END
IF 17@ == 4 // 0.3.7 R3
THEN
0A8E: 3@ = 2@ + 0x26E898 // SAMP_DIALOG_INFO_OFFSET
0A8D: 3@ = readMem 3@ sz 4 vp 0
0A8E: 4@ = 3@ + 0x20 // SAMP_DIALOG_LIST_BOX_OFFSET
0A8D: 4@ = readMem 4@ sz 4 vp 0
0A8E: 5@ = 2@ + 0x8A2B0 // SAMP_GET_DIALOG_LIST_ITEM_TEXT_OFFSET
END
IF 17@ == 5 // 0.3.7 R4
THEN
0A8E: 3@ = 2@ + 0x26E9C8 // SAMP_DIALOG_INFO_OFFSET
0A8D: 3@ = readMem 3@ sz 4 vp 0
0A8E: 4@ = 3@ + 0x20 // SAMP_DIALOG_LIST_BOX_OFFSET
0A8D: 4@ = readMem 4@ sz 4 vp 0
0A8E: 5@ = 2@ + 0x8A9F0 // SAMP_GET_DIALOG_LIST_ITEM_TEXT_OFFSET
END
IF 17@ == 6 // 0.3.7 R4 - v2
THEN
0A8E: 3@ = 2@ + 0x26E9C8 // SAMP_DIALOG_INFO_OFFSET
0A8D: 3@ = readMem 3@ sz 4 vp 0
0A8E: 4@ = 3@ + 0x20 // SAMP_DIALOG_LIST_BOX_OFFSET
0A8D: 4@ = readMem 4@ sz 4 vp 0
0A8E: 5@ = 2@ + 0x8AA20 // SAMP_GET_DIALOG_LIST_ITEM_TEXT_OFFSET
END
IF 17@ == 7 // 0.3.7 R5
THEN
0A8E: 3@ = 2@ + 0x26EB50 // SAMP_DIALOG_INFO_OFFSET
0A8D: 3@ = readMem 3@ sz 4 vp 0
0A8E: 4@ = 3@ + 0x20 // SAMP_DIALOG_LIST_BOX_OFFSET
0A8D: 4@ = readMem 4@ sz 4 vp 0
0A8E: 5@ = 2@ + 0x8A9C0 // SAMP_GET_DIALOG_LIST_ITEM_TEXT_OFFSET
END
0AA8: call_function_method 5@ struct 4@ num_params 1 pop 0 Item 0@ _Returned: text 31@
END
END
0AB2: 1 31@
rocess_current_dialog_list_item
{
0AB1: @process_current_dialog_list_item 2 ListItem 1 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: 30@ = readMem 30@ sz 4 vp 0
0A8E: 29@ = 30@ + 0x20 // SAMP_DIALOG_LIST_BOX_OFFSET
0A8D: 29@ = readMem 29@ sz 4 vp 0
0A8E: 28@ = 31@ + 0x863C0 // SAMP_SET_DIALOG_LIST_ITEM_OFFSET
0A8E: 27@ = 31@ + 0x6C040 // SAMP_DIALOG_CLOSE_OFFSET
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@ + 0x20 // SAMP_DIALOG_LIST_BOX_OFFSET
0A8D: 29@ = readMem 29@ sz 4 vp 0
0A8E: 28@ = 31@ + 0x86460 // SAMP_SET_DIALOG_LIST_ITEM_OFFSET
0A8E: 27@ = 31@ + 0x6C0F0 // SAMP_DIALOG_CLOSE_OFFSET
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@ + 0x20 // SAMP_DIALOG_LIST_BOX_OFFSET
0A8D: 29@ = readMem 29@ sz 4 vp 0
0A8E: 28@ = 31@ + 0x8A470 // SAMP_SET_DIALOG_LIST_ITEM_OFFSET
0A8E: 27@ = 31@ + 0x700D0 // SAMP_DIALOG_CLOSE_OFFSET
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@ + 0x20 // SAMP_DIALOG_LIST_BOX_OFFSET
0A8D: 29@ = readMem 29@ sz 4 vp 0
0A8E: 28@ = 31@ + 0x8A2E0 // SAMP_SET_DIALOG_LIST_ITEM_OFFSET
0A8E: 27@ = 31@ + 0x6FF40 // SAMP_DIALOG_CLOSE_OFFSET
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@ + 0x20 // SAMP_DIALOG_LIST_BOX_OFFSET
0A8D: 29@ = readMem 29@ sz 4 vp 0
0A8E: 28@ = 31@ + 0x8AA20 // SAMP_SET_DIALOG_LIST_ITEM_OFFSET
0A8E: 27@ = 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: 30@ = readMem 30@ sz 4 vp 0
0A8E: 29@ = 30@ + 0x20 // SAMP_DIALOG_LIST_BOX_OFFSET
0A8D: 29@ = readMem 29@ sz 4 vp 0
0A8E: 28@ = 31@ + 0x8AA50 // SAMP_SET_DIALOG_LIST_ITEM_OFFSET
0A8E: 27@ = 31@ + 0x70690 //SAMP_DIALOG_CLOSE
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@ + 0x20 // SAMP_DIALOG_LIST_BOX_OFFSET
0A8D: 29@ = readMem 29@ sz 4 vp 0
0A8E: 28@ = 31@ + 0x8A9F0 // SAMP_SET_DIALOG_LIST_ITEM_OFFSET
0A8E: 27@ = 31@ + 0x70630 // SAMP_DIALOG_CLOSE_OFFSET
END
0AA8: call_function_method 28@ struct 29@ num_params 1 pop 0 Item 0@ _RetVal: 6@
0AA8: call_function_method 27@ struct 30@ num_params 1 pop 0 Button 1@ _retVal 5@
END
END
0AB2: 0
Here is the code:
{$CLEO .cs}
0000:
wait 5000
printf "~y~AutoDialogSelect -- ~g~LOADED" time 1000
0AB1: @get_samp_version_id 0 _returned: ID 31@
while true
wait 0
IF 0256: player $PLAYER_CHAR defined
then
IF 0AB1: @is_dialog_active 1 CheckingState true
then
wait 500
0AB1: @get_dialog_caption 1 SampVersionID 31@ _Returned: Caption 30@
alloc 29@ 100
format 29@ "Trucker: Choose"
if 0AB1: call_scm_func @IfTextContains 2 mainTextPointer 30@ pieceToFindPointer 29@ _returnedPointer 3@
then
wait 500
alloc 27@ 195
format 27@ "Foster Valley"
0AB1: @get_current_dialog_list_item_text 1 Item 2 _Returned: Text 26@
0AB1: @get_current_dialog_list_item_text 1 Item 5 _Returned: Text 21@
if 0AB1: call_scm_func @IfTextContains 2 mainTextPointer 26@ pieceToFindPointer 27@ _returnedPointer 1@
then
0AB1: @process_current_dialog_list_item 2 ListItem 2 Button 1 // 1 = Left , 0 = Right
end
free 27@
alloc 27@ 195
format 27@ "Esplanade North"
if 0AB1: call_scm_func @IfTextContains 2 mainTextPointer 21@ pieceToFindPointer 27@ _returnedPointer 2@
then
0AB1: @process_current_dialog_list_item 2 ListItem 5 Button 1
end
free 27@
end
free 29@
end
end
end
//if 0AB1: call_scm_func @IfTextContains 2 mainTextPointer 0@ pieceToFindPointer 1@ _returnedPointer 2@
:IfTextContains
{
0@ - the main text
1@ - piece of text to be found within the main text
}
0AB1: @StrLen 1 strPtr 0@ _length 31@
0AB1: @StrLen 1 strPtr 1@ _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
//0AB1: @StrLen 1 strPtr 0@ _length 31@
:StrLen
{
0@ - string pointer
}
30@ = 0
for 31@ = 0 to 100000
0A8D: 29@ = read_memory 0@ size 1 virtual_protect 0
if 29@ == 0
then
break
else
30@++
0@++
end
end
0AB2: ret 1 30@
: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@
: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 1 SampVersionID 31@ _Returned: Caption 1@
}
IF 0AA2: 31@ = "samp.dll"
THEN
IF 0@ > 0
THEN
IF 0@ == 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 0@ == 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 0@ == 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 0@ == 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 0@ == 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 0@ == 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 0@ == 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
:get_current_dialog_list_item_text
{
0AB1: @get_current_dialog_list_item_text 1 Item 1 _Returned: Text 0@
}
IF 0AA2: 2@ = "samp.dll"
THEN
0AB1: @get_samp_version_id 0 _returned: ID 17@
IF 17@ > 0
THEN
IF 7@ == 1 // 0.3.7 R1
THEN
0A8E: 3@ = 2@ + 0x21A0B8 // SAMP_DIALOG_INFO_OFFSET
0A8D: 3@ = readMem 3@ sz 4 vp 0
0A8E: 4@ = 3@ + 0x20 // SAMP_DIALOG_LIST_BOX_OFFSET
0A8D: 4@ = readMem 4@ sz 4 vp 0
0A8E: 5@ = 2@ + 0x86390 // SAMP_GET_DIALOG_LIST_ITEM_TEXT_OFFSET
END
IF 17@ == 2 // 0.3.7 R2
THEN
0A8E: 3@ = 2@ + 0x21A0C0 // SAMP_DIALOG_INFO_OFFSET
0A8D: 3@ = readMem 3@ sz 4 vp 0
0A8E: 4@ = 3@ + 0x20 // SAMP_DIALOG_LIST_BOX_OFFSET
0A8D: 4@ = readMem 4@ sz 4 vp 0
0A8E: 5@ = 2@ + 0x86430 // SAMP_GET_DIALOG_LIST_ITEM_TEXT_OFFSET
END
IF 17@ == 3 // 0.3.DL
THEN
0A8E: 3@ = 2@ + 0x2AC9E0 // SAMP_DIALOG_INFO_OFFSET
0A8D: 3@ = readMem 3@ sz 4 vp 0
0A8E: 4@ = 3@ + 0x20 // SAMP_DIALOG_LIST_BOX_OFFSET
0A8D: 4@ = readMem 4@ sz 4 vp 0
0A8E: 5@ = 2@ + 0x8A440 // SAMP_GET_DIALOG_LIST_ITEM_TEXT_OFFSET
END
IF 17@ == 4 // 0.3.7 R3
THEN
0A8E: 3@ = 2@ + 0x26E898 // SAMP_DIALOG_INFO_OFFSET
0A8D: 3@ = readMem 3@ sz 4 vp 0
0A8E: 4@ = 3@ + 0x20 // SAMP_DIALOG_LIST_BOX_OFFSET
0A8D: 4@ = readMem 4@ sz 4 vp 0
0A8E: 5@ = 2@ + 0x8A2B0 // SAMP_GET_DIALOG_LIST_ITEM_TEXT_OFFSET
END
IF 17@ == 5 // 0.3.7 R4
THEN
0A8E: 3@ = 2@ + 0x26E9C8 // SAMP_DIALOG_INFO_OFFSET
0A8D: 3@ = readMem 3@ sz 4 vp 0
0A8E: 4@ = 3@ + 0x20 // SAMP_DIALOG_LIST_BOX_OFFSET
0A8D: 4@ = readMem 4@ sz 4 vp 0
0A8E: 5@ = 2@ + 0x8A9F0 // SAMP_GET_DIALOG_LIST_ITEM_TEXT_OFFSET
END
IF 17@ == 6 // 0.3.7 R4 - v2
THEN
0A8E: 3@ = 2@ + 0x26E9C8 // SAMP_DIALOG_INFO_OFFSET
0A8D: 3@ = readMem 3@ sz 4 vp 0
0A8E: 4@ = 3@ + 0x20 // SAMP_DIALOG_LIST_BOX_OFFSET
0A8D: 4@ = readMem 4@ sz 4 vp 0
0A8E: 5@ = 2@ + 0x8AA20 // SAMP_GET_DIALOG_LIST_ITEM_TEXT_OFFSET
END
IF 17@ == 7 // 0.3.7 R5
THEN
0A8E: 3@ = 2@ + 0x26EB50 // SAMP_DIALOG_INFO_OFFSET
0A8D: 3@ = readMem 3@ sz 4 vp 0
0A8E: 4@ = 3@ + 0x20 // SAMP_DIALOG_LIST_BOX_OFFSET
0A8D: 4@ = readMem 4@ sz 4 vp 0
0A8E: 5@ = 2@ + 0x8A9C0 // SAMP_GET_DIALOG_LIST_ITEM_TEXT_OFFSET
END
0AA8: call_function_method 5@ struct 4@ num_params 1 pop 0 Item 0@ _Returned: text 31@
END
END
0AB2: 1 31@
rocess_current_dialog_list_item
{
0AB1: @process_current_dialog_list_item 2 ListItem 1 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: 30@ = readMem 30@ sz 4 vp 0
0A8E: 29@ = 30@ + 0x20 // SAMP_DIALOG_LIST_BOX_OFFSET
0A8D: 29@ = readMem 29@ sz 4 vp 0
0A8E: 28@ = 31@ + 0x863C0 // SAMP_SET_DIALOG_LIST_ITEM_OFFSET
0A8E: 27@ = 31@ + 0x6C040 // SAMP_DIALOG_CLOSE_OFFSET
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@ + 0x20 // SAMP_DIALOG_LIST_BOX_OFFSET
0A8D: 29@ = readMem 29@ sz 4 vp 0
0A8E: 28@ = 31@ + 0x86460 // SAMP_SET_DIALOG_LIST_ITEM_OFFSET
0A8E: 27@ = 31@ + 0x6C0F0 // SAMP_DIALOG_CLOSE_OFFSET
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@ + 0x20 // SAMP_DIALOG_LIST_BOX_OFFSET
0A8D: 29@ = readMem 29@ sz 4 vp 0
0A8E: 28@ = 31@ + 0x8A470 // SAMP_SET_DIALOG_LIST_ITEM_OFFSET
0A8E: 27@ = 31@ + 0x700D0 // SAMP_DIALOG_CLOSE_OFFSET
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@ + 0x20 // SAMP_DIALOG_LIST_BOX_OFFSET
0A8D: 29@ = readMem 29@ sz 4 vp 0
0A8E: 28@ = 31@ + 0x8A2E0 // SAMP_SET_DIALOG_LIST_ITEM_OFFSET
0A8E: 27@ = 31@ + 0x6FF40 // SAMP_DIALOG_CLOSE_OFFSET
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@ + 0x20 // SAMP_DIALOG_LIST_BOX_OFFSET
0A8D: 29@ = readMem 29@ sz 4 vp 0
0A8E: 28@ = 31@ + 0x8AA20 // SAMP_SET_DIALOG_LIST_ITEM_OFFSET
0A8E: 27@ = 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: 30@ = readMem 30@ sz 4 vp 0
0A8E: 29@ = 30@ + 0x20 // SAMP_DIALOG_LIST_BOX_OFFSET
0A8D: 29@ = readMem 29@ sz 4 vp 0
0A8E: 28@ = 31@ + 0x8AA50 // SAMP_SET_DIALOG_LIST_ITEM_OFFSET
0A8E: 27@ = 31@ + 0x70690 //SAMP_DIALOG_CLOSE
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@ + 0x20 // SAMP_DIALOG_LIST_BOX_OFFSET
0A8D: 29@ = readMem 29@ sz 4 vp 0
0A8E: 28@ = 31@ + 0x8A9F0 // SAMP_SET_DIALOG_LIST_ITEM_OFFSET
0A8E: 27@ = 31@ + 0x70630 // SAMP_DIALOG_CLOSE_OFFSET
END
0AA8: call_function_method 28@ struct 29@ num_params 1 pop 0 Item 0@ _RetVal: 6@
0AA8: call_function_method 27@ struct 30@ num_params 1 pop 0 Button 1@ _retVal 5@
END
END
0AB2: 0