CLEO Help Opcode

CLEO related
Status
Not open for further replies.

shanker

Well-known member
Joined
Sep 18, 2016
Messages
291
Reaction score
16
Location
Romania
Is there  an opcode that tells me the combined keys? (an example i press q+r) or I need it do manually with 0AB0? there's to many keyboards and will take a lot lel :))
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
271
No such opcode. But you can make a function to check for keys that are currently pressed.

[shcode=cpp]
{$CLEO}
0000:

repeat
   wait 100
until 0afa:

while true
   wait 0
   
   VAR
       1@ : int
       2@ : int
       3@ : int
   END
   
   1@ = 0
   2@ = 0
   3@ = 0
   for 0@ = 1 to 255
       if 0ab0: 0@
       then
           if 1@ == 0
           then 1@ = 0@
           else
               if 2@ == 0
               then 2@ = 0@
               else
                   if 3@ == 0
                   then 3@ = 0@
                   end
               end
           end
       end
   end
   
   0ac8: 4@ = 260
   if 1@ <> 0
   then
       format 4@ "keys pressed: %d" 1@
       if 2@ <> 0
       then format 4@ "keys pressed: %d + %d" 1@ 2@  
       end
       if 3@ <> 0
       then format 4@ "keys pressed: %d + %d + %d" 1@ 2@ 3@
       end      
       0AF8: "combination : %s" -1 4@
   else
       0af8: "no keys pressed" -1
   end
   0ac9: 4@
end
[/shcode]

It's a kinda shitty implementation, but it's the simplest logic i could think of right now.
Alternatively, there's a string buffer in gta, which records all the keys that are pressed(letters only afaik) in order to check for single player cheat codes.
 

shanker

Well-known member
Joined
Sep 18, 2016
Messages
291
Reaction score
16
Location
Romania
ok I got idea that didn't was so hard but, I want to make a "log" with these keys so I can check for them later if smt like that is possible ... I tried smt but this doesn't look like i hoped :(

Code:
{$CLEO}
0000:
 
repeat
   wait 20
until 0afa:
 
while true
   wait 0
   
    IF 8AE4: not "cleo\Projects"
    THEN 0AE5: create "cleo\Projects"
    END
    
    
   VAR
       1@ : int
       2@ : int
       3@ : int
   END
    
   1@ = 0
   2@ = 0
   3@ = 0
   for 0@ = 1 to 255
       if 0ab0: 0@
       then 
       wait 20
           if 1@ == 0
           then 1@ = 0@ 
           wait 20 
           else
               if 2@ == 0
               then 2@ = 0@ 
               wait 10 
               else
                   if 3@ == 0
                   then 3@ = 0@ 
                   wait 10
                   end
               end
           end
       end
   end
    
   0ac8: 4@ = 260
   if 1@ <> 0
   then 
       format 4@ "keys pressed: %d" 1@
       0AF1: write_int 1@ to "cleo\Projects\Test.ini" section "Keys" key "First Key"
       if 2@ <> 0 
       then format 4@ "keys pressed: %d + %d" 1@ 2@  
       0AF1: write_int 1@ to "cleo\Projects\Test.ini" section "Keys" key "Key Two"
       0AF1: write_int 2@ to "cleo\Projects\Test.ini" section "Keys" key "Key Two'"  
       end
       if 3@ <> 0
       then format 4@ "keys pressed: %d + %d + %d" 1@ 2@ 3@
       0AF1: write_int 1@ to "cleo\Projects\Test.ini" section "Keys" key "Key Three"
       0AF1: write_int 2@ to "cleo\Projects\Test.ini" section "Keys" key "Key Three'"
       0AF1: write_int 3@ to "cleo\Projects\Test.ini" section "Keys" key "Key Three''"
       end      
       0AF8: "combination : %s" -1 4@
   else
       $FCKSPAM = 0
   end
   0ac9: 4@ 
end

app I thought if i will use wait script wont send me three mesages just for 1 key pressed ( an example, I press 1 sec "q" and script will send me x3 mesages with that"

I dont want use chatlog.txt bcs I dont want get messages in game about these keyboards, just in an .ini file

App, cum ai facut code-ul ala mare? Cel de pe forum ma refer.
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
271
EIther make a function to check for the keys that are pressed and log them, or query for each key, like do a dialog or something with save button etc.
(if button or key is press then save the keys).

ro: ce code? nu stiu la ce te referi.
 
Status
Not open for further replies.
Top