View previous topic :: View next topic |
Author |
Message |
DhaosCollider How do I cheat?
Reputation: 0
Joined: 12 Mar 2022 Posts: 4
|
Posted: Thu Feb 09, 2023 6:35 am Post subject: Hotkey list and clean all hotkeys |
|
|
Features:
- Add Hotkeys menu
- View Hotkey list
(Select one from the list to invoke the target hotkey form)
- Clean all Hotkeys
Notes:
- Its recommended to throw lua file into CE's autorun folder.
- Not confirmed to work with CE 7.1 or lower.
AA script code:
Code: | {$lua}
if syntaxcheck then return end
---------------------------------------------------------------------------------------------------
-- addHotKeyInfoItem functions
---------------------------------------------------------------------------------------------------
local function assignListAndTable(mr, list, tbl)
if not (0 < mr.HotkeyCount) then return end
for i = 0, mr.HotkeyCount - 1 do
local str = ('%s: %s'):format(mr.Hotkey[i].hotkeyString, mr.description)
if str then list.add(str); tbl[#tbl + 1] = mr.index end
end
end
---------------------------------------------------------------------------------------------------
local function getIndex()
local al, hl, il = getAddressList(), createStringList(), {}
for i = 0, al.count - 1 do assignListAndTable(al[i], hl, il) end
local id = showSelectionList('Hotkeys', '', hl)
hl.destroy()
return (-1 < id) and il[id + 1]
end
---------------------------------------------------------------------------------------------------
local function viewSetHotkeys()
local index = getIndex()
if not index then return end
local al, mf = getAddressList(), getMainForm()
al.setSelectedRecord(al[index]); mf.SetHotkey1.doClick()
end
---------------------------------------------------------------------------------------------------
local function cleanHotkeys(mr)
if not (0 < mr.HotkeyCount) then return end
for i = mr.HotkeyCount - 1, 0, -1 do mr.Hotkey[i].destroy() end
end
---------------------------------------------------------------------------------------------------
local function cleanAllHotkeys()
local al = getAddressList()
for i = 0, al.count - 1 do cleanHotkeys(al[i]) end
end
---------------------------------------------------------------------------------------------------
local function findHotkeyInfoItem(str)
local mf = getMainForm()
for i = mf.Menu.Items.count - 1, 0, -1 do
local caption = mf.Menu.Items[i].caption
if (caption == str) then return mf.Menu.Items[i] end
end
end
---------------------------------------------------------------------------------------------------
local function addListViewMenu(Item)
local ListViewMenu = createMenuItem(Item)
Item.add(ListViewMenu)
ListViewMenu.caption = 'List view'
ListViewMenu.onClick = viewSetHotkeys
end
---------------------------------------------------------------------------------------------------
local function addCleanAllMenu(Item)
local CleanAllMenu = createMenuItem(Item)
Item.add(CleanAllMenu)
CleanAllMenu.caption = 'Clean all'
CleanAllMenu.onClick = cleanAllHotkeys
end
---------------------------------------------------------------------------------------------------
local function addHotkeyInfoItem()
if findHotkeyInfoItem('&Hotkeys') then return end
local mf = getMainForm()
local HotKeyInfoItem = createMenuItem(mf.Menu.Items)
mf.Menu.Items.add(HotKeyInfoItem)
HotKeyInfoItem.caption = '&Hotkeys'
addListViewMenu(HotKeyInfoItem); addCleanAllMenu(HotKeyInfoItem)
end
---------------------------------------------------------------------------------------------------
[ENABLE]
addHotkeyInfoItem()
[DISABLE]
findHotkeyInfoItem('&Hotkeys').destroy() |
Description: |
|
Filesize: |
5.89 KB |
Viewed: |
14251 Time(s) |

|
Description: |
|
Filesize: |
7.3 KB |
Viewed: |
14254 Time(s) |

|
Description: |
Edit 1.2: Fixed findHotkeyInfoItem to return TMenuItem. |
|
 Download |
Filename: |
addHotKeyInfoItem.lua |
Filesize: |
3.15 KB |
Downloaded: |
1236 Time(s) |
|
|
Back to top |
|
 |
DeRol Newbie cheater
Reputation: 0
Joined: 26 Aug 2009 Posts: 18
|
Posted: Tue Mar 07, 2023 1:53 am Post subject: |
|
|
Works great and convenient. Thanks!
|
|
Back to top |
|
 |
frogsaucer How do I cheat?
Reputation: 0
Joined: 03 Feb 2024 Posts: 7
|
Posted: Sun Feb 25, 2024 12:01 pm Post subject: |
|
|
Does clean hotkeys mean delete or disable?
EDIT: Nevermind it deletes all. Is there a way to toggle off all hotkeys? It would greatly help my projects.
|
|
Back to top |
|
 |
Csimbi I post too much
Reputation: 97
Joined: 14 Jul 2007 Posts: 3282
|
Posted: Mon Feb 26, 2024 2:09 am Post subject: |
|
|
frogsaucer wrote: | Is there a way to toggle off all hotkeys? It would greatly help my projects. |
I ended up making a script for that.
Code: | <?xml version="1.0" encoding="utf-8"?>
<CheatTable>
<CheatEntries>
<CheatEntry>
<ID>118</ID>
<Description>"-- Disable CE HotKeys LUA script"</Description>
<LastState/>
<VariableType>Auto Assembler Script</VariableType>
<AssemblerScript>[ENABLE]
{$lua}
getHotkeyHandlerThread().State='htsDisabled'
[DISABLE]
{$lua}
getHotkeyHandlerThread().State='htsActive'
</AssemblerScript>
</CheatEntry>
</CheatEntries>
</CheatTable>
|
|
|
Back to top |
|
 |
frogsaucer How do I cheat?
Reputation: 0
Joined: 03 Feb 2024 Posts: 7
|
Posted: Wed Feb 28, 2024 12:30 am Post subject: |
|
|
Csimbi wrote: | frogsaucer wrote: | Is there a way to toggle off all hotkeys? It would greatly help my projects. |
I ended up making a script for that.
Code: | <?xml version="1.0" encoding="utf-8"?>
<CheatTable>
<CheatEntries>
<CheatEntry>
<ID>118</ID>
<Description>"-- Disable CE HotKeys LUA script"</Description>
<LastState/>
<VariableType>Auto Assembler Script</VariableType>
<AssemblerScript>[ENABLE]
{$lua}
getHotkeyHandlerThread().State='htsDisabled'
[DISABLE]
{$lua}
getHotkeyHandlerThread().State='htsActive'
</AssemblerScript>
</CheatEntry>
</CheatEntries>
</CheatTable>
|
|
Thank you so much, I will be using that sometime for sure.
|
|
Back to top |
|
 |
|