Jump to content

how can I send ascii text? Please help


Recommended Posts

Hi!

i have been trying to figure out how to paste ascii text into notepad and i think I have to send an enter command after each line.

Here is one of the pictures I am trying to paste

BIRTHDAY

) ( ) (

(^) (^) (^) (^)

_i___i___i___i_

(_____________)

|####|>o< |###|

(______________)

': <~ > ^ ; ` ^ - ~ ;

, HAPPY BIRTHDAY

-------Gloria!!-----------

` ^ - ~ ; ^ ; `~ ; ` ^

- ~ ; ^ ; ` - ~ ; ^ ;

- ~ ~ ; ^ ; `; ` `~ ; `

~ ; ` - ~ ; ^ ; `~ ; `

~ ; ` - ~ ; ^ ; `~ ; ~ ; ` -. ~ ;. . ^ ; `~ ; `

When i try to use the send command the script just crashes:(

is there a command that input that allows this type os text?

Thanks for any help

Link to comment
Share on other sites

  • Moderators

charactermap,

I would try using the the "raw" flag (look in the Help file for details):

Global $aPic[16] = [15]
$aPic[1] = "BIRTHDAY"
$aPic[2] = ") ( ) ("
$aPic[3] = "(^) (^) (^) (^)"
$aPic[4] = "_i___i___i___i_"
$aPic[5] = "(_____________)"
$aPic[6] = "|####|>o< |###|"
$aPic[7] = "(______________)"
$aPic[8] = "': <~ > ^ ; ` ^ - ~ ; "
$aPic[9] = ", HAPPY BIRTHDAY"
$aPic[10] = "-------Gloria!!-----------"
$aPic[11] = "` ^ - ~ ; ^ ; `~ ; ` ^ "
$aPic[12] = "- ~ ; ^ ; ` - ~ ; ^ ; "
$aPic[13] = "- ~ ~ ; ^ ; `; ` `~ ; `"
$aPic[14] = "~ ; ` - ~ ; ^ ; `~ ; `"
$aPic[15] = "~ ; ` - ~ ; ^ ; `~ ; ~ ; ` -. ~ ;. . ^ ; `~ ; ` "

Run ("Notepad.exe")

WinWaitActive("Untitled - Notepad")

For $i = 1 To $aPic[0]
    Send ($aPic[$i], 1)
    Send ("{ENTER}")
Next

You will have to play with the spacing to get the correct image.

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

Try to set the raw-flag in the Send command. That means change

Send("Text")
to
Send("Text",1)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Hi and thanks so much!

@Melbaa23

when i paste your script into the script editor save and run it I gt notepad opening and autoit closes...

@water

when i enter this script

WinWaitActive("Untitled - Notepad")

Send("BIRTHDAY",1)

Send(") ( ) (",1)

Send("(^) (^) (^) (^)",1)

Send("_i___i___i___i_",1)

Send("(_____________)",1)

Send("|####|>o< |###|",1)

Send("(______________)",1)

Send("': <~ > ^ ; ` ^ - ~ ; ",1)

Send(", HAPPY BIRTHDAY",1)

Send("-------Gloria!!-----------",1)

Send("` ^ - ~ ; ^ ; `~ ; ` ^ ",1)

Send("- ~ ; ^ ; ` - ~ ; ^ ; ",1)

Send("- ~ ~ ; ^ ; `; ` `~ ; `",1)

Send("~ ; ` - ~ ; ^ ; `~ ; `",1)

Send("~ ; ` - ~ ; ^ ; `~ ; ~ ; ` -. ~ ;. . ^ ; `~ ; ` ",1)

I get this in notepad

BIRTHDAY) ( ) ((^) (^) (^) (^)_i___i___i___i_(_____________)|####|>o< |###|(______________)': <~ > ^ ; ` ^ - ~ ; , HAPPY BIRTHDAY-------Gloria!!-----------` ^ - ~ ; ^ ; `~ ; ` ^ - ~ ; ^ ; ` - ~ ; ^ ; - ~ ~ ; ^ ; `; ` `~ ; `~ ; ` - ~ ; ^ ; `~ ; `~ ; ` - ~ ; ^ ; `~ ; ~ ; ` -. ~ ;. . ^ ; `~ ; `

:)

I have a feeling ascii art is going to be very hard for me to display. I was using a program called perfect keyboard to paste the artwork but it stopped working since it expired on windows 7

Link to comment
Share on other sites

Add a LF at the end of each line.

WinWaitActive("Untitled - Notepad")
Send("BIRTHDAY" & @LF,1)
Send(") ( ) (" & @LF,1)
Send("(^) (^) (^) (^)" & @LF,1)
Send("_i___i___i___i_" & @LF,1)
Send("(_____________)" & @LF,1)
Send("|####|>o< |###|" & @LF,1)
Send("(______________)" & @LF,1)
Send("': <~ > ^ ; ` ^ - ~ ; " & @LF,1)
Send(", HAPPY BIRTHDAY" & @LF,1)
Send("-------Gloria!!-----------" & @LF,1)
Send("` ^ - ~ ; ^ ; `~ ; ` ^ " & @LF,1)
Send("- ~ ; ^ ; ` - ~ ; ^ ; " & @LF,1)
Send("- ~ ~ ; ^ ; `; ` `~ ; `" & @LF,1)
Send("~ ; ` - ~ ; ^ ; `~ ; `" & @LF,1)
Send("~ ; ` - ~ ; ^ ; `~ ; ~ ; ` -. ~ ;. . ^ ; `~ ; ` " & @LF,1)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

How do you create the ASCII artwork? There are ASCII artwork generators available on the internet that allow you to copy and paste the results to notepad etc.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Ok, but why type it into AutoIt code which then types it into Notepad? Therefore I thought the artwork was created by another program that doesn't allow copy&paste.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

How do you create the ASCII artwork? There are ASCII artwork generators available on the internet that allow you to copy and paste the results to notepad etc.

There is a cool website that has all the artwork from amazing artists

. . . . . . . . .H||

. . . .__________H||___________

. . . [|.......................|

. . . ||.........## --.#.......| . . . . . . . . . . .

. . . ||......... . # .# ......| . . . . . .@@@@

. . . ||......... . . * .......| . . . . .@@@@@@@ . . .

. . . ||........ . . -^........| . , . . .- @@@@ . . . .

. . . ||.....##\ . . . ........| . | . . '_ @@@ . . . .

. . . ||....##### . . /###.....| . | . . __\@ \@ . . .

. . . ||....########\ \((#.....| ._\\ .(/ ) @\_/)____

. . . ||..####, . ))/ ##.......| . |(__/ / . . /|% #/

. . . ||..##### . . .'####.....| . .\___/ ----/_|-*/

. . . ||..#####\____/#####.....| . . . ,: . '( . . . . .

. . . ||...######..######......| . . . |: . . \ . . .

. . . ||....."""" .""""...b'ger| . . . |: . . .) . . .

. . . [|_______________________| . . . |: . . .| . . .

. . . . . . .H||_______H|| . . . . . . |_____,_| . . .

. . . . . . .H||________\| . . . . . . .| . / ( . . . .

. . . . . . .H|| . . . H|| . . . . . . .| ./\ .) . . . .

. . . . . . .H|| . . . H|| . . . . . . .( .\| / . . . .

. . . . . . _H||_______H||__ . . . . . .| ./'=. . . . .

. . . . . H|________________| . . . . . '=>/ .\ . . .

. . . . . . . . . . . . . . . . . . . ./ .\ /|/

. . . . . . . . . . . . . . . . . . .,___/| . .

http://www.ascii-art.de/ascii/

Edit:

I guess the board software removes the spaces so the artwork is not displayed in format. You can see the image on the homepage there at the link. btw the image looks great in the online forum editor :)

edit2:

ok i replaced the spaces with a space . now

Edited by charactermap
Link to comment
Share on other sites

AutoIt is a programming language. It's not a macro tool, but you can use AutoIt to create a macro tool. The functions in AutoIt are much more low level, then what you are expecting them to be.

I have created a library to do what you asking (except the replace part):

http://www.autoitscript.com/forum/index.php?showtopic=68422

Link to comment
Share on other sites

Ok, but why type it into AutoIt code which then types it into Notepad? Therefore I thought the artwork was created by another program that doesn't allow copy&paste.

in online chat games like poker and bingo you can use the software to display the artwork and wow the players

unfortunately it is not that simple as there are different chat applets and some don't allow spaces so you have to add dots while others only allow one line so you have to make a script that enters each line and the enter command so that the art diaplays fine to everyone

Link to comment
Share on other sites

AutoIt is a programming language. It's not a macro tool, but you can use AutoIt to create a macro tool. The functions in AutoIt are much more low level, then what you are expecting them to be.

I have created a library to do what you asking (except the replace part):

http://www.autoitscript.com/forum/index.php?showtopic=68422

Thanks for the heads up Manadar!

This is a great forum and I cannot recall another forum where I have been made welcome like this

cheers to you guys!

Edited by charactermap
Link to comment
Share on other sites

One more quick question

I can't for the life of me locate the auto text replace function...(is that what it's called?)

example

if I input

---birthday

into notepad so that the text triggers the birthday cake.

Cheers

I have been reading through and searching and I can't find a way for autoit to run the script using a simple text command. :)

I am trying to use a text trigger

---birthday

and when that text is written then it will make the birthday cake.

there most by a command that can easily do this?

say if I am typing a letter and I type in ---myname it replaces that with whatever I have in the autoit script.

I am hoping to make one .ahk file with a bunch of seperate art and text that I can trigger each one using a text trigger such as ---birthday

I am completely lost. I cannot locate any idea on the search to use in the help file. The tutorials seem to use the wait the "WinWaitActive("Untitled - Notepad")" or "Run("notepad.exe")" suggesting that users are only clicking the script file to make the script run and execute. I am trying to leave the script running and making it execute by trying the trigger.

Can anyone help?

Thanks

Link to comment
Share on other sites

1. Use the library I have given you above.

2. Delete the text that was written by sending backspaces.

3. Send your text

Thanks!

I was looking through the link and tried the script you posted here

http://www.autoitscript.com/forum/index.php?showtopic=68422&view=findpost&p=505155

I could not locate the 3 .au3 files

#include <WinAPI.au3>

#include <WindowsConstants.au3>

#include <Array.au3>

#include-once

Head hurts lol

It's much to complicated for me to figure out and I guess I should give up trying. Thanks for the tip.

Cheers

Link to comment
Share on other sites

Copy this text which is from http://www.ascii-art.de/ascii/

Paste into Notepad

And save as "Birthday.txt" in the script's directory/folder.

(        (
             ( )      ( )          (
      (       Y        Y          ( )
     ( )     |"|      |"|          Y
      Y      | |      | |         |"|
     |"|     | |.-----| |---.___  | |
     | |  .--| |,~~~~~| |~~~,,,,'-| |
     | |-,,~~'-'___   '-'       ~~| |._
    .| |~       // ___            '-',,'.
   /,'-'     <_// // _  __             ~,\
  / ;     ,-,     \\_> <<_' ____________;_)
  | ;    {(_)} _,      ._>>`'-._          |
  | ;     '-'\_\/>              '-._      |
  |\ ~,,,      _\__            ,,,,,'-.   |
  | '-._ ~~,,,            ,,,~~ __.-'~ |  |
  |     '-.__ ~~~~~~~~~~~~ __.-'       |__|
  |\         `'----------'`           _|
  | '=._                         __.=' |
  :     '=.__               __.='      |
   \         `'==========='`          .'
snd '-._                         __.-'
        '-.__               __.-'
             `'-----------'`


                            _  _
                   |_|  /| |_)|_)\_/
                   | | /-| |  |   /
               _     _ ___     _
              |_) | |_) |  |_|| \  /| \_/
              |_) | | \ |  | ||_/ /-|  /

This example script may give you a few ideas.

Notice StringReplace

;
#include <File.au3>

$sBirthday = FileRead("Birthday.txt")
ConsoleWrite($sBirthday & @CRLF)

ConsoleWrite(StringRegExpReplace(StringFormat("%50s", " "), ".", "=") & @CRLF & @CRLF)

$sBirthday = StringReplace($sBirthday, " ", ".")
ConsoleWrite($sBirthday & @CRLF)

;ShellExecute("Birthday.txt") ; or
;Run('Notepad.exe "Birthday.txt"'); or

Local $aFileArray
Run('Notepad.exe')
WinWaitActive("Untitled")
$sBirthday = _FileReadToArray("Birthday.txt", $aFileArray)
For $x = 1 To $aFileArray[0]
    Send($aFileArray[$x] & "{ENTER}")
Next
;

I assume you are using SciTE so that you will get full benefit out of the ConsoleWrite commands.

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