Multiple GUI Instances? one after another? error

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
owensingh72
Posts: 12
Joined: 29 Dec 2019, 10:48

Multiple GUI Instances? one after another? error

02 Mar 2020, 08:54

Hello I am trying to make a script. Things I want to achieve is I have two guis. I want run one after another. I have two GUIs in first u need to enter password and in second its the script I want to run and destroy previous GUI, I searched alot not luck can anybody help me?

Please someone fix for me I am trying from a lot of time no luck. I want to upload as soon as possible. I already have the permission of the no recoil script author to post on my website I already asked him on forum :)

Code: Select all

#NoEnv
SendMode Input

Gui,1: Font, S15 CDefault, Verdana
Gui,1: Add, Text, x82 y9 w300 h30 , PUBG LITE NO RECOIL HACK
Gui,1: Add, Edit, x52 y69 w370 h30 -VScroll vE1, Paste Code Here
Gui,1: Add, Button, x102 y129 w80 h30 gsub1 , Enter
Gui,1: Add, Button, x272 y129 w100 h30 gsub2 , Get Code
Gui,1: Font, S12 CDefault Italic Underline, Verdana
Gui,1: Add, Text, x32 y179 w420 h60 , To get the code click Get Code button`, After that copy on my website`, After that Copy URL and Paste here!
Gui,1: Font, S12 CDefault, Verdana
Gui,1: Font, S12 CDefault, Verdana
Gui,1: Font, , 
Gui,1: Add, Text, x2 y269 w180 h20 , Hack created By gamingforecast.com
Gui,1: Show, x404 y205 h288 w479, No Recoil Hack
Return

sub1:
Gui,1: Submit, NoHide
if (StrLen(E1) < 20)
  	Msgbox Please Visit www.gamingforecast.com Click any code, then copy the URL and paste it here!
else
	MsgBox Thanks for helping us out :), We daily update new hacks on our website www.gamingforecast.com, Make sure to check daily!
return

sub2:
Run chrome.exe "https gamingforecast.com /"  Broken Link for safety " --new-window "
return 

IniRead, IniSuspendKey, Settings.ini, Settings, SuspendKey, F3
IniRead, IniRecSize, Settings.ini, NoRecoil, Size, 4
IniRead, IniRecTiming, Settings.ini, NoRecoil, Timing, 10
IniRead, IniRecIncreaseTiming, Settings.ini, NoRecoil, Increase timing, 1000

Hotkey, %IniSuspendKey%, ~$hkWrite

ScriptON := 1
Gui Color, 33cc33
Gui Font, 000000
Gui, Add, Text, x80 y16 w30 h23 +0x200, Recoil
Gui, Add, Edit, r1 Limit2 Number Center x80 y40 w30 vRecSize, %IniRecSize%
Gui, Add, Text, x128 y16 w60 h23 +0x200, Timing (ms)
Gui, Add, Edit, r1 Limit2 Number Center x140 y40 w30 vRecTiming, %IniRecTiming%
Gui, Add, Text, x200 y16 w70 h23 +0x200, Increase (ms)
Gui, Add, Edit, r1 Limit4 Number Center x200 y40 w30 vRecIncreaseTiming, %IniRecIncreaseTiming%
Gui, Add, Text, x130 y75 w55 h20 +0x200 +center, Suspend:
Gui, Font, bold
Gui, Add, Text, x20 y75 w30 h20 +0x200 vScriptON, ON
Gui, Font, norm
Gui, Add, ComboBox, x110 y95 w90 vSuspend, %IniSuspendKey%||XButton1|Insert|Delete|F1|F2|F3|F4|F5|TAB
Gui, Add, Button, gSaveIni x100 y130, Save
Gui, Add, Button, gLoadIni x155 y130, ReLoad
Gui Show, w300 h170, RecHelp
Gui, Submit, nohide

isMouseShown()
{
	StructSize := A_PtrSize + 16
	VarSetCapacity(InfoStruct, StructSize)
	NumPut(StructSize, InfoStruct)
	DllCall("GetCursorInfo", UInt, &InfoStruct)
	Result := NumGet(InfoStruct, 8)

	if Result > 1
		return 1
	else
		return 0
}

~*$LButton::
if isMouseShown() == 0  ; comment this line to cancel mouse cursor detection
{
	RecInc := 0
	SetTimer, RecIncrease, %RecIncreaseTiming%
	Loop
	{
		GetKeyState, state, LButton, P
		if state=u
			break

		Gui, Submit, nohide		
		mouseXY(0,RecSize+RecInc)
		sleep, RecTiming
	}
	return
}

