Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


LUA Script for specify ,Capslock is On or Off

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
sjl002
Master Cheater
Reputation: 0

Joined: 31 Aug 2013
Posts: 305

PostPosted: Sun Dec 20, 2015 1:17 pm    Post subject: LUA Script for specify ,Capslock is On or Off Reply with quote

Hi.
In cheat happens trainer i see when pressed caps lock was On or Off.
How I making LUA Script for , when run trainer in lable was specify is On or Off.and when pressed caps lock, show it's On or off.
Back to top
View user's profile Send private message
sjl002
Master Cheater
Reputation: 0

Joined: 31 Aug 2013
Posts: 305

PostPosted: Tue Dec 22, 2015 4:41 am    Post subject: Reply with quote

Help me friends,please,please.
Back to top
View user's profile Send private message
lolAnonymous
Expert Cheater
Reputation: 1

Joined: 19 Jul 2015
Posts: 154

PostPosted: Tue Dec 22, 2015 4:42 am    Post subject: Reply with quote

Send me the trainer link in messages...
Back to top
View user's profile Send private message
sjl002
Master Cheater
Reputation: 0

Joined: 31 Aug 2013
Posts: 305

PostPosted: Thu Dec 24, 2015 10:16 pm    Post subject: Reply with quote

Can help me friends?plllllleas.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

Joined: 09 May 2003
Posts: 25262
Location: The netherlands

PostPosted: Fri Dec 25, 2015 4:06 am    Post subject: Reply with quote

I don't think that's currently possible with the functions provided

but you can do it a bit hackery:
Code:

autoAssemble([[
alloc(GetCapsLockStateFinished,4)
alloc(GetCapsLockStateResult,4)
alloc(GetCapsLockState,128)

registersymbol(GetCapsLockStateFinished)
registersymbol(GetCapsLockStateResult)
registersymbol(GetCapsLockState)

GetCapsLockStateFinished:
dd 0

GetCapsLockStateResult:
dd 0

GetCapsLockState:
[64-bit]
sub rsp,28
mov rcx,14
[/64-bit]

[32-bit]
push 14
[/32-bit]
call GetKeyState
and eax,1
mov [GetCapsLockStateResult],eax
mov [GetCapsLockStateFinished],1


[64-bit]
add rsp,28
ret
[/64-bit]

[32-bit]
ret 4
[/32-bit]



]],true)

function getCapsLockState()
  writeIntegerLocal("GetCapsLockStateFinished",0)
  autoAssemble([[
    createThread(GetCapsLockState)
  ]],true)

  while readIntegerLocal("GetCapsLockStateFinished")==0 do end

  return readIntegerLocal("GetCapsLockStateResult")~=0

end


this will add the "getCapsLockState()" function

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
sjl002
Master Cheater
Reputation: 0

Joined: 31 Aug 2013
Posts: 305

PostPosted: Thu Jan 14, 2016 8:18 pm    Post subject: Reply with quote

How to use this script?
can made Capslock state with lua in label. Laughing Rolling Eyes
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 138

Joined: 06 Jul 2014
Posts: 4275

PostPosted: Thu Jan 14, 2016 9:28 pm    Post subject: Reply with quote

  1. Open the Lua script window via Table -> Show Cheat Table Lua Script (Ctrl + Alt + L)
  2. Copy and paste that in
  3. Call that function by typing getCapsLockState()
  4. Do whatever you want with the boolean returned

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
sjl002
Master Cheater
Reputation: 0

Joined: 31 Aug 2013
Posts: 305

PostPosted: Thu Jan 14, 2016 9:42 pm    Post subject: Reply with quote

Okay.but where show cpslock state.
Sorry,but How to Call that function by typing getCapsLockState()
Drak byte order of "This will Add function getCapsLockState()"?
Where add it?


Last edited by sjl002 on Thu Jan 14, 2016 10:00 pm; edited 1 time in total
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 138

Joined: 06 Jul 2014
Posts: 4275

PostPosted: Thu Jan 14, 2016 9:59 pm    Post subject: Reply with quote

...anywhere you want in any way you want?

For example: have a timer check it periodically and change the text on a label based on what that function returns.

Please refer to main.lua for more information on how to do this using CE-related functions, and refer to either this or Google on how to use Lua.

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
sjl002
Master Cheater
Reputation: 0

Joined: 31 Aug 2013
Posts: 305

PostPosted: Thu Jan 14, 2016 10:12 pm    Post subject: Reply with quote

Into this site was this script:
functioncall ::= prefixexp ‘:’ Name args
I was use this?
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 138

Joined: 06 Jul 2014
Posts: 4275

PostPosted: Thu Jan 14, 2016 10:41 pm    Post subject: Reply with quote

That's not a script; it's just how that manual expresses things. It's basically saying to call a function, you write the name of a function and any arguments you want to pass to it.
i.e. type getCapsLockState() to run the getCapsLockState function.

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
sjl002
Master Cheater
Reputation: 0

Joined: 31 Aug 2013
Posts: 305

PostPosted: Thu Jan 14, 2016 11:02 pm    Post subject: Reply with quote

How to make script for call getCapsLockState() function?
This script show Capslock state in label?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites