First off, let me say that this guide was written by me, randombob, for MMOwned.
I will show you how to connect to Gliders remote control functions using AutoIt. You can from there, create you own remote control programs.
You can get AutoIt from AutoIt v3 - Automate and Script Windows Tasks - For Free!.
I will assume you have -basic- AutoIt knowledge in this guide.
First off, what we will be using is the AutoIt TCP Functions. They connect to a port, but you first need to enable this on Glider. So go to the following option:
Your Port and Password DO NOT NEED TO BE THE SAME AS MINE, that is just an example. If you plan to use the remote on the same computer, the port can be anything! In order to use the remote function from a different pc/connection, you will need to forward the ports, if you are behind a router. (but that's another guidePortForward.com - Free Help Setting up Your Router or Firewall)
Now that you have you Port and Password set in Glider, make sure that you have clicked the "Enabled" checkbox. Then go ahead and open up a new Autoit script.
We're now going to define our own TCPSend function, so that Glider recognises the data, and to make things run more smooth. Our code should look like this
Now we can move on to our main connect function, which I'm going to call "Connect", original huh?Code:Func _TCPSend($SDATA) If $OpenSocket <> -1 Then TCPSend($OpenSocket, $SDATA & @CR) EndFunc
Right, now we've connected to Glider and sent a password... now what?! Well, we need to wait to see until Glider authenticates our connection. We do this by adding a simple loop:Code:Func Connect() TCPStartup() $OpenSocket = TCPConnect($IP,$PORT) If $OpenSocket <> -1 Then ;The script will now try to connect to glider, if successful, it will continue. _TCPSend($Pass) ;Glider waits for a password as soon as it has been connected.
Code:Func Connect() Local $TempRecv ;Declare a variable. TCPStartup() $OpenSocket = TCPConnect($IP,$PORT) If $OpenSocket <> -1 Then ;The script will now try to connect to glider, if successful, it will continue. _TCPSend($Pass) ;Glider waits for a password as soon as it has been connected. Do $TempRecv = TCPRecv($OpenSocket,200) ;Recieves any data from Glider up to a max length of 200 characters (can change this). Until (@error <> 0) Or StringInStr($TempRecv, "authenticated") ;The script will continue the loop until there is eiter an error, or it detects "authenticated" in the recieved data. If StringInStr($TempRecv, "authenticated") Then ;PLACE YOUR ACTION HERE (See list below) else MsgBox(0,"Error","Glider password incorrect." ) ;Password is most likely incorrect, I'll add a message box to say so. Return -1 EndIf Else Return -1 EndIf EndFunc
That's your basic 'Authenticate and perform an action' script - here is a source example of how it can be put into action:
Will look something like this:Code:#NoTrayIcon #include <GUIConstants.au3> $IP = "127.0.0.1" Local $Port, $Pass, $OpenSocket GUICreate("TCP Example",200,180) GUICtrlCreateLabel("IP:",50,10) $IP_Input = GUICtrlCreateInput("127.0.0.1",65,8,100) GUICtrlCreateLabel("Port:",40,50) $Port_Input = GUICtrlCreateInput("3200",65,48,40) GUICtrlCreateLabel("Password:",10,80) $Pass_Input = GUICtrlCreateInput("",65,78,70,"",$ES_PASSWORD) $Start_But = GUICtrlCreateButton("START!",75,115) $Status_Label = GUICtrlCreateLabel("Status: Idle.",50,150,150,45) GUISetState() while 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit Case $IP_Input $IP = GUICtrlRead($IP_Input) Case $Port_Input $Port = GUICtrlRead($Port_Input) Case $Pass_Input $Pass = GUICtrlRead($Pass_Input) Case $Start_But _STATUS("Starting Glide") Connect() EndSwitch WEnd Func Connect() Local $TempRecv TCPStartup() _STATUS("Connecting to Glider") $OpenSocket = TCPConnect($IP,$Port) If $OpenSocket <> -1 Then _STATUS("Authenticating...") _TCPSend($Pass) Do $TempRecv = TCPRecv($OpenSocket,200) Until (@error <> 0) Or StringInStr($TempRecv, "authenticated") If StringInStr($TempRecv, "authenticated") Then _STATUS("Authenticated!") _TCPSend("/startglide") else _STATUS("Idle.") MsgBox(0,"Error","Glider password incorrect.") Return -1 EndIf Else _STATUS("Idle.") Return -1 EndIf EndFunc Func _TCPSend($SDATA) If $OpenSocket <> -1 Then TCPSend($OpenSocket, $SDATA & @CR) EndFunc Func _STATUS($SDATA) GUICtrlSetData($Status_Label,"Status: "&$SDATA) EndFunc
A list of Glider Remote Commands:
Code:/exit - shut down this connection /exitglider - shut down Glider completely /status - return current status of the game/char /version - return Glider and game version info /log [none|all|status|chatraw| gliderlog|chat|combat] - add logging of data on this channel /nolog [all|status|chatraw| gliderlog|chat|combat] - remove logging of data on this channel /say [message] - queue chat for sending /queuekeys [keys] - queue string for injection, | = CR, #VK# = VK /clearsay - clear queue of message, if pending /forcekeys [keys] - force keys in right now (dangerous!) /holdkey [VK code] - press and hold this VK code (dangerous!) /releasekey [VK code] - release this VK code (dangerous!) /grabmouse [true/false] - tell driver to grab/release mouse for bg ops /setmouse [X/Y] - position mouse, use 0 - .999 for coord /getmouse - return current mouse position in percentages /clickmouse [left|right] - click mouse button /attach - attach to the game /startglide - start gliding /stopglide - stop gliding /loadprofile [filename] - load a profile /capture - capture screen and send as JPG stream /capturecache [ms] - set capture caching time in milliseconds /capturescale [10-100] - set capture scaling from 10% to 100% /capturequality [10-100] - set capture image quality from 10% to 100% /queryconfig [name] - retrieve a config value from Glider.config.xml (name is case-sensitive!) /config - reload configuration /selectgame - bring the game window to the foreground /getgamews - get the game window state /setgamews [normal|hidden| shrunk] - set the game window state /escapehi [on/off] - escape hi-bit (intl) characters with &&#...;
I hope someone found this useful!
Enjoy,
randombob.