Jump to content
Sign in to follow this  
charactermap

how can I send ascii text? Please help

Recommended Posts

charactermap

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

Share this post


Link to post
Share on other sites
Melba23

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


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
water

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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
charactermap

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

Share this post


Link to post
Share on other sites
water

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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
charactermap

@Melbaa23

I just checked your script again and didn't realize that there was more at the bottom.

It seems to work great

Thanks so much! This is great!

Share this post


Link to post
Share on other sites
charactermap

@water

That is working too!

I will try both scripts on a more complicated artwork and see if i can automate creating the new start and end commands into each line of the artwork

Thanks for your help both of you!

I really appreciate it!

Share this post


Link to post
Share on other sites
water

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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
jvanegmond

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.

YOU TYPE IT.

That's the beauty of ASCII artwork, nothing else required but a keyword and text processor.

Share this post


Link to post
Share on other sites
charactermap

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

Share this post


Link to post
Share on other sites
water

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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
charactermap

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

Share this post


Link to post
Share on other sites
jvanegmond

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

Share this post


Link to post
Share on other sites
charactermap

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

Share this post


Link to post
Share on other sites
charactermap

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

Share this post


Link to post
Share on other sites
charactermap

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

Share this post


Link to post
Share on other sites
jvanegmond

1. Use the library I have given you above.

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

3. Send your text

Share this post


Link to post
Share on other sites
charactermap

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

Share this post


Link to post
Share on other sites
jvanegmond

These files are included with a standard AutoIt v3 installation.

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

AutoIt uses .au3 files... Are you sure you are looking for AutoIt help and not AutoHotkey help? :)

Share this post


Link to post
Share on other sites
Malkey

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.

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.