[Help] for shorten the code and ListView cell information as Row+Column!

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
pirik33
Posts: 4
Joined: 16 Sep 2021, 21:45
Contact:

[Help] for shorten the code and ListView cell information as Row+Column!

Post by pirik33 » 20 Apr 2023, 04:18

im trying to search ListView cell as text and save it as variable as Column and Row then send it as keystroke like send (Row+Column) ie. F1+4 or F4+9 etc. it kinds of working but any shorten code or different method would be great for learning.

Code: Select all

LV_GetText(asas, CBB_Row, CBB_Col) 
 If (asas = "HPpot") 
 {
  global hppotrow := CBB_Row
  global hppotcolumn := CBB_Col - 1
 }
 If (asas = "MPpot") 
 {
  global mppotrow := CBB_Row
  global mppotcolumn := CBB_Col - 1
 }
 If (asas = "Minor") 
 {
  global minorrow := CBB_Row
  global minorcolumn := CBB_Col - 1
 }
 If (asas = "Light Feet") 
 {
  global lfrow := CBB_Row
  global lfcolumn := CBB_Col - 1
 }
 If (asas = "Critical Point") 
 {
  global cprow := CBB_Row
  global cpcolumn := CBB_Col - 1
 }

if (ok:=FindText(X:=0, Y:=0, 1, 133, 209, 585, 0, 0, spike))
  {}
   else
   {
    Send, {%cprow% down}{%cprow% up}
    Send, {%cpcolumn% down}{%cpcolumn% up}
   }
   
  if (ok:=FindText(X:=0, Y:=0, 1, 133, 209, 585, 0, 0, thrust))
  {}
   else
   {
    Send, {%hppotrow% down}{%hppotrow% up}
    Send, {%hppotcolumn% down}{%hppotcolumn% up}
if (ok:=FindText(X:=0, Y:=0, 1, 133, 209, 585, 0, 0, spike))
  {}
   else
   {
    Send, {%lfcrow% down}{%lfrow% up}
    Send, {%lfcolumn% down}{%lfcolumn% up}
   }
if (ok:=FindText(X:=0, Y:=0, 1, 133, 209, 585, 0, 0, spike))
  {}
   else
   {
    Send, {%minorrow% down}{%minorrow% up}
    Send, {%minorcolumn % down}{%minorcolumn % up}
   }
if (ok:=FindText(X:=0, Y:=0, 1, 133, 209, 585, 0, 0, spike))
  {}
   else
   {
    Send, {%mppotrow% down}{%mppotrow% up}
    Send, {%mppotcolumn% down}{%mppotcolumn% up}
   }
   }

Return to “Ask for Help (v1)”