Followers 0

# Input (How Would You)

## 13 posts in this topic

Alright So basiccly what I want is let's say you have a name input box before you get to the main GUI.

So you enter it.

Then all of the sudden a file Login Records.txt is created it would look something like this:

(btw you enter JSF Rocks )

07:05:44 (8.08.06) = JSF Rocks

undertstand?

[center]Cookyx.com :: Simple LAN Chat[/center]

##### Share on other sites

#2 ·  Posted (edited)

Alright So basiccly what I want is let's say you have a name input box before you get to the main GUI.

So you enter it.

Then all of the sudden a file Login Records.txt is created it would look something like this:

(btw you enter JSF Rocks )

07:05:44 (8.08.06) = JSF Rocks

undertstand?

#include <File.au3>
While 1
$NameInput = InputBox("Name","Please enter your name") If Not @error Then ExitLoop WEnd _FileWriteLog(@ScriptDir & "Login Records.txt",$NameInput)

BTW, I especially like the THIRD LINE in your signature...

Edited by james3mg

"There are 10 types of people in this world - those who can read binary, and those who can't.""We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true." ~Robert Wilensky0101101 1001010 1100001 1101101 1100101 1110011 0110011 1001101 10001110000101 0000111 0001000 0001110 0001101 0010010 1010110 0100001 1101110

##### Share on other sites

Alright So basiccly what I want is let's say you have a name input box before you get to the main GUI.

So you enter it.

Then all of the sudden a file Login Records.txt is created it would look something like this:

(btw you enter JSF Rocks )

07:05:44 (8.08.06) = JSF Rocks

undertstand?

Assign a variable to your input box, then use _FileWriteLog() along with your variable to make your txt file.

##### Share on other sites

;***********************
; ZetaBase
; Coded by: Dan
; August 8, 2006
; Special Thanks to: keen for graphics!
;***********************

#include <GUIConstants.au3>
#include <GuiListView.au3>
#include <File.au3>

FileWrite("c:/blank.txt", "")
Global $oRP$home = "http://www.Autoitscript.com"
$forum = "http://www.Autoitscript.com/forum"$name = InputBox("Log In", "Please enter your name:")

; GUI
GUICreate("ZetaBase", 400, 400)
GUISetIcon("C:\Program Files\AutoIt3\beta\Icons\au3.ico", 0)
$TagsPageC = GUICtrlCreateLabel('Visit ZetaStyles', 1, 293, 200, 20,$SS_CENTER)
GUICtrlSetFont($TagsPageC, 9, 400, 4) GUICtrlSetColor($TagsPageC, 0x0000ff)

; BANNER
$s_TempFile = _TempFile() InetGet("http://i37.photobucket.com/albums/e91/Zombie1992/logo4.gif",$s_TempFile)
GUICtrlCreatePic($s_TempFile, 0, 0, 400, 67) ; TEXT GUICtrlCreateLabel("Sample Label ", 10, 275, 389, 20)$label = GUICtrlCreateLabel("Logged in as: " & $name, 150, 275, 400, 14) ;GUICtrlSetStyle (-1,$SS_RIGHT )

$filemenu = GUICtrlCreateMenu("File")$fileitem = GUICtrlCreateMenuitem("Open...", $filemenu)$recentfilesmenu = GUICtrlCreateMenu("Recent Files", $filemenu)$separator1 = GUICtrlCreateMenuitem("", $filemenu)$exititem = GUICtrlCreateMenuitem("Exit", $filemenu)$helpmenu = GUICtrlCreateMenu("About")
$aboutitem = GUICtrlCreateMenuitem("About ZetaBase",$helpmenu)
GUISetState(@SW_SHOW)

; TAB
GUICtrlCreateTab(1, 70, 400, 190)
$tab1 = GUICtrlCreateTabItem("Welcome") GUICtrlCreateLabel("Welcome to ZetaBase." & @CRLF & " " & @CRLF & "This project was started by keen and coded by Dan of www.zetastyles.com. This is ZetaBase. A program to show you the best of the best of what ZetaStyles has to offer. This program has ZS Best Skins, ZS Document Database, GFX Tutorial Database, and Website Template Database!", 20, 120, 375, 100) GUICtrlCreateTabItem("Pro Skins")$combo = GUICtrlCreateCombo("", 10, 100) ; create first item
GUICtrlSetData(-1, "Autoit Home|Autoit Forums", "Autoit Home") ; add other item snd set a new default
GUICtrlCreateTabItem("Documents")
GUICtrlCreateTabItem("Tutorials")
GUICtrlCreateTabItem("Website Templates")
; GUI MESSAGE        LOOP

GUICtrlCreateTabItem("")  ; end tabitem definition
GUICtrlSetState($tab1,$GUI_SHOW)  ; will be display first

GUISetState()

While 1
$NameInput = InputBox("Name","Please enter your name") If Not @error Then ExitLoop WEnd _FileWriteLog(@ScriptDir & "Login Records.txt",$NameInput)
$msg = GUIGetMsg() Select Case$msg = $fileitem$file = FileOpenDialog("Choose file...", @TempDir, "All (*.*)")
If @error <> 1 Then GUICtrlCreateMenuitem($file,$recentfilesmenu)
Case $msg =$combo
If StringInStr(GUICtrlRead($combo), "Home") Then Run(@ComSpec & " /c Start " &$home, "", @SW_HIDE)
Else
Run(@ComSpec & " /c Start " & $forum, "", @SW_HIDE) EndIf Case$msg = $TagsPageC Run(@ComSpec & ' /c start explorer http://www.zetastyles.com', '', @SW_HIDE) Case$msg = $aboutitem MsgBox(0, "About ZetaBase", "ZetaBase" & @CRLF & @CRLF & "Created by: keen" & @CRLF & "" & @CRLF & "Coded by: Dan" & @CRLF & "" & @CRLF & "©Copyrighted to repective owners") Case$msg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd IT's not working. [center]Cookyx.com :: Simple LAN Chat[/center] #### Share this post ##### Link to post ##### Share on other sites Also when i try it at the very top it doesnt work as well! =\ [center]Cookyx.com :: Simple LAN Chat[/center] #### Share this post ##### Link to post ##### Share on other sites Try this: ;*********************** ; ZetaBase ; Coded by: Dan ; August 8, 2006 ; Special Thanks to: keen for graphics! ;*********************** #include <GUIConstants.au3> #include <GuiListView.au3> #include <File.au3> FileWrite("c:/blank.txt", "") Global$oRP
$home = "http://www.Autoitscript.com"$forum = "http://www.Autoitscript.com/forum"
$name = InputBox("Log In", "Please enter your name:") ; GUI GUICreate("ZetaBase", 400, 400) GUISetIcon("C:\Program Files\AutoIt3\beta\Icons\au3.ico", 0)$TagsPageC = GUICtrlCreateLabel('Visit ZetaStyles', 1, 293, 200, 20, $SS_CENTER) GUICtrlSetFont($TagsPageC, 9, 400, 4)
GUICtrlSetColor($TagsPageC, 0x0000ff) ; BANNER$s_TempFile = _TempFile()
InetGet("http://i37.photobucket.com/albums/e91/Zombie1992/logo4.gif", $s_TempFile) GUICtrlCreatePic($s_TempFile, 0, 0, 400, 67)

; TEXT
GUICtrlCreateLabel("Sample Label ", 10, 275, 389, 20)
$label = GUICtrlCreateLabel("Logged in as: " &$name, 150, 275, 400, 14)
;GUICtrlSetStyle (-1, $SS_RIGHT ) ; MENU$filemenu = GUICtrlCreateMenu("File")
$fileitem = GUICtrlCreateMenuitem("Open...",$filemenu)
$recentfilesmenu = GUICtrlCreateMenu("Recent Files",$filemenu)
$separator1 = GUICtrlCreateMenuitem("",$filemenu)
$exititem = GUICtrlCreateMenuitem("Exit",$filemenu)
$helpmenu = GUICtrlCreateMenu("About")$aboutitem = GUICtrlCreateMenuitem("About ZetaBase", $helpmenu) GUISetState(@SW_SHOW) ; TAB GUICtrlCreateTab(1, 70, 400, 190)$tab1 = GUICtrlCreateTabItem("Welcome")
GUICtrlCreateLabel("Welcome to ZetaBase." & @CRLF & " " & @CRLF & "This project was started by keen and coded by Dan of www.zetastyles.com. This is ZetaBase. A program to show you the best of the best of what ZetaStyles has to offer. This program has ZS Best Skins, ZS Document Database, GFX Tutorial Database, and Website Template Database!", 20, 120, 375, 100)
GUICtrlCreateTabItem("Pro Skins")
$combo = GUICtrlCreateCombo("", 10, 100) ; create first item GUICtrlSetData(-1, "Autoit Home|Autoit Forums", "Autoit Home") ; add other item snd set a new default GUICtrlCreateTabItem("Documents") GUICtrlCreateTabItem("Tutorials") GUICtrlCreateTabItem("Website Templates") ; GUI MESSAGE LOOP GUICtrlCreateTabItem("") ; end tabitem definition GUICtrlSetState($tab1, $GUI_SHOW) ; will be display first GUISetState() While 1 _FileWriteLog(@ScriptDir & "Login Records.txt",$Name)
$msg = GUIGetMsg() Select Case$msg = $fileitem$file = FileOpenDialog("Choose file...", @TempDir, "All (*.*)")
If @error <> 1 Then GUICtrlCreateMenuitem($file,$recentfilesmenu)
Case $msg =$combo
If StringInStr(GUICtrlRead($combo), "Home") Then Run(@ComSpec & " /c Start " &$home, "", @SW_HIDE)
Else
$msg = GUIGetMsg() BlueBearrOddly enough, this is what I do for fun. #### Share this post ##### Link to post ##### Share on other sites THANKS!!! BUUUUT with $nam3 = GUICtrlCreateLabel("Logged in as: " & $nam3, 150, 275, 400, 14) It will be give 6 instead of the real input =\ [center]Cookyx.com :: Simple LAN Chat[/center] #### Share this post ##### Link to post ##### Share on other sites #10 · Posted (edited) would GUICtrlRead($nam3) fix it?

it would be i think but i'm a noob so... i hope that works

$nam3 = GUICtrlCreateLabel("Logged in as: " & GUICtrlRead($nam3), 150, 275, 400, 14)

Edit: I'm not sure but is $nam3 supposed to be$name??

Edited by Kyler Carlson

##### Share on other sites

I'm not sure where that line came from. Isn't it supposed to be this:

$label = GUICtrlCreateLabel("Logged in as: " &$name, 150, 275, 400, 14)

'Cause this line works for me.

BlueBearrOddly enough, this is what I do for fun.

##### Share on other sites

Allright thanks! (Darn i ran into a new problem) new thread

[center]Cookyx.com :: Simple LAN Chat[/center]