 |
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
Corroder Grandmaster Cheater Supreme
Reputation: 75
Joined: 10 Apr 2015 Posts: 1668
|
Posted: Mon Jul 08, 2019 8:07 pm Post subject: VB Net script to CE Lua syntax environment |
|
|
Hi there, I try to translate my old VB Net script to CE Lua in learning purpose.
See here: https://youtu.be/7PVseh6-MyU
I face some problem to translate that VB Net script syntax to Lua syntax scripts environment. I need some references or examples.
How to:
1. State array as an object
Code: | -- VB Net variable
Private brickArray(brickRows, brickColumns) As Rectangle
|
2. State variable as booelan
Code: | private isBrickEnabled(brickRows, brickColumns) As Boolean |
3. Drawing
Code: | Private gamePaddle As Rectangle = New Rectangle(300, 434, 72, 10)
-- I try in CE Lua:
gamePaddle = createImage(form)
gamePaddle.setPosition(20,20)
gamePaddle.Canvas.Brush = '0xF0'
gamePadle.Canvas.fillRect(300,434,72,10)
|
But it gives not a similar object size with VB Net did.
4. Create/drawing objects
Code: | For row As Integer = 0 To brickRows
For column As Integer = 0 To brickColumns
If isBrickEnabled(row, column) Then
e.Graphics.FillRectangle(Brushes.Red, brickArray(row, column))
..
..
|
5. Set up and count
Code: | brickArray(row, column) = New Rectangle(xOffset, yOffset, brickWidth, brickHeight)
//
//
For Each brick As Boolean In isBrickEnabled
If brick = True Then Count += 1
Next
|
Thanks in advance
_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL |
|
Back to top |
|
 |
Corroder Grandmaster Cheater Supreme
Reputation: 75
Joined: 10 Apr 2015 Posts: 1668
|
Posted: Tue Jul 09, 2019 10:22 pm Post subject: |
|
|
[SOLVE]
Doesn't matter, I did with:
Code: | for row = 0, brickRows do
for column = 0, brickColumns do
local brick = createImage(gameMain)
brick.Width = brickWidth
brick.Height = brickHeight
brick.Left = 15 + math.floor(gameMain.Width / 6) * (row-1)
brick.Top = 10
brick.Canvas.Brush.Color = math.random(5,65255)
brick.Canvas.fillRect(0,0,brick.Width,brick.Height)
end
end |
Or just create panels as bricks
_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL |
|
Back to top |
|
 |
|
|
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
|
|