CLEO Help Move dialog

CLEO related
Status
Not open for further replies.

Parazitas

God
Joined
Jan 2, 2017
Messages
3,104
Solutions
5
Reaction score
882
Location
Lithuania
I try move dialog to cursor position when enter command /mdialog

PHP:
{$CLEO .cs}
 
 
//-------------MAIN---------------
0000: NOP
 
REPEAT
wait 0
UNTIL samp.Available() 
                            
Dialog.Create(0@, "Hack Pack ")
Dialog.SetRECT(0@, 1@, 7@, 260, 150)
/// Dialog Background color
Dialog.SetBackgroundColor(0@, -16777216)
/// Dialog check Box
Dialog.AddCheckBox(0@, 1, "{FF0000}test 1", 10, 10, 200, 20)
Dialog.AddCheckBox(0@, 2, "{FF0000}test 2", 10, 35, 200, 20)
Dialog.AddCheckBox(0@, 3, "{FF0000}test 3", 10, 60, 200, 20)
Dialog.AddCheckBox(0@, 4, "{FF0000}test 4", 10, 85, 200, 20)
Dialog.AddButton(0@, 5, "Close", 80, 110, 70, 20)
/// Dialog CheckBox colors 
Dialog.SetCheckBoxColor(0@, 1, -15952405)
Dialog.SetCheckBoxColor(0@, 2, -15952405)
Dialog.SetCheckBoxColor(0@, 3, -15952405)
Dialog.SetCheckBoxColor(0@, 4, -15952405) 
/// Dialog set not visibile
dialog.SetVisible(0@,0)
 
0B34: "test" @ShowDialog
0B34: "mdialog" @Move_Dialog
 
 
 
WHILE TRUE
wait 0
 
IF 
Dialog.IsVisible(0@)
THEN
    SAMP.ToggleCursor(1)
 
IF
0B81: dialog 0@ pop_event_to 2@ control_id_to 3@
THEN
    IF AND
    3@ == 5 // ID
    2@ == 257 // pressed
    THEN
        Dialog.SetVisible(0@,0)
        SAMP.ToggleCursor(0)
   ELSE
       //nothing
    END
END
 
END // END Dialog.IsVisible(0@) 
END /// END WHILE TRUE
    
:ShowDialog
Dialog.SetVisible(0@, 1)
0B43: 

:Move_Dialog
0B12: 8@ = 8@ XOR TRUE

WHILE 8@ == TRUE 
    0B5E: get_cursor_pos 1@ 7@
    0AF5: write_string 1@ to_ini_file "Cleo\INI\Sarg.ini" section "Dialog Position" key "Position xy"
    0AF5: write_string 7@ to_ini_file "Cleo\INI\Sarg.ini" section "Dialog Position" key "Position z"
END
0B43:
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,104
Solutions
5
Reaction score
882
Location
Lithuania
Missing background o_O
Move dialog not looping when i want move it..
Just try code and you understand what i mean...

PHP:
{$CLEO .cs}
 
 
//-------------MAIN---------------
0000: NOP
 
REPEAT
wait 0
UNTIL samp.Available() 

SAMP.GetScreenResolution(30@, 29@)
30@ /= 2 
29@ /= 2 
30@ -= 100 
0085: 28@ = 31@ // (int) 
28@ /= 2 
0062: 29@ -= 28@ // (int) 
                            
Dialog.Create(0@, "Test")
Dialog.SetRECT(0@, 30@, 29@, 260, 31@)
/// Dialog Background color
Dialog.SetBackgroundColor(0@, -16777216)
/// Dialog check Box
Dialog.AddCheckBox(0@, 1, "{FF0000}Check to move dialog", 10, 10, 200, 20)
Dialog.AddCheckBox(0@, 2, "{FF0000}test 2", 10, 35, 200, 20)
Dialog.AddCheckBox(0@, 3, "{FF0000}test 3", 10, 60, 200, 20)
Dialog.AddCheckBox(0@, 4, "{FF0000}test 4", 10, 85, 200, 20)
Dialog.AddButton(0@, 5, "Close", 80, 110, 70, 20)
/// Dialog CheckBox colors 
Dialog.SetCheckBoxColor(0@, 1, -15952405)
Dialog.SetCheckBoxColor(0@, 2, -15952405)
Dialog.SetCheckBoxColor(0@, 3, -15952405)
Dialog.SetCheckBoxColor(0@, 4, -15952405) 
/// Dialog set not visibile
dialog.SetVisible(0@,0)
 
0B34: "test" @ShowDialog
 
 
 
WHILE TRUE
wait 0
 
IF 
Dialog.IsVisible(0@)
THEN
    SAMP.ToggleCursor(1)
 
IF
0B81: dialog 0@ pop_event_to 2@ control_id_to 3@
THEN

    IF AND
    3@ == 1 // ID
    0B92:  dialog 0@ checkbox 3@ is_checked
    THEN
        0B5E: get_cursor_pos 31@ 30@ 
        31@ -= 167 
        30@ -= 30 
        Dialog.GetRECT(0@, 29@, 28@, 27@, 26@)
        Dialog.SetRECT(0@, 31@, 30@, 27@, 26@)
        0AF1: write_int 31@ to_ini_file "Cleo\INI\Settings.ini" section "Dialog Position" key "Position xy"
        0AF1: write_int 30@ to_ini_file "Cleo\INI\Settings.ini" section "Dialog Position" key "Position z"
    END
 
    IF AND
    3@ == 5 // ID
    2@ == 257 // pressed
    THEN
        Dialog.SetVisible(0@,0)
        SAMP.ToggleCursor(0)
   ELSE
       //nothing
    END
END
 
END // END Dialog.IsVisible(0@) 
END /// END WHILE TRUE
    
:ShowDialog
Dialog.SetVisible(0@, 1)
0B43: 
@monday
@springfield
@supahdupahnubah
 

WaTTi

Well-known member
Joined
Jan 4, 2015
Messages
260
Reaction score
8
this snippet is from my brotah @juanbustillos i jsut edited to use it in wattisproject

Code:
:move
Dialog.GetRECT(0@, 2@, 3@, 4@, 5@)
SAMP.GetScreenResolution(2@, 3@)
0B5E: get_cursor_pos 6@ 7@
0085: 8@ = 6@
0085: 9@ = 7@
005A: 6@ += 4@
005A: 7@ += 5@
IF 001D: 2@ > 6@ //X
THEN                            
0085: 6@ = 8@
ELSE
0062: 2@ -= 4@
0085: 6@ = 2@
END
    
IF 001D: 3@ > 7@ //Y
THEN
0085: 7@ = 9@
ELSE
0062: 3@ -= 5@
0085: 7@ = 3@
END
Dialog.SetRECT(0@, 6@, 7@, 4@, 5@)
ret 2 6@ 7@            

Enable the cursor before using it.
call @MOVE dialogID ReturnX ReturnY
Example
Code:
    IF AND // move
    0B87: @1
    0AB0: 16
    0AB0: 52
    THEN
    CALL @move 1 @1 6@ 7@
    0AF3: write_float 6@ to_ini_file "cleo\WaTTiProject.ini" section "WaTTi" key "d4x"
    0AF3: write_float 7@ to_ini_file "cleo\WaTTiProject.ini" section "WaTTi" key "d4y"
    6@ = 0
    7@ = 0                                              
    END
also dont be autistic like me, dont save the dialog pos while you move it XD

also im bored 

Code:
{$CLEO .cs}
0000: im bored
 
while not samp.Available()
wait 0
end

0AF2: 1@  getfloat "Cleo\INI\Sarg.ini" section "DialogPosition" key "Positionx"
0AF2: 7@  getfloat "Cleo\INI\Sarg.ini" section "DialogPosition" key "Positionx"
                            
Dialog.Create(0@, "Hack Pack ")
Dialog.SetRECT(0@, 1@, 7@, 260, 150)
/// Dialog Background color
Dialog.SetBackgroundColor(0@, -16777216)
/// Dialog check Box
Dialog.AddCheckBox(0@, 1, "{FF0000}test 1", 10, 10, 200, 20)
Dialog.AddCheckBox(0@, 2, "{FF0000}test 2", 10, 35, 200, 20)
Dialog.AddCheckBox(0@, 3, "{FF0000}test 3", 10, 60, 200, 20)
Dialog.AddCheckBox(0@, 4, "{FF0000}test 4", 10, 85, 200, 20)
Dialog.AddButton(0@, 5, "Close", 80, 110, 70, 20)
/// Dialog CheckBox colors 
Dialog.SetCheckBoxColor(0@, 1, -15952405)
Dialog.SetCheckBoxColor(0@, 2, -15952405)
Dialog.SetCheckBoxColor(0@, 3, -15952405)
Dialog.SetCheckBoxColor(0@, 4, -15952405) 
/// Dialog set not visibile
dialog.SetVisible(0@,0)
 
0B34: "test" @ShowDialog
0B34: "mdialog" @Move_Dialog
 
 

while true
wait 0

    if Dialog.IsVisible(0@)
    then
    
        if 0B81: dialog 0@ pop_event_to 2@ control_id_to 3@
        then
            if and
            3@ == 5
            2@ == 257 // you dont really need to use this btw
            then
                Dialog.SetVisible(0@,0)
                SAMP.ToggleCursor(0)
            end
        end
        
        if 8@ == true
        then
            call @MOVE 1 0@ 1@ 7@ 

        end
        if 8@ == 2
        then
            8@ = 0
            0AF3: write_string 1@ to_ini_file "Cleo\INI\Sarg.ini" section "DialogPosition" key "Positionx" // strings XD, i changed the opcode to float.
            0AF3: write_string 7@ to_ini_file "Cleo\INI\Sarg.ini" section "DialogPosition" key "Positiony"
        end
    end
    
end 

:ShowDialog
Dialog.SetVisible(0@, 1)
SAMP.ToggleCursor(1)
0B43: 

:Move_Dialog
if 8@ == 0 
then 8@ = 1
else 8@ = 2
end
cmdret
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,104
Solutions
5
Reaction score
882
Location
Lithuania
What i doing wrong?

PHP:
{$CLEO .cs}

0000: NOP
 
REPEAT
wait 0
UNTIL 0AFA:

IF
0AAB:   file_exists "CLEO\INI\Settings.ini"
THEN
    0AF2: 1@  getfloat "Cleo\INI\Settings.ini" section "DialogPosition" key "Positionxy"
    0AF2: 7@  getfloat "Cleo\INI\Settings.ini" section "DialogPosition" key "Positionz"
END
                            
Dialog.Create(0@, "Hack Pack ")
Dialog.SetRECT(0@, 1@, 7@, 260, 150)
/// Dialog Background color
Dialog.SetBackgroundColor(0@, -16777216)
/// Dialog check Box
Dialog.AddCheckBox(0@, 1, "{FF0000}Test move dialog", 10, 10, 200, 20)
Dialog.AddCheckBox(0@, 2, "{FF0000}test 2", 10, 35, 200, 20)
Dialog.AddCheckBox(0@, 3, "{FF0000}test 3", 10, 60, 200, 20)
Dialog.AddCheckBox(0@, 4, "{FF0000}test 4", 10, 85, 200, 20)
Dialog.AddButton(0@, 5, "Close", 80, 110, 70, 20)
/// Dialog minimize off
Dialog.SetMinimized(0@, 0)
/// Dialog CheckBox colors 
Dialog.SetCheckBoxColor(0@, 1, -15952405)
Dialog.SetCheckBoxColor(0@, 2, -15952405)
Dialog.SetCheckBoxColor(0@, 3, -15952405)
Dialog.SetCheckBoxColor(0@, 4, -15952405) 
/// Dialog set not visibile
Dialog.SetVisible(0@,0)
 
0B34: "dialog" @ShowDialog
 
 

while true
wait 0
IF Dialog.IsVisible(0@)
THEN
    SAMP.ToggleCursor(1)
    IF 0B81: dialog 0@ pop_event_to 2@ control_id_to 3@
    THEN
        IF AND
        3@ == 1 // ID
        0B92:  dialog 0@ checkbox 3@ is_checked
        THEN
            CALL @move 1 0@ 1@ 7@
            0AF3: write_float 1@ to_ini_file "Cleo\INI\Settings.ini" section "DialogPosition" key "Positionxy"
            0AF3: write_float 7@ to_ini_file "Cleo\INI\Settings.ini" section "DialogPosition" key "Positionz"
            6@ = 0
            7@ = 0 
        END
         
        IF AND
        3@ == 5
        2@ == 257 // you dont really need to use this btw
        THEN
            Dialog.SetVisible(0@,0)
            SAMP.ToggleCursor(0)
        END
    END      
 END
    
END 

:ShowDialog
Dialog.SetVisible(0@, 1)
SAMP.ToggleCursor(1)
0B43: 

:move
Dialog.GetRECT(0@, 2@, 3@, 4@, 5@)
SAMP.GetScreenResolution(2@, 3@)
0B5E: get_cursor_pos 6@ 7@
0085: 8@ = 6@
0085: 9@ = 7@
005A: 6@ += 4@
005A: 7@ += 5@
IF 001D: 2@ > 6@ //X
THEN                            
0085: 6@ = 8@
ELSE
0062: 2@ -= 4@
0085: 6@ = 2@
END
   
IF 001D: 3@ > 7@ //Y
THEN
0085: 7@ = 9@
ELSE
0062: 3@ -= 5@
0085: 7@ = 3@
END
Dialog.SetRECT(0@, 6@, 7@, 4@, 5@)
ret 2 6@ 7@
 
Joined
Feb 18, 2005
Messages
2,963
Reaction score
267
[shcode=cpp]
{$CLEO .cs}
0000: NOP

REPEAT
   WAIT 0
UNTIL 0AFA:

//default postion
1@ = 500
2@ = 500

if 0AAB: file_exists "CLEO\INI\Settings.ini"
then
   0AF0: 1@ getint "Cleo\INI\Settings.ini" section "DialogPosition" key "Positionxy"
   0AF0: 2@ getint "Cleo\INI\Settings.ini" section "DialogPosition" key "Positionz"
end
                               
Dialog.Create(0@, "Hack Pack ")
Dialog.SetRECT(0@, 1@, 2@, 260, 150)
/// Dialog Background color
Dialog.SetBackgroundColor(0@, -16777216)
/// Dialog check Box
Dialog.AddCheckBox(0@, 1, "{FF0000}Test move dialog", 10, 10, 200, 20)
Dialog.AddButton(0@, 5, "Close", 80, 110, 70, 20)
/// Dialog minimize off
Dialog.SetMinimized(0@, 0)
/// Dialog CheckBox colors
Dialog.SetCheckBoxColor(0@, 1, -15952405)
/// Dialog set not visibile
Dialog.SetVisible(0@,0)

0B34: "dialog" @ShowDialog

while true
   wait 0
   if Dialog.IsVisible(0@)
   then
       SAMP.ToggleCursor(1)
       if 0B81: dialog 0@ pop_event_to 2@ control_id_to 3@
       then
           if and
               3@ == 1
               0B92: dialog 0@ checkbox 3@ is_checked
           then
               //move dialog
               Dialog.GetRECT(0@, 3@, 4@, 5@, 6@)
               0B5E: get_cursor_pos 1@ 2@
               000C: 3@ -= 1@
               000C: 4@ -= 2@
               while 8B81: dialog 0@ pop_event_to $n control_id_to $n
                   wait 0
                   0B5E: get_cursor_pos 1@ 2@
                   000A: 1@ += 3@
                   000A: 2@ += 4@
                   Dialog.SetRECT(0@, 1@, 2@, 5@, 6@)
               end
               //save position, will auto create file if doesn't exist
               Dialog.GetRECT(0@, 3@, 4@, 5@, 6@)
               0AF1: write_int 3@ to_ini_file "Cleo\INI\Settings.ini" section "DialogPosition" key "Positionxy"
               0AF1: write_int 4@ to_ini_file "Cleo\INI\Settings.ini" section "DialogPosition" key "Positionz"
           end
           
           if and
               3@ == 5
               2@ == 257
           then
               Dialog.SetVisible(0@,0)
               SAMP.ToggleCursor(0)
           end
       end
   end
end

:ShowDialog
Dialog.SetVisible(0@, 1)
SAMP.ToggleCursor(1)
0B43:
[/shcode]
 

Skrillex

Member
Joined
Feb 12, 2017
Messages
19
Reaction score
0
springfield said:
[shcode=cpp]
{$CLEO .cs}
0000: NOP

REPEAT
   WAIT 0
UNTIL 0AFA:

//default postion
1@ = 500
2@ = 500

if 0AAB: file_exists "CLEO\INI\Settings.ini"
then
   0AF0: 1@ getint "Cleo\INI\Settings.ini" section "DialogPosition" key "Positionxy"
   0AF0: 2@ getint "Cleo\INI\Settings.ini" section "DialogPosition" key "Positionz"
end
                               
Dialog.Create(0@, "Hack Pack ")
Dialog.SetRECT(0@, 1@, 2@, 260, 150)
/// Dialog Background color
Dialog.SetBackgroundColor(0@, -16777216)
/// Dialog check Box
Dialog.AddCheckBox(0@, 1, "{FF0000}Test move dialog", 10, 10, 200, 20)
Dialog.AddButton(0@, 5, "Close", 80, 110, 70, 20)
/// Dialog minimize off
Dialog.SetMinimized(0@, 0)
/// Dialog CheckBox colors
Dialog.SetCheckBoxColor(0@, 1, -15952405)
/// Dialog set not visibile
Dialog.SetVisible(0@,0)

0B34: "dialog" @ShowDialog

