box name fixed

box name fixed

Global $LOADER_EXEC = 'ClashVIPLoader.exe'
Global $CLASHBOT_PATH = 'C:\CLASH_BOT\'
Global $CLASHBOT_EXEC = 'ClashBot.exe'

Global $CLASBOT_WINDOW = 'ClashBot C# 7'
Global $CLASBOT_WINDOW_BTN_LOGIN = '[NAME:btnLogin]'
Global $CLASBOT_WINDOW_TOGGLE_START = '[NAME:btnStart]'
Global $CLASBOT_WINDOW_BTN_PAUSE = '[NAME:btnPauseBot]'
Global $CLASBOT_WINDOW_TOGGLE_HIDE = '[NAME:btnHideShowBlueStacks]'

Global $CLASBOT_WINDOW_LOG = '[NAME:logBox]'

Global $CLASBOT_CONFIRM_WINDOW = '[CLASS:#32770]'
Global $CLASBOT_CONFIRM_BTN_DONE = '[CLASS:Button; INSTANCE:1]'

Global $LOADER_WINDOW = 'ClashVIPLoader'
Global $LOADER_WINDOW_BTN_LAUNCH = '[CLASS:TButton; INSTANCE:1]'

Global $LOADER_EXEC = 'ClashVIPLoader.exe'
Global $CLASHBOT_PATH = 'C:\CLASH_BOT\'
Global $CLASHBOT_EXEC = 'ClashBot.exe'

Global $CLASBOT_WINDOW = 'ClashBot C# 7'
Global $CLASBOT_WINDOW_BTN_LOGIN = '[NAME:btnLogin]'
Global $CLASBOT_WINDOW_TOGGLE_START = '[NAME:btnStart]'
Global $CLASBOT_WINDOW_BTN_PAUSE = '[NAME:btnPauseBot]'
Global $CLASBOT_WINDOW_TOGGLE_HIDE = '[NAME:btnHideShowBlueStacks]'

Global $CLASBOT_WINDOW_LOG = '[CLASS:WindowsForms10.RichEdit20W.app.0.31d2b0c_r12_ad1; INSTANCE:1]'

Global $CLASBOT_CONFIRM_WINDOW = '[CLASS:#32770]'
Global $CLASBOT_CONFIRM_BTN_DONE = '[CLASS:Button; INSTANCE:1]'

Global $LOADER_WINDOW = 'ClashVIPLoader'
Global $LOADER_WINDOW_BTN_LAUNCH = '[CLASS:TButton; INSTANCE:1]'


Update Angulos.au3

Update Angulos.au3

; http://www.brasilescola.com/matematica/secante-cosecante-cotangente.htm
; http://eduardo-vasconcelos.blogspot.com.br/2012/01/trigonometria-05-funcao-secante.html
#include <Array.au3>
#include <Misc.au3>
#include <GDIPlus.au3>
#include <GUIConstantsEx.au3>
#include <GuiComboBoxEx.au3>

; #SCRIPT# =====================================================================================================================
; Name ..........: Angulos
; Description ...: Um script que demonstra visualmente onde como é representado os componentes de um ângulo (sen, cos, tan...)
; Author ........: Luigi (Luismar Chechelaky)
; Link ..........: https://github.com/chechelaky/AutoIt/blob/master/Diversos/Angulos.au3
; ===============================================================================================================================

Global $hGui, $hMsg, $active = True
Global $hGraphic, $hPen, $hPen2, $hBitmap, $hBackbuffer, $width = 350, $height = 300, $hCursor, $mouse[4], $xx2, $yy2

Global $mapa[10][10]
Global $largura = 800, $altura = 600, $limites[6]

Global Const $PI = 3.1415926535897932384626433832795
Global Const $radToDeg = 180 / $PI

$hGui = GUICreate('Ângulos', $largura, $altura)
Global $hSeno = GUICtrlCreateCheckbox('Seno', 10, 5, 80, 20)
Global $hCos = GUICtrlCreateCheckbox('Cosseno', 10, 25, 80, 20)
Global $hTan = GUICtrlCreateCheckbox('Tangente', 100, 5, 80, 20)
Global $hCot = GUICtrlCreateCheckbox('Cotangente', 100, 25, 80, 20)
Global $hSec = GUICtrlCreateCheckbox('Secante', 190, 5, 80, 20)
Global $hPasso = GUICtrlCreateCombo('', 280, 5, 80, 20, $CBS_DROPDOWNLIST)
Global $hInvertido = GUICtrlCreateCheckbox('Inverso', 370, 5, 80, 20)
GUICtrlSetData($hPasso, 'Livre|1|5|10|15|30', 'Livre')

Global $iSeno = 0, $iCos = 0, $iTan = 0, $iCot = 0, $iSec = 0, $iInverso = 0
GUISetState(@SW_SHOWNORMAL)

_GDIPlus_Startup()
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGui)
$hBitmap = _GDIPlus_BitmapCreateFromGraphics($largura - 20, $altura - 60, $hGraphic)

_limites()

Func _limites()
	$limites[0] = 10
	$limites[1] = 50
	$limites[2] = $largura - 20
	$limites[3] = $altura - 50
	$limites[4] = ($largura - 20) / 2
	$limites[5] = ($altura - 50) / 2
	;_ArrayDisplay($limites)
EndFunc   ;==>_limites
$hBackbuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)

$hPen = _GDIPlus_PenCreate()
$hPen2 = _GDIPlus_PenCreate(0xFFFF0000)
$hPen3 = _GDIPlus_PenCreate(0xFF00FF00)
_GDIPlus_GraphicsClear($hBackbuffer)
_GDIPlus_GraphicsSetSmoothingMode($hBackbuffer, 2)

Global $hBrush_01 = _GDIPlus_BrushCreateSolid(0xFF336699)
Global $hBrush_02 = _GDIPlus_BrushCreateSolid(0xFFFF0000)
Global $hBrush_03 = _GDIPlus_BrushCreateSolid(0xFF00FF00)
Global $hFamily = _GDIPlus_FontFamilyCreate('Courier New')
Global $hFont = _GDIPlus_FontCreate($hFamily, 10)
Global $hPosX = _GDIPlus_RectFCreate(2, 0, 120, 15)
Global $hPosY = _GDIPlus_RectFCreate(2, 20, 120, 15)
Global $hAng = _GDIPlus_RectFCreate(2, 80, 120, 15)
Global $hInv = _GDIPlus_RectFCreate(2, 100, 120, 15)

Global $hPosX1 = _GDIPlus_RectFCreate(2, 40, 120, 15)
Global $hPosY1 = _GDIPlus_RectFCreate(2, 60, 120, 15)
Global $hStringFormat = _GDIPlus_StringFormatCreate()

Global $start = TimerInit()
While 1
	$hMsg = GUIGetMsg()
	Switch $hMsg
		Case $GUI_EVENT_CLOSE
			_exit()
		Case $hSeno
			$iSeno = _Iif($iSeno == 0, 1, 0)
		Case $hCos
			$iCos = _Iif($iCos == 0, 1, 0)
		Case $hTan
			$iTan = _Iif($iTan == 0, 1, 0)
		Case $hCot
			$iCot = _Iif($iCot == 0, 1, 0)
		Case $hSec
			$iSec = _Iif($iSec == 0, 1, 0)
		Case $hInvertido
			$iInverso = _Iif($iInverso == 0, 1, 0)
	EndSwitch

	$hCursor = GUIGetCursorInfo()
	If Not $hCursor Then
		$mouse[0] = $hCursor[0] - $limites[0]
		$mouse[1] = $hCursor[1] - $limites[1]
	EndIf

	If WinActive($hGui) Then
		If Not $active Then $active = True
		If TimerDiff($start) >= 10 Then
			_update()
			$start = TimerInit()
		EndIf
	ElseIf Not WinActive($hGui) And $active Then
		$active = False
	EndIf
WEnd

Func _update()
	_GDIPlus_GraphicsClear($hBackbuffer, 0xF0FFFFFF)
	;_GDIPlus_StringFormatSetAlign($hStringFormat, 1)
	_GDIPlus_GraphicsDrawStringEx($hBackbuffer, 'x[' & $mouse[0] & ']', $hFont, $hPosX, $hStringFormat, $hBrush_01)
	_GDIPlus_GraphicsDrawStringEx($hBackbuffer, 'y[' & $mouse[1] & ']', $hFont, $hPosY, $hStringFormat, $hBrush_01)
	_GDIPlus_GraphicsDrawStringEx($hBackbuffer, 'x[' & $mouse[0] - 389 & ']', $hFont, $hPosX1, $hStringFormat, $hBrush_02)
	_GDIPlus_GraphicsDrawStringEx($hBackbuffer, 'y[' & - ($mouse[1] - 270) & ']', $hFont, $hPosY1, $hStringFormat, $hBrush_02)
	$ang = _ang(0, 0, $mouse[0] - 389, -($mouse[1] - 270))
	_GDIPlus_GraphicsDrawStringEx($hBackbuffer, 'º[' & $ang[0] & ']', $hFont, $hAng, $hStringFormat, $hBrush_02)

	_box($hBackbuffer, 0, 0, $largura - 21, $altura - 61)
	_GDIPlus_GraphicsDrawLine($hBackbuffer, ($largura - 21) / 2, 0, ($largura - 21) / 2, $altura - 60, $hPen)

	_GDIPlus_GraphicsDrawLine($hBackbuffer, 0, ($altura - 60) / 2, $largura - 21, ($altura - 60) / 2, $hPen)
	_GDIPlus_GraphicsDrawEllipse($hBackbuffer, ($largura - 20) / 2 - 200 - 1, ($altura - 60) / 2 - 200, 400, 400)
;~ 	_GDIPlus_GraphicsDrawLine($hBackbuffer, ($largura - 21) / 2, ($altura - 60) / 2, $mouse[0], $mouse[1], $hPen2)
	$cos = Int(200 * Cos(($ang[0] / 180) * $PI))
	$sen = Int(200 * Sin(($ang[0] / 180) * $PI))
	$tan = Int(200 * ($sen / $cos))
	$cot = Int(200 * ($cos / $sen))

	_GDIPlus_GraphicsDrawPie($hBackbuffer, ($largura - 20) / 2 - 1 - 25, ($altura - 60) / 2 - 25, 50, 50, 0, -$ang[0])

	If $iSeno Then
		_GDIPlus_GraphicsDrawLine($hBackbuffer, ($largura - 20) / 2 - 1, ($altura - 60) / 2, 389, 270 - $sen, $hPen2)
		_GDIPlus_GraphicsDrawLine($hBackbuffer, 389 + $cos, 270 - $sen, 389, 270 - $sen, $hPen2)
	EndIf

	If $iCos Then
		_GDIPlus_GraphicsDrawLine($hBackbuffer, ($largura - 20) / 2 - 1, ($altura - 60) / 2, 389 + $cos, 270, $hPen2)
		_GDIPlus_GraphicsDrawLine($hBackbuffer, 389 + $cos, 270 - $sen, 389 + $cos, 270, $hPen2)
	EndIf

	If $iTan Then
		_GDIPlus_GraphicsDrawLine($hBackbuffer, 189, 1, 189, 538, $hPen)
		_GDIPlus_GraphicsDrawLine($hBackbuffer, 589, 1, 589, 538, $hPen)
		If $cos > 0 Then
			_GDIPlus_GraphicsDrawLine($hBackbuffer, 589, 270 - $tan, 589, 270, $hPen2)
			_GDIPlus_GraphicsDrawLine($hBackbuffer, 389 + $cos, 270 - $sen, 589, 270 - $tan, $hPen2)
		Else
			_GDIPlus_GraphicsDrawLine($hBackbuffer, 189, 270 + $tan, 189, 270, $hPen2)
			_GDIPlus_GraphicsDrawLine($hBackbuffer, 389 + $cos, 270 - $sen, 189, 270 + $tan, $hPen2)
		EndIf
	EndIf

	If $iCot Then
		_GDIPlus_GraphicsDrawLine($hBackbuffer, 1, 70, 778, 70, $hPen)
		_GDIPlus_GraphicsDrawLine($hBackbuffer, 1, 470, 778, 470, $hPen)
		If $sen > 0 Then
			_GDIPlus_GraphicsDrawLine($hBackbuffer, ($largura - 20) / 2 - 1, 70, ($largura - 20) / 2 - 1 + $cot, 70, $hPen2)
			_GDIPlus_GraphicsDrawLine($hBackbuffer, 389 + $cos, 270 - $sen, ($largura - 20) / 2 - 1 + $cot, 70, $hPen2)
		Else
			_GDIPlus_GraphicsDrawLine($hBackbuffer, ($largura - 20) / 2 - 1, 470, ($largura - 20) / 2 - 1 - $cot, 470, $hPen2)
			_GDIPlus_GraphicsDrawLine($hBackbuffer, 389 + $cos, 270 - $sen, ($largura - 20) / 2 - 1 - $cot, 470, $hPen2)
		EndIf
	EndIf

	If $iSec Then
		Local $resposta = ''
		Select
			Case $ang[0] == 0 Or $ang[0] = 360
				$resposta = '#1 secante[não existe]'
			Case $ang[0] > 0 And $ang[0] < 90
				$resposta = '#2 secante[' & $ang[0] & '] angulo[' & 90 + $ang[0] & ']'
			Case $ang[0] == 90 Or $ang[0] == 180
				$resposta = '#3 secante[não existe]'
			Case $ang[0] > 90 And $ang[0] < 180
				$resposta = '#4 secante[' & $ang[0] & '] angulo[' & $ang[0] - 90 & ']'
			Case $ang[0] > 180 And $ang[0] < 270
				$resposta = '#5 secante[' & $ang[0] & '] angulo[' & 270 - $ang[0]  & ']'
			Case $ang[0] > 270 And $ang[0] < 360
				$resposta = '#6 secante[' & $ang[0] & '] angulo[' & $ang[0] - 270 & ']'
		EndSelect

		$nn1 = 389 + 0 + 1 / Int(200 * Cos(($ang[0] / 180) * $PI))
		$nn2 = 270 + 0 - $sen

		ConsoleWrite('nn1[' & $nn1 & '] nn2[' & $nn2 & ']' & @LF)
		_GDIPlus_GraphicsDrawLine($hBackbuffer, 389 + $cos, 270 - $sen, $nn1, $nn2, $hPen2)
;~ 		_GDIPlus_GraphicsDrawEllipse($hBackbuffer, ($largura - 20) / 2 - 250 - 1, ($altura - 60) / 2 - 250, 500, 500)
		ConsoleWrite($resposta & @LF)
	EndIf

	If $iInverso Then
		Local $invertido = _Iif($ang[0] > 180, $ang[0] - 180, 180 + $ang[0])
		$invertido = _Iif($invertido = 360, 0, $invertido)
		$invertido = StringFormat('%.2f', $invertido)
		_GDIPlus_GraphicsDrawLine($hBackbuffer, ($largura - 20) / 2 - 1, ($altura - 60) / 2, 389 - $cos, 270 + $sen, $hPen3)
		_GDIPlus_GraphicsDrawStringEx($hBackbuffer, 'º[' & $invertido & ']', $hFont, $hInv, $hStringFormat, $hBrush_03)
	EndIf
	_GDIPlus_GraphicsDrawLine($hBackbuffer, ($largura - 20) / 2 - 1, ($altura - 60) / 2, 389 + $cos, 270 - $sen, $hPen2)

	_GDIPlus_GraphicsDrawImageRect($hGraphic, $hBitmap, 10, 50, $largura - 20, $altura - 60)
EndFunc   ;==>_update

Func _exit()
	_GDIPlus_BrushDispose($hBrush_01)
	_GDIPlus_BrushDispose($hBrush_02)
	_GDIPlus_BrushDispose($hBrush_03)
	_GDIPlus_FontFamilyDispose($hFamily)
	_GDIPlus_FontDispose($hFont)
	_GDIPlus_StringFormatDispose($hStringFormat)

	_GDIPlus_GraphicsDispose($hBackbuffer)
	_GDIPlus_BitmapDispose($hBitmap)
	_GDIPlus_PenDispose($hPen)
	_GDIPlus_PenDispose($hPen2)
	_GDIPlus_PenDispose($hPen3)
	_GDIPlus_GraphicsDispose($hGraphic)
	_GDIPlus_Shutdown()
	Exit
EndFunc   ;==>_exit

Func _box($hToGraphic, $ix1, $iy1, $il, $ia)
	Local $aBox[5][2]
	$aBox[0][0] = 4
	$aBox[1][0] = $ix1
	$aBox[1][1] = $iy1
	$aBox[2][0] = $ix1 + $il
	$aBox[2][1] = $iy1
	$aBox[3][0] = $ix1 + $il
	$aBox[3][1] = $iy1 + $ia
	$aBox[4][0] = $ix1
	$aBox[4][1] = $iy1 + $ia
	_GDIPlus_GraphicsDrawPolygon($hToGraphic, $aBox)
EndFunc   ;==>_box

Func _ang($xx1, $yy1, $xx2, $yy2)
	Local $arr[2], $ca = Abs($yy2 - $yy1), $co = Abs($xx2 - $xx1)
	Select
		Case $xx1 > $xx2
			Select
				Case $yy1 < $yy2
					$arr[0] = ATan(($co) / ($ca)) * $radToDeg + 90
				Case $yy1 == $yy2
					$arr[0] = 180
				Case $yy1 > $yy2
					$arr[0] = 270 - ATan(($co) / ($ca)) * $radToDeg
			EndSelect
		Case $xx1 == $xx2
			Select
				Case $yy1 < $yy2
					$arr[0] = 90
				Case $yy1 == $yy2
					$arr[0] = 0
				Case $yy1 > $yy2
					$arr[0] = 270
			EndSelect
		Case $xx1 < $xx2
			Select
				Case $yy1 < $yy2
					$arr[0] = 90 - ATan(($co) / ($ca)) * $radToDeg
				Case $yy1 == $yy2
					$arr[0] = 0
				Case $yy1 > $yy2
					$arr[0] = ATan(($co) / ($ca)) * $radToDeg + 270
					;$arr[0] = 270 - ATan(($co) / ($ca)) * $radToDeg
			EndSelect
	EndSelect
	$arr[0] = StringFormat('%.2f', $arr[0])
	$arr[1] = Sqrt($co ^ 2 + $ca ^ 2)
	Return $arr
EndFunc   ;==>_ang

Func _Iif($aa, $bb, $cc)
	If $aa Then Return $bb
	Return $cc
EndFunc

; http://www.brasilescola.com/matematica/secante-cosecante-cotangente.htm
; http://eduardo-vasconcelos.blogspot.com.br/2012/01/trigonometria-05-funcao-secante.html
#include <Array.au3>
#include <Misc.au3>
#include <GDIPlus.au3>
#include <GUIConstantsEx.au3>
#include <GuiComboBoxEx.au3>

; #SCRIPT# =====================================================================================================================
; Name ..........: Angulos
; Description ...: Um script que demonstra visualmente onde como é representado os componentes de um ângulo (sen, cos, tan...)
; Author ........: Luigi (Luismar Chechelaky)
; Link ..........:
; ===============================================================================================================================

Global $hGui, $hMsg, $active = True
Global $hGraphic, $hPen, $hPen2, $hBitmap, $hBackbuffer, $width = 350, $height = 300, $hCursor, $mouse[4], $xx2, $yy2

Global $mapa[10][10]
Global $largura = 800, $altura = 600, $limites[6]

Global Const $PI = 3.1415926535897932384626433832795
Global Const $radToDeg = 180 / $PI

$hGui = GUICreate('Ângulos', $largura, $altura)
Global $hSeno = GUICtrlCreateCheckbox('Seno', 10, 5, 80, 20)
Global $hCos = GUICtrlCreateCheckbox('Cosseno', 10, 25, 80, 20)
Global $hTan = GUICtrlCreateCheckbox('Tangente', 100, 5, 80, 20)
Global $hCot = GUICtrlCreateCheckbox('Cotangente', 100, 25, 80, 20)
Global $hSec = GUICtrlCreateCheckbox('Secante', 190, 5, 80, 20)
Global $hPasso = GUICtrlCreateCombo('', 280, 5, 80, 20, $CBS_DROPDOWNLIST)
Global $hInvertido = GUICtrlCreateCheckbox('Inverso', 370, 5, 80, 20)
GUICtrlSetData($hPasso, 'Livre|1|5|10|15|30', 'Livre')

Global $iSeno = 0, $iCos = 0, $iTan = 0, $iCot = 0, $iSec = 0, $iInverso = 0
GUISetState(@SW_SHOWNORMAL)

_GDIPlus_Startup()
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGui)
$hBitmap = _GDIPlus_BitmapCreateFromGraphics($largura - 20, $altura - 60, $hGraphic)

_limites()

Func _limites()
	$limites[0] = 10
	$limites[1] = 50
	$limites[2] = $largura - 20
	$limites[3] = $altura - 50
	$limites[4] = ($largura - 20) / 2
	$limites[5] = ($altura - 50) / 2
	;_ArrayDisplay($limites)
EndFunc   ;==>_limites
$hBackbuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)

$hPen = _GDIPlus_PenCreate()
$hPen2 = _GDIPlus_PenCreate(0xFFFF0000)
$hPen3 = _GDIPlus_PenCreate(0xFF00FF00)
_GDIPlus_GraphicsClear($hBackbuffer)
_GDIPlus_GraphicsSetSmoothingMode($hBackbuffer, 2)

Global $hBrush_01 = _GDIPlus_BrushCreateSolid(0xFF336699)
Global $hBrush_02 = _GDIPlus_BrushCreateSolid(0xFFFF0000)
Global $hBrush_03 = _GDIPlus_BrushCreateSolid(0xFF00FF00)
Global $hFamily = _GDIPlus_FontFamilyCreate('Courier New')
Global $hFont = _GDIPlus_FontCreate($hFamily, 10)
Global $hPosX = _GDIPlus_RectFCreate(2, 0, 120, 15)
Global $hPosY = _GDIPlus_RectFCreate(2, 20, 120, 15)
Global $hAng = _GDIPlus_RectFCreate(2, 80, 120, 15)
Global $hInv = _GDIPlus_RectFCreate(2, 100, 120, 15)

Global $hPosX1 = _GDIPlus_RectFCreate(2, 40, 120, 15)
Global $hPosY1 = _GDIPlus_RectFCreate(2, 60, 120, 15)
Global $hStringFormat = _GDIPlus_StringFormatCreate()

Global $start = TimerInit()
While 1
	$hMsg = GUIGetMsg()
	Switch $hMsg
		Case $GUI_EVENT_CLOSE
			_exit()
		Case $hSeno
			$iSeno = _Iif($iSeno == 0, 1, 0)
		Case $hCos
			$iCos = _Iif($iCos == 0, 1, 0)
		Case $hTan
			$iTan = _Iif($iTan == 0, 1, 0)
		Case $hCot
			$iCot = _Iif($iCot == 0, 1, 0)
		Case $hSec
			$iSec = _Iif($iSec == 0, 1, 0)
		Case $hInvertido
			$iInverso = _Iif($iInverso == 0, 1, 0)
	EndSwitch

	$hCursor = GUIGetCursorInfo()
	If Not $hCursor Then
		$mouse[0] = $hCursor[0] - $limites[0]
		$mouse[1] = $hCursor[1] - $limites[1]
	EndIf

	If WinActive($hGui) Then
		If Not $active Then $active = True
		If TimerDiff($start) >= 10 Then
			_update()
			$start = TimerInit()
		EndIf
	ElseIf Not WinActive($hGui) And $active Then
		$active = False
	EndIf
WEnd

Func _update()
	_GDIPlus_GraphicsClear($hBackbuffer, 0xF0FFFFFF)
	;_GDIPlus_StringFormatSetAlign($hStringFormat, 1)
	_GDIPlus_GraphicsDrawStringEx($hBackbuffer, 'x[' & $mouse[0] & ']', $hFont, $hPosX, $hStringFormat, $hBrush_01)
	_GDIPlus_GraphicsDrawStringEx($hBackbuffer, 'y[' & $mouse[1] & ']', $hFont, $hPosY, $hStringFormat, $hBrush_01)
	_GDIPlus_GraphicsDrawStringEx($hBackbuffer, 'x[' & $mouse[0] - 389 & ']', $hFont, $hPosX1, $hStringFormat, $hBrush_02)
	_GDIPlus_GraphicsDrawStringEx($hBackbuffer, 'y[' & - ($mouse[1] - 270) & ']', $hFont, $hPosY1, $hStringFormat, $hBrush_02)
	$ang = _ang(0, 0, $mouse[0] - 389, -($mouse[1] - 270))
	_GDIPlus_GraphicsDrawStringEx($hBackbuffer, 'º[' & $ang[0] & ']', $hFont, $hAng, $hStringFormat, $hBrush_02)

	_box($hBackbuffer, 0, 0, $largura - 21, $altura - 61)
	_GDIPlus_GraphicsDrawLine($hBackbuffer, ($largura - 21) / 2, 0, ($largura - 21) / 2, $altura - 60, $hPen)

	_GDIPlus_GraphicsDrawLine($hBackbuffer, 0, ($altura - 60) / 2, $largura - 21, ($altura - 60) / 2, $hPen)
	_GDIPlus_GraphicsDrawEllipse($hBackbuffer, ($largura - 20) / 2 - 200 - 1, ($altura - 60) / 2 - 200, 400, 400)
;~ 	_GDIPlus_GraphicsDrawLine($hBackbuffer, ($largura - 21) / 2, ($altura - 60) / 2, $mouse[0], $mouse[1], $hPen2)
	$cos = Int(200 * Cos(($ang[0] / 180) * $PI))
	$sen = Int(200 * Sin(($ang[0] / 180) * $PI))
	$tan = Int(200 * ($sen / $cos))
	$cot = Int(200 * ($cos / $sen))

	_GDIPlus_GraphicsDrawPie($hBackbuffer, ($largura - 20) / 2 - 1 - 25, ($altura - 60) / 2 - 25, 50, 50, 0, -$ang[0])

	If $iSeno Then
		_GDIPlus_GraphicsDrawLine($hBackbuffer, ($largura - 20) / 2 - 1, ($altura - 60) / 2, 389, 270 - $sen, $hPen2)
		_GDIPlus_GraphicsDrawLine($hBackbuffer, 389 + $cos, 270 - $sen, 389, 270 - $sen, $hPen2)
	EndIf

	If $iCos Then
		_GDIPlus_GraphicsDrawLine($hBackbuffer, ($largura - 20) / 2 - 1, ($altura - 60) / 2, 389 + $cos, 270, $hPen2)
		_GDIPlus_GraphicsDrawLine($hBackbuffer, 389 + $cos, 270 - $sen, 389 + $cos, 270, $hPen2)
	EndIf

	If $iTan Then
		_GDIPlus_GraphicsDrawLine($hBackbuffer, 189, 1, 189, 538, $hPen)
		_GDIPlus_GraphicsDrawLine($hBackbuffer, 589, 1, 589, 538, $hPen)
		If $cos > 0 Then
			_GDIPlus_GraphicsDrawLine($hBackbuffer, 589, 270 - $tan, 589, 270, $hPen2)
			_GDIPlus_GraphicsDrawLine($hBackbuffer, 389 + $cos, 270 - $sen, 589, 270 - $tan, $hPen2)
		Else
			_GDIPlus_GraphicsDrawLine($hBackbuffer, 189, 270 + $tan, 189, 270, $hPen2)
			_GDIPlus_GraphicsDrawLine($hBackbuffer, 389 + $cos, 270 - $sen, 189, 270 + $tan, $hPen2)
		EndIf
	EndIf

	If $iCot Then
		_GDIPlus_GraphicsDrawLine($hBackbuffer, 1, 70, 778, 70, $hPen)
		_GDIPlus_GraphicsDrawLine($hBackbuffer, 1, 470, 778, 470, $hPen)
		If $sen > 0 Then
			_GDIPlus_GraphicsDrawLine($hBackbuffer, ($largura - 20) / 2 - 1, 70, ($largura - 20) / 2 - 1 + $cot, 70, $hPen2)
			_GDIPlus_GraphicsDrawLine($hBackbuffer, 389 + $cos, 270 - $sen, ($largura - 20) / 2 - 1 + $cot, 70, $hPen2)
		Else
			_GDIPlus_GraphicsDrawLine($hBackbuffer, ($largura - 20) / 2 - 1, 470, ($largura - 20) / 2 - 1 - $cot, 470, $hPen2)
			_GDIPlus_GraphicsDrawLine($hBackbuffer, 389 + $cos, 270 - $sen, ($largura - 20) / 2 - 1 - $cot, 470, $hPen2)
		EndIf
	EndIf

	If $iSec Then
		Local $resposta = ''
		Select
			Case $ang[0] == 0 Or $ang[0] = 360
				$resposta = '#1 secante[não existe]'
			Case $ang[0] > 0 And $ang[0] < 90
				$resposta = '#2 secante[' & $ang[0] & '] angulo[' & 90 + $ang[0] & ']'
			Case $ang[0] == 90 Or $ang[0] == 180
				$resposta = '#3 secante[não existe]'
			Case $ang[0] > 90 And $ang[0] < 180
				$resposta = '#4 secante[' & $ang[0] & '] angulo[' & $ang[0] - 90 & ']'
			Case $ang[0] > 180 And $ang[0] < 270
				$resposta = '#5 secante[' & $ang[0] & '] angulo[' & 270 - $ang[0]  & ']'
			Case $ang[0] > 270 And $ang[0] < 360
				$resposta = '#6 secante[' & $ang[0] & '] angulo[' & $ang[0] - 270 & ']'
		EndSelect

		$nn1 = 389 + 0 + 1 / Int(200 * Cos(($ang[0] / 180) * $PI))
		$nn2 = 270 + 0 - $sen

		ConsoleWrite('nn1[' & $nn1 & '] nn2[' & $nn2 & ']' & @LF)
		_GDIPlus_GraphicsDrawLine($hBackbuffer, 389 + $cos, 270 - $sen, $nn1, $nn2, $hPen2)
