Presets Helper

Forum Forums Grids and Presets Presets Helper

Tagged: 

This topic contains 2 replies, has 1 voice, and was last updated by  just_a_poor_boy 3 years, 11 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #27118

    just_a_poor_boy
    Participant
    0

    Hello,

    attached is a small AutohotKey script that easily lets you remove individual entries from your presets file utilizing a graphical user interface. It’s quite useful if you have amassed a large number of obsolete presets.
    Presets can be everything from grids to gathering rotations to scenarions.
    It’s pretty much the same list as in the Miqobot share menu, just with a Delete button 🙂
    The Save button will create a backup as well.

    It sadly can’t handle files correctly with extremely large presets, like huge scenarios or grids. (AHK has a character limit per line of about 65,000)

    The second file is a script that will always run the latest Miqobot executable when placed in the same directory, so you can create a shortcut to it and don’t have to change the shortcut settings everytime there’s a new version executable!

    To run these, just get AutoHotkey from https://www.autohotkey.com/

    If this type of content is not allowed here please remove this thread.

    #27119

    just_a_poor_boy
    Participant
    0

    Well I Just found out you can’t attach AHK files.

    Here’s Script #1:

    #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
    
    If !FileExist("presets.miqo"){
    	MsgBox,, Presets Helper Error, Miqobot Preset file not found! Please put me in same directory as the Miqobot executable and make sure you ran it before.
    	Exitapp
    }
    
    Loop, Files, miqobot_v*.exe
    {
    	Process, Exist, %A_LoopFileName%
    	if ErrorLevel
    		MsgBox,, Presets Helper Error, Miqobot is currently running! Changes to the presets can not be saved.
    }
    
    Gui, New,, Presets Helper
    Gui, Add, ListView, w800 h400 NoSort, Content|#|Type|Name|Description
    
    entry := 1
    
    Loop, Read, presets.miqo
    {
    	If Mod(A_Index, 2)
    	{
    		typename := StrSplit(A_LoopReadLine, ".",, MaxParts := 2)
    		type := typename[1], name := typename[2]
    	}
    	else
    	{
    		Content_%Entry% := A_LoopReadLine
    		RegExMatch(A_LoopReadLine, "description"":""(.*?)"",""", desc)
    
    		LV_Add("", Content_%Entry%, entry, type, name, desc1)
    		LV_ModifyCol()
    		Lv_ModifyCol(1,0)
    		entry++
    	}
    }
    Gui, Add, Button, gDelete, Delete Entry
    Gui, Add, Button, gSave x+m, Save
    Gui, Show
    
    return
    
    Delete:
    RowNumber := 0
    Loop
    {
        RowNumber := LV_GetNext(RowNumber)
        if not RowNumber
            break
    	LV_Delete(RowNumber)
    }
    return
    
    Save:
    FileMove, presets.miqo, presets.miko.bak
    Loop
    {
    LV_GetText(type, A_Index, 3)
    If (type = "")
    break
    LV_GetText(name, A_Index, 4)
    LV_GetText(content, A_Index, 1)
    FileAppend, %type%.%name%<code>n%content%</code>n, presets.miqo
    }
    
    return
    
    Esc::ExitApp
    GuiClose:
    GuiEscape:
    ExitApp
    
    #27120

    just_a_poor_boy
    Participant
    1+

    Here’s script 2:

    #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.
    
    Loop, Files, miqobot_v*.exe
    {
    exe := A_LoopFileName
    }
    
    run, %exe%
    return
    
Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.