Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

tcp ip small question (client-server)

$
0
0
hello there,
it's not quite right forum to ask, but it use autoit that's why i ask here, most of it i will find it quicker answare here then on php/html forums

well, lets start, i want to use and tcp ip conection based on server-client to control my winamp(like volum up, down, play, pause, stop, next e.t.c) that's easy to do it with an simple php script and and tool to check an field infinitely and search commands, but that make quite big delay between client-server so i ask myself what alternative i have, well, tcp ip it seems to be good one, but i'm not sure of something can i make an web server and use autoit client and control client through webpage?if yes, can somebody give me please some point where to start?no matter if it's autoit or php or both i just need to know
if it's possible in this way, or you can tell me some better way to don't have so big delay between server-client?all i have until now it's @3h
of work, and and done project(autoit&php) what use mysql to store comands
and it's look like inet an page with single post of mysql(command) if that file contain only "done"-> do nothing if contain other thing like winamp_play
it will call function winamp_play()
here's my script until now, the delay it's because of sql update using IE after done the command
commands are done by php script what update the command field with functions from autoit client what will be called after check

any better solution for this it is possible?

Edit: i forgot to say that i will be using mostly my domain not local connection, it's more easier(i already saw the mysql udf, i just can't config mysql server to accept external connection, don't know why, it refuse to work, so this one kinda fall)

#include <IE.au3>
#include <Winamp_Library.au3>


;~ MsgBox(0, "Form Element Value", $getcommand)
reload()

func reload()
while 1
Local $command = InetRead("http://localhost/remote/_update.php?view",1)
If BinaryToString($command) = "done" Then

Else
Call(BinaryToString($command))
$oIE = _IECreate("http://localhost/remote/_update.php?update=done",0,0,1,0)
_IEQuit($oIE)
EndIf
sleep(1000)
WEnd
EndFunc

Func winamp_play()
_Winamp_play()
TrayTip("Remote control","Winamp play/pause",5000)
EndFunc
Func winamp_stop()
_Winamp_Stop()
TrayTip("Remote control","Winamp stop",5000)
EndFunc
Func winamp_next()
_Winamp_Next()
TrayTip("Remote control","Winamp next",5000)
EndFunc
Func winamp_prev()
_Winamp_Previous()
TrayTip("Remote control","Winamp prev",5000)
EndFunc
Func winamp_volup()
$getvol=_Winamp_GetVolume()
_Winamp_SetVolume($getvol+26)

TrayTip("Remote control","Winamp Volume Up",5000)
EndFunc
Func winamp_volmin()
_Winamp_SetVolume(0)
TrayTip("Remote control","Winamp Volume Min",5000)
EndFunc
Func winamp_vol50()
_Winamp_SetVolume(128)
TrayTip("Remote control","Winamp Volume 50%",5000)
EndFunc
Func winamp_volmax()
_Winamp_SetVolume(255)
TrayTip("Remote control","Winamp Volume Max",5000)
EndFunc
Func winamp_voldown()
$getvol=_Winamp_GetVolume()
_Winamp_SetVolume($getvol-26)
TrayTip("Remote control","Winamp Volume Down",5000)
EndFunc
Func teamview()
Run("C:\Program Files (x86)\TeamViewer\Version7\TeamViewer.exe")
TrayTip("Remote control","TeamViewer Started",5000)
EndFunc
Func teamviewkill()
ProcessClose("TeamViewer.exe")
TrayTip("Remote control","TeamViewer Killed",5000)
EndFunc
Func winampstart()
_Winamp_Start()
TrayTip("Remote control","Winamp Started",5000)
EndFunc


Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>