;~ 		_GDIPlus_GraphicsDrawEllipse($hBackbuffer, ($largura - 20) / 2 - 250 - 1, ($altura - 60) / 2 - 250, 500, 500)
		ConsoleWrite($resposta & @LF)
	EndIf

	If $iInverso Then
		Local $invertido = _Iif($ang[0] > 180, $ang[0] - 180, 180 + $ang[0])
		$invertido = _Iif($invertido = 360, 0, $invertido)
		$invertido = StringFormat('%.2f', $invertido)
		_GDIPlus_GraphicsDrawLine($hBackbuffer, ($largura - 20) / 2 - 1, ($altura - 60) / 2, 389 - $cos, 270 + $sen, $hPen3)
		_GDIPlus_GraphicsDrawStringEx($hBackbuffer, 'º[' & $invertido & ']', $hFont, $hInv, $hStringFormat, $hBrush_03)
	EndIf
	_GDIPlus_GraphicsDrawLine($hBackbuffer, ($largura - 20) / 2 - 1, ($altura - 60) / 2, 389 + $cos, 270 - $sen, $hPen2)

	_GDIPlus_GraphicsDrawImageRect($hGraphic, $hBitmap, 10, 50, $largura - 20, $altura - 60)
EndFunc   ;==>_update

Func _exit()
	_GDIPlus_BrushDispose($hBrush_01)
	_GDIPlus_BrushDispose($hBrush_02)
	_GDIPlus_BrushDispose($hBrush_03)
	_GDIPlus_FontFamilyDispose($hFamily)
	_GDIPlus_FontDispose($hFont)
	_GDIPlus_StringFormatDispose($hStringFormat)

	_GDIPlus_GraphicsDispose($hBackbuffer)
	_GDIPlus_BitmapDispose($hBitmap)
	_GDIPlus_PenDispose($hPen)
	_GDIPlus_PenDispose($hPen2)
	_GDIPlus_PenDispose($hPen3)
	_GDIPlus_GraphicsDispose($hGraphic)
	_GDIPlus_Shutdown()
	Exit
EndFunc   ;==>_exit

Func _box($hToGraphic, $ix1, $iy1, $il, $ia)
	Local $aBox[5][2]
	$aBox[0][0] = 4
	$aBox[1][0] = $ix1
	$aBox[1][1] = $iy1
	$aBox[2][0] = $ix1 + $il
	$aBox[2][1] = $iy1
	$aBox[3][0] = $ix1 + $il
	$aBox[3][1] = $iy1 + $ia
	$aBox[4][0] = $ix1
	$aBox[4][1] = $iy1 + $ia
	_GDIPlus_GraphicsDrawPolygon($hToGraphic, $aBox)
EndFunc   ;==>_box

Func _ang($xx1, $yy1, $xx2, $yy2)
	Local $arr[2], $ca = Abs($yy2 - $yy1), $co = Abs($xx2 - $xx1)
	Select
		Case $xx1 > $xx2
			Select
				Case $yy1 < $yy2
					$arr[0] = ATan(($co) / ($ca)) * $radToDeg + 90
				Case $yy1 == $yy2
					$arr[0] = 180
				Case $yy1 > $yy2
					$arr[0] = 270 - ATan(($co) / ($ca)) * $radToDeg
			EndSelect
		Case $xx1 == $xx2
			Select
				Case $yy1 < $yy2
					$arr[0] = 90
				Case $yy1 == $yy2
					$arr[0] = 0
				Case $yy1 > $yy2
					$arr[0] = 270
			EndSelect
		Case $xx1 < $xx2
			Select
				Case $yy1 < $yy2
					$arr[0] = 90 - ATan(($co) / ($ca)) * $radToDeg
				Case $yy1 == $yy2
					$arr[0] = 0
				Case $yy1 > $yy2
					$arr[0] = ATan(($co) / ($ca)) * $radToDeg + 270
					;$arr[0] = 270 - ATan(($co) / ($ca)) * $radToDeg
			EndSelect
	EndSelect
	$arr[0] = StringFormat('%.2f', $arr[0])
	$arr[1] = Sqrt($co ^ 2 + $ca ^ 2)
	Return $arr
EndFunc   ;==>_ang

Func _Iif($aa, $bb, $cc)
	If $aa Then Return $bb
	Return $cc
EndFunc


Update Example.au3

Update Example.au3

; Example
#include-once
#include <GuiCreateEx.au3> ; https://github.com/chechelaky/AutoIt/raw/master/GuiCreateEx/GuiCreateEx.au3

Global $hGui
Global $hButton_NewGui

$hGui = GUICreateEx("Título[ " & $g__aGuiCreateEx[0] & " ]", 800, 600)
$hButton_NewGui = GUICtrlCreateButton("new gui", 10, 10, 80, 20)
GUICtrlSetOnEvent($hButton_NewGui, "NewGui")
GUISetState(@SW_SHOW, $hGui)

While Sleep(25)
WEnd

Func NewGui()
	Local $aSize = WinGetPos($g__aGuiCreateEx[UBound($g__aGuiCreateEx, 1) - 1])
	Local $hGui = GUICreateEx("Título[ " & $g__aGuiCreateEx[0] & " ]", $aSize[2] - (20 + 6), $aSize[3] - (40 + 5), $aSize[0] + 10, $aSize[1] + 10, Default, Default, $g__aGuiCreateEx[UBound($g__aGuiCreateEx, 1) - 1])
	$hButton_NewGui = GUICtrlCreateButton("new gui", 10, 10, 80, 20)
	GUICtrlSetOnEvent($hButton_NewGui, "NewGui")
	GUISetState(@SW_SHOW, $hGui)
EndFunc   ;==>NewGui


remove deprecated function which should not have made it in ...

git-svn-id: fc35eccb03ccef1c432fd0fcf5295fcceaca86a6@29541 bcba8976-2d24-0410-9c9c-aab3bd5fdfd6

Global $_LG_DLL = DllOpen("link-grammar.dll")

Func _LG_GetVersion()
	;const char * linkgrammar_get_version(void);
	$result = DllCall($_LG_DLL, "str:cdecl", "linkgrammar_get_version")
	Return $result[0]
EndFunc   ;==>_LG_GetVersion

Func _LG_DictionaryCreateDefault()
	;Dictionary dictionary_create_default_lang(void);
	$result = DllCall($_LG_DLL, "ptr:cdecl", "dictionary_create_default_lang")
	Return $result[0]
EndFunc   ;==>_LG_DictionaryCreateDefault

Func _LG_DictionaryCreateLang($sLanguage)
	;Dictionary dictionary_create_lang(const char * lang);
	$result = DllCall($_LG_DLL, "ptr:cdecl", "dictionary_create_lang", "str", $sLanguage)
	Return $result[0]
EndFunc   ;==>_LG_DictionaryCreateLang

;Func _LG_Dictionary_Create($sDictName, $sPostProcessFileName, $sConstituentKnowledgeName, $sAffixName)
;Dictionary dictionary_create(const char *dict_name,
;                             const char *post_process_file_name,
;                             const char *constituent_knowledge_name,
;                             const char *affix_name);EndFunc
;EndFunc

Func _LG_DictionaryDelete($hDictionary)
	;int dictionary_delete(Dictionary dict);
	DllCall($_LG_DLL, "none:cdecl", "dictionary_delete", "ptr", $hDictionary)
EndFunc   ;==>_LG_DictionaryDelete

Func _LG_DictionarySetData($sPath)
	;void dictionary_set_data_dir(const char * path);
	DllCall($_LG_DLL, "none:cdecl", "dictionary_set_data_dir", "str", $sPath)
EndFunc   ;==>_LG_DictionarySetData

Func _LG_DictionaryGetDataDir()
	;const char * dictionary_get_data_dir(void);
	$result = DllCall($_LG_DLL, "str:cdecl", "dictionary_get_data_dir")
	Return $result[0]
EndFunc   ;==>_LG_DictionaryGetDataDir

Func _LG_DictionaryGetMaxCost($hDictionary)
	;int dictionary_get_max_cost(Dictionary dict);
	$result = DllCall($_LG_DLL, "int:cdecl", "dictionary_get_max_cost", "ptr", $hDictionary)
	Return $result[0]
EndFunc   ;==>_LG_DictionaryGetMaxCost

Func _LG_ParseOptionsCreate()
	;Parse_Options  parse_options_create();
	$result = DllCall($_LG_DLL, "ptr:cdecl", "parse_options_create")
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsCreate

Func _LG_ParseOptionsDelete($hOptions)
	;int parse_options_delete(Parse_Options opts);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_delete", "ptr", $hOptions)
EndFunc   ;==>_LG_ParseOptionsDelete

Func _LG_ParseOptionsSetVerbosity($hOptions, $iVerbosity)
	;void parse_options_set_verbosity(Parse_Options opts, int verbosity);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_set_verbosity", "ptr", $hOptions, "int", $iVerbosity)
EndFunc   ;==>_LG_ParseOptionsSetVerbosity

