Hey,
wollte euch mal Fragen ob ihr vielleicht noch ein paar Ideen zur Optimierung des Codes auf Schnelligkeit habt. Das Script arbeitet leider ein bisschen zu langsam.
Code:
Octave := 2 MatchList1 := "q,w,e,r,t,z,u,i" MatchList2 := "a,s,d,f,g,h,j,k" MatchList3 := "y,x,c,v,b,n,m,_" tab := {} loop, 3 { ind := a_index loop, parse, matchlist%ind%, `, { tab[a_loopfield] := a_index } } Loop { Input, SingleKey, L1,{F1} CopiedKey := 0 if SingleKey in %MatchList1% { CopiedKey := tab[SingleKey] if (Octave = 1) { Send %CopiedKey% Octave = 1 continue } else if (Octave = 2) { Send 9 Send %CopiedKey% Octave = 1 continue } else if (Octave = 3) { Send 9 Send 9 Send %CopiedKey% Octave = 1 continue } } if SingleKey in %Matchlist2% { CopiedKey := tab[SingleKey] if (Octave = 1) { Send 0 Send %CopiedKey% Octave = 2 continue } else if (Octave = 2) { Send %CopiedKey% Octave = 2 continue } else if (Octave = 3) { Send 9 Send %CopiedKey% Octave = 2 continue } } if SingleKey in %Matchlist3% { CopiedKey := tab[SingleKey] if (Octave = 1) { Send 0 Send 0 Send %CopiedKey% Octave = 3 continue } else if (Octave = 2) { Send 0 Send %CopiedKey% Octave = 3 continue } else if (Octave = 3) { Send %CopiedKey% Octave = 3 continue } } if errorlevel = Endkey:F1 { ExitApp } } ExitApp Return
Ein bisschen Info zum Script: Die Tasten Q bis P, A bis K und Y bis , sind jeweils mit den Nummern 1 bis 8 belegt. Das Script überprüft je nach Eingabe welche Taste aus welcher Reihe gedrückt wurde und ändert wenn nötig die Oktaven indem es zusätzlich noch die 9 oder 0 sendet. (Script dient für ein Spiel)
Vielen Dank für jede Hilfe!
MfG