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 


VB Net script to CE Lua syntax environment

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1668

PostPosted: Mon Jul 08, 2019 8:07 pm    Post subject: VB Net script to CE Lua syntax environment Reply with quote

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
View user's profile Send private message
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1668

PostPosted: Tue Jul 09, 2019 10:22 pm    Post subject: Reply with quote

[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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting 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