send("key") wird nicht überliefert

07/13/2011 18:44 chip331#1
Hallo,

ich habe mir ein kleines Skript gebastelt:

Code:


dim $color

MsgBox ( 0, "Programm gestartet", "Es wurde gestartet")

while 1
	$color = PixelGetColor ( 801 , 301 )

	if hex($color) = '00FFFBFF' then
		
		Send ( "d" )
		Sleep ( 500 )
		Send ( "d" )
		sleep (500)
		send ( "d")
		sleep (500)
		send ( "d")
		MsgBox ( 0, "Farbe gefunden", "Farbe gefunden")
		
	
	endIf
wend
Das Problem

Im Spiel kommt das "d" nicht an.

Natürlich ist das Spiel maximiert.

Das Farbe gefunden wird ausgegeben.


Ich hoffe ihr könnt mir bei meinem Problem helfen.

MFG

chip331
07/13/2011 19:21 Elborod#2
Willst du "d" als Tastatur eingabe oder willst du das er einfach nur ein " D " sendet(zb in einen Chat)?

Wenn du willst das er die Taste "D" drückt, dann musst du den Befehl so gestalten:
PHP Code:
send("{d}"


PHP Code:
dim $color

MsgBox 
0"Programm gestartet""Es wurde gestartet")

while 
1
    $color 
PixelGetColor 801 301 )

    if 
hex($color) = '00FFFBFF' then
        
        send
("{d}")
        
Sleep 500 )
        
send("{d}")
        
sleep (500)
        
send("{d}")
        
sleep (500)
        
send("{d}")
        
MsgBox 0"Farbe gefunden""Farbe gefunden")
        
    
    endIf
wend 
Grüße
Stoani
07/13/2011 19:28 lolkop#3
Quote:
Originally Posted by chip331 View Post
Code:
while 1
	$color = PixelGetColor ( 801 , 301 )
	[COLOR="Red"]if hex($color) = '00FFFBFF' then[/COLOR] <-- besser wäre hier if $color = 0xFFFBFF
	[...]
	endif
wend
davon abgesehen solltest du dir am besten einmal $color dauerhaft im tooltip ausgebene lassen also etwa so:
Code:
MsgBox ( 0, "Programm gestartet", "Es wurde gestartet")
While 1
	$color = PixelGetColor ( 801 , 301 )
	ToolTip('0x'&$color)
        If $color = 0xFFFBFF then
		For $i=1 To 3
			Send("{d}")
			Sleep(500)
		Next
		MsgBox ( 0, "Farbe gefunden", "Farbe gefunden")
        EndIf
Wend
07/13/2011 19:58 chip331#4
Vielen Dank euch beiden.

Das mit "Send("{d}")" war mein Fehler und das ganze als Admin auszuführen auch.

Nochmal Danke euch.