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 


Possible to use TShortCutDialog,TShortCutGrabBox with Lua?

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

Joined: 08 Oct 2015
Posts: 486

PostPosted: Tue May 24, 2016 4:53 am    Post subject: Possible to use TShortCutDialog,TShortCutGrabBox with Lua? Reply with quote

Just to confirm, these classes and their functions are not exposed to CE's lua engine thus it's not possible for me to create new ones and use them, right?
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 218

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Tue May 24, 2016 5:35 am    Post subject: This post has 1 review(s) Reply with quote

There are handy Lua functions allowing you to write your own.


quick&dirty example:
Code:
function userPressedKey(sender, key)
  if userDefinedHotkey[4]==0 then
    for i=1,4 do
      if userDefinedHotkey[i]==0 then
        userDefinedHotkey[i]=key
        break
      else
        if userDefinedHotkey[i]==key then break end
      end
    end
  end

  UDF1.CEEdit1.Text=convertKeyComboToString(userDefinedHotkey)

  return 0
end
UDF1.CEEdit1.OnKeyDown = userPressedKey


function clearHotkey()
  userDefinedHotkey={0,0,0,0}
  UDF1.CEEdit1.Text=convertKeyComboToString(userDefinedHotkey)
  UDF1.CEEdit1.setFocus()
end
UDF1.CEButton1.OnClick = clearHotkey


function redefineHotkeyKeys()
  if myHotkey==nil then return end

  myHotkey.setKeys(userDefinedHotkey[1],userDefinedHotkey[2],
                   userDefinedHotkey[3],userDefinedHotkey[4])
end
UDF1.CEButton2.OnClick = redefineHotkeyKeys


userDefinedHotkey={0,0,0,0}







Example CT below



hotkey manuallyset.CT
 Description:

Download
 Filename:  hotkey manuallyset.CT
 Filesize:  1.72 KB
 Downloaded:  604 Time(s)


_________________
Back to top
View user's profile Send private message MSN Messenger
predprey
Master Cheater
Reputation: 24

Joined: 08 Oct 2015
Posts: 486

PostPosted: Tue May 24, 2016 5:46 am    Post subject: Reply with quote

Dark Byte wrote:
No, ce doesn't even include the unit that defines TShortCutDialog so it can't even register it at all.

But TShortCutGrabBox should be able to do. (part of the property editor)


How can I go about creating TShortCutGrabBox?
Do I have to expose the class in LuaHandler.pas and compile my own CE?
Thanks
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: Tue May 24, 2016 5:54 am    Post subject: Reply with quote

yes, you'll have to compile your own CE

TShortCutGrabBox doesn't publish the key and shiftcode variables, so lua can't see them. (so even if you spawn it, it'd be useless for your lua code)
To be able to see them you have to create your own class that publishes those fields

check out cegui.pas for some examples.

Also, once registered, you can use the new createComponentClass function (new in git) to create it from lua without having to write code in luahandler or a new unit

_________________
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
predprey
Master Cheater
Reputation: 24

Joined: 08 Oct 2015
Posts: 486

PostPosted: Tue May 24, 2016 6:01 am    Post subject: Reply with quote

Guess i'll write my own functions then. Thinking of making a hotkey configurator to set hotkey for any menu item in CE. Thanks @ mgr.inz & DB
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