Michael_9 0 Newbie Poster

Me being a master noob and making a triangles color change with a console.

link to program its shwelfClick Here

Public Class main
    Inherits Windows.Forms.Form
    Protected gfx As Drawing.Graphics
    Protected thePoints() As Drawing.Point
    Public Sub New()
        InitializeComponent()
        Console.WriteLine("Form seems to be functioning so far.")
    End Sub
    Private Sub InitializeComponent()
        Me.SuspendLayout()
        '
        'main
        '
        Me.ClientSize = New System.Drawing.Size(640, 400)
        Me.MaximizeBox = False
        Me.MaximumSize = New System.Drawing.Size(1024, 768)
        Me.MinimizeBox = False
        Me.MinimumSize = New System.Drawing.Size(300, 300)
        Me.Name = "main"
        Me.ResumeLayout(False)
        If initializeME() = True Then
            Console.WriteLine("More function done,but hmm smells like a noob.")
        End If
    End Sub
    Function initializeME() As Boolean
        Dim point1, point2, point3 As Drawing.Point
        point1 = New Drawing.Point(100, 0)
        point2 = New Drawing.Point(200, 0)
        point3 = New Drawing.Point(200, 100)
        thePoints = {point1, point2, point3}
        Return True
    End Function
    Private Sub paintme(sender As Object, e As Windows.Forms.PaintEventArgs) Handles Me.Paint

        gfx = e.Graphics

        gfx.Clear(Drawing.Color.CornflowerBlue)

        gfx.DrawPolygon(Drawing.Pens.Azure, thePoints)

        gfx.FillPolygon(polygoncolor(True), thePoints)

    End Sub

    Private Function polygoncolor(Optional change As Boolean = False) As Drawing.Brush

        If change = True Then
            Dim wutcolor As String
            ''Discarded variable
            ''Dim brush As Drawing.Brush
            ''now do a barrel roll
            Console.WriteLine("Choose, red, green or blue.")
            wutcolor = Console.ReadLine()

            If wutcolor = "red" Then
                Return New Drawing.SolidBrush(Drawing.Color.Red)
            ElseIf wutcolor = "blue" Then
                Return New Drawing.SolidBrush(Drawing.Color.Blue)
            ElseIf wutcolor = "green" Then
                Return New Drawing.SolidBrush(Drawing.Color.Green)
            End If

        End If

        Return Drawing.Brushes.Azure
    End Function
End Class



Imports LuaInterface
Module Module1
    Private lua As New Lua
    Private cmd As String
    Private opstring As String
    Const running As String = ""
    Public Sub runLine(value As Object)
        Console.WriteLine(value)
    End Sub

    Public Sub runReadLine(value As Object)
        value = Console.ReadLine()
    End Sub
    Private Function initialize() As Boolean
        Console.Title = "Digital Console"
        lua.RegisterFunction("writeL", Environment.CurrentManagedThreadId, GetType(Module1).GetMethod("runLine"))
        lua.RegisterFunction("readL", Environment.CurrentManagedThreadId, GetType(Module1).GetMethod("runReadLine"))
        '' lua("cmd") = cmd
        lua("opstring") = opstring

        Try
            lua.DoFile("scriptwrite.lua")
        Catch luaex As LuaException
            Throw New LuaException("File is corrupt,missing and or edited!")
        End Try
        Return True
    End Function
    Private Sub luaEX()
        Console.WriteLine("zomg something is wrong!")
    End Sub
    Sub Main()
        initialize()
        Dim form = New main

        Windows.Forms.Application.Run(form)




        While (running = "running")
            Windows.Forms.Application.DoEvents()
        End While
    End Sub

End Module