Page 1 of 4 1234 LastLast
Results 1 to 10 of 37

Thread: AutoIt

  1. #1
    Constant Bitrate
    Join Date
    Apr 2006
    Posts
    153

    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"...how do I grab the 12?
    - Sending a command to RR: send(GPS)....how 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. #2
    FLAC Nomader's Avatar
    Join Date
    Apr 2006
    Location
    Greece
    Posts
    1,291
    try the examples provided in the RR source..you will find examples for VB, C, auto it and more..

  3. #3
    Constant Bitrate
    Join Date
    Apr 2006
    Posts
    153
    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. #4
    FLAC Nomader's Avatar
    Join Date
    Apr 2006
    Location
    Greece
    Posts
    1,291
    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. #5
    Constant Bitrate
    Join Date
    Apr 2006
    Posts
    153
    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. #6
    FLAC Nomader's Avatar
    Join Date
    Apr 2006
    Location
    Greece
    Posts
    1,291
    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. #7
    Constant Bitrate
    Join Date
    Apr 2006
    Posts
    153
    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.

    Code:
    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
    EndFunc 
    WinActivate("classname=IntellinavWCls")
    send("{enter 2}{down 3}{enter}"&$gaslat&"{tab}"&$gaslon&"{enter}")

  8. #8
    Constant Bitrate
    Join Date
    Apr 2006
    Posts
    153
    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. #9
    Super Moderator
    Auto Apps:loading...
    JohnWPB's Avatar
    Join Date
    Sep 2005
    Location
    West Palm Beach, Florida
    Posts
    4,691
    Blog Entries
    1
    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. #10
    Constant Bitrate
    Join Date
    Apr 2006
    Posts
    153
    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)

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

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

Page 1 of 4 1234 LastLast

Similar Threads

  1. Parallel port relay control in RR using Autoit?
    By momanz in forum Road Runner
    Replies: 5
    Last Post: 04-03-2009, 09:20 AM
  2. Thoughts on Autoit X
    By lostreception in forum Software & Software Development
    Replies: 4
    Last Post: 09-13-2006, 12:33 AM
  3. Replies: 3
    Last Post: 04-24-2006, 03:53 PM
  4. AutoIT
    By ashgrovered in forum Coders Corner
    Replies: 3
    Last Post: 03-16-2006, 08:29 AM
  5. Any AutoIt script experts out there?
    By mindracing in forum Centrafuse
    Replies: 8
    Last Post: 08-11-2005, 02:19 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •