KamKam Posted May 5, 2019 Share Posted May 5, 2019 Hello. How to make a bot to change the text "TEST" to "Welcome"? Example: With TEST TEST TEST TEST TEST On Welcome1 Welcome2 Welcome3 Welcome4 Welcome5 Link to comment Share on other sites More sharing options...
KamKam Posted May 5, 2019 Author Share Posted May 5, 2019 EDIT: I would like it to be "Welcome" with numbering in turn Link to comment Share on other sites More sharing options...
jchd Posted May 5, 2019 Share Posted May 5, 2019 (edited) Local $s = "TEXT" & @CRLF & "TEXT" & @CRLF & "TEXT" & @CRLF & "TEXT" & @CRLF & "TEXT" Local $i = 0 Local $t = Execute("'" & StringRegExpReplace($s, "(?m)\w+\R?", "Welcome' & _Inc($i) & @CRLF & '") & "'") ConsoleWrite($t & @CRLF) Func _Inc(ByRef $n) $n += 1 Return $n EndFunc Bot? Can't you say "program"? Note that if you don't want a possible extra line termination at the end, then use that instead: Local $t = Execute("'" & StringRegExpReplace($s, "(?m)\w+(\R?)", "Welcome' & _Inc($i) & '$1' & '") & "'") Also if you want a running counter across several uses, plus the ability to reset the counter when needed, then try this: Local $s = "TEXT" & @CRLF & "TEXT" & @CRLF & "TEXT" & @CRLF & "TEXT" & @CRLF & "TEXT" Local $t = Execute("'" & StringRegExpReplace($s, "(?m)\w+(\R?)", "Welcome' & _RunningCount() & '$1' & '") & "'") ConsoleWrite($t & @CRLF) ConsoleWrite("Another invokation" & @CRLF) $t = Execute("'" & StringRegExpReplace($s, "(?m)\w+(\R?)", "Welcome' & _RunningCount() & '$1' & '") & "'") ConsoleWrite($t & @CRLF) ConsoleWrite("Reset count then yet another invokation" & @CRLF) _RunningCount(1) $t = Execute("'" & StringRegExpReplace($s, "(?m)\w+(\R?)", "Welcome' & _RunningCount() & '$1' & '") & "'") ConsoleWrite($t & @CRLF) Func _RunningCount($bReset = 0) Local Static $n $n = $bReset ? 0 : $n + 1 Return $n EndFunc Edited May 5, 2019 by jchd Exit 1 This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
KamKam Posted May 5, 2019 Author Share Posted May 5, 2019 I meant something like that. I would like it to change the text in Notepad++ and not show MSGBOX. MsgBox(0, "TEST", "Load the source text") $sTxt = ControlGetText("[CLASS:Notepad]", "", "Edit1") $iNR=0 MsgBox(64, "Source text", $sTxt) Do $iNR += 1 $sTxt = StringReplace($sTxt, "Test", "ProgramNR" & $iNR, 1) Until @extended=0 MsgBox(64, "Result text", $sTxt) Link to comment Share on other sites More sharing options...
jchd Posted May 6, 2019 Share Posted May 6, 2019 And your issue is? Remove your MsgBox-es and use ControlSetText at the end. This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
KamKam Posted May 6, 2019 Author Share Posted May 6, 2019 Thanks! How to make my code from random letters and numbers twice the same? Example: With TestTestTest@gmail.com TestTestTest@gmail.com TestTestTest@gmail.com TestTestTest@gmail.com TestTestTest@gmail.com TestTestTest@gmail.com On GAW54WG87GW8@gmail.com GAW54WG87GW8@gmail.com POMTE9ET74TE@gmail.com POMTE9ET74TE@gmail.com WOIMGPT7T21T@gmail.com WOIMGPT7T21T@gmail.com Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 6, 2019 Moderators Share Posted May 6, 2019 KamKam, And what exactly is the end point of all this? What are you trying to do? M23 P.S. And just to be absolutely clear - this is the Mod team determining the legality of the thread, so everyone else please keep out. 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...
KamKam Posted May 6, 2019 Author Share Posted May 6, 2019 He wants to make a program and then window in the GUI and in the input randomly select nickname and email. PS: I do not know English well, so I'm Polish. Link to comment Share on other sites More sharing options...
KamKam Posted May 6, 2019 Author Share Posted May 6, 2019 Okay, another question. How to make a loop after 2 times the same is repeated and then the other repeats after 2 times but it does not end. Example: ABC111 ABC111 ABC222 ABC222 ABC333 ABC333 ABC444 ABC444 ABC555 ABC555 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 6, 2019 Moderators Share Posted May 6, 2019 KamKam, And from where do you get these "randomly select[ed] nickname and email" elements? Why do you need to randomly select one of them? 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...
KamKam Posted May 6, 2019 Author Share Posted May 6, 2019 If a person clicks the button and draws a nickname and email then the person wins the game account and gives.je. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 7, 2019 Moderators Share Posted May 7, 2019 KamKam, That sounds to me as if it breaks the injunction in the Forum rules regarding not discussing game automation - so the thread is locked. Please read those rules before you post again and make sure you follow them in future. 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