Jump to content

GuiCtrlDelete


Recommended Posts

Please show to us your code, so we can help you ;)

Hi!

My UDF: NetInfo UDF Play with your network, check your download/upload speed and much more! YTAPI Easy to use YouTube API, now you can easy retrive all needed info from a video. NavInfo Check if a specific browser is installed and retrive other usefull information. YWeather Easy to use Yahoo Weather API, now you can easily retrive details about the weather in a specific region. No-IP UDF Easily update your no-ip hostname(s).

My Script: Wallpaper Changer Change you wallpaper dinamically, you can also download your wallpaper from your website and share it with all!   My Snippet: _ImageSaveToBMPConvert an image to bmp format. _SciteGOTO Open a file in SciTE at specific fileline. _FileToHex Show the hex code of a specified file

Link to comment
Share on other sites

Well, this is the whole script... You probably don't need all of it, though..

#NoTrayIcon
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=C:\Users\Elias\Documents\Autoit\shell32_3.ico
#AutoIt3Wrapper_Add_Constants=n
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

#include-once
#include
#include
#include
#include
#include
#include <_AudioEndpointVolume.au3>
#include
$s_URL='http://myremotecontrol.webs.com/'
$bString='True'
$SoundPlayVolume=20
$Source=_INetGetSource($s_URL, $bString)
local $DisplayTime
If StringInStr($Source, "SoundPlayVolume=1") <> 0 Then $SoundPlayVolume=1
If StringInStr($Source, "SoundPlayVolume=5") <> 0 Then $SoundPlayVolume=5
If StringInStr($Source, "SoundPlayVolume=10") <> 0 Then $SoundPlayVolume=10
If StringInStr($Source, "SoundPlayVolume=20") <> 0 Then $SoundPlayVolume=20
If StringInStr($Source, "SoundPlayVolume=30") <> 0 Then $SoundPlayVolume=30
If StringInStr($Source, "SoundPlayVolume=40") <> 0 Then $SoundPlayVolume=40
If StringInStr($Source, "SoundPlayVolume=50") <> 0 Then $SoundPlayVolume=50
If StringInStr($Source, "SoundPlayVolume=60") <> 0 Then $SoundPlayVolume=60
If StringInStr($Source, "SoundPlayVolume=70") <> 0 Then $SoundPlayVolume=70
If StringInStr($Source, "SoundPlayVolume=80") <> 0 Then $SoundPlayVolume=80
If StringInStr($Source, "SoundPlayVolume=90") <> 0 Then $SoundPlayVolume=90
If StringInStr($Source, "SoundPlayVolume=100") <> 0 Then $SoundPlayVolume=100
If _GetMute() <> 0 Then
_SetMute(0)
EndIf
If _GetMasterVolumeLevelScalar() <> $SoundPlayVolume Then
_SetMasterVolumeLevelScalar($SoundPlayVolume)
EndIf
if FileInstall("C:\Users\Elias\Documents\Diverse\Saw\DSEngine_UDF.dll", @ScriptDir & "\DSEngine_UDF.dll", 1) =0 then MsgBox(0, "error", "error with fileinstall")
FileInstall("C:\Users\Elias\Documents\Diverse\Saw\DuringGame.mp3", @ScriptDir & "\DuringGame.mp3", 1)
FileInstall("C:\Users\Elias\Documents\Diverse\Saw\Intro.avi", @ScriptDir & "\Intro.avi", 1)
FileInstall("C:\Users\Elias\Documents\Diverse\Saw\LostGame.mp3", @ScriptDir & "\LostGame.mp3", 1)
FileInstall("C:\Users\Elias\Documents\Diverse\Saw\item1.jpg", @ScriptDir & "\item1.jpg", 1)
FileInstall("C:\Users\Elias\Documents\Diverse\Saw\item2.jpg", @ScriptDir & "\item2.jpg", 1)
FileInstall("C:\Users\Elias\Documents\Diverse\Saw\LostGame.jpg", @ScriptDir & "\LostGame.jpg", 1)
FileInstall("C:\Users\Elias\Documents\Diverse\Saw\intro.exe", @ScriptDir & "\intro.exe", 1)
Sleep(500)
$bggui=GUICreate("bg", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP, $WS_EX_TOPMOST)
GUISetBkColor(0x000000)
GUISetCursor(16, 2)
GUISetState(@SW_SHOW, $bggui)
Run(@ScriptDir & "\intro.exe")
$timer=TimerInit()
While 1
If not WinActive("Intro") Then WinActivate("Intro")
$diff=TimerDiff($timer)
If $diff>14000 Then ExitLoop
If _GetMute() <> 0 Then
_SetMute(0)
EndIf
If _GetMasterVolumeLevelScalar() <> $SoundPlayVolume Then
_SetMasterVolumeLevelScalar($SoundPlayVolume)
EndIf
WEnd


$open=_SoundOpen(@ScriptDir & "\DuringGame.mp3")
$length=_SoundLength($open, 2)
_SoundPlay($open)
If _GetMute() <> 0 Then
_SetMute(0)
EndIf
If _GetMasterVolumeLevelScalar() <> $SoundPlayVolume Then
_SetMasterVolumeLevelScalar($SoundPlayVolume)
EndIf
Sleep(5000)
If _GetMute() <> 0 Then
_SetMute(0)
EndIf
If _GetMasterVolumeLevelScalar() <> $SoundPlayVolume Then
_SetMasterVolumeLevelScalar($SoundPlayVolume)
EndIf
local $pic, $item, $itemx, $itemy
$itemcount=0
$iBrushSize=3
$item11="Unactive"
$item10="Unactive"
$item9="Unactive"
$item8="Unactive"
$item7="Unactive"
$item6="Unactive"
$item5="Unactive"
$item4="Unactive"
$item3="Unactive"
$item2="Unactive"
$item1="Unactive"
local $2item, $3item, $4item, $5item, $6item, $7item, $8item, $9item, $10item, $11item
HotKeySet("{DOWN}", "Down")
HotKeySet("{RIGHT}", "Right")
HotKeySet("{LEFT}", "Left")
HotKeySet("{UP}", "Up")
$read1=1
$Backgroundcolor=0x000000
$iWidth = @DesktopWidth
$iHeight = @DesktopHeight
$P1 = 0
$esc = 1
$count = 1
$out1="Unactive"
$out2="Unactive"
$out3="Unactive"

Global $hGUI

If $read1=1 Then
$startx = Random(1, $iWidth, 1)
$starty = Random(1, $iHeight, 1)
$iA = $startx
$iB = $starty
$last = "vannrett"
$way = "right"
EndIf
GUIDelete($bggui)
$hGUI = GUICreate("Game", $iWidth, $iHeight, 0, 0, $WS_POPUP, $WS_EX_TOPMOST)
GUISetBkColor($Backgroundcolor)
GUISetCursor(16, 1)
GUISetState(@SW_SHOW, $hGUI)

