Advertisement
pentixide

Elite Dangerous Neutron Script

Jun 9th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #NoEnv
  2. ; Recommended for performance and compatibility with future AutoHotkey releases.
  3. ; #Warn
  4. ; Enable warnings to assist with detecting common errors.
  5. SendMode Input
  6. ; Recommended for new scripts due to its superior speed and reliability.
  7. SetWorkingDir %A_ScriptDir%
  8. ; Ensures a consistent starting directory.
  9. #SingleInstance force
  10.  
  11.  
  12. alphabet:= StrSplit("ABCDEFGHIJKLMNOPQRSTUVWXYZ", "")
  13.  
  14. count:=0
  15.  
  16. hasValue(haystack, needle) { ;Nov 8 '15 at 11:45 Blauhirn (stackoverflow, /33591667)
  17.     if(!isObject(haystack))
  18.         return false
  19.     if(haystack.Length()==0)
  20.         return false
  21.     for x,y in haystack
  22.         if(y==needle)
  23.             return true
  24.     return false
  25. }
  26.  
  27. hasPhrase(haystack, needle) {;Nov 8 '15 at 11:45 Blauhirn (stackoverflow, /33591667)
  28.     haystackz:=StrSplit(haystack)
  29.     for k,v in haystackz{
  30.         if(SubStr(haystack,k,StrLen(needle))==needle)
  31.             return true
  32.     }
  33.     return false
  34. }
  35.  
  36. join( strArray ){ ;Sep 1 17 at 17:08 Jim U (stackoverflow,/46002967)
  37.  
  38.   s := ""
  39.   for i,v in strArray
  40.     s .= ", " . v
  41.   return substr(s, 3)
  42. }
  43.  
  44. join2D( strArray2D ) ;Sep 1 17 at 17:08 Jim U (stackoverflow,/46002967)
  45. {
  46.   s := ""
  47.   for i,array in strArray2D
  48.     s .= ", [" . join(array) . "]"
  49.   return substr(s, 3)
  50. }
  51.  
  52. stripClipboard(){
  53.     reductionArray:=["  ","High metal content world","Water world","Ammonia world","Yes"]
  54.     for k, v in reductionArray{
  55.         Clipboard := StrReplace(Clipboard, v, ",")
  56.     }
  57. }
  58.  
  59.  
  60.  
  61. ^+c::
  62.  
  63. stripClipboard()
  64. myArray := StrSplit(Clipboard, ",")
  65. myLocale :=[]
  66.  
  67. FileDelete, locale.txt
  68.  
  69. for i, x in myArray{
  70.     a:=SubStr(x,1,1)
  71.     if(hasValue(alphabet, a)){
  72.         FileAppend, %x%`n`r, locale.txt
  73.         myLocale.Push(RegExReplace(x,"\s+\z"))
  74.     }
  75. }
  76.  
  77. myRoute:=[]
  78. myPlanets:=[]
  79.  
  80. for myNum, myNeedle in myLocale{
  81.     if(!hasPhrase(myNeedle,myRoute[myRoute.Length()]) or myRoute.Length() == 0){
  82.         myRoute.Push(RegExReplace(myNeedle,"\s+\z"))
  83.         myPlanets.Push([])
  84.     }
  85.     for otherNum, myHay in myLocale{
  86.         temp2:=[]
  87.         if(otherNum > myNum && hasPhrase(myHay,myNeedle)){
  88.             temp1:=SubStr(myHay,StrLen(myNeedle)+2, StrLen(myHay)-StrLen(myNeedle))
  89.             myPlanets[myRoute.Length()].Push(temp1)
  90.            
  91.         }
  92.         else if(otherNum > myNum){
  93.             break
  94.         }
  95.     }
  96. }
  97.  
  98.  
  99.  
  100. return
  101.  
  102. ^!v::
  103. if(count>1){
  104. count-=1
  105. Clipboard := myRoute[count]
  106. Send ^v
  107. }
  108. return
  109.  
  110. ^+v::
  111. if(count<1){
  112. count=1
  113. }
  114. if(count<myRoute.length()){
  115. count+=1
  116. Send ^v
  117. Clipboard := myRoute[count]
  118. }
  119. return
  120.  
  121. ^!+x::ExitApp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement