Jump to content

Basic help


Recommended Posts

I browsed around this site a bit and fiddled with the program but couldn't really figure out how to do what I wanted. How would I write a script to just press the space bar over and over infinatly with a timed delay between each press. I'm sure it involves a loop with a keypress command but I can't get the syntax right... I was originally going to use the ancient AutoFire 4.0 program I used years ago in MMOs, but it doesn't seem to function when inside a Flash Player.

Thank you for any help!

Link to comment
Share on other sites

I browsed around this site a bit and fiddled with the program but couldn't really figure out how to do what I wanted. How would I write a script to just press the space bar over and over infinatly with a timed delay between each press. I'm sure it involves a loop with a keypress command but I can't get the syntax right... I was originally going to use the ancient AutoFire 4.0 program I used years ago in MMOs, but it doesn't seem to function when inside a Flash Player.

Thank you for any help!

While..WEnd

Send()

Sleep()

Sample:

While 1
Send("{SPACE}")
Sleep(1000)
Wend
Link to comment
Share on other sites

here you go this does exactly what you want it to do but this is to start you off but next time try to make on your own

(is tested does work)...oh ya it it might not be EXACTLY a sec delay its a LITTLE longer you can edit the _setuserdelay func in the line $read * 500 to fix that (change 500 to a lower number and keep doing till its one sec delay)

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

 AutoIt Version: 3.2.2.0
 Author:         Isaac (toothyXdip)

 Script Function:
    Press Space Bar With delay

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

; Script Start - Add your code below here

#include <GUIConstants.au3>

Global $F5OnOff

HotKeySet("{F5}", 'autospacebar')

;window stuff-------
GUICreate("spacebar",300, 300)
$dummy = GUICtrlCreateDummy()
GUICtrlSetOnEvent($GUI_EVENT_CLOSE,'_exittt')
;input--------------
$delay_input = GUICtrlCreateInput("Enter Delay Here", 110, 100, 90, 20)
;lable--------------
$text = GUICtrlCreateLabel("Press F5 to toggle spacebar pressing" & @CRLF &  "Enter delay amount in sec. Before it presses Spacebar.", 30, 30)
$lable2 = GUICtrlCreateLabel("YOU HAVE TO PRESS SET DELAY AFTER YOU" & @CRLF &  "ENTER AMOUNT!!!", 30, 60)
;buttons------------
$set_delay_button = GUICtrlCreateButton("SetDelay", 120, 150, 70, 20)
$about_button = GUICtrlCreateButton("About", 120, 170, 70, 20)
;colorsets----------
GUICtrlSetBkColor($text, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetBkColor($lable2, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetColor($text, 0xFFFFFF)
GUICtrlSetColor($lable2, 0xFF0033)
GUISetBkColor(0x000000)
$defalt_delay = 10
$user_delay = 1000
$timer_helper = 0
GUISetState(@SW_SHOW)

While 1
    $msg = GUIGetMsg()
        Sleep($defalt_delay)
    $timer_helper = $timer_helper + 1
    If (($timer_helper * $defalt_delay) / $user_delay) >= 1 Then
        DoUserTasks()
        $timer_helper = 0
    EndIf
    Select
        Case $msg = $GUI_EVENT_CLOSE
            _exit()
        Case $msg = $set_delay_button
            _setuserdelay()
        Case $msg = $about_button
            _about()
    EndSelect
WEnd

Func _exittt()
    GUICtrlSendToDummy($dummy)
EndFunc

Func _exit()
    Exit
EndFunc

Func DoUserTasks()
    If $F5OnOff Then Send("{SPACE}")
EndFunc
    
Func autospacebar()
    $F5OnOff = Not $F5OnOff
EndFunc

Func _setuserdelay()
    $read = GUICtrlRead($delay_input)
    $user_delay = $read * 360
EndFunc

Func _about()
    MsgBox(64, "About", "This was made by ToothyXdip")
EndFunc
Edited by toothyXdip
---╔╦═╗╔╗'''╔╗╔═╦═╗╔╦═╗---╝╠═╣╝║'''║╝╝''''''╝╝║'''......''''''''''''''''''''''''''''''---╔╩═╩═╩═╩═══╩═╦═╩═╩══╦══════╗''''╔╩════════════╩══╗╔══╩══╗╔══╝ ''''''''''''''''''''''''''''''''''''''''''''''''''''║║'''''''''''''''║║ ''''''''''''''''''''''''''''''''''''''''''''''╔══╝╚══╗''''''║║''''''''''''''''''''''''''''''''''''''''''''''╚══════╝''''''╚╝
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...