Need a little help please

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
wattz
Posts: 1
Joined: 30 Sep 2013, 20:47

Need a little help please

01 Oct 2013, 20:56

Hi all ,i'm having a little trouble atm with getting my background picture on my gui to work on other people's pc's works fine on mine but on another persons it just displays the picture name e.g bckground.jpg ,here is the code below ,would be great if someone could show me where im going wrong and help me get it right :)

Code: Select all

#noenv
SetWorkingDir %A_ScriptDir%

GameFile = iw3mp.exe
;GameFile = notepad.exe
portA = 28972
portB = 28973
portC = 28974
portD = 28975
portE = 28976
portF = 28977
IP = 176.227.209.170
GamePID = 0

PicFile = %A_Temp%\BCKGROUND.bmp
FileInstall,C:\Users\WATTZ\Desktop\BCKGROUND.jpg,%PicFile%
Gui, Add, Picture, x-8 y0 w660 h420 vPicWp,%PicFile%
FileDelete,%PicFile%

Gui, Add, Picture, x-8 y0 w670 h420 , C:\Users\WATTZ\Desktop\BCKGROUND.jpg
Gui, Add, Button, x42 y160 w130 h40 gB_Options vB_tdmhc, TDM HC
Gui, Add, Button, x182 y160 w130 h40 gB_Options vB_tdm, TDM
Gui, Add, Button, x42 y220 w130 h40 gB_Options vB_dm, DEATHRUN
Gui, Add, Button, x182 y220 w130 h40 gB_Options vB_zom, ZOMBIES
Gui, Add, Button, x42 y280 w130 h40 gB_Options vB_mw2maps, MW2 MAPS
Gui, Add, Button, x182 y280 w130 h40 gB_Options vB_bomaps, BLACK OPS MAPS
Gui, Add, Button, x102 y350 w150 h30 gB_Options vB_fragforums, VIST FRAGZONE FORUMS
; Generated using SmartGUI Creator 4.0
Gui, Show, x127 y87 h414 w655, |FZ|COD4 SERVER CONNECTOR V1.1 By WATTZ & Temil2008
Return

B_Options:
	if (A_GuiControl = "B_tdmhc")
		port := portA
	else if (A_GuiControl = "B_tdm")
		port := portB
	else if (A_GuiControl = "B_dm")
		port := portC
	else if (A_GuiControl = "B_zom")
		port := portD
	else if (A_GuiControl = "B_mw2maps")
		port := portE
	else if (A_GuiControl = "B_bomaps")
		port := portF
	else if (A_GuiControl = "B_fragforums")
		port = na
		
	if (port = "na")
	{
		run, http://www.fragzonegaming.co.uk/index.php?/index
		return
	}
	if (GamePID != 0)
	{
		Process, Exist, %GamePID%
		ProcessExistA := ErrorLevel
	}
	else
	{
		ProcessExistA = 0
	}
	Process, Exist, %GameFile%
	ProcessExistB := ErrorLevel
	
	If (ProcessExistA = 0 AND ProcessExistB = 0)
	{
		IfExist, %GameFile%
		{
			Run, %GameFile% +connect %IP%:%port% , %A_ScriptDir% , GamePID
			Process, Priority, %GamePID%, high
		}
		else
		{
			MsgBox,, 48, Unable to locate file "iw3mp.exe" within the folder the launcher was placed.
		}
	}
	else if (ProcessExistA != 0)
	{
		GamePID := ProcessExistA
		gosub, SendToGame
	}
	else if (ProcessExistB != 0)
	{
		GamePID := ProcessExistB
		gosub, SendToGame
	}
return

SendToGame:
	WinActivate, ahk_pid %GamePID%
	WinWaitActive, ahk_pid %GamePID%,, 5
	ifwinactive, ahk_pid %GamePID%
	{
		send, ``
		Sleep, 500
		Send, connect %IP%:%Port%
		Sleep, 250
		Send, {enter}
	}
	else
		MsgBox, Was unable to make the game window active within 5secs.
return

GuiClose:
ExitApp
User avatar
Menixator
Posts: 69
Joined: 30 Sep 2013, 04:10

Re: Need a little help please

01 Oct 2013, 21:03

The only thing that I can think of is, the picture doesn't exist on that machine.
User avatar
joedf
Posts: 9000
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: Need a little help please

01 Oct 2013, 21:05

Menixator wrote:The only thing that I can think of is, the picture doesn't exist on that machine.
true.

@line#18 You should not Delete the file, until the gui has actually been fully loaded.
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], MrHue, Rohwedder, Rxbie, songdg and 365 guests