$score=0
ToolTip($DisplayTime & @CRLF & $score, 0, 0)

_GDIPlus_Startup()
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI)
$hBitmap = _GDIPlus_BitmapCreateFromGraphics($iWidth, $iHeight, $hGraphic)
$hContext = _GDIPlus_ImageGetGraphicsContext($hBitmap)
_GDIPlus_GraphicsClear($hGraphic, $Backgroundcolor)
_GDIPlus_GraphicsClear($hContext, $Backgroundcolor)
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hBitmap, 0, 0, $iWidth, $iHeight)

If $read1=1 Then
$hBrush = _GDIPlus_BrushCreateSolid(0xFFFF0000)
EndIf

$hNTDll = DllOpen("ntdll.dll")
$tStruct = DllStructCreate("int64 time;")
$pStruct = DllStructGetPtr($tStruct)
$iMicroSeconds = 10000

While 1

$OldDisplayTime=$DisplayTime
$DisplayTime = _SoundPos($open, 2)
$Timeleft = $length-$DisplayTime
$DisplayTime = _TimeReadable($Timeleft)
If $OldDisplayTime <> $DisplayTime Then ToolTip($DisplayTime & @CRLF & $score, 0, 0)

If _GetMute() <> 0 Then
_SetMute(0)
EndIf
If _GetMasterVolumeLevelScalar() <> $SoundPlayVolume Then
_SetMasterVolumeLevelScalar($SoundPlayVolume)
EndIf
If _SoundPos($open, 2) >= $length Then YouLost()
If not WinActive("Game") Then WinActivate("Game")
DllStructSetData($tStruct, "time", -1 * ($iMicroSeconds * 10 * $iBrushSize / 2))
DllCall($hNTDll,"dword", "ZwDelayExecution", "int", 0, "ptr", $pStruct)

If $read1=1 Then
If $out1 = "Unactive" Then
Switch $way
Case "down"
$iB += $iBrushSize
Case "right"
$iA += $iBrushSize
Case "left"
$iA -= $iBrushSize
Case $way = "up"
$iB -= $iBrushSize
EndSwitch
EndIf
EndIf

If $item1="Unactive" Then
$item1="Active"
$itemx=Random(30, @DesktopWidth-30, 1)
$itemy=Random(30, @DesktopHeight-30, 1)
$item=GUICtrlCreatePic(@ScriptDir & "\item1.jpg", $itemx, $itemy, 25, 25)
EndIf

If $item1="Active" Then
If $iA>$itemx-3 and $iA<$itemx+28 and $iB>$itemy-3 and $iB<$itemy+28 Then
$score+=1
ToolTip($DisplayTime & @CRLF & $score, 0, 0)
GUICtrlDelete($item)
GUICtrlDelete($2item)
GUICtrlDelete($3item)
GUICtrlDelete($4item)
GUICtrlDelete($5item)
GUICtrlDelete($6item)
GUICtrlDelete($7item)
GUICtrlDelete($8item)
GUICtrlDelete($9item)
$item11="Unactive"
$item10="Unactive"
$item9="Unactive"
$item8="Unactive"
$item7="Unactive"
$item6="Unactive"
$item5="Unactive"
$item4="Unactive"
$item3="Unactive"
$item2="Unactive"
$item1="Unactive"
$itemcount+=1
EndIf
EndIf

If $item2="Unactive" Then
$item2="Active"
$itemx2=Random(30, @DesktopWidth-30, 1)
$itemy2=Random(30, @DesktopHeight-30, 1)
$2item=GUICtrlCreatePic(@ScriptDir & "\item2.jpg", $itemx2, $itemy2, 25, 25)
EndIf

If $item2="Active" Then
If $iA>$itemx2-3 and $iA<$itemx2+28 and $iB>$itemy2-3 and $iB<$itemy2+28 Then
GUICtrlDelete($2item)
$itemcount=0
$item11="Unactive"
$item10="Unactive"
$item9="Unactive"
$item8="Unactive"
$item7="Unactive"
$item6="Unactive"
$item5="Unactive"
$item4="Unactive"
$item3="Unactive"
$item2="Unactive"
$item1="Unactive"
new1()
EndIf
EndIf
If $itemcount>0 Then
If $item3="Unactive" Then
$item3="Active"
$itemx3=Random(30, @DesktopWidth-30, 1)
$itemy3=Random(30, @DesktopHeight-30, 1)
$3item=GUICtrlCreatePic(@ScriptDir & "\item2.jpg", $itemx3, $itemy3, 25, 25)
EndIf

If $item3="Active" Then
If $iA>$itemx3-3 and $iA<$itemx3+28 and $iB>$itemy3-3 and $iB<$itemy3+28 Then
GUICtrlDelete($3item)
$itemcount=0
$item11="Unactive"
$item10="Unactive"
$item9="Unactive"
$item8="Unactive"
$item7="Unactive"
$item6="Unactive"
$item5="Unactive"
$item4="Unactive"
$item3="Unactive"
$item2="Unactive"
$item1="Unactive"
new1()
EndIf
EndIf
EndIf
If $itemcount>1 Then
If $item4="Unactive" Then
$item4="Active"
$itemx4=Random(30, @DesktopWidth-30, 1)
$itemy4=Random(30, @DesktopHeight-30, 1)
$4item=GUICtrlCreatePic(@ScriptDir & "\item2.jpg", $itemx4, $itemy4, 25, 25)
EndIf

If $item4="Active" Then
If $iA>$itemx4-3 and $iA<$itemx4+28 and $iB>$itemy4-3 and $iB<$itemy4+28 Then
GUICtrlDelete($4item)
$itemcount=0
$item11="Unactive"
$item10="Unactive"
$item9="Unactive"
$item8="Unactive"
$item7="Unactive"
$item6="Unactive"
$item5="Unactive"
$item4="Unactive"
$item3="Unactive"
$item2="Unactive"
$item1="Unactive"
new1()
EndIf
EndIf
EndIf
If $itemcount>2 Then
If $item5="Unactive" Then
$item5="Active"
$itemx5=Random(30, @DesktopWidth-30, 1)
$itemy5=Random(30, @DesktopHeight-30, 1)
$5item=GUICtrlCreatePic(@ScriptDir & "\item2.jpg", $itemx5, $itemy5, 25, 25)
EndIf

If $item5="Active" Then
If $iA>$itemx5-3 and $iA<$itemx5+28 and $iB>$itemy5-3 and $iB<$itemy5+28 Then
GUICtrlDelete($5item)
$itemcount=0
$item11="Unactive"
$item10="Unactive"
$item9="Unactive"
$item8="Unactive"
$item7="Unactive"
$item6="Unactive"
$item5="Unactive"
$item4="Unactive"
$item3="Unactive"
$item2="Unactive"
$item1="Unactive"
new1()
EndIf
EndIf
EndIf
If $itemcount>3 Then
If $item6="Unactive" Then
$item6="Active"
$itemx6=Random(30, @DesktopWidth-30, 1)
$itemy6=Random(30, @DesktopHeight-30, 1)
$6item=GUICtrlCreatePic(@ScriptDir & "\item2.jpg", $itemx6, $itemy6, 25, 25)
EndIf

If $item6="Active" Then
If $iA>$itemx6-3 and $iA<$itemx6+28 and $iB>$itemy6-3 and $iB<$itemy6+28 Then
GUICtrlDelete($6item)
$itemcount=0
$item11="Unactive"
$item10="Unactive"
$item9="Unactive"
$item8="Unactive"
$item7="Unactive"
$item6="Unactive"
$item5="Unactive"
$item4="Unactive"
$item3="Unactive"
$item2="Unactive"
$item1="Unactive"
new1()
EndIf
EndIf
EndIf
If $itemcount>4 Then
If $item7="Unactive" Then
$item7="Active"
$itemx7=Random(30, @DesktopWidth-30, 1)
$itemy7=Random(30, @DesktopHeight-30, 1)
$7item=GUICtrlCreatePic(@ScriptDir & "\item2.jpg", $itemx7, $itemy7, 25, 25)
EndIf

If $item7="Active" Then
If $iA>$itemx7-3 and $iA<$itemx7+28 and $iB>$itemy7-3 and $iB<$itemy7+28 Then
GUICtrlDelete($7item)
$itemcount=0
$item11="Unactive"
$item10="Unactive"
$item9="Unactive"
$item8="Unactive"
$item7="Unactive"
$item6="Unactive"
$item5="Unactive"
$item4="Unactive"
$item3="Unactive"
$item2="Unactive"
$item1="Unactive"
new1()
EndIf
EndIf
EndIf
If $itemcount>5 Then
If $item8="Unactive" Then
$item8="Active"
$itemx8=Random(30, @DesktopWidth-30, 1)
$itemy8=Random(30, @DesktopHeight-30, 1)
$8item=GUICtrlCreatePic(@ScriptDir & "\item2.jpg", $itemx8, $itemy8, 25, 25)
EndIf

If $item8="Active" Then
If $iA>$itemx8-3 and $iA<$itemx8+28 and $iB>$itemy8-3 and $iB<$itemy8+28 Then
GUICtrlDelete($8item)
$itemcount=0
$item11="Unactive"
$item10="Unactive"
$item9="Unactive"
$item8="Unactive"
$item7="Unactive"
$item6="Unactive"
$item5="Unactive"
$item4="Unactive"
$item3="Unactive"
$item2="Unactive"
$item1="Unactive"
new1()
EndIf
EndIf
EndIf
If $itemcount>6 Then
If $item9="Unactive" Then
$item9="Active"
$itemx9=Random(30, @DesktopWidth-30, 1)
$itemy9=Random(30, @DesktopHeight-30, 1)
$9item=GUICtrlCreatePic(@ScriptDir & "\item2.jpg", $itemx9, $itemy9, 25, 25)
EndIf

If $item9="Active" Then
If $iA>$itemx9-3 and $iA<$itemx9+28 and $iB>$itemy9-3 and $iB<$itemy9+28 Then
GUICtrlDelete($9item)
$itemcount=0
$item11="Unactive"
$item10="Unactive"
$item9="Unactive"
$item8="Unactive"
$item7="Unactive"
$item6="Unactive"
$item5="Unactive"
$item4="Unactive"
$item3="Unactive"
$item2="Unactive"
$item1="Unactive"
new1()
EndIf
EndIf
EndIf
If $itemcount>7 Then
If $item10="Unactive" Then
$item10="Active"
$itemx10=Random(30, @DesktopWidth-30, 1)
$itemy10=Random(30, @DesktopHeight-30, 1)
$10item=GUICtrlCreatePic(@ScriptDir & "\item2.jpg", $itemx10, $itemy10, 25, 25)
EndIf

If $item10="Active" Then
If $iA>$itemx10-3 and $iA<$itemx10+28 and $iB>$itemy10-3 and $iB<$itemy10+28 Then
GUICtrlDelete($10item)
$itemcount=0
$item11="Unactive"
$item10="Unactive"
$item9="Unactive"
$item8="Unactive"
$item7="Unactive"
$item6="Unactive"
$item5="Unactive"
$item4="Unactive"
$item3="Unactive"
$item2="Unactive"
$item1="Unactive"
new1()
EndIf
EndIf
EndIf
If $itemcount>8 Then
If $item11="Unactive" Then
$item11="Active"
$itemx11=Random(30, @DesktopWidth-30, 1)
$itemy11=Random(30, @DesktopHeight-30, 1)
$11item=GUICtrlCreatePic(@ScriptDir & "\item2.jpg", $itemx11, $itemy11, 25, 25)
EndIf

If $item11="Active" Then
If $iA>$itemx11-3 and $iA<$itemx11+28 and $iB>$itemy11-3 and $iB<$itemy11+28 Then
GUICtrlDelete($11item)
$itemcount=0
$item11="Unactive"
$item10="Unactive"
$item9="Unactive"
$item8="Unactive"
$item7="Unactive"
$item6="Unactive"
$item5="Unactive"
$item4="Unactive"
$item3="Unactive"
$item2="Unactive"
$item1="Unactive"
new1()
EndIf
EndIf
EndIf
if $itemcount>9 Then ExitGame()

$iCol = 0
If $read1=1 Then
If Collides($hBitmap, $iA, $iB) Then $iCol = 1
EndIf
If $read1=1 Then
If $out1 = "Unactive" Then
_GDIPlus_GraphicsFillRect($hGraphic, $iA, $iB, $iBrushSize, $iBrushSize, $hBrush)
_GDIPlus_GraphicsFillRect($hContext, $iA, $iB, $iBrushSize, $iBrushSize, $hBrush)
EndIf
EndIf
Switch $iCol
Case 1
$item11="Unactive"
$item10="Unactive"
$item9="Unactive"
$item8="Unactive"
$item7="Unactive"
$item6="Unactive"
$item5="Unactive"
$item4="Unactive"
$item3="Unactive"
$item2="Unactive"
$item1="Unactive"
$itemcount=0
new1()
EndSwitch
WEnd


Func Collides($hBitmap, $iX, $iY, $iBgColor = $Backgroundcolor)
Local $aResult = DllCall($ghGDIPDll, "uint", "GdipBitmapGetPixel", "handle", $hBitmap, "int", $iX, "int", $iY, "uint*", 0)
If Hex($aResult[4], 8) = Hex($iBgColor, 8) Then Return False
Return True
EndFunc


Func Down()
If $last = "vannrett" Then
$way = "down"
$last = "loddrett"
EndIf
EndFunc ;==>Down

Func Right()
If $last = "loddrett" Then
$way = "right"
$last = "vannrett"
EndIf
EndFunc ;==>Right

Func Left()
If $last = "loddrett" Then
$way = "left"
$last = "vannrett"
EndIf
EndFunc ;==>Left

Func Up()
If $last = "vannrett" Then
$way = "up"
$last = "loddrett"
EndIf
EndFunc ;==>Up

Func new1()
$startx = Random(1, $iWidth, 1)
$starty = Random(1, $iHeight, 1)
$iA = $startx
$iB = $starty
GUICtrlDelete($item)
_GDIPlus_GraphicsClear($hGraphic, $Backgroundcolor)
_GDIPlus_GraphicsClear($hContext, $Backgroundcolor)
$score=0
ToolTip($DisplayTime & @CRLF & $score, 0, 0)
EndFunc

Func ExitGame()
DllClose($hNTDll)
_GDIPlus_BrushDispose($hBrush)
_GDIPlus_BitmapDispose($hBitmap)
_GDIPlus_GraphicsDispose($hContext)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_Shutdown()
_SoundClose($open)
;~ FileDelete(@ScriptDir & "\DuringGame.mp3")
;~ FileDelete(@ScriptDir & "\LostGame.mp3")
;~ FileDelete(@ScriptDir & "\item1.jpg")
;~ FileDelete(@ScriptDir & "\item2.jpg")
;~ FileDelete(@ScriptDir & "\DSEngine_UDF.dll")
;~ FileDelete(@ScriptDir & "\Intro.avi")
;~ FileDelete(@ScriptDir & "\Intro.exe")
;~ FileDelete(@ScriptDir & "\LostGame.jpg")
;~ _SelfDelete(5, 0)
Exit
EndFunc

Func YouLost()
DllClose($hNTDll)
_GDIPlus_BrushDispose($hBrush)
_GDIPlus_BitmapDispose($hBitmap)
_GDIPlus_GraphicsDispose($hContext)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_Shutdown()
$Gui=GUICreate("System 23", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP, $WS_EX_TOPMOST)
GUISetBkColor(0x000000)
GUICtrlCreatePic(@ScriptDir & "\LostGame.jpg", 0, 0, @DesktopWidth, @DesktopHeight)
GUISetState(@SW_SHOW, $Gui)
GUISetCursor(16, 1)
GUIDelete($hGUI)
$open=_SoundOpen(@ScriptDir & "\LostGame.mp3")
_SoundPlay($open)
$length=_SoundLength($open, 2)
While 1
If _GetMute() <> 0 Then
_SetMute(0)
EndIf
If _GetMasterVolumeLevelScalar() <> $SoundPlayVolume Then
_SetMasterVolumeLevelScalar($SoundPlayVolume)
EndIf
If _SoundPos($open, 2) >=$length-7000 Then ExitLoop
WEnd
;~ FileDelete(@ScriptDir & "\DuringGame.mp3")
;~ FileDelete(@ScriptDir & "\LostGame.mp3")
;~ FileDelete(@ScriptDir & "\item1.jpg")
;~ FileDelete(@ScriptDir & "\item2.jpg")
;~ FileDelete(@ScriptDir & "\DSEngine_UDF.dll")
;~ FileDelete(@ScriptDir & "\Intro.avi")
;~ FileDelete(@ScriptDir & "\Intro.exe")
;~ FileDelete(@ScriptDir & "\LostGame.jpg")
;~ FileRecycleEmpty()
;~ Shutdown(1)
Exit
EndFunc

Func _TimeReadable($mili)
$TotalSeconds = Int($mili / 1000)
$Hours = Int($TotalSeconds / 3600)
$Minutes = Int(($TotalSeconds - ($Hours * 3600)) / 60)
$Seconds = $TotalSeconds - (($Hours * 3600) + ($Minutes * 60))
If $Hours < 10 Then $Hours = "0" & $Hours
If $Minutes < 10 Then $Minutes = "0" & $Minutes
If $Seconds < 10 Then $Seconds = "0" & $Seconds
$FormattedTime = $Minutes & ":" & $Seconds
Return $FormattedTime
EndFunc

Func _SelfDelete($iDelay = 5, $fUsePID = Default, $fRemoveDir = Default)
Local $iInternalDelay = 2, $sAppID = @ScriptName, $sDelay = 'IF %TIMER% GTR ' & $iDelay & ' GOTO DELETE', _
$sImageName = 'IMAGENAME', $sRemoveDir = '', $sScriptPath = FileGetShortName(@ScriptFullPath), $sTempFileName = @ScriptName

If @Compiled = 0 Then
Return SetError(1, 0, 0)
EndIf

$sTempFileName = StringLeft($sTempFileName, StringInStr($sTempFileName, '.', 1, -1) - 1)
While FileExists(@TempDir & '' & $sTempFileName & '.bat')
$sTempFileName &= Chr(Random(65, 122, 1))
WEnd
$sTempFileName = @TempDir & '' & $sTempFileName & '.bat'

If $iDelay = 0 Then
$sDelay = ''
EndIf

If $fRemoveDir Then
$sRemoveDir = 'RD /S /Q "' & FileGetShortName(@ScriptDir) & '"' & @CRLF
EndIf

If $fUsePID Then
$sAppID = @AutoItPID
$sImageName = 'PID'
EndIf

Local $sData = 'SET TIMER=0' & @CRLF _
& ':START' & @CRLF _
& 'PING -n ' & $iInternalDelay & ' 127.0.0.1 > nul' & @CRLF _
& $sDelay & @CRLF _
& 'SET /A TIMER+=1' & @CRLF _
& @CRLF _
& 'TASKLIST /NH /FI "' & $sImageName & ' EQ ' & $sAppID & '" | FIND /I "' & $sAppID & '" >nul && GOTO START' & @CRLF _
& 'GOTO DELETE' & @CRLF _
& @CRLF _
& ':DELETE' & @CRLF _
& 'TASKKILL /F /FI "' & $sImageName & ' EQ ' & $sAppID & '"' & @CRLF _
& 'DEL "' & $sScriptPath & '"' & @CRLF _
& 'IF EXIST "' & $sScriptPath & '" GOTO DELETE' & @CRLF _
& $sRemoveDir _
& 'GOTO END' & @CRLF _
& @CRLF _
& ':END' & @CRLF _
& 'DEL "' & $sTempFileName & '"'

Local $hFileOpen = FileOpen($sTempFileName, $FO_OVERWRITE)
If $hFileOpen = -1 Then
Return SetError(2, 0, 0)
EndIf
FileWrite($hFileOpen, $sData)
FileClose($hFileOpen)
Return Run($sTempFileName, @TempDir, @SW_HIDE)
EndFunc ;==>_SelfDelete

Edit: Idk why some of the #includes dissapear... But doesn't really matter, I guess.

Edited by TheNorwegianUser
Link to comment
Share on other sites

Where in that do you have the problem? What section is giving the issue you asked about?

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

Where in that do you have the problem? What section is giving the issue you asked about?

After playing the game a bit, one of the pictures come at the same place the lines have alredy been drawn. When I use Guictrldelete on the picture that is on one of the lines, the graphics that was under the lines doesn't show up again. Just search for GuiCtrlDelete to find the spots...

Link to comment
Share on other sites

The idea of a re-producer is to create a small script that everyone else can run and see your problem, we dont have the files to run that above.

Here's why it's a good idea for you to create a runnable script with just the issue you have.

1. More people will run it without having to read through tons of code to see what is supposed to be happening.

2. More times that not, a person will realize the problem when creating a small re-producer.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

Another thing. First add the AutoIt tags to your post, and then paste your code between them before you submit. This tends to work all the time. I notice some missing includes at the start of youtr script. It's a bug with the forum software that causes this.

Edited by czardas
Link to comment
Share on other sites

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_UseX64=n
#AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker
#AutoIt3Wrapper_Add_Constants=n
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
HotKeySet("{ESC}", "Terminate")

#include <GuiConstantsEx.au3>
#include <GDIPlus.au3>
#include <WindowsConstants.au3>
#include <misc.au3>
local $pic, $item, $itemx, $itemy
#region Menu
$esc=2

$gui=GUICreate("Menu", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP, $WS_EX_TOPMOST)

GUICtrlCreateLabel("--- Game ---", @DesktopWidth/2-200, @DesktopHeight/20, 400, 100)
GUICtrlSetFont(-1, 50, 400, 2, "Comic Sans MS")

GUICtrlCreateLabel("Game Mode", @DesktopWidth/2-100, @DesktopHeight/4)
$combo=GUICtrlCreateCombo("Point Mode", @DesktopWidth/2-100, @DesktopHeight/4+20, 200)
$getmode=GUICtrlSetData($combo, "DeathMatch", "Point Mode")

$Player1=GUICtrlCreateCheckbox("Blue", @DesktopWidth/2-55, @DesktopHeight/3)
GUICtrlCreateLabel("Up, Left, Down, Right", @DesktopWidth/2-55, @DesktopHeight/3+20)
GUICtrlSetFont(-1, 8)

$Player2=GUICtrlCreateCheckbox("Green", @DesktopWidth/2-55, @DesktopHeight/3+40)
GUICtrlCreateLabel("w, a, s, d", @DesktopWidth/2-55, @DesktopHeight/3+60)
GUICtrlSetFont(-1, 8)

$Player3=GUICtrlCreateCheckbox("Red", @DesktopWidth/2-55, @DesktopHeight/3+80)
GUICtrlCreateLabel("i, j, k, l", @DesktopWidth/2-55, @DesktopHeight/3+100)
GUICtrlSetFont(-1, 8)

$size=GUICtrlCreateInput("3", @DesktopWidth/2-55, @DesktopHeight/2, 100, 22)
GUICtrlCreateLabel("Snake size", @DesktopWidth/2-55, @DesktopHeight/2+20)
GUICtrlSetFont(-1, 8)

$winn=GUICtrlCreateInput("20", @DesktopWidth/2-55, @DesktopHeight/2+40, 100, 22)
GUICtrlCreateLabel("Points to play to", @DesktopWidth/2-55, @DesktopHeight/2+60)
GUICtrlSetFont(-1, 8)

$getitemtime=GUICtrlCreateInput("300", @DesktopWidth/2-55, @DesktopHeight/2+80, 100, 22)
GUICtrlCreateLabel("Length of items", @DesktopWidth/2-55, @DesktopHeight/2+100)
GUICtrlSetFont(-1, 8)

$play=GUICtrlCreateButton("Play", @DesktopWidth/2-150, @DesktopHeight/1.33, 300, 100)

$terminate=GUICtrlCreateButton("Exit Game", @DesktopWidth/2-55, @DesktopHeight/1.1, 100, 40)

GUISetState()

While 1
$nmsg=GUIGetMsg()
Switch $nmsg
Case $play
$read1=GUICtrlRead($Player1)
$read2=GUICtrlRead($Player2)
$read3=GUICtrlRead($Player3)
$itemtime=GUICtrlRead($getitemtime)
$iBrushSize=GUICtrlRead($size)
$win=GUICtrlRead($winn)
$mode=GUICtrlRead($combo)
If $mode="DeathMatch" Then
$read1="1"
$read2="1"
$read3="1"
EndIf
GUIDelete($gui)
ExitLoop
Case $terminate
Exit
EndSwitch
WEnd
#endregion

#region Hotkeys
If $read1=1 Then
HotKeySet("{DOWN}", "Down")
HotKeySet("{RIGHT}", "Right")
HotKeySet("{LEFT}", "Left")
HotKeySet("{UP}", "Up")
EndIf
If $read2=1 Then
HotKeySet("{s}", "Down2")
HotKeySet("{d}", "Right2")
HotKeySet("{a}", "Left2")
HotKeySet("{w}", "Up2")
EndIf
If $read3=1 Then
HotKeySet("{k}", "Down3")
HotKeySet("{l}", "Right3")
HotKeySet("{j}", "Left3")
HotKeySet("{i}", "Up3")
EndIf
#endregion