while true
   wait 0
   if Dialog.IsVisible(0@)
   then
       SAMP.ToggleCursor(1)
       if 0B81: dialog 0@ pop_event_to 2@ control_id_to 3@
       then
           if and
               3@ == 1
               0B92: dialog 0@ checkbox 3@ is_checked
           then
               //move dialog
               Dialog.GetRECT(0@, 3@, 4@, 5@, 6@)
               0B5E: get_cursor_pos 1@ 2@
               000C: 3@ -= 1@
               000C: 4@ -= 2@
               while 8B81: dialog 0@ pop_event_to $n control_id_to $n
                   wait 0
                   0B5E: get_cursor_pos 1@ 2@
                   000A: 1@ += 3@
                   000A: 2@ += 4@
                   Dialog.SetRECT(0@, 1@, 2@, 5@, 6@)
               end
               //save position, will auto create file if doesn't exist
               Dialog.GetRECT(0@, 3@, 4@, 5@, 6@)
               0AF1: write_int 3@ to_ini_file "Cleo\INI\Settings.ini" section "DialogPosition" key "Positionxy"
               0AF1: write_int 4@ to_ini_file "Cleo\INI\Settings.ini" section "DialogPosition" key "Positionz"
           end
           
           if and
               3@ == 5
               2@ == 257
           then
               Dialog.SetVisible(0@,0)
               SAMP.ToggleCursor(0)
           end
       end
   end
end

:ShowDialog
Dialog.SetVisible(0@, 1)
SAMP.ToggleCursor(1)
0B43:
[/shcode]
Please: http://ugbase.eu/Thread-What-is-wrong-here
 
Joined
Feb 18, 2005
Messages
2,963
Reaction score
267
Did you move the dialog once? Click the checkbox once to start moving the dialog, uncheck it to save position.
I tested using SF 5.3, CLEO 4.3, all seems to be working, could be your game doesn't have permissions(run as admin) to create files.
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,104
Solutions
5
Reaction score
882
Location
Lithuania
springfield said:
Did you move the dialog once? Click the checkbox once to start moving the dialog, uncheck it to save position.
I tested using SF 5.3, CLEO 4.3, all seems to be working, could be your game doesn't have permissions(run as admin) to create files.

Yes you saying true about run as admin, thanks.
So i trying create hacks pack.
https://i.imgur.com/jpCiTMP.png

But now i want add silent aim and i don't have any idea how to do that.
I found snippet , but don't know  how use that, so maybe can explane what i doing wrong.

@monday

@springfield

@supahdupahnubah

@WaTTi

PHP:
{$CLEO .cs}
{$INCLUDE SF}

0000:

REPEAT
wait 0
UNTIL 0AFA:

WHILE TRUE
wait 0

WHILE 0AB0: 1 {LEFT MOUSE}
wait 0
0AB1: call @SendSilentBullet 0
END

END // END WHILE TRUE

:SendSilentBullet
0001: wait 0     
00A0: store_actor 3@ position_to 9@ 10@ 11@
00A0: store_actor $PLAYER_ACTOR position_to 19@ 5@ 6@
////////////////////////////////////////////////////
0470: 25@ = actor $PLAYER_ACTOR current_weapon
0B2B: samp 8@ = get_player_id_by_actor_handle 3@
0AC8: 17@ = allocate_memory_size 40
0C0D: struct 17@ offset 0 size 1 = 1
0C0D: struct 17@ offset 1 size 2 = 8@
0C0D: struct 17@ offset 3 size 4 = 19@
0C0D: struct 17@ offset 7 size 4 = 5@ 
0C0D: struct 17@ offset 11 size 4 = 6@
/////////////////////////////////////////
0C0D: struct 17@ offset 15 size 4 = 9@ 
0C0D: struct 17@ offset 19 size 4 = 10@
0C0D: struct 17@ offset 23 size 4 = 11@
/////////////////////////////////////////
0098: 22@ = random_float 0.0 _to_ 0.6
0098: 23@ = random_float 0.0 _to_ 0.4
0098: 24@ = random_float 0.0 _to_ 0.5
/////////////////////////////////////////
0063: 28@ = 22@
0063: 29@ = 23@
0063: 30@ = 24@
/////////////////////////////////////////
0209: 27@ = random 1 to_ 10
if 27@ >= 5
then 
    22@ = -0.2
    0063: 22@ -= 28@
end
/////////////////////////////////////////
0209: 27@ = random 1 to_ 10
if 27@ >= 5
then 
    23@ = -0.2
    0063: 23@ -= 29@
end
/////////////////////////////////////////
0209: 27@ = random 1 to_ 10
if 27@ >= 5
then 
    24@ = -0.2
    0063: 24@ -= 30@
