Jump to content

What im doing wrong(simple noob script)


Go to solution Solved by MikahS,

Recommended Posts

#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
Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • Solution

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

 

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

  • Developers

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

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Moderators

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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