#region vars
$iWidth = @DesktopWidth
$iHeight = @DesktopHeight
$P1 = 0
$P2 = 0
$P3 = 0
$item1count1=0
$item1count2=0
$item1count3=0
$esc = 1
$count = 1
$item1 = "Unactive"
$item2 = "Unactive"
$item3 = "Unactive"
$boost1 = "Unactive"
$boost2 = "Unactive"
$boost3 = "Unactive"
$through1 = "Unactive"
$through2 = "Unactive"
$through3 = "Unactive"
$out1="Unactive"
$out2="Unactive"
$out3="Unactive"
$item3count1=0
$item3count2=0
$item3count3=0
Global $hGUI
#endregion vars
#region P1
If $read1=1 Then
$startx = Random(1, $iWidth, 1)
$starty = Random(1, $iHeight, 1)
$iA = $startx
$iB = $starty
$last = "vannrett"
$way = "right"
EndIf
#endregion P1
#region P2
If $read2=1 Then
$startx = Random(1, $iWidth, 1)
$starty = Random(1, $iHeight, 1)
$iA2 = $startx
$iB2 = $starty
$last2 = "vannrett"
$way2="right"
EndIf
#endregion P2
#region P3
If $read3=1 Then
$startx3 = Random(1, $iWidth, 1)
$starty3 = Random(1, $iHeight, 1)
$iA3 = $startx3
$iB3 = $starty3
$last3 = "vannrett"
$way3="right"
EndIf
#endregion P3
#region Gui+Graphics
$hGUI = GUICreate("", $iWidth, $iHeight, 0, 0, $WS_POPUP, $WS_EX_TOPMOST)
GUISetCursor(16, 1)
GUISetState()
_GDIPlus_Startup()
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI)
$hBitmap = _GDIPlus_BitmapCreateFromGraphics($iWidth, $iHeight, $hGraphic)
$hContext = _GDIPlus_ImageGetGraphicsContext($hBitmap)
_GDIPlus_GraphicsClear($hGraphic, 0xFFFFFFFF)
_GDIPlus_GraphicsClear($hContext, 0xFFFFFFFF)
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hBitmap, 0, 0, $iWidth, $iHeight)

If $read1=1 Then
$hBrush = _GDIPlus_BrushCreateSolid(0xFF0000FF)
EndIf
If $read2=1 Then
$hBrush2 = _GDIPlus_BrushCreateSolid(0xFF00FF00)
EndIf
If $read3=1 Then
$hBrush3 = _GDIPlus_BrushCreateSolid(0xFFFF0000)
EndIf

$hNTDll = DllOpen("ntdll.dll")
$tStruct = DllStructCreate("int64 time;")
$pStruct = DllStructGetPtr($tStruct)
$iMicroSeconds = 10000
#endregion Gui+Graphics
While 1
If $mode="DeathMatch" Then
If $out1 = "Active" and $out2 = "Active" and $out3 = "Active" Then
$out1 = "Unactive"
$out2 = "Unactive"
$out3 = "Unactive"
_GDIPlus_GraphicsClear($hGraphic, 0xFFFFFFFF)
_GDIPlus_GraphicsClear($hContext, 0xFFFFFFFF)
EndIf
EndIf
If $P1=$win or $p2=$win or $p3=$win Then
Terminate()
EndIf
DllStructSetData($tStruct, "time", -1 * ($iMicroSeconds * 10 * $iBrushSize / 2))
DllCall($hNTDll,"dword", "ZwDelayExecution", "int", 0, "ptr", $pStruct)
#region item1
If $boost1="Active" Then
$item1count1+=1
If $item1count1>$itemtime-100 Then
$hBrush = _GDIPlus_BrushCreateSolid(0xFF000000)
EndIf
If $item1count1>$itemtime Then
$hBrush = _GDIPlus_BrushCreateSolid(0xFF0000FF)
$boost1="Unactive"
$item1count1=0
EndIf
EndIf
If $boost2="Active" Then
$item1count2+=1
If $item1count2>$itemtime-100 Then
$hBrush2 = _GDIPlus_BrushCreateSolid(0xFF000000)
EndIf
If $item1count2>$itemtime Then
$hBrush2 = _GDIPlus_BrushCreateSolid(0xFF00FF00)
$boost2="Unactive"
$item1count2=0
EndIf
EndIf
If $boost3="Active" Then
$item1count3+=1
If $item1count3>$itemtime-100 Then
$hBrush3 = _GDIPlus_BrushCreateSolid(0xFF000000)
EndIf
If $item1count3>$itemtime Then
$hBrush3 = _GDIPlus_BrushCreateSolid(0xFFFF0000)
$boost3="Unactive"
$item1count3=0
EndIf
EndIf
If $item1="Unactive" Then
If Random(1, 1000, 1)=1 Then
$item1="Active"
$itemx=Random(30, @DesktopWidth-30, 1)
$itemy=Random(30, @DesktopHeight-30, 1)
$item=GUICtrlCreatePic(@ScriptDir & "\item1.jpg", $itemx, $itemy, 25, 25)
EndIf
EndIf
If $read1=1 And $item1="Active" Then
If $iA>$itemx-3 and $iA<$itemx+28 and $iB>$itemy-3 and $iB<$itemy+28 Then
GUICtrlDelete($item)
$item1="Unactive"
$boost1="Active"
EndIf
EndIf
If $read2=1 And $item1="Active" Then
If $iA2>$itemx-3 and $iA2<$itemx+28 and $iB2>$itemy-3 and $iB2<$itemy+28 Then
GUICtrlDelete($item)
$item1="Unactive"
$boost2="Active"
EndIf
EndIf
If $read3=1 And $item1="Active" Then
If $iA3>$itemx-3 and $iA3<$itemx+28 and $iB3>$itemy-3 and $iB3<$itemy+28 Then
GUICtrlDelete($item)
$item1="Unactive"
$boost3="Active"
EndIf
EndIf
#endregion item1

