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 


Need some help with form designer

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
ChickScratch
How do I cheat?
Reputation: 0

Joined: 11 Jan 2022
Posts: 2

PostPosted: Tue Jan 11, 2022 4:51 am    Post subject: Need some help with form designer Reply with quote

My apologies if this seems very simple. I wanted to make it so that when I hit enter, it puts the typed text into the listbox below.
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 Jan 11, 2022 5:34 am    Post subject: Reply with quote

give it an OnKeyDown event, and check if Key is 13

If so, add the text to the listbox. Like listbox.Items.add(myedit.Text)

_________________
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
ChickScratch
How do I cheat?
Reputation: 0

Joined: 11 Jan 2022
Posts: 2

PostPosted: Tue Jan 11, 2022 6:50 am    Post subject: Reply with quote

It ended up throwing an error when I clicked on the edit, nil something something about a global.

I did get it to work somewhat by adding these 2 lines:
Code:

    WeapSwapList.add("Firearm_PistolASilenced_SpecialAgent")
    ItemSwapList.add("Firearm_PistolASilenced_SpecialAgent")

But I don't think editing the lua directly like this is good.

For context it's a Backpack Editor for Dying Light. I was trying to improve some things, but I'm much too new at it I think.

Here is the lua if anyone wants to try and help me out with this. It ended up producing some weird results, doesn't seem to work as intended. But still fun to mess with weapons when you don't know what you're going to get.


Code:
--[========================================================================================================================[
   Process            : DyingLightGame.exe
   Game Title          : DyingLightGame
   Game File Version    : 1.43.0.0
   Game Version      : 1.43.0.0
   CE Version         : 7.2
   Script Version      : 0.0.1
   Date            : 06/13/21
   Author            : TheyCallMeTim13
]========================================================================================================================]--


--
---- GLobals
   --DEBUG = true
   RELEASE_MODE = true

   PROCESS_NAME = 'DyingLightGame.exe'
   TABLE_NAME = 'DyingLightGame'
   TABLE_VERSION = '4.0.2'
   GAME_TITLE = 'DyingLightGame'
   -- GAME_FILE_VERSION = '1.45.0.0'
   -- GAME_VERSION = '1.45.0.0'
   TABLE_TITLE = GAME_TITLE..' CET'

    VERSION_FILE_URL = 'this had to be removed to post (don't have permissions to post url's yet'
   AUTO_UPDATE = RELEASE_MODE

--
---- Locals
   local compactMode = RELEASE_MODE
   local disableHeaderSorting = true
   local requiredCEVersion = 7.2
   -- local requiredCEVersionCloseOnFail = true
   -- local requiredGameFileVersion = '1.45.0.0'
   -- local requiredGameFileVersionCloseOnFail = true

--
---- Table Setup
   local function tableSetup(processName)
        CETrequire('AddType_GameTime')
      if RELEASE_MODE then
         ---- Release Mode
      end
      Logger:debugf('Table loaded for: %s', GAME_TITLE)
   end

--
---- CE Table Require
   local tableLuaFilesDirectory = 'luaFiles'
   local luaFileExt = '.lua'
   function CETrequire(moduleStr)
      if moduleStr ~= nil then
         local localTableLuaFilePath = moduleStr
         if tableLuaFilesDirectory ~= nil and tableLuaFilesDirectory ~= '' then
            local sep = package.config:sub(1,1)
            localTableLuaFilePath = tableLuaFilesDirectory..sep..moduleStr
         end
         local f, err = io.open(localTableLuaFilePath..luaFileExt)
         if f and not err then
            f:close()
            return dofile(localTableLuaFilePath..luaFileExt)
         else
            local tableFile = findTableFile(moduleStr..luaFileExt)
            if tableFile == nil then
               return
            end
            local stream = tableFile.stream
            return load(readStringLocal(stream.memory, stream.size))()
         end
      end
   end

