Virtuelle Maus & Fenster mit Variablem Namen

10/06/2009 15:30 Psike2k8#1
Ich spiele Ultima Online und habe auch einen sehr leistungstarken miningbot geschrieben..nur stehe ich jetzt vor einem großen Problem!
  1. Das Script läuft nciht im Ultima Online fenster sondern einfach auf dem Programm welches unter der maus ist!
  2. Die Maus wird effektiv bewegt also der Mauszeiger wandert!

Beides würde ich gerne ändern die bewegungen & klicks sollen nur im UO fenster passieren, geht aber leider nciht so trivial weil jeder nen eigenen fenster namen hat Ultima Online [Char Name] [Server Name] wie kann ich das also realisieren!
Bei der Maus sache dachte ich an eine virtuelle maus also die nur in dem fenster agiert und auch wenn das fenster im Hintergrund ist! Wie soll ich das machen!
Ich hoffe ihr habt evt. einen lösungs ansatz für mich bin eldier ratlos!

Danke Lars
10/06/2009 19:28 AllesVergeben#2
1.Clientmodus einstellen, z.b.
Code:
Opt("MouseCoordMode", 0)
, immer abchecken ob der Browser im Vordergrund ist

2. Durch diese Bitte kannst du das erste vergessen. :)

Code:
ControlSend ( "title", "text", controlID, "string" [, flag] )
Help-File:

Code:
ControlSend 
--------------------------------------------------------------------------------

Sends a string of characters to a control.


ControlSend ( "title", "text", controlID, "string" [, flag] )


 

Parameters

title The title of the window to access. 
text The text of the window to access. 
controlID The control to interact with. See Controls. 
string String of characters to send to the control. 
flag [optional] Changes how "keys" is processed:
  flag = 0 (default), Text contains special characters like + to indicate SHIFT and {LEFT} to indicate left arrow.
  flag = 1, keys are sent raw. 

 

Return Value

Success: Returns 1. 
Failure: Returns 0 if window/control is not found. 

 

Remarks

ControlSend works in a similar way to Send but it can send key strokes directly to a window/control, rather than just to the active window.

ControlSend is only unreliable for command prompts as that works differently to normal windows (seems to check physical states rather than accepting the keystroke messages). For normal windows ControlSend should be way more reliable than a normal Send - and yes it does send shift, ctrl, alt etc.

As mention in the Send help the keyboard that send different chars when in CAPS LOCK and using the Shift Key cannot be simulated. An example is the Czech Keyboard. A good workaround is to use the ControlSetText.

The control might first need to be given focus with the ControlFocus command, specially when referencing an controlID created by the script itself.

Opt("SendKeyDelay",...) alters the the length of the brief pause in between sent keystrokes.
Opt("SendKeyDownDelay",...) alters the length of time a key is held down before being released during a keystroke.


 

Related

ControlCommand, Send, ControlSetText, ControlFocus, SendKeyDelay (Option), SendKeyDownDelay (Option) 
 

Example


ControlSend("Untitled", "", "Edit1", "This is a line of text in the notepad window")
10/06/2009 21:13 Psike2k8#3
Ich nutze AutoIt seit dem wochenende^^ also ich kann schon Programmieren auch anderen sprachen aber leider verstehe ich nicht so genau was du mir sagen willst ich habe mir das noch mal angesehen aber auch hier ist wieder die frage wie soll ich das machen wenn ich keinen festen fenstertitel habe? Und wie kann ich meine erste frage realisieren

Danke
10/06/2009 21:54 Ende!#4
Soweit ich weiß reicht ein Teil des Titels aus. Also nur "Ultima online". Bin mir aber nicht sicher, musste mal testen.
10/06/2009 22:07 buFFy!#5
über den Process den Fensternamen ermitteln...:rolleyes:
10/06/2009 22:13 TheOwnWay#6
Quote:
Originally Posted by u-coRe View Post
über den Process den Fensternamen ermitteln...:rolleyes:
^this, oder als title
PHP Code:
ControlSend([B]"Ultima Online" $Charname " " $Servername[/B], und so weiter.) 
angeben und abfragen lassen..
10/07/2009 08:55 Psike2k8#7
Angeben und abfragen ist keine option es soll bisher wird nur ein klick vom user gefordert der rest passiert automatisch also will ich es dabei belassen das er keinen Aufwand hat!
Also müsste ich es mit dem Process raus bekommen sind die prozess id's auf allen pc's gleich und wenn ja wie frage ich diese ab? UNd verwende sie so das ich dann den namen raus bekomme!? Danke!
10/07/2009 21:33 buFFy!#8
$pid = processexists(process)

oder mit processlist.