function SelectTopItem() PressKey("home") ReleaseKey("home") end function RepeatDown(count) i = count while (i > 0) do i = i - 1 PressKey("down") ReleaseKey("down") end end function SelectItem(num) SelectTopItem() if (num > 1) then RepeatDown((num - 1) * 3) end end function OnEvent(event, arg) if (GetMKeyState() == 1) then if (event == "G_RELEASED") then if (arg >= 1 and arg <= 19) then SelectItem(arg) end end end end