Jump to content

gPro, New Programming Language


gsglive
 Share

Recommended Posts

This language is awesome!!!

- gsglive

what does the exe do? Delete my disk? Can you please post the source?

WARNING: I ran it in a virtual machine. The code restarts itself in an endless loop!!! I have not yet done any further investigation of the real programs functionality!

Edited by /dev/null

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

what does the exe do? Delete my disk? Can you please post the source?

WARNING: I ran it in a virtual machine. The code restarts itself in an endless loop!!! I have not yet done any further investigation of the real programs functionality!

His Source Code: Note - I didnt read over it

#include <GUIConstants.au3>
#include <GUIDefaultConstants.au3>
#include <WindowsConstants.au3>

Call ("gProBasic")
Func gProBasic ()
Global $Form1 = GUICreate("gPro", @DesktopWidth, @DesktopHeight, 0, 0)
Global $gProGroup1 = GUICtrlCreateGroup("gPro Central", 210, 85, 492, 468, 0)
Global $Execute = GUICtrlCreateButton("Execute", 600, 524, 97, 25, 0,0 + 40)
Global $cLine = GUICtrlCreateInput("about", 216, 524, 369, 21)
Global $txt = GUICtrlCreateEdit("", 216, 104, 480, 420, $ES_READONLY + $WS_VSCROLL + 40)
Global $font = "courier new"
Global $textline = ("> Welcome to the gsglive command line!")
GUICtrlSetFont(-1, 9, 400, 4, $font)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlSetColor(-1, 0x7FFF00)
GUICtrlSetData($txt, $textline & @CRLF)
GUISetState(@SW_SHOW)
GUISetState($Execute, $GUI_DEFBUTTON)
While 1
    $msg = GuiGetMsg()
    Select
        Case _IsPressed("1B")
            Exit
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $Execute
            $cLineRead = GuiCtrlRead($cLine)
            $stringmid = StringMid($cLineRead, 0)
            If $stringmid > 200 Then
                _ConsoleWrite("ERROR! Cannot parse command.")
                ExitLoop
            EndIf
            Global $string = StringSplit($cLineRead, Chr(44))
            If $string[0] > 0 Then
                $string[1] = _TrimSpaces($string[1])
            EndIf
            If $string[0] > 1 Then
                $string[2] = _TrimSpaces($string[2])
            EndIf
            If $string[0] > 2 Then
                $string[3] = _TrimSpaces($string[3])
            EndIf
            If $string[0] > 3 Then
                $string[4] = _TrimSpaces($string[4])
            EndIf
            Switch $string[1]
                Case StringLower("echo")
                    _ConsoleWrite($string[2])
                    GuiCtrlSetData($cLine,"","")
                Case StringLower("clear")
                    Global $lastline = ""
                    Global $textline = ""
                    GUICtrlSetData($txt,"","")
                    GuiCtrlSetData($cLine,"","")
                Case StringLower("popup")
                    MsgBox(0, $string[2], $string[3])
                    _ConsoleWrite("--------------------------------")
                    _ConsoleWrite("<Popup Executed>")
                    _ConsoleWrite("--------------------------------")
                    GuiCtrlSetData($cLine,"","")
                Case StringLower("exit")
                    Exit
                Case StringLower("Run")
                    If $string[0] = 2 Then
                        If $stringsplitforrun = StringSplit($string[2], "@Dir") Then
                            Run (@ScriptDir & "\" & $stringsplitforrun[2])
                        Else
                            Run ($string[2]
                        EndIf
                    Else
                        _ConsoleWrite("ERROR! Cannot parse command.")
                        GUICtrlSetData($cLine, "", "")
                    EndIf
                Case StringLower("popup+")
                    If $string[0] = 4 Then
                        MsgBox($string[2], $string[3], $string[4])
                        _ConsoleWrite("--------------------------------")
                        _ConsoleWrite("<Popup+ Executed>")
                        _ConsoleWrite("--------------------------------")
                    Else
                        _ConsoleWrite("ERROR! Cannot parse command.")
                    EndIf
                    GUICtrlSetData($cLine, "", "")
                Case StringLower("program")
                    If $string[0] = 2 Then
                        Switch $string[2]
                            Case StringLower("Au3")
                                _ConsoleWrite("--------------------------------")
                                _ConsoleWrite("ERROR. Cannot find AutoIt3 Installed on Computer!!!")
                                _ConsoleWrite("--------------------------------")
                            Case StringLower("gPro")
                                _ConsoleWrite("--------------------------------")
                                _ConsoleWrite("ERROR. Already Running gPro!")
                                _ConsoleWrite("--------------------------------")
                        EndSwitch
                    Else
                        _ConsoleWrite("--------------------------------")
                        _ConsoleWrite("<ERROR. String Incomplete>")
                        _ConsoleWrite("--------------------------------")
                    EndIf
                    GUICtrlSetData($cLine, "", "")
                Case StringLower("input popup")
                    If $string[0] = 3 Then
                        $input = InputBox($string[2], $string[3])
                        _ConsoleWrite("--------------------------------")
                        _ConsoleWrite("<Input Popup Executed>")
                        _ConsoleWrite("--------------------------------")
                        _ConsoleWrite("<User Wrote: " & $input & ">")
                        _ConsoleWrite("--------------------------------")
                    ElseIf $string[0] = 4 Then
                        If $string[4] = 0 Then
                            $input = InputBox($string[2], $string[3])
                            _ConsoleWrite("--------------------------------")
                            _ConsoleWrite("<Input Popup Executed>")
                            _ConsoleWrite("--------------------------------")
                            _ConsoleWrite("<User Wrote: " & $input & ">")
                            _ConsoleWrite("--------------------------------")
                        ElseIf $string[4] = 1 Then
                            $input = InputBox($string[2], $string[3], "", "*")
                            _ConsoleWrite("--------------------------------")
                            _ConsoleWrite("<Input Popup Executed>")
                            _ConsoleWrite("--------------------------------")
                            _ConsoleWrite("<User Wrote: " & $input & ">")
                            _ConsoleWrite("--------------------------------")
                        Else
                            _ConsoleWrite("--------------------------------")
                            _ConsoleWrite("<ERROR. String Incomplete>")
                            _ConsoleWrite("--------------------------------")
                        EndIf
                    Else
                        _ConsoleWrite("--------------------------------")
                        _ConsoleWrite("<ERROR. String Incomplete>")
                        _ConsoleWrite("--------------------------------")
                    EndIf
                    GUICtrlSetData($cLine, "", "")
                Case StringLower("inputpopup")
                    If $string[0] = 3 Then
                        $input = InputBox($string[2], $string[3])
                        _ConsoleWrite("--------------------------------")
                        _ConsoleWrite("<Input Popup Executed>")
                        _ConsoleWrite("--------------------------------")
                        _ConsoleWrite("<User Wrote: " & $input & ">")
                        _ConsoleWrite("--------------------------------")
                    ElseIf $string[0] = 4 Then
                        If $string[4] = 0 Then
                            $input = InputBox($string[2], $string[3])
                            _ConsoleWrite("--------------------------------")
                            _ConsoleWrite("<Input Popup Executed>")
                            _ConsoleWrite("--------------------------------")
                            _ConsoleWrite("<User Wrote: " & $input & ">")
                            _ConsoleWrite("--------------------------------")
                        ElseIf $string[4] = 1 Then
                            $input = InputBox($string[2], $string[3], "", "*")
                            _ConsoleWrite("--------------------------------")
                            _ConsoleWrite("<Input Popup Executed>")
                            _ConsoleWrite("--------------------------------")
                            _ConsoleWrite("<User Wrote: " & $input & ">")
                            _ConsoleWrite("--------------------------------")
                        Else
                            _ConsoleWrite("--------------------------------")
                            _ConsoleWrite("<ERROR. String Incomplete>")
                            _ConsoleWrite("--------------------------------")
                        EndIf
                    Else
                        _ConsoleWrite("--------------------------------")
                        _ConsoleWrite("<ERROR. String Incomplete>")
                        _ConsoleWrite("--------------------------------")
                    EndIf
                    GUICtrlSetData($cLine, "", "")
                Case "computer"
                _ConsoleWrite("> Your username is: " & @Username)
                _ConsoleWrite("> Your computer name is: " & @ComputerName)
                _ConsoleWrite("> Your Operating System is: " & @OSVersion)
                _ConsoleWrite("> Service Pack is: " & @OSServicePack)
                _ConsoleWrite("> OS Build: " & @OSBuild)
                _ConsoleWrite("> Language: " & @OSLang)
                GuiCtrlSetData($cLine, "", "")
            Case "gui"
                $checkline = GUICtrlRead($cLine)
                If $checkline = ">gui" Then
                    _ConsoleWrite("> You have not specified width and height to create a GUI.")
                Else
                _ConsoleWrite("> Creating GUI")
                Sleep(1000)
                _NewGUI()
                EndIf
                GuiCtrlSetData($cLine, "", "")
            Case "title"
                WinSetTitle($gui, "", $string[2])
                GuiCtrlSetData($cLine, "", "")
                GuiCtrlSetData($cLine, "", "")
            Case "color"
                If $string[0] = 2 Then
                    Switch $string[2]
                        Case "green"
                            GUICtrlSetBkColor($txt, 0xaaffbb)
                            GuiCtrlSetData($cLine, "", "")
                        Case "white"
                            GUICtrlSetBkColor($txt, 0xffffff)
                            GuiCtrlSetData($cLine, "", "")
                        Case "blue"
                            GUICtrlSetBkColor($txt, 0x00ffff)
                            GuiCtrlSetData($cLine, "", "")
                        Case "rose"
                            GUICtrlSetBkColor($txt, 0xddacaa)
                            GuiCtrlSetData($cLine, "", "")
                        Case "pink"
                            GUICtrlSetBkColor($txt, 0xddacee)
                            GuiCtrlSetData($cLine, "", "")
                        Case "black"
                            GUICtrlSetBkColor($txt, 0x000000)
                            GuiCtrlSetData($cLine, "", "")
                        Case Else
                            _ConsoleWrite("--------------------------------")
                            _ConsoleWrite("<ERROR. String Incomplete>")
                            _ConsoleWrite("--------------------------------")
                    EndSwitch
                Else
                    _ConsoleWrite("--------------------------------")
                    _ConsoleWrite("<ERROR. String Incomplete>")
                    _ConsoleWrite("--------------------------------")
                EndIf
                GuiCtrlSetData($cLine, "", "")
            Case "cd"
                If $string[0] = 2 Then
                    Switch $string[2]
                        Case "cd open"
                            $drive = DriveGetDrive("CDROM")
                            CDTray($drive, "open")
                            _ConsoleWrite("CD Tray Opened")
                            GuiCtrlSetData($cLine, "", "")
                        Case "cd close"
                            CDTray("H:\", "closed")
                            _ConsoleWrite("CD Tray Closed")
                            GuiCtrlSetData($cLine, "", "")
                        Case Else
                            _ConsoleWrite("--------------------------------")
                            _ConsoleWrite("<ERROR. String Incomplete>")
                            _ConsoleWrite("--------------------------------")
                    EndSwitch
                Else
                    _ConsoleWrite("--------------------------------")
                    _ConsoleWrite("<ERROR. String Incomplete>")
                    _ConsoleWrite("--------------------------------")
                EndIf
                GuiCtrlSetData($cLine, "", "")
            Case StringLower("help")
                Switch $string[2]
                    Case StringLower("popup")
                        _ConsoleWrite("--------------------------------")
                        _ConsoleWrite("> Syntax: popup, <title>, <text>")
                        _ConsoleWrite("> Shows a little popup window")
                        _ConsoleWrite("> Remarks: none")
                        _ConsoleWrite("--------------------------------")
                    Case StringLower("echo")
                        _ConsoleWrite("--------------------------------")
                        _ConsoleWrite("> Syntax: echo, <text>")
                        _ConsoleWrite("> Places text in this control")
                        _ConsoleWrite("> Remarks: none")
                        _ConsoleWrite("--------------------------------")
                    Case StringLower("clear")
                        _ConsoleWrite("--------------------------------")
                        _ConsoleWrite("> Syntax: clear")
                        _ConsoleWrite("> Clears all text")
                        _ConsoleWrite("> Remarks: none")
                        _ConsoleWrite("--------------------------------")
                    Case "computer"
                        _ConsoleWrite("> Syntax: computer")
                        _ConsoleWrite("> Shows the computer information")
                        _ConsoleWrite("> Remarks: none")
                        GuiCtrlSetData($cLine, "", "")
                    Case "exit"
                        _ConsoleWrite("> Syntax: exit")
                        _ConsoleWrite("> Closes the command window")
                        _ConsoleWrite("> Remarks: none")
                        GuiCtrlSetData($cLine, "", "")
                    Case "beep"
                        _ConsoleWrite("> Syntax: beep {Frequency, Duration}")
                        _ConsoleWrite("> Plays back a beep to the user")
                        _ConsoleWrite("> Remarks: Requires numbers e.g. beep, 500, 1000")
                        GuiCtrlSetData($cLine, "", "")
                    Case "color"
                        _ConsoleWrite("> Syntax: color {rose, black, white, green, blue}")
                        _ConsoleWrite("> Changes the background colour")
                        _ConsoleWrite("> Remarks: Select one color e.g. color green")
                        GuiCtrlSetData($cLine, "", "")
                    Case "cd"
                        _ConsoleWrite("> Syntax: cd {open,close}")
                    Case "?"
                        _ConsoleWrite("> Syntax: help {command in which you need help}")
                        _ConsoleWrite("> Shows the help information and example. Commands are, help {color, exit, clear, popup, echo, beep}")
                        _ConsoleWrite("> Remarks: Shows help info e.g exit")
                        GuiCtrlSetData($cLine, "", "")
                    Case "title"
                        _ConsoleWrite("> Syntax: title {new title}")
                        _ConsoleWrite("> Changes the window title")
                        _ConsoleWrite("> Remarks: Example; title, James Brooks Programming Command Line")
                        GuiCtrlSetData($cLine, "", "")
                    Case "gui"
                        _ConsoleWrite("> Syntax: gui {width, height}")
                        _ConsoleWrite("> Creates a GUI")
                        _ConsoleWrite("> Remarks: A random GUI.")
                        GuiCtrlSetData($cLine, "", "")
                    Case ""
                        _ConsoleWrite("You forgot to add a command")
                        GuiCtrlSetData($cLine, "", "")
                    Case "gui"
                        _ConsoleWrite("You haven't added any values to the width and height.")
                        _ConsoleWrite("Example: gui, 400, 500")
                        GuiCtrlSetData($cLine, "", "")
                EndSwitch
                GuiCtrlSetData($cLine, "", "")
                Case StringLower("about")
                    _ConsoleWrite("--------------------------------")
                    _ConsoleWrite("> gPro")
                    _ConsoleWrite("> gPro Was Created With AutoIt3 and SciTe4AutoIt3")
                    _ConsoleWrite("> This language is licensed to: " & @UserName)
                    _ConsoleWrite("--------------------------------")
                    GuiCtrlSetData($cLine, "", "")
                Case Else
                    _ConsoleWrite("Error with syntax: " & $string[1])
                    _ConsoleWrite("Use help, <command> to find help!")
                    GuiCtrlSetData($cLine, "", "")
            EndSwitch
        Case _IsPressed("5A")
            GUICtrlSetData($txt, "> Welcome to the gsglive command line!")
    EndSelect
Wend
Call ("gProBasic")
EndFunc
Func _ConsoleWrite($text)
    Global $textline = ($textline & $text & @CRLF)
   GUICtrlSetData($txt, $textline, GUICtrlRead($txt))
EndFunc
Func _TrimSpaces(ByRef $parameter)
   Local $string
   $string = StringSplit($parameter, "")
   If $string[0] > 0 Then
    If $string[1] = Chr(32) Then
        $string = StringtrimLeft($parameter, 1)
        Return $string
    Else
        Return $parameter
    EndIf
   EndIf
EndFunc
Func _NewGUI()
Global $nGUI = GuiCreate("New GUI", $string[2], $string[3], -1, -1)
GuiSetState(@SW_SHOW)
While WinActive($nGUI)
    $gMsg = GuiGetMsg()
    Switch $gMsg
    Case $GUI_EVENT_CLOSE
        GUIDelete($nGUI)
    EndSwitch
WEnd
EndFunc
Edited by ReaImDown
[u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u]
Link to comment
Share on other sites

Well not useful, but good work in general i guess.

Note: If you want to exit it just type HELp and error will occure lol.

:rolleyes: i noticed that

the error is something about $string[2]

Link to comment
Share on other sites

This, my friend, is _not_ a programming language. You are far, far from it. This is automating an automation scripts language. I think it's pointless.

not even autoit is a programming language , it's a scripting language that means that is not a real programming language, its an automation of a programming languag

anyway your script is good but you should work it a little more fixing the problems and then post it

Link to comment
Share on other sites

not even autoit is a programming language , it's a scripting language that means that is not a real programming language, its an automation of a programming languag

I challenge you to back that up.

This is the first line from Wikipedia's Scripting Languages article.

Scripting languages (commonly called scripting programming languages or script languages) are computer programming languages that are typically interpreted and can be typed directly from a keyboard.

Link to comment
Share on other sites

I would considered Autoit a more user friendly version of c++ or whatever the backbone is.

it is basically the same thing code wise except for the fact that we call functions ie msgbox, splashtext, ect instead of actually writing the code every time for them. There's virtually nothing you can't do in autoit if you know what you're doing lol.

Link to comment
Share on other sites

SleepyXtreme, you are not right. Or at least, not fully right.

Yes, you can do a lot of things with autoit, but also, there are a lot of things you CAN'T do, or at least not with enough efficiency.

I mean mathematical calculations and other similar things.

I am currently working on l-system fractal generator, and calculating 10 iterations of one specific l-system takes 30 seconds in autoit script and 3 seconds with FreeBasic compiled executable.

This is a general problem of the interpreted languages - they are not real programming languages, because they are translated to machine code at runtime.

And this is why they can be slow in time-critical applications.

But let's not start another endless dispute.

In my previous post, my point was that it is pointless to create scripting language with another scripting language. This makes the scripts two times slower - one for interpreting to autoit code, and one for interpreting the interpreted autoit code...

Simply, this is not efficient enough.

There is no need to reinvent the wheel...

Edited by lokster
Link to comment
Share on other sites

SleepyXtreme, you are not right. Or at least, not fully right.

Yes, you can do a lot of things with autoit, but also, there are a lot of things you CAN'T do, or at least not with enough efficiency.

I mean mathematical calculations and other similar things.

I am currently working on l-system fractal generator, and calculating 10 iterations of one specific l-system takes 30 seconds in autoit script and 3 seconds with FreeBasic compiled executable.

This is a general problem of the interpreted languages - they are not real programming languages, because they are translated to machine code at runtime.

And this is why they can be slow in time-critical applications.

But let's not start another endless dispute.

In my previous post, my point was that it is pointless to create scripting language with another scripting language. This makes the scripts two times slower - one for interpreting to autoit code, and one for interpreting the interpreted autoit code...

Simply, this is not efficient enough.

There is no need to reinvent the wheel...

hah, you do pose a good point lol

[u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u]
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...