Advertisement
Guest User

Elite Dangerous Scripts WIP

a guest
Oct 8th, 2015
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;************************************
  2. ;* Crowbars82's Elite Scripts (WIP) *
  3. ;************************************
  4.  
  5. #SingleInstance force
  6. #Persistent
  7.  
  8. SplashTextOn, 300, 20, Elite Dangerous Script, Reloading Elite Dangerous Script...
  9. WinMove, Elite Dangerous Script,, 810, 0                ;need to put in auto-screen res
  10. Sleep 1000
  11. SplashTextOff
  12.  
  13. IniRead, TradeSystem1, EliteTrades.ini, System, TradeSystem1, BLANK             ;reads all data from previous entries (if any)
  14. IniRead, TradeSystem2, EliteTrades.ini, System, TradeSystem2, BLANK
  15. IniRead, TradeGoods1, EliteTrades.ini, Goods, TradeGoods1, BLANK
  16. IniRead, TradeGoods2, EliteTrades.ini, Goods, TradeGoods2, BLANK
  17. IniRead, TradeStation1, EliteTrades.ini, Station, TradeStation1, BLANK
  18. IniRead, TradeStation2, EliteTrades.ini, Station, TradeStation2, BLANK
  19.  
  20. SplashTextOn, 200, 140, Trading Info, System 1: %TradeSystem1%`nStation 1: %TradeStation1%`nBuy: %TradeGoods1%`n`nSystem 2: %TradeSystem2%`nStation 2: %TradeStation2%`nBuy: %TradeGoods2%
  21. WinMove, Trading Info,, 1984, 657
  22.  
  23. <^>!m::returnMousePos()                 ;this will return the coordinates of the mouse and send them to clipboard and saves to Mouse-Clicks.txt in script folder
  24.  
  25. ^Numpad0 up::SetTradingRoute()
  26. Numpad1 up::SetCourseToTrade1()
  27. Numpad2 up::SetCourseToTrade2()
  28.  
  29. pause::Pause
  30. ^F1::reload
  31. #q::ExitApp
  32.  
  33. ;###################################
  34. ;# ELITE DANGEROUS TRADING ASSISTS #
  35. ;###################################
  36.  
  37. returnMousePos()
  38. {
  39.     CoordMode, Mouse, Screen
  40.     MouseGetPos, MouseX, MouseY
  41.     clipboard = %MouseX%, %MouseY%
  42.     SplashTextOn, 300, 20, Shodan, clipboard is X:%MouseX% Y:%MouseY%
  43.     WinMove, Shodan,, 810, 0
  44.     Sleep 1000
  45.     SplashTextOff
  46.     FileAppend,
  47.     (
  48.     Send {Click %MouseX%, %MouseY%}`n
  49.     ), Mouse-Clicks.txt
  50. Return
  51. }
  52.  
  53. SetTradingRoute()
  54.     {
  55.     Global TradeSystem1
  56.     Global TradeSystem2
  57.     Global TradeGoods1
  58.     Global TradeGoods2
  59.     Global TradeStation1
  60.     Global TradeStation2
  61.    
  62.     InputBox, TradeSystem1, Set Trading Route, Enter First System...,,,,1984, 357
  63.     if ErrorLevel 1
  64.         {
  65.         Sleep, 1000
  66.         }
  67.     else
  68.         {
  69.         IniWrite, %TradeSystem1%, EliteTrades.ini, System, TradeSystem1
  70.         }
  71.     InputBox, TradeStation1, Set Station, Enter First Station...,,,,1984, 357
  72.     if ErrorLevel 1
  73.         {
  74.         Sleep, 100
  75.         }
  76.     else
  77.         {
  78.         IniWrite, %TradeStation1%, EliteTrades.ini, Station, TradeStation1
  79.         }
  80.     InputBox, TradeGoods1, Set Trading Route, Enter Trade Goods...,,,,1984, 357
  81.     if ErrorLevel 1
  82.         {
  83.         Sleep, 100
  84.         }
  85.     else
  86.         {
  87.         IniWrite, %TradeGoods1%, EliteTrades.ini, Goods, TradeGoods1
  88.         }  
  89.     InputBox, TradeSystem2, Set Trading Route, Enter Second System...,,,,1984, 357
  90.     if ErrorLevel 1
  91.         {
  92.         Sleep, 100
  93.         }
  94.     else
  95.         {
  96.         IniWrite, %TradeSystem2%, EliteTrades.ini, System, TradeSystem2
  97.         }  
  98.     InputBox, TradeStation2, Set Station, Enter Second Station...,,,,1984, 357
  99.     if ErrorLevel 1
  100.         {
  101.         Sleep, 100
  102.         }
  103.     else
  104.         {
  105.         IniWrite, %TradeStation2%, EliteTrades.ini, Station, TradeStation2
  106.         }  
  107.     InputBox, TradeGoods2, Set Trading Route, Enter Trade Goods...,,,,1984, 357
  108.     if ErrorLevel 1
  109.         {
  110.         Sleep, 100
  111.         }
  112.     else
  113.         {
  114.         IniWrite, %TradeGoods2%, EliteTrades.ini, Goods, TradeGoods2
  115.         }
  116.    
  117.     SplashTextOn, 200, 150, Trading Info, System 1: %TradeSystem1%`nStation 1:%TradeStation1%`nBuy: %TradeGoods1%`n`nSystem 2: %TradeSystem2%`nnStation 2:%TradeStation2%`nBuy: %TradeGoods2%
  118.     WinMove, Trading Info,, 1984, 657
  119.     Return
  120. }
  121.  
  122. SetCourseToTrade1()
  123.     {
  124.     Global TradeSystem1
  125.     Global TradeSystem2
  126.     Global TradeGoods1
  127.     Global TradeGoods2
  128.     Global TradeStation1
  129.     Global TradeStation2
  130.    
  131.     IfWinExist, ahk_class FrontierDevelopmentsAppWinClass
  132.         {
  133.         WinActivate
  134.         Sleep, 100
  135.         CoordMode, Mouse, Screen
  136.  
  137.         MouseMove, 58, 139              ;click on the info tab
  138.         Sleep, 100
  139.         Send {LButton down}
  140.         Sleep, 10
  141.         Send {LButton up}
  142.         Sleep, 100
  143.        
  144.         MouseMove, 216, 143             ;click on the navigation tab
  145.         Sleep, 100
  146.         Send {LButton down}
  147.         Sleep, 10
  148.         Send {LButton up}
  149.         Sleep, 100
  150.        
  151.         MouseMove, 341, 246             ;click in the search box
  152.         Sleep, 100
  153.         Send {LButton down}
  154.         Sleep, 10
  155.         Send {LButton up}
  156.         Sleep, 100
  157.        
  158.         Loop, 30
  159.             {
  160.             Send {Backspace}            ;clear current system if any
  161.             }
  162.         Sleep, 10
  163.        
  164.         Send %TradeSystem1%             ;enter system name
  165.         Sleep, 100
  166.         Send {Enter down}
  167.         Sleep, 10
  168.         Send {Enter up}
  169.        
  170.         MouseMove, 1142, 662            ;hovers over the plot route button
  171.         Sleep, 2000                     ;waits for the map to float over to the desired system (will need to be changed for systems further than a few jumps)
  172.         Send {LButton down}
  173.         Sleep, 10
  174.         Send {LButton up}
  175.         Sleep, 100
  176.         }
  177.     Return
  178. }
  179.  
  180. SetCourseToTrade2()
  181.     {
  182.     Global TradeSystem1
  183.     Global TradeSystem2
  184.     Global TradeGoods1
  185.     Global TradeGoods2
  186.     Global TradeStation1
  187.     Global TradeStation2
  188.    
  189.     IfWinExist, ahk_class FrontierDevelopmentsAppWinClass
  190.         {
  191.         WinActivate
  192.         Sleep, 100
  193.         CoordMode, Mouse, Screen
  194.  
  195.         MouseMove, 58, 139              ;click on the info tab
  196.         Sleep, 100
  197.         Send {LButton down}
  198.         Sleep, 10
  199.         Send {LButton up}
  200.         Sleep, 100
  201.        
  202.         MouseMove, 216, 143             ;click on the navigation tab
  203.         Sleep, 100
  204.         Send {LButton down}
  205.         Sleep, 10
  206.         Send {LButton up}
  207.         Sleep, 100
  208.        
  209.         MouseMove, 341, 246             ;click in the search box
  210.         Sleep, 100
  211.         Send {LButton down}
  212.         Sleep, 10
  213.         Send {LButton up}
  214.         Sleep, 100
  215.        
  216.         Loop, 30
  217.             {
  218.             Send {Backspace}            ;clear current system if any
  219.             }
  220.         Sleep, 10
  221.        
  222.         Send %TradeSystem2%             ;enter system name
  223.         Sleep, 100
  224.         Send {Enter down}
  225.         Sleep, 10
  226.         Send {Enter up}
  227.        
  228.         MouseMove, 1142, 662            ;hovers over the plot route button
  229.         Sleep, 2000                     ;waits for the map to float over to the desired system (will need to be changed for systems further than a few jumps)
  230.         Send {LButton down}
  231.         Sleep, 10
  232.         Send {LButton up}
  233.         Sleep, 100
  234.         }
  235.     Return
  236. }
  237.  
  238. Return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement