Jump to content

Problem with a script


Recommended Posts

Hi,

Sorry to create another topic that talk about Controlsend, but i will don't know why :geek:

So if someone can help me :)

Well, i have an old script that send in a minimize windows some text.

I try to send some text to the game but sometime he doesn't write what i have initialize....

Here is the code :

WinWaitActive("Game")
While WinExists("Game")
 ControlSend("Game","","","450 EA 00 E2 AZ FE{Enter}")
 Sleep(650)
 ControlSend("Game","","","450 EA 00 12 2B F6{Enter}")
 Sleep(650)
Wend

That a sample of my code

Then when the run the macro

Sometime it send what i want "450 EA 00 E2 AZ FE" but some time it send "450 éA0à00E20AZ FE"

I really don't know where that unwanted text is coming from :lmao:

If someone have a solution!! My goal is to use my script and be able to do other things at the same time :ph34r:

thx for all your help

ChoosenOne

Edited by ChoosenOne
Link to comment
Share on other sites

Hi,

have you tried it with the flag = 1 ?

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

to th.meger : I have try with the flag =1 (sent raw) but i still have the same problem

I always have that unwanted caractere that insert themself from nowhere in my text....

Does it work if i'm doin' something like this

WinWaitActive("Game")
$FirstPacket="450 EA 00 E2 AZ FE"
$SecondPacket="450 EA 00 E2 AZ FE"

While WinExists("Game")
 ControlSend("Game","","",$FirstPacket,1)
 ControlSend("Game","","","{Enter}")
 Sleep(650)
 ControlSend("Game","","",$SecondPacket,1)
 ControlSend("Game","","","{Enter}")
 Sleep(650)
Wend

And is ControlSend the appropriate function to what i want to do ?

When i try with the function send that work properly...Need some advise :lmao:

Link to comment
Share on other sites

Hi,

I guess that problem seems to stay a mystery. :lmao:

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

This is something I have seen in my scripts as well. I've never been able to nail it down as to the cause. I tried slowing down what was sent, which helped, but even then, I needed something that was 100%. What I ended up doing was this. It does a error check to make sure what was sent is what I want. It is messy, but it does work well. Some will question why I repeat a "^c". I found if I didn't do this, sometimes it would fail. (about 10% of the time) It was the only way I could make it bullet proof that worked.

ControlSend("Unicenter ServicePlus Service Desk - Change Order Search", "", "Internet Explorer_Server1", "{RIGHT}", 0)
    _F3b_chk1()
    $g = 1
    While 2
        $g = $g + 1
        $aa = StringLen($iniread_5)
        Sleep(5)
        Send("^c")
        Sleep(5)
        Send("^c") ;this allows for error. Sometimes this fails, so it is done twice for safety.
        $clip = ClipGet()
        
        $bb = StringLen(String($clip))
        Select
            Case $aa = $bb
                ExitLoop
            Case $g = 10
                ExitLoop
            Case Else
                _F3b_chk1()
                ContinueLoop
        EndSelect
    WEnd
Func _F3b_chk1()
    local $iniread_5
    $iniread_5 = IniRead(@ScriptDir & "\bin\unplus.ini", @UserName, "search 5", "not found")
    Send($iniread_5)
    ClipPut("")
    Send("^a")
    Sleep(10)
    Send("^c")
    Sleep(5)
    Send("^c") ;this allows for error. Sometimes this fails, so it is done twice for safety.
EndFunc   ;==>_F3b_chk1
Link to comment
Share on other sites

Hi,

did you already try ControlSetText or Clip funcs? Just to prove it works other way round?

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

Hi,

did you already try ControlSetText or Clip funcs? Just to prove it works other way round?

So long,

Mega

I will try ControlSetText and tell if it work or not :">

I don't know the function Clip i am goin to get some information and try it

I tell u if it work

to vollyman : I can't repeat twice the same packet coz i will crash the client of my game ^^

Edited by ChoosenOne
Link to comment
Share on other sites

Hi,

ok. :lmao: Clip was my short for ClipPut and ClipGet. :">

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

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