IMG

 
IMG
IMG   IMG
  Welcome to GTAForums! Be sure to check out the Grand Theft Auto V Forum.

You are not registered! (If you are, click here to login) Registering is fast, free and easy and allows you to instantly reply to any topic on GTAForums.
Why wait? Click here to register your own unique username and become part of the ever-growing community!


( Log In | Register | Revalidate Validation E-mail )
Quick Log-In:
  IMG
       
>
Forum Rules GTA Modification Forums

Please post mod releases in the Mod Showroom

GTAGarage.com
free mod hosting from GTANet, simply login with your GTAForums account details

GTAModding.com
GTANet's modding wiki

GTA Modding Chatroom
provided by irc.gtanet.com (Don't have an IRC client? Click here)


  Reply to this topicStart new topicStart Poll

 Keypress using memory

 
HeresOtis  
Posted: Friday, Mar 9 2012, 02:05
Quote Post


Mark Chump
Group Icon
Group: Members
Joined: Apr 29, 2011

XXXXX



How to check if a key is pressed using memory address?

I found this but don't understand. How do I check if F6 is pressed?
CODE
:LABEL
wait 0
0A8D: 0@ = read_memory 0x00969110 size 4 virtual_protect 0
if
04A4:   0@ == 0x434F4445 // Hex String 'CODE'
jf @LABEL
0A8C: write_memory 0x00969110 size 4 value 0 virtual_protect 0 // Clear buffer
PM
  Top
 

 
Link2012  
Posted: Friday, Mar 9 2012, 02:29
Quote Post


Wut?
Group Icon
Group: Members
Joined: Jan 30, 2011

ba.gif

XXXXX



0x969110 is the cheat pool, is where the cheat string is located (Is used to check if a cheat was typed)
So 0x969110 method only works with characteres that goes to Cheat string (A-Z,1-9, that basic)

Why just don't use the CLEO 0AB0 for check F6?

anyway CLEO 0AB0 opcode uses the windows func (SHORT __stdcall GetKeyState(int nVirtKey)) at 0x0081E64C in 1.0US
PMMSN
  Top
 

 
Ashwin the new boy  
Posted: Friday, Mar 9 2012, 02:31
Quote Post


I am The Most Confused Person
Group Icon
Group: Members
Joined: Nov 14, 2010

ia.gif

XXXXX



i was wrong, Sorry!

This post has been edited by Ashwin the new boy on Friday, Mar 9 2012, 02:46
Users WebsitePM
  Top
 

 
Link2012  
Posted: Friday, Mar 9 2012, 02:37
Quote Post


Wut?
Group Icon
Group: Members
Joined: Jan 30, 2011

ba.gif

XXXXX



QUOTE (Ashwin the new boy @ Thursday, Mar 8 2012, 23:31)
there are many way of doing that,
one of them is to read only one byte of it, & check if it is equals to 117
CODE

:0
wait 0
0A8D: 0@ = read_memory 0x969110 size 1 virtual_protect 0
if
0@ == 117
jf @0
0A8C: write_memory 0x969110 size 4 value 0 virtual_protect 0
jump @0

i will work only if the last key pressed was F6,
you may add 1 to mem add for previous key check,

Cheat string only stores ASCII Characteres for checking cheats, not virtual keys like F6.
PMMSN
  Top
 

 
HeresOtis  
Posted: Friday, Mar 9 2012, 05:04
Quote Post


Mark Chump
Group Icon
Group: Members
Joined: Apr 29, 2011

XXXXX



I'm modding the main.scm so I can't use cleo opcodes. I need to find a way to use F6 as a keypress.
PM
  Top
 

 
Ashwin the new boy  
Posted: Friday, Mar 9 2012, 05:44
Quote Post


I am The Most Confused Person
Group Icon
Group: Members
Joined: Nov 14, 2010

ia.gif

XXXXX



cleo opcodes are not only for cleo scripts,
once you installed cleo mod, you can use them in main.scm also,
Users WebsitePM
  Top
 

 
HeresOtis  
Posted: Friday, Mar 9 2012, 05:53
Quote Post


Mark Chump
Group Icon
Group: Members
Joined: Apr 29, 2011

XXXXX



But I don't want to use it for my mod. I want it to be CLEO-independent.
PM
  Top
 

 
Ashwin the new boy  
Posted: Friday, Mar 9 2012, 06:03
Quote Post


I am The Most Confused Person
Group Icon
Group: Members
Joined: Nov 14, 2010

ia.gif

XXXXX



this may be difficult then,
Users WebsitePM
  Top
 

 
HeresOtis  
Posted: Friday, Mar 9 2012, 06:21
Quote Post


Mark Chump
Group Icon
Group: Members
Joined: Apr 29, 2011

XXXXX



I found this posted by Seeman. It's easy and works perfect.

http://www.gtaforums.com/index.php?showtop...dpost&p=4082258
PM
  Top
 

 

0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)

0 Members:

Topic Options Reply to this topicStart new topicStart Poll
Search topic for posted by (exact match)



 
IMG IMG