ItemTable = {}
WeaponTable = {}
BaseItemTable = {}
ModTable = {}
ItemPack = 0
WeapPack = 0
BaseItemPoint = 0

   function BackPackUpdate(sender)
   WeapPack = readQword(readQword("ItemEditData")+0x60)+0x40
   ItemPack = readQword(readQword("ItemEditData")+0x58)+0x40
   BaseItemPoint = readQword("ItemEditData+8")-0x18
   local BasePointCount = readInteger(BaseItemPoint+8)
   PackEdit_LBWeapSwap.clear()
   local WeapSwapList = PackEdit_LBWeapSwap.getItems()
   local ItemSwapList = PackEdit_LBItemSwap.getItems()
   for i=0,BasePointCount-1 do
     local ItemAddr = readQword(readQword(BaseItemPoint)+i*8)
     local ItemString = readString(readQword(ItemAddr+0x18))
     if ItemString then
       if string.find(ItemString,"Craft") then
         table.insert(ModTable,{Address = ItemAddr,Name = ItemString})
       end
       table.insert(BaseItemTable,{Address=ItemAddr,Name=ItemString})
     end
   end
   PackEdit_CBWeapMod.clear()
   local ModList = PackEdit_CBWeapMod.getItems()
   ModList.add("None")
   PackEdit_CBWeapMod.setItemIndex(0)
   for k,v in pairs(ModTable) do
     ModList.add(v.Name)
   end
  for k,v in pairs(BaseItemTable) do
    WeapSwapList.add(v.Name)
    ItemSwapList.add(v.Name)
    WeapSwapList.add("Firearm_PistolASilenced_SpecialAgent")
    ItemSwapList.add("Firearm_PistolASilenced_SpecialAgent")
  end
end

function BWeapUpdateClick(sender)
  if #BaseItemTable == 0 then
    BackPackUpdate()
  end
  PackEdit_LBWeapList.clear()
  WeaponTable={}
  local WeapList = PackEdit_LBWeapList.getItems()
  local WeapCount = readInteger(WeapPack+8)
  for i=0,WeapCount-1 do
    local WeapAddr = readQword(readQword(WeapPack)+i*8)
    local WeapString = readString(readQword(readQword(WeapAddr+0x60)+0x18))
    local EquipFlag = bAnd(readBytes(WeapAddr+0xf8),4)
    if EquipFlag == 4 then
      WeapString = "E: "..WeapString
    end
    table.insert(WeaponTable,{Index = i,Name=WeapString,Address=WeapAddr,Equip=EquipFlag})
  end
  table.sort(WeaponTable,function(a,b) return a.Equip>b.Equip end)
  for k,v in pairs(WeaponTable) do
    WeapList.add(v.Name)
  end
end


function LBWeapListSelectionChange(sender, user)
  if sender.ItemIndex == -1 then return end
  local Weapon = WeaponTable[sender.ItemIndex+1]
  local Dura = readFloat(Weapon.Address+0x44)
  local Repair = readInteger(Weapon.Address+0x48)
  local Quant = readInteger(Weapon.Address+0x40)
  local Qual = readBytes(Weapon.Address+0x68)
  local Mod = readQword(Weapon.Address+0x70)
  PackEdit_EWeapDur.text = Dura
  PackEdit_EWeapRepair.text = Repair
  PackEdit_EWeapQual.text = Qual
  PackEdit_EWeapQuant.text = Quant
  local ModTest = false
  for k,v in pairs(ModTable) do
      if v.Address == Mod then
        PackEdit_CBWeapMod.setItemIndex(k)
        ModTest = true
        break
      end
  end
  if ModTest == false then PackEdit_CBWeapMod.setItemIndex(0) end
end

function EWeapApplyClick(sender)
  if tonumber(PackEdit_EWeapDur.text) == nil or tonumber(PackEdit_EWeapRepair.text) == nil or tonumber(PackEdit_EWeapQual.text) == nil or tonumber(PackEdit_EWeapQuant.text) == nil then
    showMessage("Please enter only number values.")
  return end
  if PackEdit_LBWeapList.ItemIndex == -1 then return end
  local ModIndex = PackEdit_CBWeapMod.getItemIndex()
  local Weapon = WeaponTable[PackEdit_LBWeapList.ItemIndex+1]
  local Dura = tonumber(PackEdit_EWeapDur.text)
  local Repair = tonumber(PackEdit_EWeapRepair.text)
  local Quant = tonumber(PackEdit_EWeapQuant.text)
  local Qual = tonumber(PackEdit_EWeapQual.text)
  writeFloat(Weapon.Address+0x44,Dura)
  writeInteger(Weapon.Address+0x48,Repair)
  writeInteger(Weapon.Address+0x40,Quant)
  writeBytes(Weapon.Address+0x68,Qual)
  if ModIndex == 0 then
    writeQword(Weapon.Address+0x70,0)
  else
    writeQword(Weapon.Address+0x70,ModTable[ModIndex].Address)
  end