RecIncrease:
RecInc++
return

mouseXY(x,y)
{
	DllCall("mouse_event",int,1,int,x,int,y,uint,0,uint,0)
}

NumpadHome::increaseRecSize(RecSize)
NumpadEnd::decreaseRecSize(RecSize)
increaseRecSize(s)
{
	if s <= 98
	{
		s++
		GuiControl,, RecSize, %s%
		Gui, Submit, nohide
	}
	else
		return
}
decreaseRecSize(s)
{
	if s >= 2
	{
		s--
		GuiControl,, RecSize, %s%
		Gui, Submit, nohide
	}
	else
		return
}
NumpadUp::increaseTiming(RecTiming)
NumpadDown::decreaseTiming(RecTiming)
increaseTiming(t)
{
	if t <= 98
	{
		t++
		GuiControl,, RecTiming, %t%
		Gui, Submit, nohide
	}
	else
		return
}
decreaseTiming(t)
{
	if t >= 2
	{
		t--
		GuiControl,, RecTiming, %t%
		Gui, Submit, nohide
	}
	else
		return
}
NumpadPgUp::increaseIncreaseTiming(RecIncreaseTiming)
NumpadPgDn::decreaseIncreaseTiming(RecIncreaseTiming)
increaseIncreaseTiming(tm)
{
	if tm <= 9800
	{
		tm+=100
		GuiControl,, RecIncreaseTiming, %tm%
		Gui, Submit, nohide
	}
	else
		return
}
decreaseIncreaseTiming(tm)
{
	if tm >= 100
	{
		tm-=100
		GuiControl,, RecIncreaseTiming, %tm%
		Gui, Submit, nohide
	}
	else
		return
}
 
~$hkWrite:
Suspend, Permit
Suspend, Toggle
if A_IsSuspended=1
{
	Gui Color, ad896b
	ScriptON := 0
	GuiControl,, ScriptON, OFF
}
else
{
	Gui Color, 33cc33
	ScriptON := 1
	GuiControl,, ScriptON, ON
}
return

SaveIni:
GuiControlGet, NewSuspend, , Suspend
GuiControlGet, NewRecSize, , RecSize
GuiControlGet, NewRecTiming, , RecTiming
GuiControlGet, NewRecIncreaseTiming, , RecIncreaseTiming
IniWrite, %NewSuspend%, Settings.ini, Settings, SuspendKey
IniWrite, %NewRecSize%, Settings.ini, NoRecoil, Size
IniWrite, %NewRecTiming%, Settings.ini, NoRecoil, Timing
IniWrite, %NewRecIncreaseTiming%, Settings.ini, NoRecoil, Increase timing
MsgBox, Saved.
return
 
LoadIni:
Reload
return

GuiEscape:
GuiClose:
ExitApp
Last edited by owensingh72 on 02 Mar 2020, 10:55, edited 1 time in total.
User avatar
boiler
Posts: 16949
Joined: 21 Dec 2014, 02:44

Re: Multiple GUI Instances? one after another? error

02 Mar 2020, 09:34

Tip: Bumping your own thread in less than half an hour after posting makes it less likely to get a reply, not more likely.
UnReALiTyy
Posts: 223
Joined: 06 Jun 2017, 11:38

Re: Multiple GUI Instances? one after another? error

02 Mar 2020, 11:10

owensingh72 wrote:
02 Mar 2020, 08:54
Hello I am trying to make a script. Things I want to achieve is I have two guis. I want run one after another. I have two GUIs in first u need to enter password and in second its the script I want to run and destroy previous GUI, I searched alot not luck can anybody help me?

Please someone fix for me I am trying from a lot of time no luck. I want to upload as soon as possible. I already have the permission of the no recoil script author to post on my website I already asked him on forum :)

Code: Select all

#NoEnv
SendMode Input

