CLEO Help Detect if space bar is pressed twice then do something?

CLEO related
Status
Not open for further replies.

noobish

Active member
Joined
Feb 16, 2014
Messages
120
Reaction score
0
Hello how can i make this when spacebar is pressed quickly twice the fast run will work so i dont need to press spacebar rapidly to fast run

Code:
// This file was decompiled using SASCM.ini published by GTAG (http://gtag.gtagaming.com/opcode-database) on 14.6.2013
{$CLEO .cs}

//-------------MAIN---------------
thread "UGBASE.EU" 
0000: NOP 

:UGBASE.EU_15
wait 0 
if and
00E1:   player 0 pressed_key 16 
044B:   actor $PLAYER_ACTOR on_foot 
else_jump @UGBASE.EU_87 

:UGBASE.EU_41
wait 0 
0AB1: call_scm_func @UGBASE.EU_94 2 32 255  
0AB1: call_scm_func @UGBASE.EU_94 2 32 0  
80E1:   not player 0 pressed_key 16 
else_jump @UGBASE.EU_41 

:UGBASE.EU_87
jump @UGBASE.EU_15 

:UGBASE.EU_94
2@ = 12006488 
005A: 2@ += 0@ // (int) 
0A8C: write_memory 2@ size 1 value 1@ virtual_protect 0 
0AB2: ret 0


thanks
 

Zin

Expert
Joined
Aug 1, 2013
Messages
1,692
Reaction score
105
No idea if this could work but maybe you can make a double check loop and add a wait of like 50ms between the second check, kind of like this.


Code:
:CHECK
wait 0
if
key_down 32 // SPACE
jf @CHECK
wait 50      
if
key_down 32 // SPACE
jf @CHECK
// DO SOMETHING
 

noobish

Active member
Joined
Feb 16, 2014
Messages
120
Reaction score
0
zin said:
No idea if this could work but maybe you can make a double check loop and add a wait of like 50ms between the second check, kind of like this.


Code:
:CHECK
wait 0
if
key_down 32 // SPACE
jf @CHECK
wait 50      
if
key_down 32 // SPACE
jf @CHECK
// DO SOMETHING

Hello, how can i compensate the "Incorrect number of conditions" when compiling?

Code:
// This file was decompiled using SASCM.ini published by GTAG (http://gtag.gtagaming.com/opcode-database) on 14.6.2013
{$CLEO .cs}

//-------------MAIN---------------
thread "UGBASE.EU" 
0000: NOP 

:UGBASEEU_15
wait 0
if
00E1:   player 0 pressed_key 16 // SPACE
044B:   actor $PLAYER_ACTOR on_foot 
jf @UGBASEEU_15
wait 50      
if
00E1:   player 0 pressed_key 16 // SPACE
jf @UGBASEEU_15
// DO SOMETHING 
else_jump @UGBASEEU_87 

:UGBASEEU_41
wait 0 
call @UGBASEEU_94 2 32 255 
call @UGBASEEU_94 2 32 0 
80E1:   not player 0 pressed_key 16 
else_jump @UGBASEEU_41 

:UGBASE.EU_87
jump @UGBASEEU_15 

:UGBASEEU_94
2@ = 12006488 
005A: 2@ += 0@ // (int) 
0A8C: write_memory 2@ size 1 value 1@ virtual_protect 0 
ret 0
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,133
Solutions
5
Reaction score
885
Location
Lithuania
not add IF AND in here.:
[shcode=cpp]
if
00E1:   player 0 pressed_key 16 // SPACE
044B:   actor $PLAYER_ACTOR on_foot
[/shcode]

So your code..

[shcode=cpp]
{$CLEO .cs}

//-------------MAIN---------------
thread "UGBASE.EU"
0000: NOP

:UGBASEEU_15
wait 0
if and
00E1:   player 0 pressed_key 16 // SPACE
044B:   actor $PLAYER_ACTOR on_foot
jf @UGBASEEU_15
wait 50      
if
00E1:   player 0 pressed_key 16 // SPACE
jf @UGBASEEU_15
// DO SOMETHING
else_jump @UGBASEEU_87

:UGBASEEU_41
wait 0
call @UGBASEEU_94 2 32 255
call @UGBASEEU_94 2 32 0
80E1:   not player 0 pressed_key 16
else_jump @UGBASEEU_41

:UGBASEEU_87
jump @UGBASEEU_15

:UGBASEEU_94
2@ = 12006488
005A: 2@ += 0@ // (int)
0A8C: write_memory 2@ size 1 value 1@ virtual_protect 0
ret 0
[/shcode]

P.S. Good luck to learn more...
 

Zin

Expert
Joined
Aug 1, 2013
Messages
1,692
Reaction score
105
BUMP

What I said does not seem to work under every circumstance so anyone got an actual way of doing this?
 

Zin

Expert
Joined
Aug 1, 2013
Messages
1,692
Reaction score
105
MrChristmas said:
do you want to make a spacebar macro in cleo or what?

Need it as an activation for my auto litefoot so basically I press C twice as in like a double cbug.
 
Status
Not open for further replies.
Top