SomeNerd Posted April 5, 2017 Share Posted April 5, 2017 ;Send the string $ss after the Shift Alt and Ctrl keys are released. Otherwise Autoit makes them stuck >.< Func _SendEx($ss, $raw = 0) While _IsPressed("10") Or _IsPressed("11") Or _IsPressed("12") Sleep(50) WEnd If($raw=1)Then Send($ss,1) Else Send($ss) EndIf EndFunc;==>_SendE HotKeySet("^+v", "SC2Pasta") ; Cntrl+Shift+V Func SC2Pasta() Local $clipboard = ClipGet() if(Not @error)Then Local $lines = StringSplit($clipboard, '\n', 1) For $i = 1 To $lines[0] _SendEX("+{ENTER}"); _SendEX($lines[$i],1); _SendEX("{ENTER}"); Next EndIf EndFunc Hello! SO I'm pretty new to autoit syntax, and am trying to create a copy/paste function for a game which does not support return carriages in a single message. What I'm trying to accomplish is: -Get contents of clipboard -Break contents up into individual lines -Send each line as a message one by one in a loop. I'm using _SendEx rather than send as a workaround for the shift and control keys getting stuck in the down state. Currently it ALMOST works. The problem arises in the For loop. Game requires shift+enter key to open chat to send to all players. Right now, the first line will send shift+enter correctly and paste the appropriate line from the clipboard. However, subsequent iterations through the loop are sending only the enter key, not the shift+enter key. Why is this? Thanks in advance Link to comment Share on other sites More sharing options...
SomeNerd Posted April 5, 2017 Author Share Posted April 5, 2017 4 minutes ago, SomeNerd said: However, subsequent iterations through the loop are sending only the enter key, not the shift+enter key. Why is this? Since I can't seem to edit my own post, I feel I should clarify this with a reply -.- subsequent iterations through the loop send enter, the correct line of text from the clipboard, and enter again. The problem is that shift is not being held for the preceding enter, resulting in the message being sent to the wrong place. I want shift+enter, line, enter. Link to comment Share on other sites More sharing options...
SomeNerd Posted April 5, 2017 Author Share Posted April 5, 2017 Okay /Thread problem was the While condition in sendex. That's what I get for using examples from a third party. Link to comment Share on other sites More sharing options...
water Posted April 5, 2017 Share Posted April 5, 2017 4 hours ago, SomeNerd said: trying to create a copy/paste function for a game Welcome to AutoIt and the forum! Seems you missed to read the forum rules on your way in. Please do so now! You will notice that game automation of any kind is not permitted here. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Recommended Posts