Gui,1: Font, S15 CDefault, Verdana
Gui,1: Add, Text, x82 y9 w300 h30 , PUBG LITE NO RECOIL HACK
Gui,1: Add, Edit, x52 y69 w370 h30 -VScroll vE1, Paste Code Here
Gui,1: Add, Button, x102 y129 w80 h30 gsub1 , Enter
Gui,1: Add, Button, x272 y129 w100 h30 gsub2 , Get Code
Gui,1: Font, S12 CDefault Italic Underline, Verdana
Gui,1: Add, Text, x32 y179 w420 h60 , To get the code click Get Code button`, After that copy on my website`, After that Copy URL and Paste here!
Gui,1: Font, S12 CDefault, Verdana
Gui,1: Font, S12 CDefault, Verdana
Gui,1: Font, , 
Gui,1: Add, Text, x2 y269 w180 h20 , Hack created By gamingforecast.com
Gui,1: Show, x404 y205 h288 w479, No Recoil Hack
Return

sub1:
Gui,1: Submit, NoHide
if (StrLen(E1) < 20)
  	Msgbox Please Visit www.gamingforecast.com Click any code, then copy the URL and paste it here!
else
	MsgBox Thanks for helping us out :), We daily update new hacks on our website www.gamingforecast.com, Make sure to check daily!
return

sub2:
Run chrome.exe "https gamingforecast.com /"  Broken Link for safety " --new-window "

IniRead, IniSuspendKey, Settings.ini, Settings, SuspendKey, F3
IniRead, IniRecSize, Settings.ini, NoRecoil, Size, 4
IniRead, IniRecTiming, Settings.ini, NoRecoil, Timing, 10
IniRead, IniRecIncreaseTiming, Settings.ini, NoRecoil, Increase timing, 1000

Hotkey, %IniSuspendKey%, ~$hkWrite

ScriptON := 1
Gui Color, 33cc33
Gui Font, 000000
Gui, Add, Text, x80 y16 w30 h23 +0x200, Recoil
Gui, Add, Edit, r1 Limit2 Number Center x80 y40 w30 vRecSize, %IniRecSize%
Gui, Add, Text, x128 y16 w60 h23 +0x200, Timing (ms)
Gui, Add, Edit, r1 Limit2 Number Center x140 y40 w30 vRecTiming, %IniRecTiming%
Gui, Add, Text, x200 y16 w70 h23 +0x200, Increase (ms)
Gui, Add, Edit, r1 Limit4 Number Center x200 y40 w30 vRecIncreaseTiming, %IniRecIncreaseTiming%
Gui, Add, Text, x130 y75 w55 h20 +0x200 +center, Suspend:
Gui, Font, bold
Gui, Add, Text, x20 y75 w30 h20 +0x200 vScriptON, ON
Gui, Font, norm
Gui, Add, ComboBox, x110 y95 w90 vSuspend, %IniSuspendKey%||XButton1|Insert|Delete|F1|F2|F3|F4|F5|TAB
Gui, Add, Button, gSaveIni x100 y130, Save
Gui, Add, Button, gLoadIni x155 y130, ReLoad
Gui Show, w300 h170, RecHelp
Gui, Submit, nohide

isMouseShown()
{
	StructSize := A_PtrSize + 16
	VarSetCapacity(InfoStruct, StructSize)
	NumPut(StructSize, InfoStruct)
	DllCall("GetCursorInfo", UInt, &InfoStruct)
	Result := NumGet(InfoStruct, 8)

	if Result > 1
		return 1
	else
		return 0
}

~*$LButton::
if isMouseShown() == 0  ; comment this line to cancel mouse cursor detection
{
	RecInc := 0
	SetTimer, RecIncrease, %RecIncreaseTiming%
	Loop
	{
		GetKeyState, state, LButton, P
		if state=u
			break

		Gui, Submit, nohide		
		mouseXY(0,RecSize+RecInc)
		sleep, RecTiming
	}
	return
}

RecIncrease:
RecInc++
return

mouseXY(x,y)
{
	DllCall("mouse_event",int,1,int,x,int,y,uint,0,uint,0)
}

NumpadHome::increaseRecSize(RecSize)
NumpadEnd::decreaseRecSize(RecSize)
increaseRecSize(s)
{
	if s <= 98
	{
		s++
		GuiControl,, RecSize, %s%
		Gui, Submit, nohide
	}
	else
		return
}
decreaseRecSize(s)
{
	if s >= 2
	{
		s--
		GuiControl,, RecSize, %s%
		Gui, Submit, nohide
	}
	else
		return
}
NumpadUp::increaseTiming(RecTiming)
NumpadDown::decreaseTiming(RecTiming)
increaseTiming(t)
{
	if t <= 98
	{
		t++
		GuiControl,, RecTiming, %t%
		Gui, Submit, nohide
	}
	else
		return
}
decreaseTiming(t)
{
	if t >= 2
	{
		t--
		GuiControl,, RecTiming, %t%
		Gui, Submit, nohide
	}
	else
		return
}
NumpadPgUp::increaseIncreaseTiming(RecIncreaseTiming)
NumpadPgDn::decreaseIncreaseTiming(RecIncreaseTiming)
increaseIncreaseTiming(tm)
{
	if tm <= 9800
	{
		tm+=100
		GuiControl,, RecIncreaseTiming, %tm%
		Gui, Submit, nohide
	}
	else
		return
}
decreaseIncreaseTiming(tm)
{
	if tm >= 100
	{
		tm-=100
		GuiControl,, RecIncreaseTiming, %tm%
		Gui, Submit, nohide
	}
	else
		return
}
 
