Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma compile(Console, True)
- #NoTrayIcon
- If (Not @Compiled) Then
- MsgBox(0, "Error", "This script must be compiled to run correctly.")
- Exit
- EndIf
- Global $sConfigPath = @ScriptDir & "\" & StringTrimRight(@ScriptName, 3) & "ini"
- Global $sHotKey = IniRead($sConfigPath, "General", "sHotKey", "{Insert}")
- If (HotKeySet($sHotKey, "RunScript") = 1) Then
- ConsoleWrite("HotKeySet() called and '" & $sHotKey & "' key registered" & @CRLF)
- Else
- ConsoleWrite("HotKeySet() called but '" & $sHotKey & "' key not registered" & @CRLF)
- EndIf
- Global $bActive = False
- Func RunScript()
- $bActive = Not $bActive
- If ($bActive) Then
- ConsoleWrite("RunScript() called, $bActive is TRUE" & @CRLF)
- Local $iLinesCount = IniRead($sConfigPath, "General", "iLinesCount", "0")
- If ($iLinesCount > 0) Then
- ConsoleWrite("$iLinesCount > 0, triforce started" & @CRLF)
- DrawTF($iLinesCount)
- EndIf
- $bActive = False
- ConsoleWrite("Triforce completed, you can use '" & $sHotKey & "' key again" & @CRLF)
- Else
- ConsoleWrite("RunScript() called, $bActive is FALSE, triforce canceled" & @CRLF)
- HotKeySet($sHotKey)
- Run(@ScriptFullPath)
- Exit
- EndIf
- EndFunc
- Func DrawTF($iCount)
- ; read settings
- Local $sMainChar = ChrW("0x" & IniRead($sConfigPath, "Symbols", "sMainChar", "2206"))
- Local $sSpaceChar = ChrW("0x" & IniRead($sConfigPath, "Symbols", "sSpaceChar", "00A0"))
- Local $iSpaceMult = IniRead($sConfigPath, "Symbols", "iSpaceMult", 2)
- ; construct parts
- Local $sSpaceMult = TextMult($sSpaceChar, $iSpaceMult)
- Local $sSpaceMultMain = $sSpaceMult & $sMainChar
- ; set counters
- Local $iSpaceMultCount = $iCount - 1
- Local $iSpaceMultMainCount = 0
- ; send text into lines
- For $iLineIndex = 0 To $iCount - 1 Step 1
- Send(TextMult($sSpaceMult, $iSpaceMultCount) & $sMainChar & TextMult($sSpaceMultMain, $iSpaceMultMainCount) & "{ENTER}")
- $iSpaceMultCount = $iSpaceMultCount - 1
- $iSpaceMultMainCount = $iSpaceMultMainCount + 1
- Next
- Send("{BACKSPACE}")
- EndFunc
- Func TextMult($sText, $iMult)
- Local $sResult = ""
- For $iIndex = 0 To $iMult - 1 Step 1
- $sResult = $sResult & $sText
- Next
- Return $sResult
- EndFunc
- While True
- Sleep(1000)
- WEnd
Advertisement
Advertisement
Advertisement
RAW Paste Data
Copied
Advertisement