Func _LG_ParseOptionsGetVerbosity($hOptions)
	;int  parse_options_get_verbosity(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_get_verbosity", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsGetVerbosity

Func _LG_ParseOptionsSetLinkageLimit($hOptions, $iLinkageLimit)
	;void parse_options_set_linkage_limit(Parse_Options opts, int linkage_limit);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_set_linkage_limit", "ptr", $hOptions, "int", $iLinkageLimit)
EndFunc   ;==>_LG_ParseOptionsSetLinkageLimit

Func _LG_ParseOptionsGetLinkageLimit($hOptions)
	;int  parse_options_get_linkage_limit(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_get_linkage_limit", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsGetLinkageLimit

Func _LG_ParseOptionsSetDisjunctCost($hOptions, $iDisjunctCost)
	;void parse_options_set_disjunct_cost(Parse_Options opts, int disjunct_cost);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_set_disjunct_cost", "ptr", $hOptions, "int", $iDisjunctCost)
EndFunc   ;==>_LG_ParseOptionsSetDisjunctCost

Func _LG_ParseOptionsGetDisjunctCost($hOptions)
	;int  parse_options_get_disjunct_cost(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_get_disjunct_cost", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsGetDisjunctCost

Func _LG_ParseOptionsSetMinNullCount($hOptions, $iNullCount)
	;void parse_options_set_min_null_count(Parse_Options opts, int null_count);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_set_min_null_count", "ptr", $hOptions, "int", $iNullCount)
EndFunc   ;==>_LG_ParseOptionsSetMinNullCount

Func _LG_ParseOptionsGetMinNullCount($hOptions)
	;int  parse_options_get_min_null_count(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_get_min_null_count", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsGetMinNullCount

Func _LG_ParseOptionsSetMaxNullCount($hOptions, $iNullCount)
	;void parse_options_set_max_null_count(Parse_Options opts, int null_count);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_set_max_null_count", "ptr", $hOptions, "int", $iNullCount)
EndFunc   ;==>_LG_ParseOptionsSetMaxNullCount

Func _LG_ParseOptionsGetMaxNullCount($hOptions)
	;int  parse_options_get_max_null_count(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_get_max_null_count", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsGetMaxNullCount

Func _LG_ParseOptionsSetNullBlock($hOptions, $iNullBlock)
	;void parse_options_set_null_block(Parse_Options opts, int null_block);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_set_null_block", "ptr", $hOptions, "int", $iNullBlock)
EndFunc   ;==>_LG_ParseOptionsSetNullBlock

Func _LG_ParseOptionsGetNullBlock($hOptions)
	;int  parse_options_get_null_block(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_get_null_block", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsGetNullBlock

Func _LG_ParseOptionsSetShortLength($hOptions, $iShortLength)
	;void parse_options_set_short_length(Parse_Options opts, int short_length);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_set_short_length", "ptr", $hOptions, "int", $iShortLength)
EndFunc   ;==>_LG_ParseOptionsSetShortLength

Func _LG_ParseOptionsGetShortLength($hOptions)
	;int  parse_options_get_short_length(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_get_short_length", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsGetShortLength

Func _LG_ParseOptionsSetIslandsOk($hOptions, $iIslandsOk)
	;void parse_options_set_islands_ok(Parse_Options opts, int islands_ok);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_set_islands_ok", "ptr", $hOptions, "int", $iIslandsOk)
EndFunc   ;==>_LG_ParseOptionsSetIslandsOk

Func _LG_ParseOptionsGetIslandsOk($hOptions)
	;int  parse_options_get_islands_ok(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_get_islands_ok", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsGetIslandsOk

Func _LG_ParseOptionsSetMaxParseTime($hOptions, $iSeconds)
	;void parse_options_set_max_parse_time(Parse_Options  opts, int secs);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_set_max_parse_time", "ptr", $hOptions, "int", $iSeconds)
EndFunc   ;==>_LG_ParseOptionsSetMaxParseTime

Func _LG_ParseOptionsGetMaxParseTime($hOptions)
	;int  parse_options_get_max_parse_time(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_get_max_parse_time", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsGetMaxParseTime

Func _LG_ParseOptionsSetMaxMemory($hOptions, $iMemory)
	;void parse_options_set_max_memory(Parse_Options  opts, int mem);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_set_max_memory", "ptr", $hOptions, "int", $iMemory)
EndFunc   ;==>_LG_ParseOptionsSetMaxMemory

Func _LG_ParseOptionsGetMaxMemory($hOptions)
	;int  parse_options_get_max_memory(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_get_max_memory", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsGetMaxMemory

Func _LG_ParseOptionsTimerExpired($hOptions)
	;int  parse_options_timer_expired(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_timer_expired", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsTimerExpired

Func _LG_ParseOptionsMemoryExhausted($hOptions)
	;int  parse_options_memory_exhausted(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_memory_exhausted", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsMemoryExhausted

Func _LG_ParseOptionsResourcesExhausted($hOptions)
	;int  parse_options_resources_exhausted(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_resources_exhausted", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsResourcesExhausted

Func _LG_ParseOptionsResetResources($hOptions)
	;void parse_options_reset_resources(Parse_Options opts);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_reset_resources", "ptr", $hOptions)
EndFunc   ;==>_LG_ParseOptionsResetResources

Func _LG_ParseOptionsSetCostModelType($hOptions, $iCostModel)
	;void parse_options_set_cost_model_type(Parse_Options opts, int cm);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_set_cost_model_type", "ptr", $hOptions, "int", $iCostModel)
EndFunc   ;==>_LG_ParseOptionsSetCostModelType

Func _LG_ParseOptionsGetCostModelType($hOptions)
	;int  parse_options_get_cost_model_type(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_get_cost_model_type", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsGetCostModelType

Func _LG_ParseOptionsSetScreenWidth($hOptions, $iWidth)
	;void parse_options_set_screen_width(Parse_Options opts, int val);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_set_screen_width", "ptr", $hOptions, "int", $iWidth)
EndFunc   ;==>_LG_ParseOptionsSetScreenWidth

Func _LG_ParseOptionsGetScreenWidth($hOptions)
	;int  parse_options_get_screen_width(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_get_screen_width", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsGetScreenWidth

Func _LG_ParseOptionsSetAllowNull($hOptions, $iAllowNull)
	;void parse_options_set_allow_null(Parse_Options opts, int val);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_set_allow_null", "ptr", $hOptions, "int", $iAllowNull)
EndFunc   ;==>_LG_ParseOptionsSetAllowNull

Func _LG_ParseOptionsGetAllowNull($hOptions)
	;int  parse_options_get_allow_null(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_get_allow_null", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsGetAllowNull

Func _LG_ParseOptionsSetDisplayWalls($hOptions, $iDisplayWalls)
	;void parse_options_set_display_walls(Parse_Options opts, int val);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_set_display_walls", "ptr", $hOptions, "int", $iDisplayWalls)
EndFunc   ;==>_LG_ParseOptionsSetDisplayWalls

Func _LG_ParseOptionsGetDisplayWalls($hOptions)
	;int  parse_options_get_display_walls(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_get_display_walls", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsGetDisplayWalls

Func _LG_ParseOptionsSetAllShortConnectors($hOptions, $iShortConnectors)
	;void parse_options_set_all_short_connectors(Parse_Options opts, int val);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_set_all_short_connectors", "ptr", $hOptions, "int", $iShortConnectors)
EndFunc   ;==>_LG_ParseOptionsSetAllShortConnectors

Func _LG_ParseOptionsGetAllShortConnectors($hOptions)
	;int  parse_options_get_all_short_connectors(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_get_all_short_connectors", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsGetAllShortConnectors

Func _LG_SentenceCreate($sInputString, $hDictionary)
	;Sentence sentence_create(const char *input_string, Dictionary dict);
	$result = DllCall($_LG_DLL, "ptr:cdecl", "sentence_create", "str", $sInputString, "ptr", $hDictionary)
	Return $result[0]
EndFunc   ;==>_LG_SentenceCreate

Func _LG_SentenceDelete($hSentence)
	;void sentence_delete(Sentence sent);
	DllCall($_LG_DLL, "none:cdecl", "sentence_delete", "ptr", $hSentence)
EndFunc   ;==>_LG_SentenceDelete

Func _LG_SentenceSplit($hSentence, $hOptions)
	;int sentence_split(Sentence sent, Parse_Options opts);
	DllCall($_LG_DLL, "none:cdecl", "sentence_split", "ptr", $hSentence, "ptr", $hOptions)
EndFunc   ;==>_LG_SentenceSplit

Func _LG_SentenceParse($hSentence, $hOptions)
	;int sentence_parse(Sentence sent, Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "sentence_parse", "ptr", $hSentence, "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_SentenceParse

Func _LG_SentenceLength($hSentence)
	;int sentence_length(Sentence sent);
	$result = DllCall($_LG_DLL, "int:cdecl", "sentence_length", "ptr", $hSentence)
	Return $result[0]
EndFunc   ;==>_LG_SentenceLength

Func _LG_SentenceGetWord($hSentence, $iWord)
	;const char * sentence_get_word(Sentence sent, int w);
	$result = DllCall($_LG_DLL, "str:cdecl", "sentence_get_word", "ptr", $hSentence, "int", $iWord)
	Return $result[0]
EndFunc   ;==>_LG_SentenceGetWord

Func _LG_SentenceNullCount($hSentence)
	;int sentence_null_count(Sentence sent);
	$result = DllCall($_LG_DLL, "int:cdecl", "sentence_null_count", "ptr", $hSentence)
	Return $result[0]
EndFunc   ;==>_LG_SentenceNullCount

Func _LG_SentenceNumLinkagesFound($hSentence)
	;int sentence_num_linkages_found(Sentence sent);
	$result = DllCall($_LG_DLL, "int:cdecl", "sentence_num_linkages_found", "ptr", $hSentence)
	Return $result[0]
EndFunc   ;==>_LG_SentenceNumLinkagesFound

Func _LG_SentenceNumValidLinkages($hSentence)
	;int sentence_num_valid_linkages(Sentence sent);
	$result = DllCall($_LG_DLL, "int:cdecl", "sentence_num_valid_linkages", "ptr", $hSentence)
	Return $result[0]
EndFunc   ;==>_LG_SentenceNumValidLinkages

Func _LG_SentenceNumLinkagesPostProcessed($hSentence)
	;int sentence_num_linkages_post_processed(Sentence sent);
	$result = DllCall($_LG_DLL, "int:cdecl", "sentence_num_linkages_post_processed", "ptr", $hSentence)
	Return $result[0]
EndFunc   ;==>_LG_SentenceNumLinkagesPostProcessed

Func _LG_SentenceNumViolations($hSentence, $iNumber)
	;int sentence_num_violations(Sentence sent, int i);
	$result = DllCall($_LG_DLL, "int:cdecl", "sentence_num_violations", "ptr", $hSentence, "int", $iNumber)
	Return $result[0]
EndFunc   ;==>_LG_SentenceNumViolations

Func _LG_SentenceDisjunctCost($hSentence, $iNumber)
	;int sentence_disjunct_cost(Sentence sent, int i);
	$result = DllCall($_LG_DLL, "int:cdecl", "sentence_disjunct_cost", "ptr", $hSentence, "int", $iNumber)
	Return $result[0]
EndFunc   ;==>_LG_SentenceDisjunctCost

Func _LG_SentenceLinkCost($hSentence, $iNumber)
	;int sentence_link_cost(Sentence sent, int i);
	$result = DllCall($_LG_DLL, "int:cdecl", "sentence_link_cost", "ptr", $hSentence, "int", $iNumber)
	Return $result[0]
EndFunc   ;==>_LG_SentenceLinkCost

Func _LG_SentenceAndCost($hSentence, $iNumber)
	;int sentence_and_cost(Sentence sent, int i);
	$result = DllCall($_LG_DLL, "int:cdecl", "sentence_and_cost", "ptr", $hSentence, "int", $iNumber)
	Return $result[0]
EndFunc   ;==>_LG_SentenceAndCost

Func _LG_LinkageCreate($iIndex, $hSentence, $hOptions)
	;Linkage  linkage_create(int index, Sentence sent, Parse_Options opts);
	$result = DllCall($_LG_DLL, "ptr:cdecl", "linkage_create", "int", $iIndex, "ptr", $hSentence, "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_LinkageCreate

Func _LG_LinkageGetNumSublinkages($hLinkage)
	;int linkage_get_num_sublinkages(Linkage linkage);
	$result = DllCall($_LG_DLL, "int:cdecl", "linkage_get_num_sublinkages", "ptr", $hLinkage)
	Return $result[0]
EndFunc   ;==>_LG_LinkageGetNumSublinkages

Func _LG_LinkageSetCurrentSublinkage($hLinkage, $iIndex)
	;int linkage_set_current_sublinkage(Linkage linkage, int index);
	$result = DllCall($_LG_DLL, "int:cdecl", "linkage_set_current_sublinkage", "ptr", $hLinkage, "int", $iIndex)
	Return $result[0]
EndFunc   ;==>_LG_LinkageSetCurrentSublinkage

Func _LG_LinkageComputeUnion($hLinkage)
	;int linkage_compute_union(Linkage linkage);
	$result = DllCall($_LG_DLL, "int:cdecl", "linkage_compute_union", "ptr", $hLinkage)
	Return $result[0]
EndFunc   ;==>_LG_LinkageComputeUnion

Func _LG_LinkageGetNumWords($hLinkage)
	;int linkage_get_num_words(Linkage linkage);
	$result = DllCall($_LG_DLL, "int:cdecl", "linkage_get_num_words", "ptr", $hLinkage)
	Return $result[0]
EndFunc   ;==>_LG_LinkageGetNumWords

Func _LG_LinkageGetNumLinks($hLinkage)
	;int  linkage_get_num_links(Linkage linkage);
	$result = DllCall($_LG_DLL, "int:cdecl", "linkage_get_num_links", "ptr", $hLinkage)
	Return $result[0]
EndFunc   ;==>_LG_LinkageGetNumLinks

Func _LG_LinkageGetLinkLength($hLinkage, $iIndex)
	;int linkage_get_link_length(Linkage linkage, int index);
	$result = DllCall($_LG_DLL, "int:cdecl", "linkage_get_link_length", "ptr", $hLinkage, "int", $iIndex)
	Return $result[0]
EndFunc   ;==>_LG_LinkageGetLinkLength

Func _LG_LinkageGetLinkLWord($hLinkage, $iIndex)
	;int linkage_get_link_lword(Linkage linkage, int index);
	$result = DllCall($_LG_DLL, "int:cdecl", "linkage_get_link_lword", "ptr", $hLinkage, "int", $iIndex)
	Return $result[0]
EndFunc   ;==>_LG_LinkageGetLinkLWord

Func _LG_LinkageGetLinkRWord($hLinkage, $iIndex)
	;int linkage_get_link_rword(Linkage linkage, int index);
	$result = DllCall($_LG_DLL, "int:cdecl", "linkage_get_link_rword", "ptr", $hLinkage, "int", $iIndex)
	Return $result[0]
EndFunc   ;==>_LG_LinkageGetLinkRWord

Func _LG_LinkagePrintDiagram($hLinkage)
	;char * linkage_print_diagram(Linkage linkage);
	$result = DllCall($_LG_DLL, "str:cdecl", "linkage_print_diagram", "ptr", $hLinkage)
	Return $result[0]
EndFunc   ;==>_LG_LinkagePrintDiagram

Func _LG_LinkageFreeDiagram($hDiagram)
	;void   linkage_free_diagram(char * str);
	DllCall($_LG_DLL, "none:cdecl", "linkage_free_diagram", "ptr", $hDiagram)
EndFunc   ;==>_LG_LinkageFreeDiagram

Func _LG_LinkagePrintPostscript($hLinkage, $iMode)
	;char * linkage_print_postscript(Linkage linkage, int mode);
	$result = DllCall($_LG_DLL, "str:cdecl", "linkage_print_postscript", "ptr", $hLinkage, "int", $iMode)
	Return $result[0]
EndFunc   ;==>_LG_LinkagePrintPostscript

Func _LG_LinkageFreePostscript($hPostscript)
	;void   linkage_free_postscript(char * str);
	DllCall($_LG_DLL, "none:cdecl", "linkage_free_postscript", "ptr", $hPostscript)
EndFunc   ;==>_LG_LinkageFreePostscript

Func _LG_LinkagePrintLinksAndDomains($hLinkage)
	;char * linkage_print_links_and_domains(Linkage linkage);
	$result = DllCall($_LG_DLL, "str:cdecl", "linkage_print_links_and_domains", "ptr", $hLinkage)
	Return $result[0]
EndFunc   ;==>_LG_LinkagePrintLinksAndDomains

Func _LG_LinkageFreeLinksAndDomains($hLinksAndDomains)
	;void   linkage_free_links_and_domains(char *str);
	DllCall($_LG_DLL, "none:cdecl", "linkage_free_links_and_domains", "ptr", $hLinksAndDomains)
EndFunc   ;==>_LG_LinkageFreeLinksAndDomains

Func _LG_LinkagePrintConstituentTree($hLinkage, $iOpt)
	;char * linkage_print_constituent_tree(Linkage linkage int iOpt);
	$result = DllCall($_LG_DLL, "str:cdecl", "linkage_print_constituent_tree", "ptr", $hLinkage, "int", $iOpt)
	Return $result[0]
EndFunc   ;==>_LG_LinkagePrintConstituentTree

Func _LG_LinkageGetLinkLabel($hLinkage, $iIndex)
	;const char * linkage_get_link_label(Linkage linkage, int index);
	$result = DllCall($_LG_DLL, "str:cdecl", "linkage_get_link_label", "ptr", $hLinkage, "int", $iIndex)
	Return $result[0]
EndFunc   ;==>_LG_LinkageGetLinkLabel

Func _LG_LinkageGetLinkLLabel($hLinkage, $iIndex)
	;const char * linkage_get_link_llabel(Linkage linkage, int index);
	$result = DllCall($_LG_DLL, "str:cdecl", "linkage_get_link_llabel", "ptr", $hLinkage, "int", $iIndex)
	Return $result[0]
EndFunc   ;==>_LG_LinkageGetLinkLLabel

Func _LG_LinkageGetLinkRLabel($hLinkage, $iIndex)
	;const char * linkage_get_link_rlabel(Linkage linkage, int index);
	$result = DllCall($_LG_DLL, "str:cdecl", "linkage_get_link_rlabel", "ptr", $hLinkage, "int", $iIndex)
	Return $result[0]
EndFunc   ;==>_LG_LinkageGetLinkRLabel

Func _LG_LinkageGetLinkNumDomains($hLinkage, $iIndex)
	;int     linkage_get_link_num_domains(Linkage linkage, int index);
	$result = DllCall($_LG_DLL, "int:cdecl", "linkage_get_link_num_domains", "ptr", $hLinkage, "int", $iIndex)
	Return $result[0]
EndFunc   ;==>_LG_LinkageGetLinkNumDomains

Func _LG_LinkageGetLinkDomainNames($hLinkage, $iIndex)
	;const char ** linkage_get_link_domain_names(Linkage linkage, int index);
	$result = DllCall($_LG_DLL, "str:cdecl", "linkage_get_link_domain_names", "ptr", $hLinkage, "int", $iIndex)
	Return $result[0]
EndFunc   ;==>_LG_LinkageGetLinkDomainNames

Func _LG_LinkageGetViolationName($hLinkage)
	;const char *  linkage_get_violation_name(Linkage linkage);
	$result = DllCall($_LG_DLL, "str:cdecl", "linkage_get_violation_name", "ptr", $hLinkage)
	Return $result[0]
EndFunc   ;==>_LG_LinkageGetViolationName

;Func _LG_LinkageGetWords($hLinkage)
;	;const char ** linkage_get_words(Linkage linkage);
;			$result = DllCall($_LG_DLL, "int:cdecl", "linkage_get_words", "ptr", $hLinkage)
;	Return $result[0]
;EndFunc

Func _LG_LinkageGetWord($hLinkage, $iWord)
	;const char *  linkage_get_word(Linkage linkage, int w);
	$result = DllCall($_LG_DLL, "str:cdecl", "linkage_get_word", "ptr", $hLinkage, "int", $iWord)
	Return $result[0]
EndFunc   ;==>_LG_LinkageGetWord

Func _LG_LinkageGetDisjunct($hLinkage, $iWord)
	;const char *  linkage_get_disjunct(Linkage linkage, int w);
	$result = DllCall($_LG_DLL, "str:cdecl", "linkage_get_disjunct", "ptr", $hLinkage, "int", $iWord)
	Return $result[0]
EndFunc   ;==>_LG_LinkageGetDisjunct

Func _LG_LinkageUnusedWordCost($hLinkage)
	;int linkage_unused_word_cost(Linkage linkage);
	$result = DllCall($_LG_DLL, "int:cdecl", "linkage_unused_word_cost", "ptr", $hLinkage)
	Return $result[0]
EndFunc   ;==>_LG_LinkageUnusedWordCost

Func _LG_LinkageDisjunctCost($hLinkage)
	;int linkage_disjunct_cost(Linkage linkage);
	$result = DllCall($_LG_DLL, "int:cdecl", "linkage_disjunct_cost", "ptr", $hLinkage)
	Return $result[0]
EndFunc   ;==>_LG_LinkageDisjunctCost

Func _LG_LinkageAndCost($hLinkage)
	;int linkage_and_cost(Linkage linkage);
	$result = DllCall($_LG_DLL, "int:cdecl", "linkage_and_cost", "ptr", $hLinkage)
	Return $result[0]
EndFunc   ;==>_LG_LinkageAndCost

Func _LG_LinkageLinkCost($hLinkage)
	;int linkage_link_cost(Linkage linkage);
	$result = DllCall($_LG_DLL, "int:cdecl", "linkage_link_cost", "ptr", $hLinkage)
	Return $result[0]
EndFunc   ;==>_LG_LinkageLinkCost

Func _LG_LinkageIsCanonical($hLinkage)
	;int linkage_is_canonical(Linkage linkage);
	$result = DllCall($_LG_DLL, "int:cdecl", "linkage_is_canonical", "ptr", $hLinkage)
	Return $result[0]
EndFunc   ;==>_LG_LinkageIsCanonical

Func _LG_LinkageIsImproper($hLinkage)
	;int linkage_is_improper(Linkage linkage);
	$result = DllCall($_LG_DLL, "int:cdecl", "linkage_is_improper", "ptr", $hLinkage)
	Return $result[0]
EndFunc   ;==>_LG_LinkageIsImproper

Func _LG_LinkageHasInconsistentDomains($hLinkage)
	;int linkage_has_inconsistent_domains(Linkage linkage);
	$result = DllCall($_LG_DLL, "int:cdecl", "linkage_has_inconsistent_domains", "ptr", $hLinkage)
	Return $result[0]
EndFunc   ;==>_LG_LinkageHasInconsistentDomains

Func _LG_LinkageDelete($hLinkage)
	;void linkage_delete(Linkage linkage);
	$result = DllCall($_LG_DLL, "none:cdecl", "linkage_delete", "ptr", $hLinkage)
EndFunc   ;==>_LG_LinkageDelete

Func _LG_PostProcessOpen($sName)
	;PostProcessor   post_process_open(const char * name);
	$result = DllCall($_LG_DLL, "ptr:cdecl", "post_process_open", "str", $sName)
	Return $result[0]
EndFunc   ;==>_LG_PostProcessOpen

Func _LG_PostProcessClose($hPostProcessor)
	;void            post_process_close(PostProcessor postprocessor);
	DllCall($_LG_DLL, "none:cdecl", "post_process_close", "ptr", $hPostProcessor)
EndFunc   ;==>_LG_PostProcessClose

Func _LG_LinkagePostProcess($hLinkage, $hPostProcessor)
	;void linkage_post_process(Linkage linkage, PostProcessor postprocessor);
	DllCall($_LG_DLL, "none:cdecl", "linkage_post_process", "ptr", $hLinkage, "ptr", $hPostProcessor)
EndFunc   ;==>_LG_LinkagePostProcess

Func _LG_LinkagePrintDisjuncts($hLinkage)
	$result = DllCall($_LG_DLL, "str:cdecl", "linkage_print_disjuncts", "ptr", $hLinkage)
	Return $result[0]
EndFunc

Global $_LG_DLL = DllOpen("link-grammar.dll")

Func _LG_GetVersion()
	;const char * linkgrammar_get_version(void);
	$result = DllCall($_LG_DLL, "str:cdecl", "linkgrammar_get_version")
	Return $result[0]
EndFunc   ;==>_LG_GetVersion

Func _LG_DictionaryCreateDefault()
	;Dictionary dictionary_create_default_lang(void);
	$result = DllCall($_LG_DLL, "ptr:cdecl", "dictionary_create_default_lang")
	Return $result[0]
EndFunc   ;==>_LG_DictionaryCreateDefault

Func _LG_DictionaryCreateLang($sLanguage)
	;Dictionary dictionary_create_lang(const char * lang);
	$result = DllCall($_LG_DLL, "ptr:cdecl", "dictionary_create_lang", "str", $sLanguage)
	Return $result[0]
EndFunc   ;==>_LG_DictionaryCreateLang

;Func _LG_Dictionary_Create($sDictName, $sPostProcessFileName, $sConstituentKnowledgeName, $sAffixName)
;Dictionary dictionary_create(const char *dict_name,
;                             const char *post_process_file_name,
;                             const char *constituent_knowledge_name,
;                             const char *affix_name);EndFunc
;EndFunc

Func _LG_DictionaryDelete($hDictionary)
	;int dictionary_delete(Dictionary dict);
	DllCall($_LG_DLL, "none:cdecl", "dictionary_delete", "ptr", $hDictionary)
EndFunc   ;==>_LG_DictionaryDelete

Func _LG_DictionarySetData($sPath)
	;void dictionary_set_data_dir(const char * path);
	DllCall($_LG_DLL, "none:cdecl", "dictionary_set_data_dir", "str", $sPath)
EndFunc   ;==>_LG_DictionarySetData

Func _LG_DictionaryGetDataDir()
	;const char * dictionary_get_data_dir(void);
	$result = DllCall($_LG_DLL, "str:cdecl", "dictionary_get_data_dir")
	Return $result[0]
EndFunc   ;==>_LG_DictionaryGetDataDir

Func _LG_DictionaryGetMaxCost($hDictionary)
	;int dictionary_get_max_cost(Dictionary dict);
	$result = DllCall($_LG_DLL, "int:cdecl", "dictionary_get_max_cost", "ptr", $hDictionary)
	Return $result[0]
EndFunc   ;==>_LG_DictionaryGetMaxCost

Func _LG_ParseOptionsCreate()
	;Parse_Options  parse_options_create();
	$result = DllCall($_LG_DLL, "ptr:cdecl", "parse_options_create")
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsCreate

Func _LG_ParseOptionsDelete($hOptions)
	;int parse_options_delete(Parse_Options opts);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_delete", "ptr", $hOptions)
EndFunc   ;==>_LG_ParseOptionsDelete

Func _LG_ParseOptionsSetVerbosity($hOptions, $iVerbosity)
	;void parse_options_set_verbosity(Parse_Options opts, int verbosity);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_set_verbosity", "ptr", $hOptions, "int", $iVerbosity)
EndFunc   ;==>_LG_ParseOptionsSetVerbosity

Func _LG_ParseOptionsGetVerbosity($hOptions)
	;int  parse_options_get_verbosity(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_get_verbosity", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsGetVerbosity

Func _LG_ParseOptionsSetLinkageLimit($hOptions, $iLinkageLimit)
	;void parse_options_set_linkage_limit(Parse_Options opts, int linkage_limit);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_set_linkage_limit", "ptr", $hOptions, "int", $iLinkageLimit)
EndFunc   ;==>_LG_ParseOptionsSetLinkageLimit

Func _LG_ParseOptionsGetLinkageLimit($hOptions)
	;int  parse_options_get_linkage_limit(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_get_linkage_limit", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsGetLinkageLimit

Func _LG_ParseOptionsSetDisjunctCost($hOptions, $iDisjunctCost)
	;void parse_options_set_disjunct_cost(Parse_Options opts, int disjunct_cost);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_set_disjunct_cost", "ptr", $hOptions, "int", $iDisjunctCost)
EndFunc   ;==>_LG_ParseOptionsSetDisjunctCost

Func _LG_ParseOptionsGetDisjunctCost($hOptions)
	;int  parse_options_get_disjunct_cost(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_get_disjunct_cost", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsGetDisjunctCost

Func _LG_ParseOptionsSetMinNullCount($hOptions, $iNullCount)
	;void parse_options_set_min_null_count(Parse_Options opts, int null_count);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_set_min_null_count", "ptr", $hOptions, "int", $iNullCount)
EndFunc   ;==>_LG_ParseOptionsSetMinNullCount

Func _LG_ParseOptionsGetMinNullCount($hOptions)
	;int  parse_options_get_min_null_count(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_get_min_null_count", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsGetMinNullCount

Func _LG_ParseOptionsSetMaxNullCount($hOptions, $iNullCount)
	;void parse_options_set_max_null_count(Parse_Options opts, int null_count);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_set_max_null_count", "ptr", $hOptions, "int", $iNullCount)
EndFunc   ;==>_LG_ParseOptionsSetMaxNullCount

Func _LG_ParseOptionsGetMaxNullCount($hOptions)
	;int  parse_options_get_max_null_count(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_get_max_null_count", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsGetMaxNullCount

Func _LG_ParseOptionsSetNullBlock($hOptions, $iNullBlock)
	;void parse_options_set_null_block(Parse_Options opts, int null_block);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_set_null_block", "ptr", $hOptions, "int", $iNullBlock)
EndFunc   ;==>_LG_ParseOptionsSetNullBlock

Func _LG_ParseOptionsGetNullBlock($hOptions)
	;int  parse_options_get_null_block(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_get_null_block", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsGetNullBlock

Func _LG_ParseOptionsSetShortLength($hOptions, $iShortLength)
	;void parse_options_set_short_length(Parse_Options opts, int short_length);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_set_short_length", "ptr", $hOptions, "int", $iShortLength)
EndFunc   ;==>_LG_ParseOptionsSetShortLength

Func _LG_ParseOptionsGetShortLength($hOptions)
	;int  parse_options_get_short_length(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_get_short_length", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsGetShortLength

Func _LG_ParseOptionsSetIslandsOk($hOptions, $iIslandsOk)
	;void parse_options_set_islands_ok(Parse_Options opts, int islands_ok);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_set_islands_ok", "ptr", $hOptions, "int", $iIslandsOk)
EndFunc   ;==>_LG_ParseOptionsSetIslandsOk

Func _LG_ParseOptionsGetIslandsOk($hOptions)
	;int  parse_options_get_islands_ok(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_get_islands_ok", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsGetIslandsOk

Func _LG_ParseOptionsSetMaxParseTime($hOptions, $iSeconds)
	;void parse_options_set_max_parse_time(Parse_Options  opts, int secs);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_set_max_parse_time", "ptr", $hOptions, "int", $iSeconds)
EndFunc   ;==>_LG_ParseOptionsSetMaxParseTime

Func _LG_ParseOptionsGetMaxParseTime($hOptions)
	;int  parse_options_get_max_parse_time(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_get_max_parse_time", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsGetMaxParseTime

Func _LG_ParseOptionsSetMaxMemory($hOptions, $iMemory)
	;void parse_options_set_max_memory(Parse_Options  opts, int mem);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_set_max_memory", "ptr", $hOptions, "int", $iMemory)
EndFunc   ;==>_LG_ParseOptionsSetMaxMemory

Func _LG_ParseOptionsGetMaxMemory($hOptions)
	;int  parse_options_get_max_memory(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_get_max_memory", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsGetMaxMemory

Func _LG_ParseOptionsTimerExpired($hOptions)
	;int  parse_options_timer_expired(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_timer_expired", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsTimerExpired

Func _LG_ParseOptionsMemoryExhausted($hOptions)
	;int  parse_options_memory_exhausted(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_memory_exhausted", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsMemoryExhausted

Func _LG_ParseOptionsResourcesExhausted($hOptions)
	;int  parse_options_resources_exhausted(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_resources_exhausted", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsResourcesExhausted

Func _LG_ParseOptionsResetResources($hOptions)
	;void parse_options_reset_resources(Parse_Options opts);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_reset_resources", "ptr", $hOptions)
EndFunc   ;==>_LG_ParseOptionsResetResources

Func _LG_ParseOptionsSetCostModelType($hOptions, $iCostModel)
	;void parse_options_set_cost_model_type(Parse_Options opts, int cm);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_set_cost_model_type", "ptr", $hOptions, "int", $iCostModel)
EndFunc   ;==>_LG_ParseOptionsSetCostModelType

Func _LG_ParseOptionsGetCostModelType($hOptions)
	;int  parse_options_get_cost_model_type(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_get_cost_model_type", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsGetCostModelType

Func _LG_ParseOptionsSetScreenWidth($hOptions, $iWidth)
	;void parse_options_set_screen_width(Parse_Options opts, int val);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_set_screen_width", "ptr", $hOptions, "int", $iWidth)
EndFunc   ;==>_LG_ParseOptionsSetScreenWidth

Func _LG_ParseOptionsGetScreenWidth($hOptions)
	;int  parse_options_get_screen_width(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_get_screen_width", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsGetScreenWidth

Func _LG_ParseOptionsSetAllowNull($hOptions, $iAllowNull)
	;void parse_options_set_allow_null(Parse_Options opts, int val);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_set_allow_null", "ptr", $hOptions, "int", $iAllowNull)
EndFunc   ;==>_LG_ParseOptionsSetAllowNull

Func _LG_ParseOptionsGetAllowNull($hOptions)
	;int  parse_options_get_allow_null(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_get_allow_null", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsGetAllowNull

Func _LG_ParseOptionsSetDisplayWalls($hOptions, $iDisplayWalls)
	;void parse_options_set_display_walls(Parse_Options opts, int val);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_set_display_walls", "ptr", $hOptions, "int", $iDisplayWalls)
EndFunc   ;==>_LG_ParseOptionsSetDisplayWalls

Func _LG_ParseOptionsGetDisplayWalls($hOptions)
	;int  parse_options_get_display_walls(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_get_display_walls", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsGetDisplayWalls

Func _LG_ParseOptionsSetAllShortConnectors($hOptions, $iShortConnectors)
	;void parse_options_set_all_short_connectors(Parse_Options opts, int val);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_set_all_short_connectors", "ptr", $hOptions, "int", $iShortConnectors)
EndFunc   ;==>_LG_ParseOptionsSetAllShortConnectors

Func _LG_ParseOptionsGetAllShortConnectors($hOptions)
	;int  parse_options_get_all_short_connectors(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_get_all_short_connectors", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsGetAllShortConnectors

Func _LG_SentenceCreate($sInputString, $hDictionary)
	;Sentence sentence_create(const char *input_string, Dictionary dict);
	$result = DllCall($_LG_DLL, "ptr:cdecl", "sentence_create", "str", $sInputString, "ptr", $hDictionary)
	Return $result[0]
EndFunc   ;==>_LG_SentenceCreate

Func _LG_SentenceDelete($hSentence)
	;void sentence_delete(Sentence sent);
	DllCall($_LG_DLL, "none:cdecl", "sentence_delete", "ptr", $hSentence)
EndFunc   ;==>_LG_SentenceDelete

Func _LG_SentenceSplit($hSentence, $hOptions)
	;int sentence_split(Sentence sent, Parse_Options opts);
	DllCall($_LG_DLL, "none:cdecl", "sentence_split", "ptr", $hSentence, "ptr", $hOptions)
EndFunc   ;==>_LG_SentenceSplit

Func _LG_SentenceParse($hSentence, $hOptions)
	;int sentence_parse(Sentence sent, Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "sentence_parse", "ptr", $hSentence, "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_SentenceParse

Func _LG_SentenceLength($hSentence)
	;int sentence_length(Sentence sent);
	$result = DllCall($_LG_DLL, "int:cdecl", "sentence_length", "ptr", $hSentence)
	Return $result[0]
EndFunc   ;==>_LG_SentenceLength

Func _LG_SentenceGetWord($hSentence, $iWord)
	;const char * sentence_get_word(Sentence sent, int w);
	$result = DllCall($_LG_DLL, "str:cdecl", "sentence_get_word", "ptr", $hSentence, "int", $iWord)
	Return $result[0]
EndFunc   ;==>_LG_SentenceGetWord

Func _LG_SentenceNullCount($hSentence)
	;int sentence_null_count(Sentence sent);
	$result = DllCall($_LG_DLL, "int:cdecl", "sentence_null_count", "ptr", $hSentence)
	Return $result[0]
EndFunc   ;==>_LG_SentenceNullCount

Func _LG_SentenceNumLinkagesFound($hSentence)
	;int sentence_num_linkages_found(Sentence sent);
	$result = DllCall($_LG_DLL, "int:cdecl", "sentence_num_linkages_found", "ptr", $hSentence)
	Return $result[0]
EndFunc   ;==>_LG_SentenceNumLinkagesFound

Func _LG_SentenceNumValidLinkages($hSentence)
	;int sentence_num_valid_linkages(Sentence sent);
	$result = DllCall($_LG_DLL, "int:cdecl", "sentence_num_valid_linkages", "ptr", $hSentence)
	Return $result[0]
EndFunc   ;==>_LG_SentenceNumValidLinkages

Func _LG_SentenceNumLinkagesPostProcessed($hSentence)
	;int sentence_num_linkages_post_processed(Sentence sent);
	$result = DllCall($_LG_DLL, "int:cdecl", "sentence_num_linkages_post_processed", "ptr", $hSentence)
	Return $result[0]
EndFunc   ;==>_LG_SentenceNumLinkagesPostProcessed

Func _LG_SentenceNumViolations($hSentence, $iNumber)
	;int sentence_num_violations(Sentence sent, int i);
	$result = DllCall($_LG_DLL, "int:cdecl", "sentence_num_violations", "ptr", $hSentence, "int", $iNumber)
	Return $result[0]
EndFunc   ;==>_LG_SentenceNumViolations

Func _LG_SentenceDisjunctCost($hSentence, $iNumber)
	;int sentence_disjunct_cost(Sentence sent, int i);
	$result = DllCall($_LG_DLL, "int:cdecl", "sentence_disjunct_cost", "ptr", $hSentence, "int", $iNumber)
	Return $result[0]
EndFunc   ;==>_LG_SentenceDisjunctCost

Func _LG_SentenceLinkCost($hSentence, $iNumber)
	;int sentence_link_cost(Sentence sent, int i);
	$result = DllCall($_LG_DLL, "int:cdecl", "sentence_link_cost", "ptr", $hSentence, "int", $iNumber)
	Return $result[0]
EndFunc   ;==>_LG_SentenceLinkCost

Func _LG_SentenceAndCost($hSentence, $iNumber)
	;int sentence_and_cost(Sentence sent, int i);
	$result = DllCall($_LG_DLL, "int:cdecl", "sentence_and_cost", "ptr", $hSentence, "int", $iNumber)
	Return $result[0]
EndFunc   ;==>_LG_SentenceAndCost

Func _LG_SentenceNthWordHasDisjunction($hSentence, $iNumber)
	;int sentence_nth_word_has_disjunction(Sentence sent, int i);
	$result = DllCall($_LG_DLL, "int:cdecl", "sentence_nth_word_has_disjunction", "ptr", $hSentence, "int", $iNumber)
	Return $result[0]
EndFunc   ;==>_LG_SentenceNthWordHasDisjunction

Func _LG_LinkageCreate($iIndex, $hSentence, $hOptions)
	;Linkage  linkage_create(int index, Sentence sent, Parse_Options opts);
	$result = DllCall($_LG_DLL, "ptr:cdecl", "linkage_create", "int", $iIndex, "ptr", $hSentence, "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_LinkageCreate

Func _LG_LinkageGetNumSublinkages($hLinkage)
	;int linkage_get_num_sublinkages(Linkage linkage);
	$result = DllCall($_LG_DLL, "int:cdecl", "linkage_get_num_sublinkages", "ptr", $hLinkage)
	Return $result[0]
EndFunc   ;==>_LG_LinkageGetNumSublinkages

Func _LG_LinkageSetCurrentSublinkage($hLinkage, $iIndex)
	;int linkage_set_current_sublinkage(Linkage linkage, int index);
	$result = DllCall($_LG_DLL, "int:cdecl", "linkage_set_current_sublinkage", "ptr", $hLinkage, "int", $iIndex)
	Return $result[0]
EndFunc   ;==>_LG_LinkageSetCurrentSublinkage

Func _LG_LinkageComputeUnion($hLinkage)
	;int linkage_compute_union(Linkage linkage);
	$result = DllCall($_LG_DLL, "int:cdecl", "linkage_compute_union", "ptr", $hLinkage)
	Return $result[0]
EndFunc   ;==>_LG_LinkageComputeUnion

Func _LG_LinkageGetNumWords($hLinkage)
	;int linkage_get_num_words(Linkage linkage);
	$result = DllCall($_LG_DLL, "int:cdecl", "linkage_get_num_words", "ptr", $hLinkage)
	Return $result[0]
EndFunc   ;==>_LG_LinkageGetNumWords

Func _LG_LinkageGetNumLinks($hLinkage)
	;int  linkage_get_num_links(Linkage linkage);
	$result = DllCall($_LG_DLL, "int:cdecl", "linkage_get_num_links", "ptr", $hLinkage)
	Return $result[0]
EndFunc   ;==>_LG_LinkageGetNumLinks

Func _LG_LinkageGetLinkLength($hLinkage, $iIndex)
	;int linkage_get_link_length(Linkage linkage, int index);
	$result = DllCall($_LG_DLL, "int:cdecl", "linkage_get_link_length", "ptr", $hLinkage, "int", $iIndex)
	Return $result[0]
EndFunc   ;==>_LG_LinkageGetLinkLength

Func _LG_LinkageGetLinkLWord($hLinkage, $iIndex)
	;int linkage_get_link_lword(Linkage linkage, int index);
	$result = DllCall($_LG_DLL, "int:cdecl", "linkage_get_link_lword", "ptr", $hLinkage, "int", $iIndex)
	Return $result[0]
EndFunc   ;==>_LG_LinkageGetLinkLWord

Func _LG_LinkageGetLinkRWord($hLinkage, $iIndex)
	;int linkage_get_link_rword(Linkage linkage, int index);
	$result = DllCall($_LG_DLL, "int:cdecl", "linkage_get_link_rword", "ptr", $hLinkage, "int", $iIndex)
	Return $result[0]
EndFunc   ;==>_LG_LinkageGetLinkRWord

Func _LG_LinkagePrintDiagram($hLinkage)
	;char * linkage_print_diagram(Linkage linkage);
	$result = DllCall($_LG_DLL, "str:cdecl", "linkage_print_diagram", "ptr", $hLinkage)
	Return $result[0]
EndFunc   ;==>_LG_LinkagePrintDiagram

Func _LG_LinkageFreeDiagram($hDiagram)
	;void   linkage_free_diagram(char * str);
	DllCall($_LG_DLL, "none:cdecl", "linkage_free_diagram", "ptr", $hDiagram)
EndFunc   ;==>_LG_LinkageFreeDiagram

Func _LG_LinkagePrintPostscript($hLinkage, $iMode)
	;char * linkage_print_postscript(Linkage linkage, int mode);
	$result = DllCall($_LG_DLL, "str:cdecl", "linkage_print_postscript", "ptr", $hLinkage, "int", $iMode)
	Return $result[0]
EndFunc   ;==>_LG_LinkagePrintPostscript

Func _LG_LinkageFreePostscript($hPostscript)
	;void   linkage_free_postscript(char * str);
	DllCall($_LG_DLL, "none:cdecl", "linkage_free_postscript", "ptr", $hPostscript)
EndFunc   ;==>_LG_LinkageFreePostscript

Func _LG_LinkagePrintLinksAndDomains($hLinkage)
	;char * linkage_print_links_and_domains(Linkage linkage);
	$result = DllCall($_LG_DLL, "str:cdecl", "linkage_print_links_and_domains", "ptr", $hLinkage)
	Return $result[0]
EndFunc   ;==>_LG_LinkagePrintLinksAndDomains

Func _LG_LinkageFreeLinksAndDomains($hLinksAndDomains)
	;void   linkage_free_links_and_domains(char *str);
	DllCall($_LG_DLL, "none:cdecl", "linkage_free_links_and_domains", "ptr", $hLinksAndDomains)
EndFunc   ;==>_LG_LinkageFreeLinksAndDomains

Func _LG_LinkagePrintConstituentTree($hLinkage, $iOpt)
	;char * linkage_print_constituent_tree(Linkage linkage int iOpt);
	$result = DllCall($_LG_DLL, "str:cdecl", "linkage_print_constituent_tree", "ptr", $hLinkage, "int", $iOpt)
	Return $result[0]
EndFunc   ;==>_LG_LinkagePrintConstituentTree

Func _LG_LinkageGetLinkLabel($hLinkage, $iIndex)
	;const char * linkage_get_link_label(Linkage linkage, int index);
	$result = DllCall($_LG_DLL, "str:cdecl", "linkage_get_link_label", "ptr", $hLinkage, "int", $iIndex)
	Return $result[0]
EndFunc   ;==>_LG_LinkageGetLinkLabel

Func _LG_LinkageGetLinkLLabel($hLinkage, $iIndex)
	;const char * linkage_get_link_llabel(Linkage linkage, int index);
	$result = DllCall($_LG_DLL, "str:cdecl", "linkage_get_link_llabel", "ptr", $hLinkage, "int", $iIndex)
	Return $result[0]
EndFunc   ;==>_LG_LinkageGetLinkLLabel

Func _LG_LinkageGetLinkRLabel($hLinkage, $iIndex)
	;const char * linkage_get_link_rlabel(Linkage linkage, int index);
	$result = DllCall($_LG_DLL, "str:cdecl", "linkage_get_link_rlabel", "ptr", $hLinkage, "int", $iIndex)
	Return $result[0]
EndFunc   ;==>_LG_LinkageGetLinkRLabel

Func _LG_LinkageGetLinkNumDomains($hLinkage, $iIndex)
	;int     linkage_get_link_num_domains(Linkage linkage, int index);
	$result = DllCall($_LG_DLL, "int:cdecl", "linkage_get_link_num_domains", "ptr", $hLinkage, "int", $iIndex)
	Return $result[0]
EndFunc   ;==>_LG_LinkageGetLinkNumDomains

Func _LG_LinkageGetLinkDomainNames($hLinkage, $iIndex)
	;const char ** linkage_get_link_domain_names(Linkage linkage, int index);
	$result = DllCall($_LG_DLL, "str:cdecl", "linkage_get_link_domain_names", "ptr", $hLinkage, "int", $iIndex)
	Return $result[0]
EndFunc   ;==>_LG_LinkageGetLinkDomainNames

Func _LG_LinkageGetViolationName($hLinkage)
	;const char *  linkage_get_violation_name(Linkage linkage);
	$result = DllCall($_LG_DLL, "str:cdecl", "linkage_get_violation_name", "ptr", $hLinkage)
	Return $result[0]
EndFunc   ;==>_LG_LinkageGetViolationName

;Func _LG_LinkageGetWords($hLinkage)
;	;const char ** linkage_get_words(Linkage linkage);
;			$result = DllCall($_LG_DLL, "int:cdecl", "linkage_get_words", "ptr", $hLinkage)
;	Return $result[0]
;EndFunc

Func _LG_LinkageGetWord($hLinkage, $iWord)
	;const char *  linkage_get_word(Linkage linkage, int w);
	$result = DllCall($_LG_DLL, "str:cdecl", "linkage_get_word", "ptr", $hLinkage, "int", $iWord)
	Return $result[0]
EndFunc   ;==>_LG_LinkageGetWord

Func _LG_LinkageGetDisjunct($hLinkage, $iWord)
	;const char *  linkage_get_disjunct(Linkage linkage, int w);
	$result = DllCall($_LG_DLL, "str:cdecl", "linkage_get_disjunct", "ptr", $hLinkage, "int", $iWord)
	Return $result[0]
EndFunc   ;==>_LG_LinkageGetDisjunct

Func _LG_LinkageUnusedWordCost($hLinkage)
	;int linkage_unused_word_cost(Linkage linkage);
	$result = DllCall($_LG_DLL, "int:cdecl", "linkage_unused_word_cost", "ptr", $hLinkage)
	Return $result[0]
EndFunc   ;==>_LG_LinkageUnusedWordCost

Func _LG_LinkageDisjunctCost($hLinkage)
	;int linkage_disjunct_cost(Linkage linkage);
	$result = DllCall($_LG_DLL, "int:cdecl", "linkage_disjunct_cost", "ptr", $hLinkage)
	Return $result[0]
EndFunc   ;==>_LG_LinkageDisjunctCost

Func _LG_LinkageAndCost($hLinkage)
	;int linkage_and_cost(Linkage linkage);
	$result = DllCall($_LG_DLL, "int:cdecl", "linkage_and_cost", "ptr", $hLinkage)
	Return $result[0]
EndFunc   ;==>_LG_LinkageAndCost

Func _LG_LinkageLinkCost($hLinkage)
	;int linkage_link_cost(Linkage linkage);
	$result = DllCall($_LG_DLL, "int:cdecl", "linkage_link_cost", "ptr", $hLinkage)
	Return $result[0]
EndFunc   ;==>_LG_LinkageLinkCost

Func _LG_LinkageIsCanonical($hLinkage)
	;int linkage_is_canonical(Linkage linkage);
	$result = DllCall($_LG_DLL, "int:cdecl", "linkage_is_canonical", "ptr", $hLinkage)
	Return $result[0]
EndFunc   ;==>_LG_LinkageIsCanonical

Func _LG_LinkageIsImproper($hLinkage)
	;int linkage_is_improper(Linkage linkage);
	$result = DllCall($_LG_DLL, "int:cdecl", "linkage_is_improper", "ptr", $hLinkage)
	Return $result[0]
EndFunc   ;==>_LG_LinkageIsImproper

Func _LG_LinkageHasInconsistentDomains($hLinkage)
	;int linkage_has_inconsistent_domains(Linkage linkage);
	$result = DllCall($_LG_DLL, "int:cdecl", "linkage_has_inconsistent_domains", "ptr", $hLinkage)
	Return $result[0]
EndFunc   ;==>_LG_LinkageHasInconsistentDomains

Func _LG_LinkageDelete($hLinkage)
	;void linkage_delete(Linkage linkage);
	$result = DllCall($_LG_DLL, "none:cdecl", "linkage_delete", "ptr", $hLinkage)
EndFunc   ;==>_LG_LinkageDelete

Func _LG_PostProcessOpen($sName)
	;PostProcessor   post_process_open(const char * name);
	$result = DllCall($_LG_DLL, "ptr:cdecl", "post_process_open", "str", $sName)
	Return $result[0]
EndFunc   ;==>_LG_PostProcessOpen

Func _LG_PostProcessClose($hPostProcessor)
	;void            post_process_close(PostProcessor postprocessor);
	DllCall($_LG_DLL, "none:cdecl", "post_process_close", "ptr", $hPostProcessor)
EndFunc   ;==>_LG_PostProcessClose

Func _LG_LinkagePostProcess($hLinkage, $hPostProcessor)
	;void linkage_post_process(Linkage linkage, PostProcessor postprocessor);
	DllCall($_LG_DLL, "none:cdecl", "linkage_post_process", "ptr", $hLinkage, "ptr", $hPostProcessor)
EndFunc   ;==>_LG_LinkagePostProcess

Func _LG_LinkagePrintDisjuncts($hLinkage)
	$result = DllCall($_LG_DLL, "str:cdecl", "linkage_print_disjuncts", "ptr", $hLinkage)
	Return $result[0]
EndFunc


fixed duration call

fixed duration call

Func newTestSuite($suiteName)
	Local $oClassObject = _AutoItObject_Class()
	$oClassObject.Create()

    Local $dicTest = ObjCreate("Scripting.Dictionary")

	With $oClassObject
		.AddMethod("finish", "finish")
		.AddMethod("addTest", "AddTest")
		.AddMethod("testPassed","testPassed")
        .AddMethod("testFailed","testFailed")
        .AddMethod("duration","suiteDuration")
	EndWith

	With $oClassObject
		.AddProperty("_type_", $ELSCOPE_PUBLIC, "_testSuite_") ;Object type
		.AddProperty("name", $ELSCOPE_PUBLIC, $suiteName)
		.AddProperty("ci", $ELSCOPE_PUBLIC, False)
		.AddProperty("format", $ELSCOPE_PUBLIC, "html")
		.AddProperty("tests", $ELSCOPE_PUBLIC, $dicTest)
		.AddProperty("testCount", $ELSCOPE_PUBLIC, 0)
		.AddProperty("testsPassed", $ELSCOPE_PUBLIC, 0)
		.AddProperty("testsFailed", $ELSCOPE_PUBLIC, 0)
		.AddProperty("pass", $ELSCOPE_PUBLIC, True) ;0 Failed - 1 OK
		.AddProperty("result", $ELSCOPE_PUBLIC, "Passed")
		.AddProperty("beginTime", $ELSCOPE_PUBLIC, _NowCalc())
		.AddProperty("endTime", $ELSCOPE_PUBLIC, _NowCalc())
		.AddProperty("failFast", $ELSCOPE_PUBLIC, False)
	EndWith

	Return $oClassObject.Object
EndFunc

Func addTest($this, $test)
	$this.testCount = $this.testCount + 1

    If $test.pass Then
		$this.testPassed()
	Else
		$this.testFailed()
	EndIf

    If $this.ci Then
        appveyorAddTest($test.name, $test.testResult, $test.duration())
    Else

        ConsoleWrite(@CRLF & _colorTagFor($test.pass) & "(" & $this.testCount & ") " & $test.name & @CRLF)
        ConsoleWrite($test.steps & @CRLF)

        For $step In $test.steps
            If $test.steps.Item($step)[1] Then
                ConsoleWrite(_colorTagFor($test.steps.Item($step)[1]) & @TAB & "PASS" & @TAB & $test.steps.Item($step)[0] & @CRLF)
            Else
                ConsoleWrite(_colorTagFor($test.steps.Item($step)[1]) & @TAB & "FAIL" & @TAB & $test.steps.Item($step)[0] & @CRLF)
            EndIf
        Next

    EndIf
    $this.tests.Add($this.testCount, $test.TestResult)
EndFunc

Func testPassed($this)
    $this.testsPassed = $this.testsPassed + 1
EndFunc

Func testFailed($this)
    $this.pass = False
    $this.result = "Failed"
    $this.testsFailed = $this.testsFailed + 1
    If $this.failFast Then
        Exit 1
    EndIf
EndFunc

Func finish($this)
	$this.endTime = _NowCalc()
    ConsoleWrite(@CRLF & @CRLF)
    If $this.pass Then
        Exit 0
    Else
        Exit 1
    EndIf
EndFunc

Func suiteDuration($this)
    Return $this.endTime - $this.beginTime
EndFunc

Func _colorTagFor($boolean)
    If $boolean Then
        Return "+"
    Else
        Return "!"
    EndIf
EndFunc

Func newTestSuite($suiteName)
	Local $oClassObject = _AutoItObject_Class()
	$oClassObject.Create()

    Local $dicTest = ObjCreate("Scripting.Dictionary")

	With $oClassObject
		.AddMethod("finish", "finish")
		.AddMethod("addTest", "AddTest")
		.AddMethod("testPassed","testPassed")
        .AddMethod("testFailed","testFailed")
        .AddMethod("duration","suiteDuration")
	EndWith

	With $oClassObject
		.AddProperty("_type_", $ELSCOPE_PUBLIC, "_testSuite_") ;Object type
		.AddProperty("name", $ELSCOPE_PUBLIC, $suiteName)
		.AddProperty("ci", $ELSCOPE_PUBLIC, False)
		.AddProperty("format", $ELSCOPE_PUBLIC, "html")
		.AddProperty("tests", $ELSCOPE_PUBLIC, $dicTest)
		.AddProperty("testCount", $ELSCOPE_PUBLIC, 0)
		.AddProperty("testsPassed", $ELSCOPE_PUBLIC, 0)
		.AddProperty("testsFailed", $ELSCOPE_PUBLIC, 0)
		.AddProperty("pass", $ELSCOPE_PUBLIC, True) ;0 Failed - 1 OK
		.AddProperty("result", $ELSCOPE_PUBLIC, "Passed")
		.AddProperty("beginTime", $ELSCOPE_PUBLIC, _NowCalc())
		.AddProperty("endTime", $ELSCOPE_PUBLIC, _NowCalc())
		.AddProperty("failFast", $ELSCOPE_PUBLIC, False)
	EndWith

	Return $oClassObject.Object
EndFunc

Func addTest($this, $test)
	$this.testCount = $this.testCount + 1

    If $test.pass Then
		$this.testPassed()
	Else
		$this.testFailed()
	EndIf

    If $this.ci Then
        appveyorAddTest($test.name, $test.testResult, $test.duration)
    Else

        ConsoleWrite(@CRLF & _colorTagFor($test.pass) & "(" & $this.testCount & ") " & $test.name & @CRLF)
        ConsoleWrite($test.steps & @CRLF)

        For $step In $test.steps
            If $test.steps.Item($step)[1] Then
                ConsoleWrite(_colorTagFor($test.steps.Item($step)[1]) & @TAB & "PASS" & @TAB & $test.steps.Item($step)[0] & @CRLF)
            Else
                ConsoleWrite(_colorTagFor($test.steps.Item($step)[1]) & @TAB & "FAIL" & @TAB & $test.steps.Item($step)[0] & @CRLF)
            EndIf
        Next

    EndIf
    $this.tests.Add($this.testCount, $test.TestResult)
EndFunc

Func testPassed($this)
    $this.testsPassed = $this.testsPassed + 1
EndFunc

Func testFailed($this)
    $this.pass = False
    $this.result = "Failed"
    $this.testsFailed = $this.testsFailed + 1
    If $this.failFast Then
        Exit 1
    EndIf
EndFunc

Func finish($this)
	$this.endTime = _NowCalc()
    ConsoleWrite(@CRLF & @CRLF)
    If $this.pass Then
        Exit 0
    Else
        Exit 1
    EndIf
EndFunc

Func suiteDuration($this)
    Return $this.endTime - $this.beginTime
EndFunc

Func _colorTagFor($boolean)
    If $boolean Then
        Return "+"
    Else
        Return "!"
    EndIf
EndFunc


speed up Paste()

speed up Paste()

.. don't really remember why i had the sleep there at all

#include <Array.au3>
#include <SQLite.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <AutoItConstants.au3>
#include <FontConstants.au3>
#include <MsgBoxConstants.au3>
#include <GuiListBox.au3>
#include <File.au3>
#include <String.au3>

HotKeySet("{PGUP}","WriteTransferMoney");
HotKeySet("{PGDN}","ParseBankLogs");
HotKeySet("{END}","RunProgramsOnAccessControlServer"); i'm just making up these hotkeys as i need em, there's no logic to it.
Func Paste()
   Sleep(1*500);
   Send(ClipGet());
EndFunc
Func init()
   _SQLite_Startup() ; Load the DLL
   If @error Then Exit MsgBox($MB_SYSTEMMODAL, "SQLite Error", "error loading SQLite3.dll ! you can download it from https://www.sqlite.org/download.html , look for ""Precompiled Binaries for Windows"", should be named something like sqlite-dll-win32-x86-3220000.zip");
;why this isn't the default beats me...
   AutoItSetOption("MouseClickDelay",0);
   AutoItSetOption("MouseClickDownDelay",0);
   AutoItSetOption("MouseClickDragDelay",0);
   AutoItSetOption("SendKeyDelay",1);
   AutoItSetOption("SendKeyDownDelay",1);
   AutoItSetOption("WinWaitDelay",0);
   AutoItSetOption("MustDeclareVars",1);
   Global $playerDB=selectPlayer();
   Global $db=_SQLite_Open ( $playerDB,$SQLITE_OPEN_READWRITE, $SQLITE_ENCODING_UTF8 );
   If @error Then Exit MsgBox($MB_SYSTEMMODAL, "SQLite Error", "error loading " & $playerDB & " ! (_SQLite_Open failed, and i'm too lazy to add proper error description code atm)");
EndFunc
Func selectPlayer()
Local $FileList=_FileListToArray(@AppDataDir & "\Onlink\users\","*.db");
Local $GUI = GUICreate("Select agent", 300, 300) ;create gui
Local $ListBox = _GUICtrlListBox_Create($GUI, "", 0, 0,300,300) ;create listbox
For $i = 1 To $FileList[0]
    ;MsgBox(0, $i, $FileList[$i])
    _GUICtrlListBox_AddString($ListBox, StringReplace($FileList[$i],".db","",-1) )
Next

GUISetState() ;show the gui
WinSetOnTop($GUI,"",$WINDOWS_ONTOP);
Local $selected=-1
Do
   Sleep(100);
   $selected=_GUICtrlListBox_GetCurSel ( $ListBox );
Until $selected <> -1;
Local $ret=@AppDataDir & "\Onlink\users\" & _GUICtrlListBox_GetText($ListBox,$selected) & ".db";
ConsoleWriteError($ret);
GUIDelete() ; if autoit expect me to clean up all inner gui controls myself, and this technically leaks memory, here is a list of all the f*ks i give:
Return $ret;
EndFunc

Func SplashMessage($title,$message, $timeoutMS=500)
   Return 0;not working with onlink, onlink overrides WinSetOnTop, apparently...
	  Local $size=50+(StringLen($message)*15);
	  Local $hwnd=SplashTextOn($title, $message, $size, $size, -1, -1, $DLG_TEXTLEFT, "", 24)
	  WinSetOnTop($hwnd,"",$WINDOWS_ONTOP);
	  Sleep($timeoutMS);
	  SplashOff()
   EndFunc

Func e_SQLite_GetTable2d ( $hDB, $sSQL, ByRef $aResult, ByRef $iRows, ByRef $iColumns, $iCharSize = -1, $bSwichDimensions = False )
   if( _SQLite_GetTable2d ( $hDB, $sSQL,$aResult, $iRows,$iColumns, $iCharSize, $bSwichDimensions ) <> $SQLITE_OK) Then
	  Exit MsgBox(0,"SQL error","error executing: " & $sSql );
   EndIf

EndFunc

Func WriteTransferMoney()
   Local $aResult, $iRows, $iColumns;
   local $connectedIp;
   Send("{tab}" & _StringRepeat("{BACKSPACE}",30) & "waiting for db flush, hold on...");
   Do
	  sleep(100);
	  e_SQLite_GetTable2d($db, 'SELECT remotehost FROM player LIMIT 1', $aResult, $iRows, $iColumns) ;
	  $connectedIp=$aResult[1][0];
	  ; get player's account for current bank:
      e_SQLite_GetTable2d($db, 'SELECT SUBSTR(content,LENGTH((SELECT remotehost FROM player LIMIT 1))+2) FROM accounts WHERE content LIKE (SELECT remotehost FROM player LIMIT 1) || '' %'' AND suP_ref LIKE ''%(player)'' LIMIT 1',$aResult, $iRows, $iColumns) ;
	  ;_ArrayDisplay($aResult, "Results from the query");
	  ;ConsoleWrite(UBound($aResult) & @CRLF);
   Until (UBound($aResult) == 2) ; waiting for the game to flush db after entering transfer money screen.. sometimes it takes a few seconds.
   ;_ArrayDisplay($aResult, "Results from the query")
   ;_ArrayDisplay($aResult, "Results from the query");
   local $playerAccountNumber=$aResult[1][0];
   ;ConsoleWrite($playerAccount  & @CRLF );
   e_SQLite_GetTable2d($db, 'SELECT bankaccount.balance FROM bankaccount WHERE bankaccount.accountnumber=(SELECT remote.security_name FROM remote)',$aResult, $iRows, $iColumns) ;
   ;_ArrayDisplay($aResult, "Results from the query");
   Local $connectedAccountBalance=$aResult[1][0];
   e_SQLite_GetTable2d($db, 'SELECT remote.security_name FROM remote WHERE id=1',$aResult, $iRows, $iColumns) ;
   Local $connectedAccountNumber=$aResult[1][0];
   Send(_StringRepeat("{BACKSPACE}",33) & $connectedAccountNumber &  "{tab}" & $connectedIp & "{tab}" & $playerAccountNumber & "{tab}" & $connectedAccountBalance);
; get current connected bank account number: SELECT remote.security_name WHERE id=1

; get balance of current connected bank account: SELECT bankaccount.balance FROM bankaccount WHERE bankaccount.accountnumber=(SELECT remote.security_name FROM remote)

EndFunc
Func ParseBankLogs()
   Local $aResult, $iRows, $iColumns;
   local $connectedIp;
   ;Send("{tab}" & _StringRepeat("{BACKSPACE}",15) & "waiting for db flush, hold on...");
   Do
	  sleep(100);
	  e_SQLite_GetTable2d($db, 'SELECT remotehost FROM player LIMIT 1', $aResult, $iRows, $iColumns) ;
	  $connectedIp=$aResult[1][0];
	  ; get player's account for current bank:
      e_SQLite_GetTable2d($db, 'SELECT SUBSTR(content,LENGTH((SELECT remotehost FROM player LIMIT 1))+2) FROM accounts WHERE content LIKE (SELECT remotehost FROM player LIMIT 1) || '' %'' AND suP_ref LIKE ''%(player)'' LIMIT 1',$aResult, $iRows, $iColumns) ;
	  ;_ArrayDisplay($aResult, "Results from the query");
	  ;ConsoleWrite(UBound($aResult) & @CRLF);
   Until (UBound($aResult) == 2) ; waiting for the game to flush db after entering transfer money screen.. sometimes it takes a few seconds.
   ; current connected account number: SELECT remote.security_name FROM remote WHERE id=1
   ; logbank: SELECT logbank FROM bankaccount WHERE accountnumber = (SELECT remote.security_name FROM remote WHERE id=1)
   ; logs: SELECT data1,data2,data3,date,fromip,fromname FROM accesslog WHERE sup_ref = ((SELECT logbank FROM bankaccount WHERE accountnumber = (SELECT remote.security_name FROM remote WHERE id=1)) || ''(logbank)'')
   e_SQLite_GetTable2d($db,'SELECT data1 FROM accesslog WHERE sup_ref = ((SELECT logbank FROM bankaccount WHERE accountnumber = (SELECT remote.security_name FROM remote WHERE id=1)) || ''(logbank)'')',$aResult, $iRows, $iColumns);
   ;_ArrayDisplay($aResult, "Results from the query");
   Local $cur, $curL, $matchIp, $matchAccount, $sql, $aResult2,$iRows2,$iColumns2;
   For $i = 1 To $iRows Step 1
	  $curL=$aResult[$i][0];
	  ;ConsoleWrite($cur & @CRLF);
	  $cur=StringRegExp($curL,"^(\d+\.\d+\.\d+\.\d+)\ (\d+)$",$STR_REGEXPARRAYMATCH);
	  if @error Then ContinueLoop
	  $matchIp=$cur[0];
	  $matchAccount=$cur[1];
	  ;ConsoleWrite($matchIp & " - " & $matchAccount & @CRLF);
	  e_SQLite_GetTable2d($db,'SELECT * FROM accesscodes WHERE key = ' & _SQLite_Escape($curL) & ' AND sup_ref = ''1(player)''',$aResult2, $iRows2, $iColumns2);
	  ;_ArrayDisplay($aResult2, "Results from the query");
	  ConsoleWrite($iRows2);

	  if($iRows2 > 0) Then ContinueLoop
	  $sql='INSERT INTO accesscodes (content,key,sup_ref) VALUES(''?'', ' & _SQLite_Escape($curL) & ', ''1(player)'');';
	  if(_SQLite_Exec($db,$sql) <> $SQLITE_OK) Then
		 ; sigh...
		Exit MsgBox(0,"error","SQLite error executing " & $sql);
	  EndIf
   Next
   Beep();
EndFunc

Func RunProgramsOnAccessControlServer()
   ; Denial is not included.
   Local $args=[ _
	  "run File_Copier", _
	  "run Proxy_Killer", _
	  "run Firewall_Bypass", _
	  "run Password_Breaker", _
	  "run Decypher", _
	  "run B.Monitor_Killer", _
	  "run File_Deleter", _
	  "run Log_Deleter", _
	  "run Sentry_Bypass", _
	  "run Encryption_Bypass", _
	  "run Proxy_Bypass", _
	  "run Gateway_Nuke", _
	  "run Motion_Sensor", _
	  "run Defrag", _
	  "run Decrypter", _
	  "run Encrypter", _
	  "run PC_AdminMenuInject", _
	  "run PC_ConsoleEnable", _
	  "run PC_LoginEnable", _
	  "run PC_MainMenuInject", _
	  "run PC_md2Crack", _
	  "run PC_md4Crack", _
	  "run PC_md5Crack", _
	  "run PC_SHA-512Crack", _
	  "run B.Monitor_Bypass", _
	  "run Compressor", _
	  "run Decompressor", _
	  "run Encrypter", _
	  "run LAN_Agent", _
	  "run Log_UnDeleter", _
	  "run Voice_Analyser", _
	  "run IP_Lookup", _
	  "run IP_Probe", _
	  "run LAN_Probe", _
	  "run LAN_Scan", _
	  "run LAN_Spoof", _
	  "run LAN_Force", _
	  "run Trace_Tracker", _
	  "run Monitor_Bypass", _
	  "run LAN_Spike", _
	  "run VDPIN_Cracker", _
	  "run Encryption_Killer", _
	  "run Firewall_Killer", _
	  "run Sentry_Killer", _
	  "run Log_Modifier" _
   ];
   Local $iMax = UBound($args)
   Send("dir{ENTER}");
   Sleep(200);
   For $i = 0 to $iMax - 1;
	  Send($args[$i] & "{ENTER}");
	  sleep(60);
   Next
EndFunc

init();
While 1
   Sleep(100);
WEnd

#include <Array.au3>
#include <SQLite.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <AutoItConstants.au3>
#include <FontConstants.au3>
#include <MsgBoxConstants.au3>
#include <GuiListBox.au3>
#include <File.au3>
#include <String.au3>

HotKeySet("{PGUP}","WriteTransferMoney");
HotKeySet("{PGDN}","ParseBankLogs");
HotKeySet("{END}","RunProgramsOnAccessControlServer"); i'm just making up these hotkeys as i need em, there's no logic to it.
Func Paste()
   Sleep(2*1000);
   Send(ClipGet());
EndFunc
Func init()
   _SQLite_Startup() ; Load the DLL
   If @error Then Exit MsgBox($MB_SYSTEMMODAL, "SQLite Error", "error loading SQLite3.dll ! you can download it from https://www.sqlite.org/download.html , look for ""Precompiled Binaries for Windows"", should be named something like sqlite-dll-win32-x86-3220000.zip");
;why this isn't the default beats me...
   AutoItSetOption("MouseClickDelay",0);
   AutoItSetOption("MouseClickDownDelay",0);
   AutoItSetOption("MouseClickDragDelay",0);
   AutoItSetOption("SendKeyDelay",1);
   AutoItSetOption("SendKeyDownDelay",1);
   AutoItSetOption("WinWaitDelay",0);
   AutoItSetOption("MustDeclareVars",1);
   Global $playerDB=selectPlayer();
   Global $db=_SQLite_Open ( $playerDB,$SQLITE_OPEN_READWRITE, $SQLITE_ENCODING_UTF8 );
   If @error Then Exit MsgBox($MB_SYSTEMMODAL, "SQLite Error", "error loading " & $playerDB & " ! (_SQLite_Open failed, and i'm too lazy to add proper error description code atm)");
EndFunc
Func selectPlayer()
Local $FileList=_FileListToArray(@AppDataDir & "\Onlink\users\","*.db");
Local $GUI = GUICreate("Select agent", 300, 300) ;create gui
Local $ListBox = _GUICtrlListBox_Create($GUI, "", 0, 0,300,300) ;create listbox
For $i = 1 To $FileList[0]
    ;MsgBox(0, $i, $FileList[$i])
    _GUICtrlListBox_AddString($ListBox, StringReplace($FileList[$i],".db","",-1) )
Next

GUISetState() ;show the gui
WinSetOnTop($GUI,"",$WINDOWS_ONTOP);
Local $selected=-1
Do
   Sleep(100);
   $selected=_GUICtrlListBox_GetCurSel ( $ListBox );
Until $selected <> -1;
Local $ret=@AppDataDir & "\Onlink\users\" & _GUICtrlListBox_GetText($ListBox,$selected) & ".db";
ConsoleWriteError($ret);
GUIDelete() ; if autoit expect me to clean up all inner gui controls myself, and this technically leaks memory, here is a list of all the f*ks i give:
Return $ret;
EndFunc

Func SplashMessage($title,$message, $timeoutMS=500)
   Return 0;not working with onlink, onlink overrides WinSetOnTop, apparently...
	  Local $size=50+(StringLen($message)*15);
	  Local $hwnd=SplashTextOn($title, $message, $size, $size, -1, -1, $DLG_TEXTLEFT, "", 24)
	  WinSetOnTop($hwnd,"",$WINDOWS_ONTOP);
	  Sleep($timeoutMS);
	  SplashOff()
   EndFunc

Func e_SQLite_GetTable2d ( $hDB, $sSQL, ByRef $aResult, ByRef $iRows, ByRef $iColumns, $iCharSize = -1, $bSwichDimensions = False )
   if( _SQLite_GetTable2d ( $hDB, $sSQL,$aResult, $iRows,$iColumns, $iCharSize, $bSwichDimensions ) <> $SQLITE_OK) Then
	  Exit MsgBox(0,"SQL error","error executing: " & $sSql );
   EndIf

EndFunc

Func WriteTransferMoney()
   Local $aResult, $iRows, $iColumns;
   local $connectedIp;
   Send("{tab}" & _StringRepeat("{BACKSPACE}",30) & "waiting for db flush, hold on...");
   Do
	  sleep(100);
	  e_SQLite_GetTable2d($db, 'SELECT remotehost FROM player LIMIT 1', $aResult, $iRows, $iColumns) ;
	  $connectedIp=$aResult[1][0];
	  ; get player's account for current bank:
      e_SQLite_GetTable2d($db, 'SELECT SUBSTR(content,LENGTH((SELECT remotehost FROM player LIMIT 1))+2) FROM accounts WHERE content LIKE (SELECT remotehost FROM player LIMIT 1) || '' %'' AND suP_ref LIKE ''%(player)'' LIMIT 1',$aResult, $iRows, $iColumns) ;
	  ;_ArrayDisplay($aResult, "Results from the query");
	  ;ConsoleWrite(UBound($aResult) & @CRLF);
   Until (UBound($aResult) == 2) ; waiting for the game to flush db after entering transfer money screen.. sometimes it takes a few seconds.
   ;_ArrayDisplay($aResult, "Results from the query")
   ;_ArrayDisplay($aResult, "Results from the query");
   local $playerAccountNumber=$aResult[1][0];
   ;ConsoleWrite($playerAccount  & @CRLF );
   e_SQLite_GetTable2d($db, 'SELECT bankaccount.balance FROM bankaccount WHERE bankaccount.accountnumber=(SELECT remote.security_name FROM remote)',$aResult, $iRows, $iColumns) ;
   ;_ArrayDisplay($aResult, "Results from the query");
   Local $connectedAccountBalance=$aResult[1][0];
   e_SQLite_GetTable2d($db, 'SELECT remote.security_name FROM remote WHERE id=1',$aResult, $iRows, $iColumns) ;
   Local $connectedAccountNumber=$aResult[1][0];
   Send(_StringRepeat("{BACKSPACE}",33) & $connectedAccountNumber &  "{tab}" & $connectedIp & "{tab}" & $playerAccountNumber & "{tab}" & $connectedAccountBalance);
; get current connected bank account number: SELECT remote.security_name WHERE id=1

; get balance of current connected bank account: SELECT bankaccount.balance FROM bankaccount WHERE bankaccount.accountnumber=(SELECT remote.security_name FROM remote)

EndFunc
Func ParseBankLogs()
   Local $aResult, $iRows, $iColumns;
   local $connectedIp;
   ;Send("{tab}" & _StringRepeat("{BACKSPACE}",15) & "waiting for db flush, hold on...");
   Do
	  sleep(100);
	  e_SQLite_GetTable2d($db, 'SELECT remotehost FROM player LIMIT 1', $aResult, $iRows, $iColumns) ;
	  $connectedIp=$aResult[1][0];
	  ; get player's account for current bank:
      e_SQLite_GetTable2d($db, 'SELECT SUBSTR(content,LENGTH((SELECT remotehost FROM player LIMIT 1))+2) FROM accounts WHERE content LIKE (SELECT remotehost FROM player LIMIT 1) || '' %'' AND suP_ref LIKE ''%(player)'' LIMIT 1',$aResult, $iRows, $iColumns) ;
	  ;_ArrayDisplay($aResult, "Results from the query");
	  ;ConsoleWrite(UBound($aResult) & @CRLF);
   Until (UBound($aResult) == 2) ; waiting for the game to flush db after entering transfer money screen.. sometimes it takes a few seconds.
   ; current connected account number: SELECT remote.security_name FROM remote WHERE id=1
   ; logbank: SELECT logbank FROM bankaccount WHERE accountnumber = (SELECT remote.security_name FROM remote WHERE id=1)
   ; logs: SELECT data1,data2,data3,date,fromip,fromname FROM accesslog WHERE sup_ref = ((SELECT logbank FROM bankaccount WHERE accountnumber = (SELECT remote.security_name FROM remote WHERE id=1)) || ''(logbank)'')
   e_SQLite_GetTable2d($db,'SELECT data1 FROM accesslog WHERE sup_ref = ((SELECT logbank FROM bankaccount WHERE accountnumber = (SELECT remote.security_name FROM remote WHERE id=1)) || ''(logbank)'')',$aResult, $iRows, $iColumns);
   ;_ArrayDisplay($aResult, "Results from the query");
   Local $cur, $curL, $matchIp, $matchAccount, $sql, $aResult2,$iRows2,$iColumns2;
   For $i = 1 To $iRows Step 1
	  $curL=$aResult[$i][0];
	  ;ConsoleWrite($cur & @CRLF);
	  $cur=StringRegExp($curL,"^(\d+\.\d+\.\d+\.\d+)\ (\d+)$",$STR_REGEXPARRAYMATCH);
	  if @error Then ContinueLoop
	  $matchIp=$cur[0];
	  $matchAccount=$cur[1];
	  ;ConsoleWrite($matchIp & " - " & $matchAccount & @CRLF);
	  e_SQLite_GetTable2d($db,'SELECT * FROM accesscodes WHERE key = ' & _SQLite_Escape($curL) & ' AND sup_ref = ''1(player)''',$aResult2, $iRows2, $iColumns2);
	  ;_ArrayDisplay($aResult2, "Results from the query");
	  ConsoleWrite($iRows2);

	  if($iRows2 > 0) Then ContinueLoop
	  $sql='INSERT INTO accesscodes (content,key,sup_ref) VALUES(''?'', ' & _SQLite_Escape($curL) & ', ''1(player)'');';
	  if(_SQLite_Exec($db,$sql) <> $SQLITE_OK) Then
		 ; sigh...
		Exit MsgBox(0,"error","SQLite error executing " & $sql);
	  EndIf
   Next
   Beep();
EndFunc

Func RunProgramsOnAccessControlServer()
   ; Denial is not included.
   Local $args=[ _
	  "run File_Copier", _
	  "run Proxy_Killer", _
	  "run Firewall_Bypass", _
	  "run Password_Breaker", _
	  "run Decypher", _
	  "run B.Monitor_Killer", _
	  "run File_Deleter", _
	  "run Log_Deleter", _
	  "run Sentry_Bypass", _
	  "run Encryption_Bypass", _
	  "run Proxy_Bypass", _
	  "run Gateway_Nuke", _
	  "run Motion_Sensor", _
	  "run Defrag", _
	  "run Decrypter", _
	  "run Encrypter", _
	  "run PC_AdminMenuInject", _
	  "run PC_ConsoleEnable", _
	  "run PC_LoginEnable", _
	  "run PC_MainMenuInject", _
	  "run PC_md2Crack", _
	  "run PC_md4Crack", _
	  "run PC_md5Crack", _
	  "run PC_SHA-512Crack", _
	  "run B.Monitor_Bypass", _
	  "run Compressor", _
	  "run Decompressor", _
	  "run Encrypter", _
	  "run LAN_Agent", _
	  "run Log_UnDeleter", _
	  "run Voice_Analyser", _
	  "run IP_Lookup", _
	  "run IP_Probe", _
	  "run LAN_Probe", _
	  "run LAN_Scan", _
	  "run LAN_Spoof", _
	  "run LAN_Force", _
	  "run Trace_Tracker", _
	  "run Monitor_Bypass", _
	  "run LAN_Spike", _
	  "run VDPIN_Cracker", _
	  "run Encryption_Killer", _
	  "run Firewall_Killer", _
	  "run Sentry_Killer", _
	  "run Log_Modifier" _
   ];
   Local $iMax = UBound($args)
   Send("dir{ENTER}");
   Sleep(200);
   For $i = 0 to $iMax - 1;
	  Send($args[$i] & "{ENTER}");
	  sleep(60);
   Next
EndFunc

init();
While 1
   Sleep(100);
WEnd