Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 15:05

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

Advertisement



Autoit (Checkbox) (Funktionen)

Discussion on Autoit (Checkbox) (Funktionen) within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
speedlink1986's Avatar
 
elite*gold: 11
Join Date: Aug 2011
Posts: 468
Received Thanks: 43
Autoit (Checkbox) (Funktionen)

Servus leute,

Nach langer zeit beschäftige ich mich mal wieder mit Autoit.
Und zwar habe ich folgende Frage/Problem.

Ich arbeite derzeit mit imagesearch an einem Bot für stronghold Kindoms
(Farmbot)

Das funktioniert auch soweit aber eben nur mit Obst.
Jetzt habe ich mir eine kleine gui geschrieben und wollte dies nun so regeln.
Das ich aussuchen kann was ich Farmen möchte.

Sprich ist Checkbox 1 Obst ausgewählt und ich drücke start farmt er Apfel.
Ist Checkbox 2 ausgewählt Holz etc...

Nun weiß ich aber nich wie ich das ganze so richtig realisieren soll.
Sprich ich benötige ein Denkanstoß.

Code:
#include <ImageSearch.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

$Form1 = GUICreate("Form1", 625, 443, 204, 174)
$Group1 = GUICtrlCreateGroup("FarmBot", 16, 8, 289, 425)
$Pic1 = GUICtrlCreatePic("C:\ImageSearch.au3 + SourceCode\apple.jpg", 32, 32, 41, 41, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
$Checkbox1 = GUICtrlCreateCheckbox("Apfel Bot", 88, 40, 65, 25)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group2 = GUICtrlCreateGroup("TradeBot", 312, 8, 297, 361)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button1 = GUICtrlCreateButton("Pause Bot", 480, 384, 129, 41, $WS_GROUP)
$Button2 = GUICtrlCreateButton("Start Bot", 312, 384, 129, 41, $WS_GROUP)
GUISetState(@SW_SHOW)


While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit

EndSwitch
WEnd
$x = 0
$y = 0

$xd = @DesktopHeight
$yd = @DesktopWidth

;MsgBox(0,"", $xd & "@" & $yd)

HotKeySet("{ESC}", "Close")
HotKeySet("{F1}", "Start")
HotKeySet("{F2}", "Pause")
_Startup()


Func _Startup()
   ToolTip("Startup",0,0)
   While 1
	  Sleep(100)
	  WEnd
   EndFunc

Func Close()
   Exit
EndFunc

Func Pause()
   ToolTip("Pause",0,0)
   While 1
	  Sleep(100)
	  WEnd
   EndFunc

   Func Start()
	   ToolTip("",0,0)
	   While 1
		  $pos = MouseGetPos()
		  $IS = _ImageSearch("Start.png",1,$x,$y,50)
		  If $IS = 1 Then
			 MouseClick("left",$x,$y,5,20)
			 MouseMove($pos [0], $pos [1], 20)
			 Adlibregister ("Start", 300000)
			 IMR()
			 EndIf
			 WEnd
		  EndFunc

		  Func IMR()
			 While 1
			 $pos = MouseGetPos()
			   $IMR = _ImageSearch("IMR.png",1,$x,$y,50)
			   If $IMR = 1 Then
			   MouseClick("left",$x,$y,5,20)
			   MouseMove($pos [0], $pos [1], 20)
			   Else
				  Sleep(100)
				  BOX()
			   EndIf
			   WEnd
			EndFunc

			Func BOX()
			 While 1
			 $pos = MouseGetPos()
			 $BOX = _ImageSearch("BB.png",1,$x,$y,50)
			   If $BOX = 1 Then
			   MouseClick("left",$x,$y,5,20)
			   MouseMove($pos [0], $pos [1], 20)
			   Else
				  Sleep(100)
			   EndIf
			   WEnd
			EndFunc
Das ist jetzt mein Kompletter Code. Ich hoffe jemand kann mir helfen.
speedlink1986 is offline  
Old 04/02/2015, 16:47   #2
 
alpines's Avatar
 
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
Hast im dt. AutoIt-Forum eins aufn Deckel bekommen und fragst jetzt hier rum?

Na dann, Checkboxen kannst du mittels BitAnd(GUICtrlRead($cb), 1) auslesen und abfragen ob sie gecheckt ist oder nicht.
alpines is offline  
Old 04/02/2015, 17:26   #3
 
speedlink1986's Avatar
 
elite*gold: 11
Join Date: Aug 2011
Posts: 468
Received Thanks: 43
Wusste nicht das die sich so Pissig haben

Danke ich probier es mal
speedlink1986 is offline  
Old 04/02/2015, 19:51   #4
 
alpines's Avatar
 
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
Das liegt daran das du zu unfähig bist die Forenregeln zu lesen.
alpines is offline  
Reply


Similar Threads Similar Threads
[AUtoIt] Checkbox funzt nicht?!
06/24/2010 - AutoIt - 9 Replies
habe hier mal einen Spambot geschrieben... (ist noch nicht fertig) nur leider funktionieren die checkboxen nicht , bis auf die erste... HotKeySet("{ESC}", "_exit") #include <GUIConstants.au3> #Region ### START Koda GUI section ### Form= $GUI_GlobalSpam = GUICreate("GlobalSpam Info", 536, 309, 398, 153) $GUI_Spam1 = GUICtrlCreateInput("Was soll GlobalSpam als erstes spamen?", 24, 96, 321, 21)
[AutoIT] Auto Login mit Checkbox
07/08/2008 - Guild Wars - 5 Replies
Hallo, ich habe ein neues Problem. Da ich BlackWorkX nicht immer nerven mag, schreibe ich es hier ^^ Ich habe eine GUI mit der Möglichkeit, einen Auto Login zu nehmen. Nun habe ich das Problem, dass wenn ich die Checkbox deaktiviere, dass das Programm Guild Wars dennoch startet und versucht sich einzuloggen. $STATE = GUICtrlRead($login) If $STATE == 1 Then
AutoIT - Transparente Checkbox
07/19/2007 - General Coding - 2 Replies
-



All times are GMT +2. The time now is 15:05.


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.