--[===[ Author: YoucefHam Email: youcefham20@gmail.com Discord: YoucefHam#5634 Zoom with Ctrl + Mouse Wheel in all "Script editors" beta: this file only for test ]===] local timer = createTimer(nil, false) timer.Interval = 2000 timer_times = 1 timer.OnTimer = function(timer) timer.Enabled = false timer.destroy() local frmCE function getCEForms() frmCE = {} for i = 0, getFormCount() - 1 do frmVarName = 'frm'..(getForm(i).Name~='' and getForm(i).Name or getForm(i).ClassName) frmCE[frmVarName] = getForm(i) end end local function mnLuaEngineUseZoom(frmluaEngine) local mnLuaUseZoom = false local mnLuaOutput = frmluaEngine.ComponentByName['mOutput'] local mnLuaScript = frmluaEngine.ComponentByName['mScript'] if not mnLuaOutput or not mnLuaScript then return end local mnLuaOutputoldOnKeyDown = mnLuaOutput.OnKeyDown mnLuaOutput.OnKeyDown = function(sender, key) if key == VK_CONTROL and not UseZoom then if isKeyPressed(VK_CONTROL) and not mnLuaUseZoom then mnLuaUseZoom = true end end if mnLuaOutputoldOnKeyDown then mnLuaOutputoldOnKeyDown(sender, key) end end local mnLuaScriptoldOnKeyDown = mnLuaScript.OnKeyDown mnLuaScript.OnKeyDown = function(sender, key) if key == VK_CONTROL and not UseZoom then if isKeyPressed(VK_CONTROL) and not mnLuaUseZoom then mnLuaUseZoom = true end end if mnLuaScriptoldOnKeyDown then mnLuaScriptoldOnKeyDown(sender, key) end end local mnLuaOutputoldOnKeyUp = mnLuaOutput.OnKeyUp mnLuaOutput.OnKeyUp = function(sender, key) if isKeyPressed(VK_CONTROL) and mnLuaUseZoom then mnLuaUseZoom = false end if mnLuaOutputoldOnKeyUp then mnLuaOutputoldOnKeyUp(sender, key) end end local mnLuaScriptoldOnKeyUp = mnLuaScript.OnKeyUp mnLuaScript.OnKeyUp = function(sender, key) if isKeyPressed(VK_CONTROL) and mnLuaUseZoom then mnLuaUseZoom = false end if mnLuaScriptoldOnKeyUp then mnLuaScriptoldOnKeyUp(sender, key) end end local mnLuaOutputoldOnMouseWheelDown = mnLuaOutput.OnMouseWheelDown mnLuaOutput.OnMouseWheelDown = function(sender, x, y) if mnLuaUseZoom and isKeyPressed(VK_CONTROL) then if sender.Font.Size > 1 then sender.Font.Size = sender.Font.Size - 1 end end if mnLuaOutputoldOnMouseWheelDown then mnLuaOutputoldOnMouseWheelDown(sender, x, y) end end local mnLuaScriptoldOnMouseWheelDown = mnLuaScript.OnMouseWheelDown mnLuaScript.OnMouseWheelDown = function(sender, x, y) if mnLuaUseZoom and isKeyPressed(VK_CONTROL) then if sender.Font.Size > 1 then sender.Font.Size = sender.Font.Size - 1 end end if mnLuaScriptoldOnMouseWheelDown then mnLuaScriptoldOnMouseWheelDown(sender, x, y) end end local mnLuaOutputoldOnMouseWheelUp = mnLuaOutput.OnMouseWheelUp mnLuaOutput.OnMouseWheelUp = function(sender, x, y) if mnLuaUseZoom and isKeyPressed(VK_CONTROL) then if sender.Font.Size < 50 then sender.Font.Size = sender.Font.Size + 1 end end if mnLuaOutputoldOnMouseWheelUp then mnLuaOutputoldOnMouseWheelUp(sender, x, y) end end local mnLuaScriptoldOnMouseWheelUp = mnLuaScript.OnMouseWheelUp mnLuaScript.OnMouseWheelUp = function(sender, x, y) if mnLuaUseZoom and isKeyPressed(VK_CONTROL) then if sender.Font.Size < 50 then sender.Font.Size = sender.Font.Size + 1 end end if mnLuaScriptoldOnMouseWheelUp then mnLuaScriptoldOnMouseWheelUp(sender, x, y) end end local oldNewWindow = frmluaEngine.ComponentByName['MenuItem11'].OnClick frmluaEngine.ComponentByName['MenuItem11'].OnClick = function(...) if oldNewWindow then oldNewWindow(...) end local timer2 = createTimer(nil, false) timer2.Interval = 1000 timer2.OnTimer = function(timer2) timer2.Enabled = false timer2.destroy() local frm0 for i = 0, getFormCount() - 1 do frm0 = getForm(i) if frm0.ClassName=='TfrmLuaEngine' and frm0.isForegroundWindow(frm0) then break end end frm0 = frm0.ClassName=='TfrmLuaEngine' and frm0 or getLuaEngine() if frm0 then mnLuaEngineUseZoom(frm0) end end timer2.Enabled = true end end local function mnAutoInjectUseZoom(frmAutoInject) local mnLuaUseZoom = false local mnAssemblescreen = frmAutoInject.ComponentByName['Assemblescreen'] if not mnAssemblescreen then return end local mnAssemblescreenoldOnKeyDown = mnAssemblescreen.OnKeyDown mnAssemblescreen.OnKeyDown = function(sender, key) if key == VK_CONTROL and not UseZoom then if isKeyPressed(VK_CONTROL) and not mnLuaUseZoom then mnLuaUseZoom = true end end if mnAssemblescreenoldOnKeyDown then mnAssemblescreenoldOnKeyDown(sender, key) end end local mnAssemblescreenoldOnKeyUp = mnAssemblescreen.OnKeyUp mnAssemblescreen.OnKeyUp = function(sender, key) if isKeyPressed(VK_CONTROL) and mnLuaUseZoom then mnLuaUseZoom = false end if mnAssemblescreenoldOnKeyUp then mnAssemblescreenoldOnKeyUp(sender, key) end end local mnAssemblescreenoldOnMouseWheelDown = mnAssemblescreen.OnMouseWheelDown mnAssemblescreen.OnMouseWheelDown = function(sender, x, y) if mnLuaUseZoom and isKeyPressed(VK_CONTROL) then if sender.Font.Size > 1 then sender.Font.Size = sender.Font.Size - 1 end end if mnAssemblescreenoldOnMouseWheelDown then mnAssemblescreenoldOnMouseWheelDown(sender, x, y) end end local mnAssemblescreenoldOnMouseWheelUp = mnAssemblescreen.OnMouseWheelUp mnAssemblescreen.OnMouseWheelUp = function(sender, x, y) if mnLuaUseZoom and isKeyPressed(VK_CONTROL) then if sender.Font.Size < 50 then sender.Font.Size = sender.Font.Size + 1 end end if mnAssemblescreenoldOnMouseWheelUp then mnAssemblescreenoldOnMouseWheelUp(sender, x, y) end end local oldNewWindow = frmAutoInject.miNewWindow.OnClick frmAutoInject.miNewWindow.OnClick = function(...) if oldNewWindow then oldNewWindow(...) end local timer2 = createTimer(nil, false) timer2.Interval = 1000 timer2.OnTimer = function(timer2) timer2.Enabled = false timer2.destroy() local frm2 for i = 0, getFormCount() - 1 do frm2 = getForm(i) if frm2.ClassName == 'TfrmAutoInject' and frm2.isForegroundWindow(frm2) then break end end if frm2 then mnAutoInjectUseZoom(frm2) end end timer2.Enabled = true end end oldAddressListOnDblClick = AddressList.List.OnDblClick AddressList.List.OnDblClick = function(...) if oldAddressListOnDblClick then oldAddressListOnDblClick(...) end local timer2 = createTimer(nil, false) timer2.Interval = 1000 timer2.OnTimer = function(timer2) timer2.Enabled = false timer2.destroy() local frm2 for i = 0, getFormCount() - 1 do frm2 = getForm(i) if frm2.ClassName == 'TfrmAutoInject' and frm2.isForegroundWindow(frm2) then break end end if frm2 then mnAutoInjectUseZoom(frm2) end end timer2.Enabled = true end oldAutoInject1OnClick = getMemoryViewForm().AutoInject1.OnClick getMemoryViewForm().AutoInject1.OnClick = function(...) if oldAutoInject1OnClick then oldAutoInject1OnClick(...) end local timer2 = createTimer(nil, false) timer2.Interval = 1000 timer2.OnTimer = function(timer2) timer2.Enabled = false timer2.destroy() local frm2 for i = 0, getFormCount() - 1 do frm2 = getForm(i) if frm2.ClassName == 'TfrmAutoInject' and frm2.isForegroundWindow(frm2) then break end end if frm2 then mnAutoInjectUseZoom(frm2) end end timer2.Enabled = true end getCEForms() mnLuaEngineUseZoom(frmCE.frmfrmLuaEngine) mnAutoInjectUseZoom(frmCE.frmfrmAutoInject) end timer.Enabled = true