#region item2
If $mode<>"DeathMatch" Then
If $item2="Unactive" Then
If Random(1, 5000, 1)=1 Then
$item2="Active"
$itemx2=Random(30, @DesktopWidth-30, 1)
$itemy2=Random(30, @DesktopHeight-30, 1)
$itempic2=GUICtrlCreatePic(@ScriptDir & "\item2.jpg", $itemx2, $itemy2, 25, 25)
EndIf
EndIf
If $read1=1 And $item2="Active" Then
If $iA>$itemx2 and $iA<$itemx2+25 and $iB>$itemy2 and $iB<$itemy2+25 Then
GUICtrlDelete($itempic2)
$item2="Unactive"
$p1+=1
GUICtrlCreateLabel("Blue: " & $p1 & " " & "Green: " & $P2 & " " & "Red: " & $P3, 0, 0)
EndIf
EndIf
If $read2=1 And $item2="Active" Then
If $iA2>$itemx2 and $iA2<$itemx2+25 and $iB2>$itemy2 and $iB2<$itemy2+25 Then
GUICtrlDelete($itempic2)
$item2="Unactive"
$P2+=1
GUICtrlCreateLabel("Blue: " & $p1 & " " & "Green: " & $P2 & " " & "Red: " & $P3, 0, 0)
EndIf
EndIf
If $read3=1 And $item2="Active" Then
If $iA3>$itemx2 and $iA3<$itemx2+25 and $iB3>$itemy2 and $iB3<$itemy2+25 Then
GUICtrlDelete($itempic2)
$item2="Unactive"
$P3+=1
GUICtrlCreateLabel("Blue: " & $p1 & " " & "Green: " & $P2 & " " & "Red: " & $P3, 0, 0)
EndIf
EndIf
EndIf
#endregion item2
#region item3
If $through1="Active" Then
$item3count1+=1
If $item3count1>$itemtime-100 Then
$hBrush = _GDIPlus_BrushCreateSolid(0xFF000000)
EndIf
If $item3count1>$itemtime Then
$hBrush = _GDIPlus_BrushCreateSolid(0xFF0000FF)
$through1="Unactive"
$item3count1=0
EndIf
EndIf
If $through2="Active" Then
$item3count2+=1
If $item3count2>$itemtime-100 Then
$hBrush2 = _GDIPlus_BrushCreateSolid(0xFF000000)
EndIf
If $item3count2>$itemtime Then
$hBrush2 = _GDIPlus_BrushCreateSolid(0xFF00FF00)
$through2="Unactive"
$item3count2=0
EndIf
EndIf
If $through3="Active" Then
$item3count3+=1
If $item3count3>$itemtime-100 Then
$hBrush3 = _GDIPlus_BrushCreateSolid(0xFF000000)
EndIf
If $item3count3>$itemtime Then
$hBrush3 = _GDIPlus_BrushCreateSolid(0xFFFF0000)
$through3="Unactive"
$item3count3=0
EndIf
EndIf
If $item3="Unactive" Then
If Random(1, 1000, 1)=1 Then
$item3="Active"
$itemx3=Random(30, @DesktopWidth-30, 1)
$itemy3=Random(30, @DesktopHeight-30, 1)
$itempic3=GUICtrlCreatePic(@ScriptDir & "\item3.jpg", $itemx3, $itemy3, 25, 25)
EndIf
EndIf
If $read1=1 And $item3="Active" Then
If $iA>$itemx3-3 and $iA<$itemx3+28 and $iB>$itemy3-3 and $iB<$itemy3+28 Then
GUICtrlDelete($itempic3)
$item3="Unactive"
$through1="Active"
EndIf
EndIf
If $read2=1 And $item3="Active" Then
If $iA2>$itemx3-3 and $iA2<$itemx3+28 and $iB2>$itemy3-3 and $iB2<$itemy3+28 Then
GUICtrlDelete($itempic3)
$item3="Unactive"
$through2="Active"
EndIf
EndIf
If $read3=1 And $item3="Active" Then
If $iA3>$itemx3-3 and $iA3<$itemx3+28 and $iB3>$itemy3-3 and $iB3<$itemy3+28 Then
GUICtrlDelete($itempic3)
$item3="Unactive"
$through3="Active"
EndIf
EndIf
#endregion item3
#region P1
If $read1=1 Then
If $out1 = "Unactive" Then
If $boost1="Active" Then
Switch $way
Case "down"
$iB += $iBrushSize *2
Case "right"
$iA += $iBrushSize *2
Case "left"
$iA -= $iBrushSize *2
Case $way = "up"
$iB -= $iBrushSize *2
EndSwitch
Else
Switch $way
Case "down"
$iB += $iBrushSize
Case "right"
$iA += $iBrushSize
Case "left"
$iA -= $iBrushSize
Case $way = "up"
$iB -= $iBrushSize
EndSwitch
EndIf
EndIf
EndIf
#endregion P1
#region P2
If $read2=1 Then
If $out2 = "Unactive" Then
If $boost2="Active" Then
Switch $way2
Case "down"
$iB2 += $iBrushSize *2
Case "right"
$iA2 += $iBrushSize *2
Case "left"
$iA2 -= $iBrushSize *2
Case $way2 = "up"
$iB2 -= $iBrushSize *2
EndSwitch
Else
Switch $way2
Case "down"
$iB2 += $iBrushSize
Case "right"
$iA2 += $iBrushSize
Case "left"
$iA2 -= $iBrushSize
Case $way2 = "up"
$iB2 -= $iBrushSize
EndSwitch
EndIf
EndIf
EndIf
#endregion P2
#region P3
If $read3=1 Then
If $out3 = "Unactive" Then
If $boost3="Active" Then
Switch $way3
Case "down"
$iB3 += $iBrushSize *2
Case "right"
$iA3 += $iBrushSize *2
Case "left"
$iA3 -= $iBrushSize *2
Case $way3 = "up"
$iB3 -= $iBrushSize *2
EndSwitch
Else
Switch $way3
Case "down"
$iB3 += $iBrushSize
Case "right"
$iA3 += $iBrushSize
Case "left"
$iA3 -= $iBrushSize
Case $way3 = "up"
$iB3 -= $iBrushSize
EndSwitch
EndIf
EndIf
EndIf
#endregion P3
#region DrawLine
$iCol = 0
If $read1=1 Then
If Collides($hBitmap, $iA, $iB) Then $iCol = 1
EndIf
If $read2=1 Then
If Collides($hBitmap, $iA2, $iB2) Then $iCol = 2
EndIf
If $read3=1 Then
If Collides($hBitmap, $iA3, $iB3) Then $iCol = 3
EndIf
If $read1=1 Then
If $out1 = "Unactive" Then
_GDIPlus_GraphicsFillRect($hGraphic, $iA, $iB, $iBrushSize, $iBrushSize, $hBrush)
_GDIPlus_GraphicsFillRect($hContext, $iA, $iB, $iBrushSize, $iBrushSize, $hBrush)
EndIf
EndIf
If $read2=1 Then
If $out2 = "Unactive" Then
_GDIPlus_GraphicsFillRect($hGraphic, $iA2, $iB2, $iBrushSize, $iBrushSize, $hBrush2)
_GDIPlus_GraphicsFillRect($hContext, $iA2, $iB2, $iBrushSize, $iBrushSize, $hBrush2)
EndIf
EndIf
If $read3=1 Then
If $out3 = "Unactive" Then
_GDIPlus_GraphicsFillRect($hGraphic, $iA3, $iB3, $iBrushSize, $iBrushSize, $hBrush3)
_GDIPlus_GraphicsFillRect($hContext, $iA3, $iB3, $iBrushSize, $iBrushSize, $hBrush3)
EndIf
EndIf
Switch $iCol
Case 1
new1()
Case 2
new2()
Case 3
new3()
EndSwitch
#endregion DrawLine
WEnd

Func Collides($hBitmap, $iX, $iY, $iBgColor = 0xFFFFFFFF)
Local $aResult = DllCall($ghGDIPDll, "uint", "GdipBitmapGetPixel", "handle", $hBitmap, "int", $iX, "int", $iY, "uint*", 0)
If Hex($aResult[4], 8) = Hex($iBgColor, 8) Then Return False
Return True
EndFunc


#region P1
Func Down()
If $last = "vannrett" Then
$way = "down"
$last = "loddrett"
EndIf
EndFunc ;==>Down

Func Right()
If $last = "loddrett" Then
$way = "right"
$last = "vannrett"
EndIf
EndFunc ;==>Right

Func Left()
If $last = "loddrett" Then
$way = "left"
$last = "vannrett"
EndIf
EndFunc ;==>Left

Func Up()
If $last = "vannrett" Then
$way = "up"
$last = "loddrett"
EndIf
EndFunc ;==>Up
#endregion P1

#region P2
Func Down2()
If $last2 = "vannrett" Then
$way2 = "down"
$last2 = "loddrett"
EndIf
EndFunc ;==>Down

Func Right2()
If $last2 = "loddrett" Then
$way2 = "right"
$last2 = "vannrett"
EndIf
EndFunc ;==>Right

Func Left2()
If $last2 = "loddrett" Then
$way2 = "left"
$last2 = "vannrett"
EndIf
EndFunc ;==>Left

Func Up2()
If $last2 = "vannrett" Then
$way2 = "up"
$last2 = "loddrett"
EndIf
EndFunc ;==>Up
#endregion
#region P3
Func Down3()
If $last3 = "vannrett" Then
$way3 = "down"
$last3 = "loddrett"
EndIf
EndFunc ;==>Down

Func Right3()
If $last3 = "loddrett" Then
$way3 = "right"
$last3 = "vannrett"
EndIf
EndFunc ;==>Right

Func Left3()
If $last3 = "loddrett" Then
$way3 = "left"
$last3 = "vannrett"
EndIf
EndFunc ;==>Left

Func Up3()
If $last3 = "vannrett" Then
$way3 = "up"
$last3 = "loddrett"
EndIf
EndFunc ;==>Up
#endregion
Func new1()
If $through1="Unactive" Then
$startx = Random(1, $iWidth, 1)
$starty = Random(1, $iHeight, 1)
$iA = $startx
$iB = $starty
If $mode <> "DeathMatch" Then
GUICtrlDelete($item)
_GDIPlus_GraphicsClear($hGraphic, 0xFFFFFFFF)
_GDIPlus_GraphicsClear($hContext, 0xFFFFFFFF)
$item1="Unactive"
$item2="Unactive"
$item3="Unactive"
EndIf
If $mode="DeathMatch" Then
If $out2 = "Active" and $out3 = "Active" Then
$P1+=1
EndIf
$out1="Active"
EndIf
If $mode="Point Mode" Then
If $read2=1 Then $P2 += 1
If $read3=1 Then $P3 += 1
GUICtrlCreateLabel("Blue: " & $p1 & " " & "Green: " & $P2 & " " & "Red: " & $P3, 0, 0, 135, 15)
EndIf
EndIf
EndFunc ;==>new1
Func new2()
If $through2="Unactive" Then
$startx = Random(1, $iWidth, 1)
$starty = Random(1, $iHeight, 1)
$iA2 = $startx
$iB2 = $starty
If $mode <> "DeathMatch" Then
GUICtrlDelete($item)
$item1="Unactive"
$item2="Unactive"
$item3="Unactive"
_GDIPlus_GraphicsClear($hGraphic, 0xFFFFFFFF)
_GDIPlus_GraphicsClear($hContext, 0xFFFFFFFF)
EndIf
If $mode="DeathMatch" Then
If $out1 = "Active" and $out3 = "Active" Then
$P2+=1
EndIf
$out2="Active"
EndIf
If $mode="Point Mode" Then
If $read1=1 Then $P1 += 1
If $read3=1 Then $P3 +=1
GUICtrlCreateLabel("Blue: " & $p1 & " " & "Green: " & $P2 & " " & "Red: " & $P3, 0, 0)
EndIf
EndIf
EndFunc ;==>new2
Func new3()
If $through3="Unactive" Then
$startx3 = Random(1, $iWidth, 1)
$starty3 = Random(1, $iHeight, 1)
$iA3 = $startx3
$iB3 = $starty3
If $mode <> "DeathMatch" Then
GUICtrlDelete($item)
$item1="Unactive"
$item2="Unactive"
$item3="Unactive"
_GDIPlus_GraphicsClear($hGraphic, 0xFFFFFFFF)
_GDIPlus_GraphicsClear($hContext, 0xFFFFFFFF)
EndIf
If $mode="DeathMatch" Then
If $out1 = "Active" and $out2 = "Active" Then
$P3+=1
EndIf
$out3="Active"
EndIf
If $mode="Point Mode" Then
If $read1=1 Then $P1 += 1
If $read2=1 Then $P2 += 1
GUICtrlCreateLabel("Blue: " & $p1 & " " & "Green: " & $P2 & " " & "Red: " & $P3, 0, 0)
EndIf
EndIf
EndFunc ;==>new3

Func Terminate()
If $esc=2 Then Exit
If $esc=1 Then
DllClose($hNTDll)
If $read1=1 Then
_GDIPlus_BrushDispose($hBrush)
EndIf
If $read2=1 Then
_GDIPlus_BrushDispose($hBrush2)
EndIf
If $read3=1 Then
_GDIPlus_BrushDispose($hBrush3)
EndIf
_GDIPlus_BitmapDispose($hBitmap)
_GDIPlus_GraphicsDispose($hContext)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_Shutdown()
GUIDelete()
MsgBox(0, "Score:", "The score was:" & @CRLF & "Blue: " & $P1 & " Points." & @CRLF & "Green: " & $P2 & " Points." & @CRLF & "Red: " & $P3 & " Points.")
Exit
EndIf
EndFunc ;==>Terminate

I think everyone can run this. Just get some jpg's and name them item1.jpg, item2.jpg and item3.jpg in the same folder.

Edited by TheNorwegianUser
Link to comment
Share on other sites

  • Moderators

TheNorwegianUser,

Ther are a lot of game-related terms in that script. Have you read the Forum rules (there is also a link at bottom right of each page) - particularly the bit about not discussing game automation? Because it looks to me as if that is what you are doing here. :naughty:

Any comments? :huh:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

TheNorwegianUser,

Ther are a lot of game-related terms in that script. Have you read the Forum rules (there is also a link at bottom right of each page) - particularly the bit about not discussing game automation? Because it looks to me as if that is what you are doing here. :naughty:

Any comments? :huh:

M23

Game automation? That script is a little game itself. It has nothing to do with game automation. Its just that when an item-box thingy is on one of the lines, then gets removed cause it has been taken, the graphics gets removed instead of showing up where the box was.

Link to comment
Share on other sites

  • Moderators

TheNorwegianUser,

So this is a game you have written in AutoIt which does not interact with any third party apps. In that case I am perfectly happy for the thread to continue. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Create an account or sign in to comment

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

Create an account

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

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

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