No announcement yet.


  • Filter
  • Time
  • Show
Clear All
new posts

  • AutoIt

    Is there a thread or sample code for some basic AutoIT interactions with RR? I've tried to skim through the forums looking at any .au3 files I can find but I can't seem to find what I'm looking for. I'm looking for things like:

    - Receiving a command from RR: "run;test.exe|12" do I grab the 12?
    - Sending a command to RR: send(GPS) do I get RR to run GPS?
    - receiving a variable....reading the coordinates of gps_lon
    - changing a variable....writing to gps_lon

    I've gotten comfortable reading and writing ini's and gui but I can't find anything solid on "communicating" with RR. Any help would be greatly appreciated.

  • #2
    try the examples provided in the RR will find examples for VB, C, auto it and more..


    • #3
      oooo that's good stuff. I think that might answer a whole lot of questions. Thanks Nomander! I had never even downloaded the source before as I know very very little about programming (I'm an accountant by trade). Also, special shoutout to b8bboi since guino gives him credit in the readme. I just widened my horizons.....


      • #4
        i am not a programmer aswell by any means..but i know quiet well how to drag info from RR with autoit..pretty easy..i can send you an example less complicated than the sources..and i can help you there more if you want.. I haven't looked into sending stuff to RR yet.. i will find time..hopefully.


        • #5
          That would be awesome. Also, if you have an example of how you would have RR send a command to the .exe that would be awesome (using run | cmd). I think I'm supposed to be able to do it with guigetmsg but I'm having problems. Drop me a pm if you need my address or anything.


          • #6
            ok getting stuff from RR is easy
            just use

            $rr = ObjCreate("RoadRunner.SDK")
            $MY = $rr.GetInfo("gpslat")

            in this case you get the label "gpslat"
            then you can do whatever you want with it..
            you don't need rr to send labels and stuff..your script will request it and will get it from the sdk


            • #7
              Nice. You have me on a roll now. So I whipped this up to see if I have an understanding of what's going on. For the embedded gasfinder, this would send the gps coordinates for "0" to iguidance. Next hurdle is how to make it so that the "0" in gas_0_lon is variable based on what I send it from RR. So that "run|1" would run it for location 1 as opposed to 0. Make sense? Let me know what you think.

              Global Const $WM_COPYDATA = 0x4A
              $RR_Path = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\RoadRunner\Install", "InstallFolder")
              $rr = ObjCreate("RoadRunner.SDK")
              $gaslat = $rr.GetInfo("gas_0_lat")
              $gaslon = $rr.GetInfo("gas_0_lon")
              $My_Hwnd = GUICreate("SendData")
              $hwnd_RR = WinGetHandle("RoadRunner")
              SendCommand($My_Hwnd, $hwnd_RR, "GPS")
              Func SendCommand($My_Hwnd, $hwnd_Remote, $sCmd)
              	Local $CmdStruct = DllStructCreate('Char[' & StringLen($sCmd) + 1 & ']')
              	DllStructSetData($CmdStruct, 1, $sCmd)
              	Local $COPYDATA = DllStructCreate('Ptr;DWord;Ptr')
              	DllStructSetData($COPYDATA, 1, 1)
              	DllStructSetData($COPYDATA, 2, StringLen($sCmd))
              	DllStructSetData($COPYDATA, 3, DllStructGetPtr($CmdStruct))
              	DllCall('User32.dll', 'None', 'SendMessage', 'HWnd', $hwnd_Remote, 'Int', $WM_COPYDATA, 'HWnd', $My_Hwnd, 'Ptr', DllStructGetPtr($COPYDATA))
              	$COPYDATA = 0
              	$CmdStruct = 0
              send("{enter 2}{down 3}{enter}"&$gaslat&"{tab}"&$gaslon&"{enter}")


              • #8
                Found it! $cmdlineraw (or cmdline if i'm passing multiple parameters)

                I just realized that AutoIt has a decompiler ! Opened up some code from some other's .exe and found a whole bunch of goodies.

                Thanks for the help!


                • #9
                  The easiest way to get information from RR to AutoIt is through the command line interface that AutoIt accepts.

                  For instance you can pass variables to AutoIt with the following:
                  "RUN;AutoScriptName.exe|RRvar RRVar2"

                  Then in the AutoIt script use:

                  $MyVar = $cmdline[1]
                  $MyVar2 = $cmdline[2]

                  The variables in Road Runner passed, after the | are separated by a [SPACE], meaning that "alpha bravo charlie: would be 3 different things passed, due to the spaces between them.

                  this will turn the variables passed from Road Runner into variables that you can use in AutoIt.
                  Front End of Choice: Ride Runner (Is there anything else??? ) & Powered by the DFX5.1 Skin Available in the Mobile App Mart

                  My Fiero Build Thread


                  • #10
                    Thanks Jon. For anyone else who stubles accross this.... cmdlineraw would return the entire "alpha bravo charlie" including spaces and cmdline[0] would capture the number of parameters (in this case 3)

                    ("run;test.exe|alpha bravo charlie")

                    cmdline[0] = 3
                    cmdline[1] = alpha
                    cmdline[2] = bravo
                    cmdline[3] = charlie
                    cmdlineraw = alpha bravo charlie


                    • #11
                      WOW, thats alot of coding... is it because you want a smoother transisition? I managed to code something for streets and trips using send() and didnt even come close to that much programming... ill post it here if you want
                      It works!!

                      Almost all of the time too!


                      • #12
                        If you have code you'd like to share that would be great. I'm going to throw samples of code on here every now and again for anyone who's trying to get started. The easier it is, the more people will try, the more people who contribute, the easier it is for everyone.


                        • #13
                          Was something like this, I am not at my work computer so, I dont have the exact stuff infront of me. (i copied what you guys already had up here to make it easier on me)

                          $number = $cmdline[1]
                          $rr = ObjCreate("RoadRunner.SDK")
                          $gaslat = $rr.GetInfo("gas_" & $number & "_lat")
                          $gaslon = $rr.GetInfo("gas_" & $number & "_lon")

                          you call this program with as: gas.exe n
                          n being the number of the gas station you want the lat and lon for, 0-5
                          you can then use the Send() command to send keys to the program to route you to it
                          It works!!

                          Almost all of the time too!


                          • #14
                            Haha that's the exact code I have up there! I think all the extra code you're seeing is sending 'GPS' back to RR. As you've indicated there's an easy way to get info (SDK) but not send it back. If you have an easier way to send it there, let me know.


                            • #15
                              WinActivate("Map - Microsoft Streets & Trips", "")
                              $rr = ObjCreate("RoadRunner.SDK")
                              $number = $cmdline[1]
                              $gaslat = $rr.GetInfo("gas_" & $number & "_lat")
                              $gaslon = $rr.GetInfo("gas_" & $number & "_lon")
                              ;msgbox(0,"", $gaslat & $gaslon)
                              Send("!ef{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{RIGHT}{TAB }{TAB}{TAB}{RIGHT}")
                              WinWaitActive("Find", "Type the latitude and longitude as decimal values")

                              I could probably reduce most of the send commands to one or two lines, but im lazy... yes its a hacked up version of what you have.

                              Im still trying to figure out why you have it reading the registry?
                              It works!!

                              Almost all of the time too!