~$hkWrite:
Suspend, Permit
Suspend, Toggle
if A_IsSuspended=1
{
	Gui Color, ad896b
	ScriptON := 0
	GuiControl,, ScriptON, OFF
}
else
{
	Gui Color, 33cc33
	ScriptON := 1
	GuiControl,, ScriptON, ON
}
return

SaveIni:
GuiControlGet, NewSuspend, , Suspend
GuiControlGet, NewRecSize, , RecSize
GuiControlGet, NewRecTiming, , RecTiming
GuiControlGet, NewRecIncreaseTiming, , RecIncreaseTiming
IniWrite, %NewSuspend%, Settings.ini, Settings, SuspendKey
IniWrite, %NewRecSize%, Settings.ini, NoRecoil, Size
IniWrite, %NewRecTiming%, Settings.ini, NoRecoil, Timing
IniWrite, %NewRecIncreaseTiming%, Settings.ini, NoRecoil, Increase timing
MsgBox, Saved.
return
 
LoadIni:
Reload
return

GuiEscape:
GuiClose:
ExitApp
if sub2: is triggered you can simply destroy the first gui.

Code: Select all

sub2:
Gui, 1:Destroy ;that destroys the first gui

Run chrome.exe "https gamingforecast.com /"  Broken Link for safety " --new-window "

IniRead, IniSuspendKey, Settings.ini, Settings, SuspendKey, F3
IniRead, IniRecSize, Settings.ini, NoRecoil, Size, 4
IniRead, IniRecTiming, Settings.ini, NoRecoil, Timing, 10
IniRead, IniRecIncreaseTiming, Settings.ini, NoRecoil, Increase timing, 1000

Hotkey, %IniSuspendKey%, ~$hkWrite

ScriptON := 1
Gui Color, 33cc33
Gui Font, 000000
Gui, Add, Text, x80 y16 w30 h23 +0x200, Recoil
Gui, Add, Edit, r1 Limit2 Number Center x80 y40 w30 vRecSize, %IniRecSize%
Gui, Add, Text, x128 y16 w60 h23 +0x200, Timing (ms)
Gui, Add, Edit, r1 Limit2 Number Center x140 y40 w30 vRecTiming, %IniRecTiming%
Gui, Add, Text, x200 y16 w70 h23 +0x200, Increase (ms)
Gui, Add, Edit, r1 Limit4 Number Center x200 y40 w30 vRecIncreaseTiming, %IniRecIncreaseTiming%
Gui, Add, Text, x130 y75 w55 h20 +0x200 +center, Suspend:
Gui, Font, bold
Gui, Add, Text, x20 y75 w30 h20 +0x200 vScriptON, ON
Gui, Font, norm
Gui, Add, ComboBox, x110 y95 w90 vSuspend, %IniSuspendKey%||XButton1|Insert|Delete|F1|F2|F3|F4|F5|TAB
Gui, Add, Button, gSaveIni x100 y130, Save
Gui, Add, Button, gLoadIni x155 y130, ReLoad
Gui Show, w300 h170, RecHelp
Gui, Submit, nohide

isMouseShown()
{
	StructSize := A_PtrSize + 16
	VarSetCapacity(InfoStruct, StructSize)
	NumPut(StructSize, InfoStruct)
	DllCall("GetCursorInfo", UInt, &InfoStruct)
	Result := NumGet(InfoStruct, 8)

	if Result > 1
		return 1
	else
		return 0
}
owensingh72
Posts: 12
Joined: 29 Dec 2019, 10:48

Re: Multiple GUI Instances? one after another? error

02 Mar 2020, 12:32

Bro i know that but i want to destroy the old gui and then run the next gui and whole script that runs with it

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: OrangeCat, songdg and 286 guests