View previous topic :: View next topic |
Author |
Message |
AylinCE Grandmaster Cheater Supreme
Reputation: 37
Joined: 16 Feb 2017 Posts: 1526
|
Posted: Sun Sep 27, 2020 7:58 am Post subject: Which way is it going? "+"? "-"? |
|
|
I could not find any examples to understand this.
I need to print a "TrackBar" progress or a "OnResize" progress.
Rising or falling!
Sample;
Code: | function UDF1_CETrackBar1Change(sender)
if UDF1.CETrackBar1.Position==UDF1.CETrackBar1.Position + 1 then
print("The value is Rising: "..tonumber(UDF1.CETrackBar1.Position)) end
if UDF1.CETrackBar1.Position==UDF1.CETrackBar1.Position - 1 then
print("The value is Falling: "..tonumber(UDF1.CETrackBar1.Position)) end
end |
or
Code: | function UDF1_FormResize(sender)
if UDF1.Width==UDF1.Width - 1 then
print("The value is Rising: "..tonumber(UDF1.Width)) end
if UDF1.Width==UDF1.Width + 1 then
print("The value is Rising: "..tonumber(UDF1.Width)) end
end |
The above codes did not work.
How can a test like this be done? _________________
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25806 Location: The netherlands
|
Posted: Sun Sep 27, 2020 8:10 am Post subject: |
|
|
store the original position/width and compare that on change, and afterwards save the new position/width _________________
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 |
|
 |
Corroder Grandmaster Cheater Supreme
Reputation: 75
Joined: 10 Apr 2015 Posts: 1668
|
Posted: Sun Sep 27, 2020 8:18 am Post subject: |
|
|
Like this?. Or I am misunderstood as well
I set the trackbar range is 0 to 10 and trackbar position is 5 as default.
Code: | tb = UDF1.CETrackBar1
tb.OnChange = function()
tbVal = tb.Position
if tbVal > 5 and tbVal <= 10 then
print('Rising..')
elseif tbVal < 5 and tbVal >= 0 then
print('Falling..')
else
print('Centering..')
end
end
UDF1.Show() |
EDIT : Should be this
Code: | tb = UDF1.CETrackBar1
tb.Position = 5
tb.OnChange = function()
local tbNow = 5
local tbNew = tb.Position
if tbNow == tbNew then
return nil
elseif tbNew > tbNow then
print('Rising..')
tbNow = tbNew
elseif tbNew < tbNow then
print('Falling..')
tbNow = tbNew
end
end
UDF1.Show() |
_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Last edited by Corroder on Sun Sep 27, 2020 9:03 am; edited 2 times in total |
|
Back to top |
|
 |
AylinCE Grandmaster Cheater Supreme
Reputation: 37
Joined: 16 Feb 2017 Posts: 1526
|
Posted: Sun Sep 27, 2020 9:00 am Post subject: |
|
|
I think I'm asking wrong.
I do not want to decrease or decrease from the current position.
I can find this result.
I'm trying to do;
Is the progress bar or "ReSize" going right or left?
I'm trying to find this.
So; Direction, right or left?
example:
Code: | function UDF1_CETrackBar1Change(sender)
if UDF1.CETrackBar1.Min + 1 then
print("The value is Rising: "..tonumber(UDF1.CETrackBar1.Position))
else
print("The value is Falling: "..tonumber(UDF1.CETrackBar1.Position)) end
end |
@Corroder example;
Value; 0, 5, 10. Result; 6,7,8 "Rising". 9,8,7,6 "Rising"
No! It should be like this;
0,1,2,3,4,5,6,7,8,9,10, "Rising"
10,9,8,7,6,5, etc. "Falling"
Value + 1 = "Rising"
Value - 1 = "Falling"
Progress bar going right or left?
I want to question this.  _________________
|
|
Back to top |
|
 |
Corroder Grandmaster Cheater Supreme
Reputation: 75
Joined: 10 Apr 2015 Posts: 1668
|
|
Back to top |
|
 |
AylinCE Grandmaster Cheater Supreme
Reputation: 37
Joined: 16 Feb 2017 Posts: 1526
|
Posted: Sun Sep 27, 2020 10:17 am Post subject: |
|
|
5 to 10 Rising and 10 to 5 Rising.
It should be like this; 0 - progression "Rising" (When moving the bar to the right).
10 - 0 progress (When sliding the bar left) "Falling"
Rising should print +1 "Rising" and Falling - 1 "Falling".  _________________
|
|
Back to top |
|
 |
Corroder Grandmaster Cheater Supreme
Reputation: 75
Joined: 10 Apr 2015 Posts: 1668
|
|
Back to top |
|
 |
AylinCE Grandmaster Cheater Supreme
Reputation: 37
Joined: 16 Feb 2017 Posts: 1526
|
Posted: Mon Sep 28, 2020 6:23 am Post subject: |
|
|
Thanks @Corroder.
Now I can see in which direction it is heading left or right.
The strange part is; I could not find any examples for "left or right" in Lua.
Your code works fine and you got me out of this situation, I owe you +1.
Note; While I was dealing with the code below, this question struck me.
https://forum.cheatengine.org/viewtopic.php?p=5765172#5765172
Is it going "right" or "left" ..
I think "Lua" or CE (DB) should generate a shorter code to this.
TrackBar..Move.Right
ProgressBar..Move.Left
if TrackBar.Move==Right then vs.
Thanks again mate. _________________
|
|
Back to top |
|
 |
Corroder Grandmaster Cheater Supreme
Reputation: 75
Joined: 10 Apr 2015 Posts: 1668
|
Posted: Mon Sep 28, 2020 8:29 am Post subject: |
|
|
I think I have something like this before in old topic in the forum.
https://forum.cheatengine.org/viewtopic.php?p=5721406#5721406
but the original script actually is here:
Code: | if f then f.destroy() end
f = createForm()
f.Width = 300
f.Height = 200
f.Position = 'poScreenCenter'
c = createCheckBox(f)
c.Left = 10
c.Top = 10
c.Caption = 'Check Me To Show Track Bar'
l = createLabel(f)
l.Font.Size = 12
l.Caption = 'Corroder'
l.Top = c.Top + c.Height + 20
l.Left = math.floor(f.Width - l.Width) / 2
l.Font.Color = 0
l.Visible = false
t = createTrackBar(f)
t.left = 20
t.top = f.height - 60
t.width = f.width - t.left - 20
t.height = 30
t.frequency = 1
t.Max = 48 --- Maximum Value for a variable you want to change
t.Min = 12 --- Maninum Value for a variable you want to change
t.position = 0
t.SelStart = 0
t.SelEnd = 0
t.Visible = false
l2 = createLabel(f)
l2.Caption = 'Font Size : 12'
l2.Top = t.Top + t.Height + 8
l2.Left = 10
l2.Font.Color = 0
l2.Visible = false
f.show()
---- input here what all stuffs you want change when it check / uncheck
function cCheck(sender)
if sender.Checked then
l.Visible = true
l2.Visible = true
t.Visible = true
else
l.Visible = false
l2.Visible = false
t.Visible = false
end
end
---- Change your variable values here according to trackbar position
ls = t.Position
ns = t.Position
function TrackBar1Change(sender)
l.Font.Size = t.Position
ls = t.Position
if ls > ns then
l.Font.Color = 4231485
l2.Font.Color = 4231485
l2.Caption = 'Font Size INCREASE to : '..tostring(t.position)
l.Left = math.floor(f.Width - l.Width) / 2
l.Top = c.Top + c.Height + 20
ns = ls
ls = t.Position
elseif ls < ns then
l.Font.Color = 858083
l2.Font.Color = 858083
l2.Caption = 'Font Size DECREASE to : '..tostring(t.position)
l.Left = math.floor(f.Width - l.Width) / 2
l.Top = c.Top + c.Height + 20
ns = ls
ls = t.Position
end
end
t.onChange = TrackBar1Change --- execute trackbar change
c.onChange = cCheck --- execute check box change |
_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL |
|
Back to top |
|
 |
AylinCE Grandmaster Cheater Supreme
Reputation: 37
Joined: 16 Feb 2017 Posts: 1526
|
Posted: Mon Sep 28, 2020 10:41 am Post subject: |
|
|
Yes @Corroder, all solutions are made by adding additional queries.
We can print whether an object moves to the right or left (the direction of travel while it is manual) with additional codes.
What are there we might want to question (?);
TrackBar
ProgressBar
Timer
ReSize
Lines
etc.
Going forward or backward, up or down.
Knowing for now is not possible without additional codes.
"if Object.PositionMove + 1 then" or "- 1"
Is this a shortcoming? We will see over time.
Thank you for participating in the thread and for your opinion. _________________
|
|
Back to top |
|
 |
|