|
You last visited: Today at 06:16
Advertisement
stop infinite loop
Discussion on stop infinite loop within the AutoIt forum part of the Coders Den category.
04/10/2016, 00:13
|
#1
|
elite*gold: 0
Join Date: Nov 2007
Posts: 18
Received Thanks: 0
|
stop infinite loop
Opt("GUIOnEventMode", 1)
Global $RunState = False
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 231, 67, 1144, 503)
$Start = GUICtrlCreateButton("Start", 16, 16, 91, 25)
GUICtrlSetOnEvent(-1, "Start")
$Stop = GUICtrlCreateButton("Stop", 112, 16, 99, 25)
GUICtrlSetOnEvent(-1, "Stop")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
Sleep (1000)
WEnd
Func Start ()
$RunState = True
If $RunState then
while 1
ToolTip('working',0,0)
Sleep (1000)
WEnd
EndIf
EndFunc
Func Stop ()
$RunState = False
ToolTip('stop',0,0)
EndFunc
|
|
|
04/10/2016, 00:25
|
#2
|
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
|
Check for a variable $bRunning instead of repeating the loop over and over again. If you run Stop() set the variable to false and the loop will automatically exit.
|
|
|
04/10/2016, 00:39
|
#3
|
elite*gold: 0
Join Date: Nov 2007
Posts: 18
Received Thanks: 0
|
i added $RunState = False still not work
|
|
|
04/10/2016, 02:47
|
#4
|
elite*gold: 0
Join Date: Apr 2011
Posts: 363
Received Thanks: 167
|
U only need one loop, don't use onevent methods because if u have an inside loop will fail.
Use guigetmsg() instead
Code:
Global $RunState = False
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 231, 67, 1144, 503)
$Start = GUICtrlCreateButton("Start", 16, 16, 91, 25)
$Stop = GUICtrlCreateButton("Stop", 112, 16, 99, 25)
$Switch = GUICtrlCreateButton("Switch",65,42,99,25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$msg = GUIGetMsg()
Switch $msg
Case -3
Exit 0
Case $Start
$RunState = True
Case $Stop
$RunState = False
Case $Switch
$RunState = Not $RunState ;u can use one button too
EndSwitch
If $RunState Then
ToolTip('working', 0, 0)
;Somefunc()
Else
ToolTip("waiting", 0, 0)
EndIf
WEnd
|
|
|
04/13/2016, 00:19
|
#5
|
elite*gold: 37
Join Date: May 2014
Posts: 1,835
Received Thanks: 9,833
|
This should help you.
Code:
#RequireAdmin
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 231, 67, 1144, 503)
$Start = GUICtrlCreateButton("Start", 16, 16, 91, 25)
$Stop = GUICtrlCreateButton("Stop", 112, 16, 99, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Case $Start
Start()
Case $Stop
Stop()
EndSwitch
WEnd
Func Start()
ToolTip("Working",0,0)
EndFunc
Func Stop()
ToolTip("",0,0)
Endfunc
|
|
|
04/14/2016, 00:06
|
#6
|
elite*gold: 0
Join Date: Sep 2010
Posts: 473
Received Thanks: 104
|
Quote:
Originally Posted by HaMaDa..
This should help you.
Code:
#RequireAdmin
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 231, 67, 1144, 503)
$Start = GUICtrlCreateButton("Start", 16, 16, 91, 25)
$Stop = GUICtrlCreateButton("Stop", 112, 16, 99, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Case $Start
Start()
Case $Stop
Stop()
EndSwitch
WEnd
Func Start()
ToolTip("Working",0,0)
EndFunc
Func Stop()
ToolTip("",0,0)
Endfunc
|
Here is working code u forgot to add Exit under $GUI_EVENT_CLOSE
Code:
#RequireAdmin
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 231, 67, 1144, 503)
$Start = GUICtrlCreateButton("Start", 16, 16, 91, 25)
$Stop = GUICtrlCreateButton("Stop", 112, 16, 99, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Start
Start()
Case $Stop
Stop()
EndSwitch
WEnd
Func Start()
ToolTip("Working",0,0)
EndFunc
Func Stop()
ToolTip("Stoped",0,0)
Endfunc
|
|
|
04/15/2016, 01:51
|
#7
|
elite*gold: 37
Join Date: May 2014
Posts: 1,835
Received Thanks: 9,833
|
Quote:
Originally Posted by mlukac89
Here is working code u forgot to add Exit under $GUI_EVENT_CLOSE
Code:
#RequireAdmin
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 231, 67, 1144, 503)
$Start = GUICtrlCreateButton("Start", 16, 16, 91, 25)
$Stop = GUICtrlCreateButton("Stop", 112, 16, 99, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Start
Start()
Case $Stop
Stop()
EndSwitch
WEnd
Func Start()
ToolTip("Working",0,0)
EndFunc
Func Stop()
ToolTip("Stoped",0,0)
Endfunc
|
Yea sorry, forgot it.
|
|
|
04/15/2016, 02:27
|
#8
|
elite*gold: 0
Join Date: Nov 2007
Posts: 18
Received Thanks: 0
|
got it guys thx
|
|
|
04/15/2016, 17:11
|
#9
|
elite*gold: 2
Join Date: Jul 2009
Posts: 14,456
Received Thanks: 4,685
|
#closed
|
|
|
 |
Similar Threads
|
Infinite "Auto Loop" in Black Desert EU/NA?
03/24/2016 - Black Desert - 11 Replies
Hey, wanted to know if there is an infinite "Auto Loop" makro/cheat/hack/whatever that allows you for example to level your horse faster. It really pisses me off to always to select a position and autorun there like every 10min (Velia to Calpheon for example).
Is there already something like this out there? If not.. I would pay for some shit like that^^
EDIT:
I'm not a programer or something - but imo it shouldn't be that hard. If I'm right, all you gotta do is setting up the bot,...
|
[Non Stop Non Stop 24/7] For Ever Free MM Service [Non Stop 24/7]
01/10/2012 - Middleman - 38 Replies
ch möchte hier meine Dienste als Middleman anbieten.
Deutsch
✔] Telefon Verifizierung
✔] Seit 3 Monaten registriert
✔] Mehr als 300 Posts
✔] Mind. 10 TBM-Bewertungen
✔] Kein negatives Rating
Welchen Service biete ich an?
|
EliteBot 0.24 (HolyBot for esro).. Loop and stop.
08/15/2011 - SRO Private Server - 15 Replies
Hey everybody.. I have a problem :/.
Town script work, i use looop.. I have record script, and bot use that script and walk on spot.. My char go to this place, and dont do anything!! He stay and nothing... I dont know why.... He don't attack mobs.. I have all option good, Use Coordinates + Radius, mob range, skills, everything.. Anyone can help me??
Sorry.. My english is not good, I am From Poland. Thanks.
|
Agbot loop dosnt loop
10/18/2008 - Silkroad Online - 1 Replies
my agbot after i tele will go through the 20 sec wait then says in bot concle feature not available yet
feature not available yet
idk whats wrong
|
Stop people from hitting multiple stakes in TG/Stop weapon skill
12/06/2007 - CO2 Exploits, Hacks & Tools - 21 Replies
Let me start off by saying this is a pretty dirty trick! But if you really don't like someone you can stop them from getting their max exp in TG.
Explained: When someone uses a club/wand/FOH/etc in TG, it hits multiple stakes. You can make it so it doesn't hit a certain stake(s). This is easiest achieved by using the #alone feature in proxy.
Use the #alone feature and stack on top of the stake you wish for the person not to hit. That's it! Their skill isn't hitting the stake(s) for some...
|
All times are GMT +1. The time now is 06:16.
|
|