Jump to content

Recommended Posts

Posted (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 by BlueDuckYT
Posted

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

Posted
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.

 

Posted (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 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

Posted
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.

Posted

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

Posted (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 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

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...