Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 12:50

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Running Function 2 after Function 1 finished

Discussion on Running Function 2 after Function 1 finished within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jul 2012
Posts: 56
Received Thanks: 1
Running Function 2 after Function 1 finished

Hey, its me again.
Im stuck on a problem since yesterday and as much as i hate to ask for help, i really dont know what else to try. I want Function 2 to run after Function 1 has finished. I tried GuiCtrlSetOnEvent and MsgLoop, but i dont really understand it. I tried to read tutorials but they didnt help at all.

The line that are underline is what im talking about. I want gamestart() to run first and when its finished, i want iniviteteam() to run.

Code:
#AutoIt3Wrapper_UseX64=n
#include<File.au3>
#include<autologin.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#region ### START Koda GUI section ### Form=


$Form1 = GUICreate("bot", 409, 240)
$_StartBot = GUICtrlCreateButton("Start Bot", 128, 128, 161, 33)
$_StopBot = GUICtrlCreateButton("Close bot", 129, 165, 161, 33)
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###
HotKeySet("{F1}", "_stopbot") ;Emergency Stop


While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit 1
	EndSwitch
	[U]Select
		Case $nMsg = $_StartBot
			gamestart()
			inviteteam()
	EndSelect[/U]
	Select
		Case $nMsg = $_StopBot
			_stopbot()
	EndSelect
WEnd
milk4hunn is offline  
Old 09/15/2013, 13:06   #2
 
elite*gold: 46
Join Date: Oct 2010
Posts: 782
Received Thanks: 525
Ehh ?
Just let gamestart call inviteteam when it is finished.
th0rex is offline  
Old 09/15/2013, 13:23   #3
 
alpines's Avatar
 
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
The Switch-Statement is kinda useless, better use it like this:
Code:
While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit1

		Case $_StartBot
			gamestart()
			inviteteam()

		Case $_StopBot
			_stopbot()
	EndSwitch
WEnd
If these functions don't work like you want to, then the problem is probably inside gamestart().
alpines is offline  
Old 09/15/2013, 13:47   #4
 
elite*gold: 0
Join Date: Jul 2012
Posts: 56
Received Thanks: 1
@omitma: I already tried it, but the function didnt run.. or so i thought, just placed a msgbox inside the function and it ran. So it looks like the inviteteam() has a problem somewhere.


@alpines: Thanks, i was wondering if its possible to clean that up a little bit.
milk4hunn is offline  
Reply


Similar Threads Similar Threads
[HELP]Function LUA
08/21/2012 - Metin2 - 3 Replies
Hello guys, I have a problem with a function .. does anyone know how does it work? purge_area ()
function
07/23/2012 - Rappelz Private Server - 4 Replies
Hi pepole Trying to make Lua Code But i cant find The Function to Open Store :D anyone can help l
[C++] Using the TAB Function
07/08/2012 - Last Chaos - 9 Replies
.
Interrupting a running function
02/02/2012 - AutoIt - 0 Replies
Just want to share this guide Interrupting a running function - AutoIt Wiki
[VIP-function] ToxicSYS [VIP-function]
08/14/2010 - WarRock Hacks, Bots, Cheats & Exploits - 1 Replies
heeeey E-pvpers :pimp: this is a new hack by TSYS Status : UNDETECTED Functions (VIDEO) : YouTube - WarRock - Bikini event VIP hack



All times are GMT +2. The time now is 12:50.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.