Sign in to follow this  
Followers 0
Zeronic

Input Box Read Problem

7 posts in this topic

#1 ·  Posted (edited)

The Intent of the scipt is to complete two task:

One create symbolic links of a folder

Two create a shortcut to a file and place it on the desktop.

It is for a game but I don't intent to make interact with the game or allow the script to launch the game itself.

I'm having trouble with the Input box that is used to tell how many cycles the script to run for. Or how many symbolic links to create with shortcuts.

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
Local $EvePath, $EveCreate = 0, $EveCycle
If @OSArch = "X86" Then $EvePath = "C:\Program Files\CCP\Eve"
If @OSArch = "X64" Then $EvePath = "C:\Program Files(x86)\CCP\Eve"
$Menu = GUICreate("Eve Online Clone Creater", 527, 125, 192, 124)
$Finder = GUICtrlCreateButton("Eve Folder", 200, 24, 89, 49)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
$Close = GUICtrlCreateButton("Close", 424, 24, 89, 49)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
$Eve = GUICtrlCreateInput($EvePath, 8, 96, 513, 24)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
$Profile = GUICtrlCreateLabel("Clones to Create", 48, 24, 103, 20)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
$Number = GUICtrlCreateInput($EveCreate, 48, 48, 97, 24)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
$Create = GUICtrlCreateButton("Create", 312, 24, 89, 49)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Close
            Exit
        Case $Finder
            Run01()
        Case $Create
            GUICtrlRead($Number, 0)
            GUICtrlRead($EveCreate, 0)
            GUICtrlSetData($EveCycle, $EveCreate)
            MsgBox(0, "Cycle Value", $EveCycle)
            MsgBox(0, "To Create", $EveCreate)
            MsgBox(0, "Number", $Number)
            Run02()
    EndSwitch
WEnd
Func Run01()
    Local $EvePath = FileSelectFolder("Select the Eve Folder",$EvePath)
    GUICtrlSetData($Eve, $EvePath)
EndFunc
Func Run02()
    While $EveCycle >= 0
    MsgBox(0, "Cycle", $EveCycle)
    FileCreateNTFSLink ( $EvePath, $EvePath & "." & $EveCreate)
    MsgBox(0, "Step 2",  $EvePath)
    MsgBox(0, "Step 3",  $EvePath & "." & $EveCreate)
    FileCreateShortcut ( $EvePath & "." & $EveCreate & "\bin\Exefile.exe", @DesktopDir & "\Eve." & $EveCreate & ".lnk",  $EvePath & "\bin")
    MsgBox(0, "Step 4", $EvePath & "." & $EveCreate & "\bin\Exefile.exe")
    MsgBox(0, "Step 5", @DesktopDir & "\Eve." & $EveCreate & ".lnk")
    Msgbox(0, "Step 6", $EvePath & "." & $EveCreate & "\bin")
    $EveCycle-=1
    WEnd
EndFunc
Edited by Zeronic

Share this post


Link to post
Share on other sites



And the question is?

BTW: What is the difference to the thread you got locked on thsi subject?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Hi,

The last thread on this subject was locked following some incorrect information from another user. After discussions I am happy for the OP to receive help for this script - as long as it stays limited to the creation of links and shortcuts and does not have anything to do with the game itself. :)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Hi,

The last thread on this subject was locked following some incorrect information from another user. After discussions I am happy for the OP to receive help for this script - as long as it stays limited to the creation of links and shortcuts and does not have anything to do with the game itself. :)

M23

 

Yes, This has been my plan from the beginning. I don't ever want to make something that would interact with any game. Just trying to make the user experince a bit easier.

Share this post


Link to post
Share on other sites
"I'm having trouble with the Input box that is used to tell how many cycles the script to run for."

What exactly do you mean by "trouble"? If you enter a number how many links does it create? None, one ...?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

If i understood your problem, check this out.

Removed msgboxes and some stuff that did nothing.

Tell us if this is in the lines of what you need.

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
#region ### START Koda GUI section ### Form=
Local $EvePath, $EveCycle, $EveCreate, $EveCreate2
If @OSArch = "X86" Then $EvePath = "C:\Program Files\CCP\Eve"
If @OSArch = "X64" Then $EvePath = "C:\Program Files(x86)\CCP\Eve"
$Menu = GUICreate("Eve Online Clone Creater", 527, 125, 192, 124)
$Finder = GUICtrlCreateButton("Eve Folder", 200, 24, 89, 49)
GUICtrlSetOnEvent($Finder, "Run01")
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
$Close = GUICtrlCreateButton("Close", 424, 24, 89, 49)
GUICtrlSetOnEvent($Close, "Close")
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
$Eve = GUICtrlCreateInput($EvePath, 8, 96, 513, 24)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
$Profile = GUICtrlCreateLabel("Clones to Create", 48, 24, 103, 20)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
$Number = GUICtrlCreateInput('1', 48, 48, 97, 24)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
$Create = GUICtrlCreateButton("Create", 312, 24, 89, 49)
GUICtrlSetOnEvent($Create, "Run02")
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
GUISetState(@SW_SHOW)
GUISetOnEvent($GUI_EVENT_CLOSE, "Close")
#endregion ### END Koda GUI section ###
While 1
    Sleep(100)
WEnd

Func Run01()
    Local $EvePath = FileSelectFolder("Select the Eve Folder", $EvePath)
    GUICtrlSetData($Eve, $EvePath)
EndFunc   ;==>Run01

Func Run02()
    $Number2 = GUICtrlRead($Number, 0)
    For $i = 1 To $Number2
        FileCreateShortcut($EvePath & "." & $i & "\bin\Exefile.exe", @DesktopDir & "\Eve." & $i & ".lnk", $EvePath & "\bin")
    Next
EndFunc   ;==>Run02

Func Close()
    Exit
EndFunc   ;==>Ru

Spoiler

Paster - Main function is to paste text, but has more functions.

OpenW - Open With... alternative, Open any file with any application, set it's icon, set application as default.

Renamer - Rename files and folders, remove portions of text from the filename etc.

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Firefox Profile Backup - Backup/restore previously saved profile.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

 

Share this post


Link to post
Share on other sites

 

If i understood your problem, check this out.

Removed msgboxes and some stuff that did nothing.

Tell us if this is in the lines of what you need.

 

Yeah, I think you got what I was trying to do. Looks like I wasn't storing the number that the GUICtrlRead was reading. I'm still very much a newbie at this but this gives me a far better understanding of how this works.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0