Jump to content

small problem with controlsend


Recommended Posts

i want to use controlsend to send for game(so it's like flash without id)

i tryed

controlsend("game","",0,"what i want")

it's work :party: but when i send small and cap letters

it's make it random :)

ex : i maked code

ControlSend("Game","",0, "This is Some Text")

it some time send it "THIs some text" and some time "this is some text" and some times "this is SOME TEXT" ,etc

i need to solve for this problems plz cuze what i want to send when change form cap to small it's give me error in the game

Link to comment
Share on other sites

controlsettext will change the name of game to the new text

u didn't understand me

for games u have to make the id 0 to work

so if i used controlsettext it will change the game name

Edited by MrBot
Link to comment
Share on other sites

$shsro = WinGetHandle("Game")
        $C0DE= FILEOPEN(@WORKINGDIR& "\code.txt",0)
        $CAPTCHA= FILEREADLINE($C0DE)
        FileClose($C0DE)
        controlsend($shsro,"",0,$CAPTCHA)

that simple from my code

sry for my bad english

Link to comment
Share on other sites

try sending it in raw mode

$shsro = WinGetHandle("Game")
        $C0DE= FILEOPEN(@WORKINGDIR& "\code.txt",0)
        $CAPTCHA= FILEREADLINE($C0DE)
        FileClose($C0DE)
        controlsend($shsro,"",0,$CAPTCHA,1);<----flag for raw mode 
        ;flag = 0 (default), Text contains special characters like + to indicate SHIFT and {LEFT} to indicate left arrow.
        ;flag = 1, keys are sent raw.
[Cheeky]Comment[/Cheeky]
Link to comment
Share on other sites

try sending it in raw mode

$shsro = WinGetHandle("Game")
        $C0DE= FILEOPEN(@WORKINGDIR& "\code.txt",0)
        $CAPTCHA= FILEREADLINE($C0DE)
        FileClose($C0DE)
        controlsend($shsro,"",0,$CAPTCHA,1);<----flag for raw mode 
        ;flag = 0 (default), Text contains special characters like + to indicate SHIFT and {LEFT} to indicate left arrow.
        ;flag = 1, keys are sent raw.
same problem

it changed "C5n3G5" to "C%N#G5"

random change :)

Link to comment
Share on other sites

it might be just the game augmenting things try this

controlsend($shsro,"",0,"{T}his is {S}ome {T}ext",0);<----flag
        ;flag = 0 (default), Text contains special characters like + to indicate SHIFT and {LEFT} to indicate left arrow.
        ;flag = 1, keys are sent raw.
[Cheeky]Comment[/Cheeky]
Link to comment
Share on other sites

#include <string.au3>
        $shsro = WinGetHandle("Game")
        $C0DE= FILEOPEN(@WORKINGDIR& "\code.txt",0)
        $CAPTCHA= FILEREADLINE($C0DE)
        FileClose($C0DE)
        $HS = _StringToHex($CAPTCHA)
        controlsend($shsro,"",0,$HS)
        
        ;Just check what it likes, its going to come down to how much do really need this?
        ;Maybe it likes Binary? try StringToBinary and sending the Binary variable. I cant test it
        ;because I dont have the game or I would.

[Cheeky]Comment[/Cheeky]
Link to comment
Share on other sites

controlsend($shsro,"",0,"{T}his is {S}ome {T}ext",0);<----flag
        ;flag = 0 (default), Text contains special characters like + to indicate SHIFT and {LEFT} to indicate left arrow.
        ;flag = 1, keys are sent raw.ƒoÝŠ÷ Ûú®¢×ªº‹^©ž
Edited by MrBot
Link to comment
Share on other sites

I have seen this problem myself when it comes to send. I've never been able to nail it down, but what I have done as a work around is to do a control read to check to see if what I sent was correct. If it was sent wrong, I would resend it. As what was said earlier, controlsend works best.

Link to comment
Share on other sites

I had this exact same problem recently.

Got round it like this:

put this at the top of your script:

Opt("SendCapslockMode",0)

This prevents AutoIt messing with caps lock when trying to send data.

You will then need to send your own caps lock commands:

e.g. to send "Hello There" will be

Send("{CAPSLOCK on}")
ControlSend($hWND,"","","h")
Send("{CAPSLOCK off}")
ControlSend($hWND,"","","ello")
Send("{CAPSLOCK on}")
ControlSend($hWND,"","","t")
Send("{CAPSLOCK off}")
ControlSend($hWND,"","","here")
- Table UDF - create simple data tables - Line Graph UDF GDI+ - quickly create simple line graphs with x and y axes (uses GDI+ with double buffer) - Line Graph UDF - quickly create simple line graphs with x and y axes (uses AI native graphic control) - Barcode Generator Code 128 B C - Create the 1/0 code for barcodes. - WebCam as BarCode Reader - use your webcam to read barcodes - Stereograms!!! - make your own stereograms in AutoIT - Ziggurat Gaussian Distribution RNG - generate random numbers based on normal/gaussian distribution - Box-Muller Gaussian Distribution RNG - generate random numbers based on normal/gaussian distribution - Elastic Radio Buttons - faux-gravity effects in AutoIT (from javascript)- Morse Code Generator - Generate morse code by tapping your spacebar!
Link to comment
Share on other sites

I had this exact same problem recently.

Got round it like this:

put this at the top of your script:

Opt("SendCapslockMode",0)

This prevents AutoIt messing with caps lock when trying to send data.

You will then need to send your own caps lock commands:

e.g. to send "Hello There" will be

Send("{CAPSLOCK on}")
ControlSend($hWND,"","","h")
Send("{CAPSLOCK off}")
ControlSend($hWND,"","","ello")
Send("{CAPSLOCK on}")
ControlSend($hWND,"","","t")
Send("{CAPSLOCK off}")
ControlSend($hWND,"","","here")
lol so how i will make it read from file ^^
Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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