Jump to content

Sleep Question.


Recommended Posts

Hey, I got this simple script:

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <SliderConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

HotKeySet ("{F1}","AutoAttackLR")

Global $ua = False

#Region ### START Koda GUI section ### Form=C:\Users\tjado\Desktop\AutoIt\Form\DS Bot V1.kxf
$Form1 = GUICreate("DS Bot V1", 235, 364, 192, 124)
$Group1 = GUICtrlCreateGroup("Info", 8, 8, 217, 105)
$Label1 = GUICtrlCreateLabel("Attacks:", 16, 32, 43, 17)
$Label2 = GUICtrlCreateLabel("Total Attacks:", 16, 56, 70, 17)
$Label3 = GUICtrlCreateLabel("-", 96, 32, 7, 17)
$Label4 = GUICtrlCreateLabel("-", 96, 56, 7, 17)
$Label5 = GUICtrlCreateLabel("HP:", 144, 32, 22, 17)
$Label6 = GUICtrlCreateLabel("MP:", 144, 56, 23, 17)
$Label7 = GUICtrlCreateLabel("-", 176, 32, 7, 17)
$Label8 = GUICtrlCreateLabel("-", 176, 56, 7, 17)
$Button2 = GUICtrlCreateButton("Reset", 80, 80, 75, 25, $WS_GROUP)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group2 = GUICtrlCreateGroup("Auto Attack", 8, 120, 217, 121)
$Radio1 = GUICtrlCreateRadio("Left", 56, 152, 41, 17)
$Radio2 = GUICtrlCreateRadio("Right", 136, 152, 49, 17)
$Label9 = GUICtrlCreateLabel("Start Auto Attack [A] - F1", 40, 184, 122, 17)
$Button3 = GUICtrlCreateButton("Options", 72, 208, 75, 25, $WS_GROUP)
$Label10 = GUICtrlCreateLabel("Off", 176, 184, 18, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group3 = GUICtrlCreateGroup("AutoPot", 8, 248, 217, 105)
$Button4 = GUICtrlCreateButton("AutoHP Options", 24, 272, 91, 25, $WS_GROUP)
$Button5 = GUICtrlCreateButton("AutoMP Options", 120, 272, 91, 25, $WS_GROUP)
$Slider1 = GUICtrlCreateSlider(24, 312, 182, 29)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

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

EndSwitch

Sleep (5)


If $nMsg = $Button3 Then
    Call ("AutoAttackOptions")
EndIf


WEnd

Func AutoAttackLR()
GUICtrlSetData($Label10, "On")
GuiCtrlSetColor($Label10, 0x00FF00)

$ua = Not $ua
If $ua = True Then


MsgBox (0,"Test","Let it work!")
Sleep($Input1q)
MsgBox (0,"Succes","It worked!")
Sleep($Input1q)
MsgBox (0,"Succes","It worked!")
Sleep($Input1q)
MsgBox (0,"Succes","It worked!")


GUICtrlSetData($Label10, "Off")
GuiCtrlSetColor($Label10, 0x000000)

EndIf
EndFunc

Func AutoAttackOptions()
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <SliderConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>


#Region ### START Koda GUI section ### Form=C:\Users\tjado\Desktop\AutoIt\Form\Attack Options.kxf
$Form2q = GUICreate("Attack Options", 265, 187, 448, 198)
$Group1q = GUICtrlCreateGroup("Options", 8, 8, 241, 169)
$Label1q = GUICtrlCreateLabel("Delay:", 16, 32, 34, 17)
$Input1q = GUICtrlCreateInput("", 64, 32, 49, 21)
$Slider1q = GUICtrlCreateSlider(24, 120, 214, 45)
$Label2q = GUICtrlCreateLabel("Move Size:", 112, 96, 57, 17)
$Label3q = GUICtrlCreateLabel("Pause:", 16, 64, 37, 17)
$Input2q = GUICtrlCreateInput("", 64, 64, 49, 21)
$Label4q = GUICtrlCreateLabel("Reset:", 136, 32, 35, 17)
$Input3q = GUICtrlCreateInput("", 184, 32, 49, 21)
$Button1q = GUICtrlCreateButton("Close", 136, 64, 99, 25, $WS_GROUP)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

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

EndSwitch

Sleep (5)

If $nMsg = $Button1q Then
    GUIDelete ($Form2q)
EndIf



WEnd
EndFunc

I did the msgbox because it is just a test, so the point of this script is: its a simple program for a game, when I click on options, a other form pops up, then when I fill in a delay in the delay box, now when I press F1, a msgbox pops up, now it should wait the delay i filled in, but I get an error. Can anyone help me with this?

~Thanks :mellow:

Link to comment
Share on other sites

Sigh....

Have you read Valik's announcement?

Edited by kaotkbliss

010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

Link to comment
Share on other sites

Try using Sleep(GuiCtrlRead($Input1q))

All by me:

"Sometimes you have to go back to where you started, to get to where you want to go." 

"Everybody catches up with everyone, eventually" 

"As you teach others, you are really teaching yourself."

From my dad

"Do not worry about yesterday, as the only thing that you can control is tomorrow."

 

WindowsError.gif

WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF

AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send

StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2

AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit  Docs

SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF

Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language

Programming Tips

Excel Changes

ControlHover.UDF

GDI_Plus

Draw_On_Screen

GDI Basics

GDI_More_Basics

GDI Rotate

GDI Graph

GDI  CheckExistingItems

GDI Trajectory

Replace $ghGDIPDll with $__g_hGDIPDll

DLL 101?

Array via Object

GDI Swimlane

GDI Plus French 101 Site

GDI Examples UEZ

GDI Basic Clock

GDI Detection

Ternary operator

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...