Halli hallo hallöchen,
ich besitze ein LG kp500 und gestern hab ich mir gedacht, es wäre doch cool, wenn man den PC über dieses Handy mehr oder weniger steuern könnte.
Soweit ich weiß, existiert keinerlei remotefunktion.
Das ganze funktioniert jetzt über Bluetooth. Um den Empfangsclient zu starten, hab ich leider Imagesearch gebraucht. Bluetooth muss natürlich vorher an sein.
-> Man sendet vom Handy bestimmte Datein (entweder Musik oder txt-files, die bestimmte Namen haben). Wenn ein bestimmter Dateiname aufm PC dann erkannt wird, wird eine bestimmte Funktion ausgeführt. Mp3's/wma's werden automatisch ausgeführt.
Das Skript ist eher für den privaten Gebrauch bestimmt, dh. einige Sachen müsst ihr evtl anpassen.
#include<array.au3>
#include<file.au3>
local $txt=False
local $mp3=false
local $title
while 1
do
$imagesearch= _imagesearch(@scriptdir&"\bluetooth.jpg", 1, $x, $y, 100)
until $x<>0 and $y<>0
MouseClick("", $x, $y)
sleep(2000)
mouseclick("", 988, 687)
do
$array= _filelisttoarray(@tempdir, "FSQ_***********",0)
for $i= 0 to ubound($array)-1
$array2= _filelisttoarray(@tempdir&$array[$i], "*", 0)
for $j= 0 to ubound($array2)-1
if stringinstr($array2[$j], "mp3")<>0 or stringinstr($array2[$j], "wma")<>0 then
$mp3=true
$title= $array2[$j]
$path= @tempdir&$array[$i]&"\"&$array2[$j]
elseif stringinstr($array2[$j], "txt")<>0 then
$txt=True
$path= @tempdir&$array[$i]&"\"&$array2[$j]
endif
next
next
until $mp3=true or $txt=true
If $txt=true then
If stringinstr($path, "open firefox") then
shellexecute("firefox.exe")
elseif stringinstr($path, "open itunes") then
shellexecute("itunes.exe")
elseif stringinstr($path, "shutdown") then
Shutdown(1)
endif
elseif $mp3=true then
do
$sizeold=filegetsize($path)
sleep(1000)
$sizenew= filegetsize($path)
sleep(1000)
until $sizeold=$sizenew and $sizeold<>0
filecopy($path, @desktopdir&"\"&$title)
filedelete($path)
shellexecute(@desktopdir&"\"&$title)
endif
wend
;===============================================================================
Func _ImageSearch($findImage,$resultPosition,ByRef $x, ByRef $y,$tolerance)
return _ImageSearchArea($findImage,$resultPosition,0,0,@DesktopWidth,@DesktopHeight,$x,$y,$tolerance)
EndFunc
Func _ImageSearchArea($findImage,$resultPosition,$x1,$y1,$right,$bottom,ByRef $x, ByRef $y, $tolerance)
if $tolerance>0 then $findImage = "*" & $tolerance & " " & $findImage
$result = DllCall("ImageSearchDLL.dll","str","ImageSearch","int",$x1,"int",$y1,"int",$right,"int",$bottom,"str",$findImage)
if $result[0]="0" then return 0
$array = StringSplit($result[0],"|")
[/autoit][autoit][/autoit][autoit]$x=Int(Number($array[2]))
$y=Int(Number($array[3]))
if $resultPosition=1 then
$x=$x + Int(Number($array[4])/2)
$y=$y + Int(Number($array[5])/2)
endif
return 1
EndFunc
Hat jemand ne Idee, wie man das einschalten von Bluetooth und von dem "empfängerfenster" automatisieren könnte (nat. ohne imagesearch)?
Edit: DIe imagesearch.dll muss in system32 sein... und bluetooth.jpg logischerweise in der @scriptdir
[Blockierte Grafik: http://www7.pic-upload.de/18.08.11/musa9lujw656.jpg]