BlueDuckYT Posted January 6, 2018 Posted January 6, 2018 (edited) Hard to explain. First off, I am NOT trying to bot a game. I am simply trying to make an automated script that will activate once I press enter, which opens chat, and types `1, which colors the chat. Everything works fine, except that I am trying to make it so I can press enter again to send the message, as currently it just recolors the chat. I also need it to end itself when the delete key is pressed. Could someone please fix my code? Func AutoColor() if $o = 1 Then Sleep ( 5 ) Send("`1") $o = 2 Else $o = 1 EndIf EndFunc Global $o = 1 Global $i = 10 While $i < 100 $i =- 1 if $o = 1 Then HotKeySet ( "{ENTER}" , "AutoColor" ) Else Send ( "{ENTER}" ) EndIf WEnd Edited January 6, 2018 by BlueDuckYT
DynamicRookie Posted January 6, 2018 Posted January 6, 2018 Easy as bread to solve Just replace your script with this: HotKeySet("{enter}", "start_ColorChat") Func SleepForUser() While 1 Sleep (1000) WEnd EndFunc Func start_colorchat() Send("`1", 1) Call("SleepForUser") Endfunc Tell me if it fixs your error, and if it doesn't, tell me the exact error message it gives u. Happy Scripting
careca Posted January 6, 2018 Posted January 6, 2018 Another method, and the delete to exit. #include <Misc.au3> While 1 If _IsPressed('2E') Then Exit EndIf If _IsPressed('0D') Then AutoColor() EndIf Sleep(100) WEnd Func AutoColor() Send("`1") EndFunc Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe
BlueDuckYT Posted January 6, 2018 Author Posted January 6, 2018 1 hour ago, careca said: Another method, and the delete to exit. #include <Misc.au3> While 1 If _IsPressed('2E') Then Exit EndIf If _IsPressed('0D') Then AutoColor() EndIf Sleep(100) WEnd Func AutoColor() Send("`1") EndFunc This certainly condenses it well and has the delete key, but the enter button pulls up the chat, and is also used to send the chat message. I need some way for it to know if I have pressed the enter key or not, and then do a normal enter rather than `1. Thanks for the help.
careca Posted January 6, 2018 Posted January 6, 2018 (edited) " I need some way for it to know if I have pressed the enter key or not, and then do a normal enter rather than `1 " I mean, How does is the script going to know when you want to send '1 ? You can either disable it / exit after the first enter, or you can have a key to enable/disable the send. Maybe im overthinking this, Do you want to send '1 only one time and leave? #include <Misc.au3> ;No more Delete Key, leave right away after the enter and sending '1. While 1 If _IsPressed('0D') Then AutoColor() EndIf Sleep(100) WEnd Func AutoColor() Send("`1") Exit EndFunc Another option is to have a key to enable or disable the send. The script isn't going to magically guess when you want to send '1 after pressing enter. Edited January 6, 2018 by careca Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe
BlueDuckYT Posted January 6, 2018 Author Posted January 6, 2018 4 hours ago, careca said: " I need some way for it to know if I have pressed the enter key or not, and then do a normal enter rather than `1 " I mean, How does is the script going to know when you want to send '1 ? You can either disable it / exit after the first enter, or you can have a key to enable/disable the send. Maybe im overthinking this, Do you want to send '1 only one time and leave? #include <Misc.au3> ;No more Delete Key, leave right away after the enter and sending '1. While 1 If _IsPressed('0D') Then AutoColor() EndIf Sleep(100) WEnd Func AutoColor() Send("`1") Exit EndFunc Another option is to have a key to enable or disable the send. The script isn't going to magically guess when you want to send '1 after pressing enter. After I press enter the first time, I would like it to update a variable or something. When the variable is in its updated state, I want the hotkey to do nothing except reset the variable.
careca Posted January 6, 2018 Posted January 6, 2018 That should be easy enough for you to try. Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe
BlueDuckYT Posted January 6, 2018 Author Posted January 6, 2018 4 minutes ago, careca said: That should be easy enough for you to try. I did in my original script, but it did not work.
careca Posted January 6, 2018 Posted January 6, 2018 (edited) "After I press enter the first time, I would like it to update a variable. When the variable is in its updated state, I want the hotkey to do nothing except reset the variable. " What do you mean reset the var? Do you mean like: ENTER = send '1 and disable the send for the next Enter. ENTER = Enable ENTER = send '1 and disable the send for the next Enter. ENTER = Enable ? #include <Misc.au3> Global $State = 1 While 1 If _IsPressed('0D') Then AutoColor() EndIf Sleep(100) WEnd Func AutoColor() If $State = 1 Then Send("`1") $State = 0 Else $State = 1 EndIf EndFunc Edited January 6, 2018 by careca Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe
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