donater Posted October 6, 2015 Share Posted October 6, 2015 (edited) HiI have no idea why this code is not working. When I explicitly put a string into PutClip("adsgasdfgdfgsdf") the script compiles and runs. But when I try to use PutClip with an array a compile time error message is telling me the function is unknown.I have only written stuff in C# so Autoit is very new to me and I am not used to datatypes being all the same like they are in autoit. Can someone see why this script is not working?Also, I dont know anything about what is and what is not included in autoit. So I just try to include everything i can think of lol. Is there some holy grail to include all?#include <MsgBoxConstants.au3>#include <Clipboard.au3>#include <Array.au3>#include <File.au3>#include <AutoItConstants.au3>#include <File.au3>#include <String.au3>sleep(1400)Work()Func Work() ; Read the current script file into an array using the filepath. Local $arr = FileReadToArray("C:\Users\BOSSMAN\Desktop\originslist.txt") If @error Then MsgBox($MB_SYSTEMMODAL, "", "There was an error reading the file. @error: " & @error) ; An error occurred reading the current script file. Else For $i = 0 To UBound($arr) - 1; Loop through the array. PutClip($arr[$i]) Sleep(250) MouseClick($MOUSE_CLICK_LEFT, 2482, 359, 1) Sleep(100) Send("^v") Sleep(100) Send("{ENTER}") Next EndIfEndFunc Edited October 6, 2015 by donater Link to comment Share on other sites More sharing options...
Tekk Posted October 6, 2015 Share Posted October 6, 2015 ClipPut($arr[$i]) Link to comment Share on other sites More sharing options...
donater Posted October 6, 2015 Author Share Posted October 6, 2015 LOL thank you Link to comment Share on other sites More sharing options...
donater Posted October 6, 2015 Author Share Posted October 6, 2015 Ok, for some reason my script is only partially working. Everything works as planned except for the fact that the array is populated with only parts of my file. I looked through and it just randomly skips some entries. I tried working with the _FileReadToArray method instead of the FIleReadToArray and its confusing and i cant get it to comiple so i am going to stick with FileReadToArray for now.My text file is delimited by line breaks and looks like this:Jace, Vryn's Prodigy (ORI #60)Nissa, Vastwood Seer (ORI #189)Hangarback WalkerLiliana, Heretical Healer (ORI #106)Kytheon, Hero of Akros (ORI #23)Abbot of Keral KeepChandra, Fire of Kaladesh (ORI #135)Archangel of TithesDay's UndoingExquisite FirecraftDemonic PactPyromancer's GogglesWoodland BellowerLanguish (ORI #105)Erebos's TitanStarfield of NyxShivan Reef (ORI #251)Llanowar Wastes (ORI #248)Alhammarret's ArchiveAvaricious DragonCaves of Koilos (ORI #245)Battlefield Forge (ORI #244)The Great AuroraDisciple of the RingManagorger HydraYavimaya Coast (ORI #252)Tragic ArroganceEvolutionary LeapGoblin Piledriver (ORI #151)Pia and Kiran Nalaar (ORI #157)Harbinger of the TidesSword of the AnimistDwynen, Gilt-Leaf Daen (ORI #172)Hallowed MoonlightScab-Clan BerserkerThopter Spy NetworkKnight of the White Orchid (ORI #21)Molten VortexDark PetitionHerald of the PantheonGilt-Leaf WinnowerVryn WingmareSigil of the Empty Throne (ORI #31) Anyone know why my script is only picking up some of the elements? Also I dont think it has anything to do with some entries have (OPI # ***), as some of those values post and some dont. Link to comment Share on other sites More sharing options...
donater Posted October 6, 2015 Author Share Posted October 6, 2015 Clarification: The script is only taking every other element in the array. Link to comment Share on other sites More sharing options...
TheSaint Posted October 7, 2015 Share Posted October 7, 2015 Not sure why you would want to put an array as is on the Clipboard, and then attempt to paste it elsewhere.If you are just after the text, with included separator character, then just use _ArrayToString command when placing on the clipboard. Make sure brain is in gear before opening mouth! Remember, what is not said, can be just as important as what is said. Spoiler What is the Secret Key? Life is like a Donut If I put effort into communication, I expect you to read properly & fully, or just not comment. Ignoring those who try to divert conversation with irrelevancies. If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it. I'm only big and bad, to those who have an over-active imagination. I may have the Artistic Liesense to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage) Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 7, 2015 Moderators Share Posted October 7, 2015 donater,Welcome to the AutoIt forums.Looking at the content of that array, please take the time to read the Forum rules before you post again.M23 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now