Jump to content
Sign in to follow this  
Mantas7776

What im doing wrong(simple noob script)

Recommended Posts

Mantas7776

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

 AutoIt Version: 3.3.12.0
 Author:         myName

 Script Function:
    Template AutoIt script.

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

; Script Start - Add your code below here

local $x

HotKeySet("{INS}", "xfunc")
HotKeySet("{HOME}", "Terminate")

;While 1
;    Sleep(100)
;WEnd
ToolTip($x)

;that part isnt working ==================
Func xfunc()
    $x = 1
EndFunc

While 1
    If ($x == 1) Then
        Send("{ENTER}")
        ToolTip("working")
    EndIf
    Sleep(50)
WEnd

Func Terminate()
    Exit
EndFunc

Script doesnt set $x = 1

Edited code abit, deleted one while

If i replace $x = 1 with tooltip, tooltip appears, I have no idea what I'm doing wrong

Edited by Mantas7776

Share this post


Link to post
Share on other sites
MikahS

Multiple while loops is not good :shifty:

Could you post what you are trying to achieve with this script? Looks kinda like you are trying to automate a game  :ermm: 


Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Share this post


Link to post
Share on other sites
Mantas7776

Multiple while loops is not good :shifty:

Could you post what you are trying to achieve with this script? Looks kinda like you are trying to automate a game  :ermm:

I'm just trying to do simple enter spam. Deleted multiple whiles

Edited by Mantas7776

Share this post


Link to post
Share on other sites
MikahS

Again, two while loops in the main line >_<

local $x = 0
 
HotKeySet("{INS}", "xfunc")
HotKeySet("{HOME}", "Terminate")
 
ToolTip($x)
 
While 1 ; only need 1 while loop
    If $x = 1 Then ; if x is set to 1
        Send("{ENTER}") ; do this
        Tooltip("working") ; do this
    EndIf
WEnd
 
Func xfunc()
    $x = 1
EndIf
 
Func Terminate()
    Exit
EndFunc
Edited by MikahS

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Share this post


Link to post
Share on other sites
MikahS

Anytime :)


Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Share this post


Link to post
Share on other sites
Mantas7776

Also any way to register hotkey clicks in-game? Because If i click macro ingame nothing happens i have to minimaze and then press macro

Share this post


Link to post
Share on other sites
Jos

Also any way to register hotkey clicks in-game? Because If i click macro ingame nothing happens i have to minimaze and then press macro

You just spoke the magic word.

Read our forumrules please.

*click*

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Melba23

Mantas7776 ,

 

Because If i click macro ingame nothing happens

And nothing more will happen here either. ;)

You appear not to have read the Forum rules since your arrival. Please do read them - particularly the bit about not discussing game automation - before you post again. Thread locked. :naughty:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×