CLEO Help Press enter / Select first dialog option

CLEO related
Status
Not open for further replies.

KennyDixon

Member
Joined
Jan 1, 2016
Messages
8
Reaction score
0
Hi,

I believe this is relatively easy for you, but I've been trying to find solution for a while and couldn't make it by myself.  :sadpepe:

When dialog appears I want it to automatically press enter or just select the left option in the dialog.

This was my best try which i suppose shouldn't work.
Code:
:AUTOENTER_144
0001: wait 0 ms 
03C0: 1@ = actor $PLAYER_ACTOR car 
00D6: if or
00EC:   actor $PLAYER_ACTOR sphere 0 near_point 1911.0634 -1775.0464 radius 2.0 2.0 
00EC:   actor $PLAYER_ACTOR sphere 0 near_point 2456.4438 -1461.0022 radius 2.0 2.0 
00EC:   actor $PLAYER_ACTOR sphere 0 near_point 1017.8705 -916.6630 radius 2.0 2.0 
004D: jump_if_false @AUTOENTER_77                                                  
0002: jump @AUTOENTER_366 


:AUTOENTER_366
0001: wait 0 ms 
0AB0:   key_pressed  13
0001: wait 1000 ms 
0002: jump @AUTOENTER_77         
 

Attachments

  • EG.png
    EG.png
    21.3 KB · Views: 39

Opcode.eXe

Expert
Joined
Feb 18, 2013
Messages
1,492
Reaction score
236
Location
( ͡° ͜ʖ ͡°)
0AB0:  key_pressed  13

can only be used to CHECK if you are pressing that key...

There is a function in the SNIPPET section to PRESS the KEY:
:keyPress
// 0@ - key, 1@ - time
// Example: 0AB1: call @keyPress 2 key 0@ time 1@

if 0AA2: 2@ = load_library "User32.dll"
then
    if 0AA4: 2@ = get_proc_address "keybd_event" library 2@
    then
        0AA5: call 2@ num_params 4 pop 0 0 0 0 0@
        wait 1@
        0AA5: call 2@ num_params 4 pop 0 0 0x02 0 0@
    end
end
0AB2: ret 0
 

KennyDixon

Member
Joined
Jan 1, 2016
Messages
8
Reaction score
0
Thanks for replying, Opcode, I'm a big fan.

Unfortunately the code doesn't work for me. When a player in the car drives through the pickup, the dialog appears and you have to confirm it to fix the vehicle. But in my case, when player is near the coordinates the sound beeps, but auto-enter doesn't work.

Code:
:AUTOENTER_22 
0001: wait 0 ms 
00D6: if and
0AB0:   key_pressed 88  
0AB0:   key_pressed 66 
004D: jump_if_false @AUTOENTER_22 
0001: wait 1000 ms 
018C: play_sound 1058 at 0.0 0.0 0.0 
0002: jump @AUTOENTER_77 

:AUTOENTER_77
0001: wait 0 ms 
00D6: if or 
8AB0:   not key_pressed 88 
8AB0:   not key_pressed 66 
004D: jump_if_false @AUTOENTER_450 
00D6: if 
00DF:   actor $PLAYER_ACTOR driving
004D: jump_if_false @AUTOENTER_77 
00D6: if or
047A:   actor $PLAYER_ACTOR driving_bike 
047A:   actor $PLAYER_ACTOR 
004D: jump_if_false @AUTOENTER_144 
0002: jump @AUTOENTER_77 

:AUTOENTER_144
0001: wait 0 ms 
//03C0: 1@ = actor $PLAYER_ACTOR car
00D6: if or
00EC:   actor $PLAYER_ACTOR sphere 0 near_point 1911.0634 -1775.0464 radius 2.0 2.0
00EC:   actor $PLAYER_ACTOR sphere 0 near_point 2456.4438 -1461.0022 radius 2.0 2.0 
00EC:   actor $PLAYER_ACTOR sphere 0 near_point 1017.8705 -916.6630 radius 2.0 2.0
004D: jump_if_false @AUTOENTER_77                                                                 
0002: jump @AUTOENTER_366 


:AUTOENTER_366
0001: wait 0 ms
018C: play_sound 1059 at 0.0 0.0 0.0 
0AB1: call @keyPress 2 key 13 time 100
0001: wait 500 ms 
0002: jump @AUTOENTER_77


:AUTOENTER_450
0001: wait 1000 ms 
018C: play_sound 1057 at 0.0 0.0 0.0 
0002: jump @AUTOENTER_22

:keyPress
if 0AA2: 2@ = load_library "User32.dll"
then
     if 0AA4: 2@ = get_proc_address "keybd_event" library 2@
     then
         0AA5: call 2@ num_params 4 pop 0 0 0 0 0@
         wait 1@
         0AA5: call 2@ num_params 4 pop 0 0 0x02 0 0@
     end
end
0AB2: ret 0
 
Status
Not open for further replies.
Top