Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #NoEnv
- ; Recommended for performance and compatibility with future AutoHotkey releases.
- ; #Warn
- ; Enable warnings to assist with detecting common errors.
- SendMode Input
- ; Recommended for new scripts due to its superior speed and reliability.
- SetWorkingDir %A_ScriptDir%
- ; Ensures a consistent starting directory.
- #SingleInstance force
- alphabet:= StrSplit("ABCDEFGHIJKLMNOPQRSTUVWXYZ", "")
- count:=0
- hasValue(haystack, needle) { ;Nov 8 '15 at 11:45 Blauhirn (stackoverflow, /33591667)
- if(!isObject(haystack))
- return false
- if(haystack.Length()==0)
- return false
- for x,y in haystack
- if(y==needle)
- return true
- return false
- }
- hasPhrase(haystack, needle) {;Nov 8 '15 at 11:45 Blauhirn (stackoverflow, /33591667)
- haystackz:=StrSplit(haystack)
- for k,v in haystackz{
- if(SubStr(haystack,k,StrLen(needle))==needle)
- return true
- }
- return false
- }
- join( strArray ){ ;Sep 1 17 at 17:08 Jim U (stackoverflow,/46002967)
- s := ""
- for i,v in strArray
- s .= ", " . v
- return substr(s, 3)
- }
- join2D( strArray2D ) ;Sep 1 17 at 17:08 Jim U (stackoverflow,/46002967)
- {
- s := ""
- for i,array in strArray2D
- s .= ", [" . join(array) . "]"
- return substr(s, 3)
- }
- stripClipboard(){
- reductionArray:=[" ","High metal content world","Water world","Ammonia world","Yes"]
- for k, v in reductionArray{
- Clipboard := StrReplace(Clipboard, v, ",")
- }
- }
- ^+c::
- stripClipboard()
- myArray := StrSplit(Clipboard, ",")
- myLocale :=[]
- FileDelete, locale.txt
- for i, x in myArray{
- a:=SubStr(x,1,1)
- if(hasValue(alphabet, a)){
- FileAppend, %x%`n`r, locale.txt
- myLocale.Push(RegExReplace(x,"\s+\z"))
- }
- }
- myRoute:=[]
- myPlanets:=[]
- for myNum, myNeedle in myLocale{
- if(!hasPhrase(myNeedle,myRoute[myRoute.Length()]) or myRoute.Length() == 0){
- myRoute.Push(RegExReplace(myNeedle,"\s+\z"))
- myPlanets.Push([])
- }
- for otherNum, myHay in myLocale{
- temp2:=[]
- if(otherNum > myNum && hasPhrase(myHay,myNeedle)){
- temp1:=SubStr(myHay,StrLen(myNeedle)+2, StrLen(myHay)-StrLen(myNeedle))
- myPlanets[myRoute.Length()].Push(temp1)
- }
- else if(otherNum > myNum){
- break
- }
- }
- }
- return
- ^!v::
- if(count>1){
- count-=1
- Clipboard := myRoute[count]
- Send ^v
- }
- return
- ^+v::
- if(count<1){
- count=1
- }
- if(count<myRoute.length()){
- count+=1
- Send ^v
- Clipboard := myRoute[count]
- }
- return
- ^!+x::ExitApp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement