Jump to content

Morse code macro thing - need a little help


Recommended Posts

Hey guys! This is my first post here and any help will be appreciated.

I'm quite new to any kind of scripting and I've been trying to make a script that types anything I type on my keyboard in morse code.

The issue here is that i can't figure out a way to do "spaces", since when I try to do them it just gets stuck in a loop that spams the "/" symbol. Just enable the last func in the comment, if you want to see for yourself.

I want it to do a "/ " when i press the space bar.

Thanks for any replies!

<snip>

 

 

Edited by Melba23
Code removed
Link to comment
Share on other sites

Hotkeyset apparently sends whatever you have set, in addition to whatever you have set for the space character (since you have a space character in your Send),  see here with the letter "a"

 

HotKeySet("{esc}", "stahp")
HotKeySet("a", "ay")
HotKeySet("{space}", "spake")

while 1
    sleep(10)
WEnd

Func ay()
   Send(".- ")
EndFunc


Func spake()
   send("SPACE_CHARACTER")
EndFunc


Func stahp()
   Exit
EndFunc

 

remove that space from your morse letters and you will probably get the behavior you desire.

 

Edited by boththose

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

  • Moderators

BarryBareth,

Welcome to the AutoIt forums.

Unfortunately what you posted was a crude keylogger - which as you can see from the Forum rules is a forbidden subject here.  I realise that you were not trying to log keys. but I suggest you read this announcement which clarifies what you can and cannot discuss on the forum with regards to key press detection. Thread locked.

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