| View previous topic :: View next topic |
| Author |
Message |
FIRESKY Cheater
Reputation: 0
Joined: 01 Mar 2017 Posts: 34
|
Posted: Tue May 07, 2024 7:24 am Post subject: |
|
|
thanks for the tips and your time!
I can finally try many new tests with all the correct statements, this work!
Was forgot too another little sub question:
i was think if was possible while the cursor passes over an CEEDIT, then without put it in active control, right to create a bolean / statement only while the mouse cursor is above the CEEDIT.
Also Is there a correct negative form for this? "if (CETtrainer.isForegroundWindow(CETtrainer))" then -----> Exemple: (CETtrainer.notisForegroundWindow(CETtrainer)) or IDK...
|
|
| Back to top |
|
 |
AylinCE Grandmaster Cheater Supreme
Reputation: 37
Joined: 16 Feb 2017 Posts: 1531
|
Posted: Tue May 07, 2024 11:51 am Post subject: |
|
|
Here are general examples:
Functions have been added to warn when the cursor hovers over CEEdit (OnMouseEnter) and when the cursor leaves CEEdit (OnMouseLeave).
Also added a function (isForegroundWindow()) with which you can test whether the Trainer window is at the top or not.
You can test this not with "not" but with "true" or "false" as shown in the code (foregroundW1()).
Timers are given as examples.
You decide what you want the timers to do.
2 timers were given;
1) Trainer window constantly checks to see if it is at the top. It will only stop if the cursor is on CEEdit.
(tmr22.OnTimer=foregroundW1)
2) It will work if the trainer window is at the top. Or you can arrange it for the opposite. Or you can replace this timer with a code replacement function.
(TimerAA.OnTimer=startMsg)
I think you'll edit again and ask another question.
I hope you achieve the final result.
| Code: | if frm1 then frm1.Destroy() frm1=nil end
frm1=createForm()
frm1.Position="poDesktopCenter"
frm1.Height=80
local CETrainer = {}
CETrainer.CEEdit1 = createEdit(frm1)
CETrainer.CEEdit1.Left=30 CETrainer.CEEdit1.Top=30
-------------------------------------------------------------------
if tmr22 then tmr22.Destroy() tmr22=nil end
tmr22=createTimer()
tmr22.Interval=1000
tmr22.Enabled=false
if TimerAA then TimerAA.Destroy() TimerAA=nil end
TimerAA=createTimer()
TimerAA.Interval=1000
TimerAA.Enabled=false
-------------------------- Foreground Window func -----------------
local ctpid = 0
--Get the trainer window ID. (Execute Script or Trainer.Show() )
if ctpid==0 then ctpid = getForegroundProcess() end
print(ctpid)
--Use during testing: If CETrainer is not at the top, the print trainer is at the top.
--This code will prevent the Lua Engine (Print) window from rising to the top unnecessarily.
getLuaEngine().cbShowOnPrint.Checked=false
isForegroundWindow=function(s)
res = false
pd = getForegroundProcess()
if tonumber(pd)==tonumber(ctpid) then
res=true
else
res=false
end
return res
end
----------------------- start timer check window! ---------------------
function startMsg()
print("Now: CETrainer is on top!")
end
function foregroundW1()
if isForegroundWindow(CETrainer)==true then --foreground window check:
TimerAA.Enabled=true
else
print("Now: CETrainer is not at the top!")
TimerAA.Enabled=false
end
end
tmr22.OnTimer=foregroundW1
TimerAA.OnTimer=startMsg
tmr22.Enabled=true
------------------------ cursor and edit -------------------------
--right to create a bolean / statement only while the mouse cursor is above the CEEDIT.
CETrainer.CEEdit1.OnMouseEnter=function(sender)
tmr22.Enabled=false
TimerAA.Enabled=false
print("Cursor on Edit1!")
end
CETrainer.CEEdit1.OnMouseLeave=function(sender)
tmr22.Enabled=true
print("Cursor not on Edit1!")
end
-------------------------------------------------------------------
|
_________________
|
|
| Back to top |
|
 |
FIRESKY Cheater
Reputation: 0
Joined: 01 Mar 2017 Posts: 34
|
Posted: Wed May 08, 2024 6:36 am Post subject: |
|
|
Ofc AylinCE I accomplished what I had to from quite a few tips ago ,
I just took the opportunity to better understand some statements that could be more or less useful for me and probably others and I thank you for your time, you really were really friendly.
More than anything I used your advice to experiment with many things,
have ideas and understand some correct forms of lua that were not clear to me, certainly everyone can learn a lot from the official lua guides,
but it's also nice to do it by asking for advice and help, but I certainly don't want to take advantage of your time, so realy thanks for everything.
I just hope sooner or later I can reciprocate in some way.
AylinCE = Master-chief.
- TOPIC SOLVED -
|
|
| Back to top |
|
 |
|