end
/////////////////////////////////////////
0C0D: struct 17@ offset 27 size 4 = 22@ 
0C0D: struct 17@ offset 31 size 4 = 23@
0C0D: struct 17@ offset 35 size 4 = 24@ 
/////////////////////////////////////////
0C0D: struct 17@ offset 39 size 1 = 25@ 
0B3D: raknet 12@ = new_bit_stream 
0B40: raknet bit_stream 12@ write 206 type BS_TYPE_BYTE size 1     
0B40: raknet bit_stream 12@ write 17@ type BS_TYPE_ARRAY size 40
0B8B: raknet send bit_stream 12@
0B3E: raknet delete_bit_stream 12@
0AC9: free_allocated_memory 17@
0AB2: ret 0
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,104
Solutions
5
Reaction score
882
Location
Lithuania
springfield said:
Parazitas said:
PHP:
00A0: store_actor 3@ position_to 9@ 10@ 11@
-snip-
0B2B: samp 8@ = get_player_id_by_actor_handle 3@

I'll go with this, 3@ isn't defined/sent to the function.

So @springfield , what's wrong now?
PHP:
{$CLEO .cs}
{$INCLUDE SF}

0000:

REPEAT
wait 0
UNTIL 0AFA:

WHILE TRUE
wait 0

WHILE 0AB0: 1 {LEFT MOUSE}
wait 0
0AB1: call @Streamed_Player 0
END

END // END WHILE TRUE

:Streamed_Player
0001: wait 0
FOR 28@ = 0.0 TO 0@ STEP 8.0
    0A8D: 29@ = read_memory 0xB74490 size 4 virtual_protect 0
    000A: 29@ += 0x4
    0A8D: 29@ = read_memory 29@ size 4 virtual_protect 0
    for 30@ = 0 to 35584 step 0x100
        0A8D: 3@ = read_memory 29@ size 1 virtual_protect 0
        000A: 29@ += 0x1
        if and
            0029:  3@ >= 0x00
            001B:  0x80 > 3@
        then 005A: 3@ += 30@
        if 056D:  actor 3@ defined
        then
            if 803C: $PLAYER_ACTOR == 3@
            then 0AB1: call @SendSilentBullet 0 3@
            end
        end
    end
end
end
0AB2: ret 0 


:SendSilentBullet
0001: wait 0     
00A0: store_actor 3@ position_to 9@ 10@ 11@
00A0: store_actor $PLAYER_ACTOR position_to 19@ 5@ 6@
////////////////////////////////////////////////////
0470: 25@ = actor $PLAYER_ACTOR current_weapon
0B2B: samp 8@ = get_player_id_by_actor_handle 3@
0AC8: 17@ = allocate_memory_size 40
0C0D: struct 17@ offset 0 size 1 = 1
0C0D: struct 17@ offset 1 size 2 = 8@
0C0D: struct 17@ offset 3 size 4 = 19@
0C0D: struct 17@ offset 7 size 4 = 5@ 
0C0D: struct 17@ offset 11 size 4 = 6@
/////////////////////////////////////////
0C0D: struct 17@ offset 15 size 4 = 9@ 
0C0D: struct 17@ offset 19 size 4 = 10@
0C0D: struct 17@ offset 23 size 4 = 11@
/////////////////////////////////////////
0098: 22@ = random_float 0.0 _to_ 0.6
0098: 23@ = random_float 0.0 _to_ 0.4
0098: 24@ = random_float 0.0 _to_ 0.5
/////////////////////////////////////////
0063: 28@ = 22@
0063: 29@ = 23@
0063: 30@ = 24@
/////////////////////////////////////////
0209: 27@ = random 1 to_ 10
if 27@ >= 5
then 
    22@ = -0.2
    0063: 22@ -= 28@
end
/////////////////////////////////////////
0209: 27@ = random 1 to_ 10
if 27@ >= 5
then 
    23@ = -0.2
    0063: 23@ -= 29@
end
/////////////////////////////////////////
0209: 27@ = random 1 to_ 10
if 27@ >= 5
then 
    24@ = -0.2
    0063: 24@ -= 30@
end
/////////////////////////////////////////
0C0D: struct 17@ offset 27 size 4 = 22@ 
0C0D: struct 17@ offset 31 size 4 = 23@
0C0D: struct 17@ offset 35 size 4 = 24@ 
/////////////////////////////////////////
0C0D: struct 17@ offset 39 size 1 = 25@ 
0B3D: raknet 12@ = new_bit_stream 
0B40: raknet bit_stream 12@ write 206 type BS_TYPE_BYTE size 1     
0B40: raknet bit_stream 12@ write 17@ type BS_TYPE_ARRAY size 40
0B8B: raknet send bit_stream 12@
0B3E: raknet delete_bit_stream 12@
0AC9: free_allocated_memory 17@
0AB2: ret 0 
 

shanker

Well-known member
Joined
Sep 18, 2016
Messages
291
Reaction score
16
Location
Romania
springfield said:
[shcode=cpp]
{$CLEO .cs}
0000: NOP

REPEAT
   WAIT 0
UNTIL 0AFA:

//default postion
1@ = 500
2@ = 500

if 0AAB: file_exists "CLEO\INI\Settings.ini"
then
   0AF0: 1@ getint "Cleo\INI\Settings.ini" section "DialogPosition" key "Positionxy"
   0AF0: 2@ getint "Cleo\INI\Settings.ini" section "DialogPosition" key "Positionz"
end
                               
Dialog.Create(0@, "Hack Pack ")
Dialog.SetRECT(0@, 1@, 2@, 260, 150)
/// Dialog Background color
Dialog.SetBackgroundColor(0@, -16777216)
/// Dialog check Box
Dialog.AddCheckBox(0@, 1, "{FF0000}Test move dialog", 10, 10, 200, 20)
Dialog.AddButton(0@, 5, "Close", 80, 110, 70, 20)
/// Dialog minimize off
Dialog.SetMinimized(0@, 0)
/// Dialog CheckBox colors
Dialog.SetCheckBoxColor(0@, 1, -15952405)
/// Dialog set not visibile
Dialog.SetVisible(0@,0)

0B34: "dialog" @ShowDialog

while true
   wait 0
   if Dialog.IsVisible(0@)
   then
       SAMP.ToggleCursor(1)
       if 0B81: dialog 0@ pop_event_to 2@ control_id_to 3@
       then
           if and
               3@ == 1
               0B92: dialog 0@ checkbox 3@ is_checked
           then
               //move dialog
               Dialog.GetRECT(0@, 3@, 4@, 5@, 6@)
               0B5E: get_cursor_pos 1@ 2@
               000C: 3@ -= 1@
               000C: 4@ -= 2@
               while 8B81: dialog 0@ pop_event_to $n control_id_to $n
                   wait 0
                   0B5E: get_cursor_pos 1@ 2@
                   000A: 1@ += 3@
                   000A: 2@ += 4@
                   Dialog.SetRECT(0@, 1@, 2@, 5@, 6@)
               end
               //save position, will auto create file if doesn't exist
               Dialog.GetRECT(0@, 3@, 4@, 5@, 6@)
               0AF1: write_int 3@ to_ini_file "Cleo\INI\Settings.ini" section "DialogPosition" key "Positionxy"
               0AF1: write_int 4@ to_ini_file "Cleo\INI\Settings.ini" section "DialogPosition" key "Positionz"
           end
           
           if and
               3@ == 5
               2@ == 257
           then
               Dialog.SetVisible(0@,0)
               SAMP.ToggleCursor(0)
           end
       end
   end
end

:ShowDialog
Dialog.SetVisible(0@, 1)
SAMP.ToggleCursor(1)
0B43:
[/shcode]

i don't know why this is not working for me,but i think this is same thing as below

[shcode=cpp]
    0AB1: @GET 2 var_number 19 var_size 4 receiver 10@
    if
        Dialog.CheckBoxIsChecked(10@, 1) 
    then
        0B5E: get_cursor_pos 3@ 4@
        {Checkbox COORD}
        3@ -= 220 
        4@ -= 30 
     Dialog.GetRECT(10@, -1, -1, 1@, 2@) 
        Dialog.SetRECT(10@, 3@, 4@, 1@, 2@)
    end[/shcode]
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,104
Solutions
5
Reaction score
882
Location
Lithuania
doroftel said:
springfield said:
[shcode=cpp]
{$CLEO .cs}
0000: NOP

REPEAT
   WAIT 0
UNTIL 0AFA:

//default postion
1@ = 500
2@ = 500

if 0AAB: file_exists "CLEO\INI\Settings.ini"
then
   0AF0: 1@ getint "Cleo\INI\Settings.ini" section "DialogPosition" key "Positionxy"
   0AF0: 2@ getint "Cleo\INI\Settings.ini" section "DialogPosition" key "Positionz"
end
                               
Dialog.Create(0@, "Hack Pack ")
Dialog.SetRECT(0@, 1@, 2@, 260, 150)
/// Dialog Background color
Dialog.SetBackgroundColor(0@, -16777216)
/// Dialog check Box
Dialog.AddCheckBox(0@, 1, "{FF0000}Test move dialog", 10, 10, 200, 20)
Dialog.AddButton(0@, 5, "Close", 80, 110, 70, 20)
/// Dialog minimize off
Dialog.SetMinimized(0@, 0)
/// Dialog CheckBox colors
Dialog.SetCheckBoxColor(0@, 1, -15952405)
/// Dialog set not visibile
Dialog.SetVisible(0@,0)

0B34: "dialog" @ShowDialog

while true
   wait 0
   if Dialog.IsVisible(0@)
   then
       SAMP.ToggleCursor(1)
       if 0B81: dialog 0@ pop_event_to 2@ control_id_to 3@
       then
           if and
               3@ == 1
               0B92: dialog 0@ checkbox 3@ is_checked
           then
               //move dialog
               Dialog.GetRECT(0@, 3@, 4@, 5@, 6@)
               0B5E: get_cursor_pos 1@ 2@
               000C: 3@ -= 1@
               000C: 4@ -= 2@
               while 8B81: dialog 0@ pop_event_to $n control_id_to $n
                   wait 0
                   0B5E: get_cursor_pos 1@ 2@
                   000A: 1@ += 3@
                   000A: 2@ += 4@
                   Dialog.SetRECT(0@, 1@, 2@, 5@, 6@)
               end
               //save position, will auto create file if doesn't exist
               Dialog.GetRECT(0@, 3@, 4@, 5@, 6@)
               0AF1: write_int 3@ to_ini_file "Cleo\INI\Settings.ini" section "DialogPosition" key "Positionxy"
               0AF1: write_int 4@ to_ini_file "Cleo\INI\Settings.ini" section "DialogPosition" key "Positionz"
           end
           
           if and
               3@ == 5
               2@ == 257
           then
               Dialog.SetVisible(0@,0)
               SAMP.ToggleCursor(0)
           end
       end
   end
end

:ShowDialog
Dialog.SetVisible(0@, 1)
SAMP.ToggleCursor(1)
0B43:
[/shcode]

i don't know why this is not working for me,but i think this is same thing as below

[shcode=cpp]
    0AB1: @GET 2 var_number 19 var_size 4 receiver 10@
    if
        Dialog.CheckBoxIsChecked(10@, 1) 
    then
        0B5E: get_cursor_pos 3@ 4@
        {Checkbox COORD}
        3@ -= 220 
        4@ -= 30 
       Dialog.GetRECT(10@, -1, -1, 1@, 2@) 
        Dialog.SetRECT(10@, 3@, 4@, 1@, 2@)
    end[/shcode]

Maybe can show full code?
I'am not sure about this.

PHP:
    0AB1: @GET 2 var_number 19 var_size 4 receiver 10@
    IF
    Dialog.CheckBoxIsChecked(10@, 1) 
    THEN
        WHILE 8AB1: @GET 2 var_number 19 var_size 4 receiver 10@
        wait 0
        0B5E: get_cursor_pos 3@ 4@
        {Checkbox COORD}
        3@ -= 220 
        4@ -= 30 
        Dialog.GetRECT(10@, -1, -1, 1@, 2@) 
        Dialog.SetRECT(10@, 3@, 4@, 1@, 2@)
        END
    END
 

shanker

Well-known member
Joined
Sep 18, 2016
Messages
291
Reaction score
16
Location
Romania
@Parazitas,

what dont you understand

[shcode=cpp]Dialog.AddCheckBox(5@, 5, "", 210, 5, 25, 25) // press checkbox and move mouse where you want to, press click 1 to save current position[/shcode]

[shcode=cpp]
    if
        Dialog.CheckBoxIsChecked(10@, 1)
    then  
        0B5E: get_cursor_pos 3@ 4@
        3@ -= 220 // x check box coord + 10
        4@ -= 30  // y check box coord + 25 (this way i can reach the middle of checkbox so i can uncheck it whenever i want while i can move dialog)    
        Dialog.GetRECT(10@, -1, -1, 1@, 2@)
Dialog.SetRECT(10@, 3@, 4@, 1@, 2@)
    end[/shcode]

it's easy just few lines instead of 100 as above
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,104
Solutions
5
Reaction score
882
Location
Lithuania
doroftel said:
@Parazitas,

what dont you understand

[shcode=cpp]Dialog.AddCheckBox(5@, 5, "", 210, 5, 25, 25) // press checkbox and move mouse where you want to, press click 1 to save current position[/shcode]

[shcode=cpp]
    if
        Dialog.CheckBoxIsChecked(10@, 1)
    then  
        0B5E: get_cursor_pos 3@ 4@
        3@ -= 220 // x check box coord + 10
        4@ -= 30  // y check box coord + 25 (this way i can reach the middle of checkbox so i can uncheck it whenever i want while i can move dialog)    
        Dialog.GetRECT(10@, -1, -1, 1@, 2@)
       Dialog.SetRECT(10@, 3@, 4@, 1@, 2@)
    end[/shcode]

it's easy just few lines instead of 100 as above

Your dialog have this opcode?
0B81:
 
Status
Not open for further replies.
Top