Jump to content

I need some help with the auto it script.


Recommended Posts

Yeah, after 2 years of retired of using this autoit, i need some help from people, to remind me of how this was working ><..

I need a text script.

So, if I press ctrl + shift + a(any button, in this case just a), then it types for example ;

"Hello, my username is Husa.

I need some help with this autoit script

And I got the help I need cause I posted here.

Thank you.."

Can anyone do this for me?

Just need this, and ill find out fastly how to do such scripts again..

I appreciate the help here, thank you.

Link to comment
Share on other sites

  • Moderators

Husa,

Welcome (back?) to the AutoIt forum. :(

AutoIt has changed a bit since you last used it - you might want to re-read the Help file (at least the first few sections - Using AutoIt, Tutorials and the first couple of References) or look at the excellent tutorials that you will find here and here.

Then if you look in the Help file for HotKeySet and Send, you will soon work out how to do what you want. If you run into problems, just post your code here and we will help. :)

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

Just treid this now ;

HotKeySet("{alt}+{LSHIFT}+a")

func hotkeyset send ("hello")

EndFunc

I get a error saying ;

Line 14 (File "C\users\husa\desktop\try.au3")

fund hotkeyset send ("hello")

error : Badly formatted func statement.

if i remember right, there has to be a name for the hotkeyset, to tell func hotkseyset to tell.

correct me if im wrong.

anyone know what I did wrong here? please.

Link to comment
Share on other sites

  • Moderators

Husa,

Did you actually read the Help file as I suggested? If so you must be real speed reader! ;)

From the HotKeySet page:

HotKeySet ( "key" , "function" )

That is how you tell the HotKey which function to run.

The same page tells you how to tell AutoIt that you want to use the Alt and Shift keys as modifiers - what you have at present is not correct. :)

Then if we look at virtually any of the help file examples you will see how to format a function:

Func functioname ( parameters )
    ...
EndFunc

You have the function code on the same line as the Func keyword - hence the "Badly formatted func statement" error.

I am quite prepared to help, but you need to make some effort yourself first. :( Go and READ carefully the pages I suggested and try again. :)

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

You don't need HotkeySet for such simple use.

Just compile this simple AU3 script:

send ("hello")

then create shortcut to compiled EXE file and in its properties fill your desired hotkey shortcut.

BTW: Your nick sounds like Czech word, are you from Czech republic?

Edited by Zedna
Link to comment
Share on other sites

No, im from denmark..

giuliom ; Not working. full or errors.

anyway, I got what I need :

HotKeySet("{Shift+ALT+A}", "harhar")

While 1
Sleep(50)
WEnd

Func harhar()
Sleep(50)
Send("{ENTER}")
Send(" DIABLO MESSAGE LOOLOLOLOLOL")
Send("{ENTER}")
Sleep(50)

Endfunc

but it dosnt Send when i press on shift + alt + a.

can anyone help me with the binding key? (alt + shift + a)

Link to comment
Share on other sites

You guys should have followed Melba23's example. I'm sure he could have given the guy the code, but you know the old proverb "Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime."

Link to comment
Share on other sites

Btw, the one you gave me, thats not what im searching for..

your comes up with a window, where it says "Hello im husa".

i want a script, so when i press alt + shift + a for example, it says "Hello im husa"..

I got it allrdy.

:

HotKeySet("!+a", "harhar")

While 1
Sleep(50)
WEnd

Func harhar()
Sleep(50)
Send("{ENTER}")
Send(" DIABLO MESSAGE LOOLOLOLOLOL")
Send("{ENTER}")
Sleep(50)

Endfunc

my problem now: It keeps alt + shift down untill i manually press them my self.

how do i fix this?

Link to comment
Share on other sites

Zedna that does not work still ><

HotKeySet("!+a", "harhar")

While 1
Sleep(50)
WEnd

Func harhar()
Sleep(50)
Send("{ENTER}")
Send(" DIABLO MESSAGE LOOLOLOLOLOL")
Send("{ENTER}")
Sleep(50)
HotKeySet("!+a", "")

Endfunc
Link to comment
Share on other sites

guiliom, thats another kind of using it, i want to use mine since i know this way best.

how do i fix this for keeping shift + alt down after script is done?

er, i haven't compresed. you mean something like a command Send () repeated infinitely?
Link to comment
Share on other sites

HotKeySet("!+a", "harhar")

While 1
Sleep(50)
WEnd

HotKeySet("!+a", "")

Func harhar()
Sleep(50)
Send("{ENTER}")
Send(" DIABLO MESSAGE LOOLOLOLOLOL")
Send("{ENTER}")
Sleep(50)
Endfunc

You should more carefully read the helpfile instead of writing so many posts.

Still keeps alt + shift down ~~

HotKeySet("!+a", "harhar") 
While 1 
    Sleep(50) 
WEnd 
HotKeySet("!+a", "") 
Func harhar() 
    Sleep(50) 
    Send("{ENTER}") 
    Send(" DIABLO MESSAGE LOOLOLOLOLOL") 
    Send("{ENTER}") 
    Sleep(50) 
    Endfunc
Link to comment
Share on other sites

That code does not keep them down, I think you might be using it from within some other application that is causing that problem.

You could try sending "{ALTUP}{SHIFTUP}" but I'm not sure that will help.

Also, if you are using it within another application and just sending "{ALTUP}{SHIFTUP}" does not work, try calling SendKeepActive("") before the "{ALTUP}{SHIFTUP}" with the window name in the quotes.

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...