end

function BWeapSwapClick(sender)
  if PackEdit_LBWeapSwap.ItemIndex == -1 or PackEdit_LBWeapList.ItemIndex == -1 then return end
  local SwapIndex = PackEdit_LBWeapSwap.getItemIndex()+1
  local Weapon = WeaponTable[PackEdit_LBWeapList.ItemIndex+1]
  writeQword(Weapon.Address+0x60,BaseItemTable[SwapIndex].Address)
  BWeapUpdateClick()
end


function BItemUpdateClick(sender)
  if #BaseItemTable == 0 then
    BackPackUpdate()
  end
  PackEdit_LBItemList.clear()
  ItemTable = {}
  local ItemList = PackEdit_LBItemList.getItems()
  local ItemCount = readInteger(ItemPack+8)
  for i = 0,ItemCount-1 do
    local ItemAddr = readQword(readQword(ItemPack)+i*8)
    local ItemString = readString(readQword(readQword(ItemAddr+0x60)+0x18))
    local ItemType = readBytes(readQword(ItemAddr+0x60)+0x78)
    table.insert(ItemTable,{Name = ItemString,Address = ItemAddr,ItemIndex = ItemType})
  end
  table.sort(ItemTable,function(a,b) return a.ItemIndex < b.ItemIndex end)
    for k,v in pairs(ItemTable) do
    ItemList.add(v.Name)
    end
    end

    function LBItemListSelectionChange(sender, user)
    if sender.ItemIndex == -1 then return end
    local Item = ItemTable[sender.ItemIndex+1]
    local Quant = readInteger(Item.Address+0x40)
    PackEdit_EItemQuant.text = Quant
    local ItemTypeIndex = 0
    for k,v in pairs(BaseItemTable) do
    if v.Name == Item.Name then ItemTypeIndex = k-1 end
    end
    PackEdit_LBItemSwap.setItemIndex(ItemTypeIndex)
    end

    function BItemApplyClick(sender)
    if PackEdit_LBItemSwap.ItemIndex == -1 or PackEdit_LBItemList.ItemIndex == -1 then return end
    if tonumber(PackEdit_EItemQuant.text) == nil then showMessage("Please enter only number values.") end
    local SwapIndex = PackEdit_LBItemSwap.getItemIndex()+1
    local Item = ItemTable[PackEdit_LBItemList.ItemIndex+1]
    local Quant = tonumber(PackEdit_EItemQuant.text)
    writeQword(Item.Address+0x60,BaseItemTable[SwapIndex].Address)
    writeInteger(Item.Address+0x40,Quant)
    BItemUpdateClick()
    end

    function EditorShow()
    ItemTable = {}
    WeaponTable = {}
    BaseItemTable = {}
    PackEdit.show()
    end

    function EditorHide()
    PackEdit.close()
    end
--
---- Logger
   CETrequire('I2CETLogger')
   Logger = I2CETLogger:new({LogName = 'CT'})
   if DEBUG then Logger:write(string.rep('=', 90)) end
   Logger:debugf('Lodding Table: %s : %s', TABLE_NAME, TABLE_VERSION)
   Logger:debugf('Useing CE version: %.1f', getCEVersion())

--
---- Helpers, Functions & Commands
   CETrequire('I2CEHelpers')
   CETrequire('I2CETableHelpers')
   CETrequire('I2CELuaFunctions')
   CETrequire('I2CEAACommands')

--
---- Modules
   CETrequire('I2CETableCEA')
   CETrequire('I2CETeleporter')
   CETrequire('I2CETState')
   CETrequire('I2CETUpdater')
   if AUTO_UPDATE then
      CETUpdater.TableVersion = TABLE_VERSION
      CETUpdater.TableName = TABLE_NAME
      CETUpdater.VersionFileUrl = VERSION_FILE_URL
      CETUpdater.checkTableVersion()
   end

--
---- CE Setup
   Helpers.ceSetup(compactMode, disableHeaderSorting)
   Helpers.requireCEVersion(requiredCEVersion, requiredCEVersionCloseOnFail)

--
---- Auto Attach
   Helpers.tableSetup = tableSetup
   Helpers.autoAttachCT(PROCESS_NAME, requiredGameFileVersion, requiredGameVersionCloseOnFail)


--WeapSwapList.add(KBWeapSwap.Text)
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 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