Jump to content

Help Me With


Recommended Posts

My Script before changing to try to make the script below did this

Press F5

Sends b until press F5 again

Press F6

Sends z until press F6 again

Press F11

Sends Left Mouse button untill press F11 again

Right now im working on trying to make something that you toggle on/off with F10 for:

a input box that you type a number into and it counts down backward IN SEC (or something really close to seconds) and when it gets to zero it sends '0'

then it does it again and again untill you press F10 again.

here is my script

(when i try to use it it says this error)

C:\Documents and Settings\isaac\Desktop\AutoIt\TDBot.au3(104,1) : ERROR: syntax error

^

#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.2.2.0
 Author:         myName

 Script Function:
    Template AutoIt script.

#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here

#include <GUIConstants.au3>

Opt("GUIOnEventMode", 1)

Global $F5OnOff
Global $F6OnOff
Global $F11OnOff
Global $F10OnOff

HotKeySet('{F5}', '_SendB')
HotKeySet('{F6}', '_SendZ')
HotKeySet('{F11}', '_SendLeftClick')
HotKeySet('{F10}', '_MasterSwitch')

GUICreate("Program (In Progress)",220,200, 100,200)
GUISetBkColor (0xCC00CC)
GUICtrlSetOnEvent($GUI_EVENT_CLOSE, "onclick")
GUICtrlCreateLabel("1." & @CRLF & "F5 Toggle Pressing B" & @CRLF & @CRLF &  "2." & @CRLF & "F6 Toggle Pressing Z" & @CRLF & @CRLF &  "F11 Toggle Auto Click Left", 50, 10)
$NumberKey = GUICtrlCreateInput("Enter Amount In Sec.", 55, 120, 110, 20)
$user = GUICtrlCreateDummy()
GUICtrlSetOnEvent(-1, "Onexit")
$button = GUICtrlCreateButton ("Close",75,170,70,20)
GUICtrlSetOnEvent(-1, "onclick")
GUISetState(@SW_SHOW)

Sleep(5000)


While 1
   Sleep (10)
   If $F5OnOff Then Send('b')
   If $F6OnOff Then Send('z')
   If $F11OnOff Then MouseClick('Left')
      
Wend

Exit

; Functions ----------------------

Func onclick()
   GUICtrlSendToDummy($user)
EndFunc

Func OnExit()
   Exit
EndFunc

Func _SendB()
    $F5OnOff = Not $F5OnOff
EndFunc

Func _SendZ()
    $F6OnOff = Not $F6OnOff
EndFunc

Func _SendLeftClick()
    $F11OnOff = Not $F11OnOff
EndFunc

    
Func _MasterSwitch()
    $F10OnOff = Not $F10OnOff
    If $F10OnOff Then
        HotKeySet('', '_Send0')
    EndIf
    Return ''
EndFunc

Func _Send0()
    $count = $NumberKey

Do
$count = $count - 1 
Until $count = 0

If $count  = 0 Then
Send('0')
EndIF

if you know what im doing wrong could you plz tell me cause im stuck

THANKS! :whistle:

Isaac

Edited by toothyXdip
---╔╦═╗╔╗'''╔╗╔═╦═╗╔╦═╗---╝╠═╣╝║'''║╝╝''''''╝╝║'''......''''''''''''''''''''''''''''''---╔╩═╩═╩═╩═══╩═╦═╩═╩══╦══════╗''''╔╩════════════╩══╗╔══╩══╗╔══╝ ''''''''''''''''''''''''''''''''''''''''''''''''''''║║'''''''''''''''║║ ''''''''''''''''''''''''''''''''''''''''''''''╔══╝╚══╗''''''║║''''''''''''''''''''''''''''''''''''''''''''''╚══════╝''''''╚╝
Link to comment
Share on other sites

More information on the error would be helpful. What exactly does it say? (everything that it says).

By just a cursory examination of your code, I would think that the line

$F10OnOff = Not $F10OnOff

is whats causing your problems. If you are running your script through the Scite editor, once the error occurs you can press F4 to jump to the line that has the error.

Link to comment
Share on other sites

this is all it says (i copyed it from the error box)

C:\Documents and Settings\isaac\Desktop\AutoIt\TDBot.au3(93,1) : ERROR: syntax error

^

C:\Documents and Settings\isaac\Desktop\AutoIt\TDBot.au3 - 1 error(s), 0 warning(s)

There is nothing before ^ and nothing after ERROR: Syntax error and its on a blank line 0.o

cause this is my scripts bottem an ill show which one has the error (scroll up for my whole script)

Func _MasterSwitch()
    $F10OnOff = Not $F10OnOff
    If $F10OnOff Then
        HotKeySet('', '_Send0')
    EndIf
    Return ''
EndFunc

Func _Send0()
    $count = $NumberKey

Do
$count = $count - 1 
Until $count = 0

If $count  = 0 Then
Send('0')
EndIF

*this line has the error*
Edited by toothyXdip
---╔╦═╗╔╗'''╔╗╔═╦═╗╔╦═╗---╝╠═╣╝║'''║╝╝''''''╝╝║'''......''''''''''''''''''''''''''''''---╔╩═╩═╩═╩═══╩═╦═╩═╩══╦══════╗''''╔╩════════════╩══╗╔══╩══╗╔══╝ ''''''''''''''''''''''''''''''''''''''''''''''''''''║║'''''''''''''''║║ ''''''''''''''''''''''''''''''''''''''''''''''╔══╝╚══╗''''''║║''''''''''''''''''''''''''''''''''''''''''''''╚══════╝''''''╚╝
Link to comment
Share on other sites

Func _Send0()
    $count = $NumberKey
EndFunc ; needs EndFunc

I haven't tried it, but I think that might help.

[font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com
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...