waltv7 Posted December 12, 2008 Posted December 12, 2008 (edited) Hello everyone I am about a 3 hour beginner here so please bear with me on this. expandcollapse popup;Author Flix AKA Walt ; ;Script function is to automate the creation of world file for MUDS. ; ; Prompt the user to run the script - use a Yes/No prompt (4 - see help file) $answer = MsgBox(4, "MUD World Creator", "This program will create your world files for you. Run?") ; Check the user's answer to the prompt (see the help file for MsgBox return values) ; If "No" was clicked (7) then exit the script If $answer = 7 Then MsgBox(4096, "Thanks", "Bye!") Exit EndIf $answer2 = MsgBox(1, "File Check", "Open a new or existing world file in wordpad then click ok.") ;WinWaitActive("WordPad") $aloop = 1 While $aloop = 1 $roomnum = InputBox("Room Number", "Please enter the room #") If @error = 1 Then MsgBox(4096, "Error", "You must enter a room number!") Else If $roomnum = "" Then MsgBox(4096, "Error", "You must enter a room number!") Else Send ($roomnum"{Enter}") $aloop = 0 ; Exit the loop - ExitLoop would have been an alternative too :) EndIf EndIf WEnd $bloop = 1 While $bloop = 1 $roomname = InputBox("Room Name", "Please enter the room name") If @error = 1 Then MsgBox(4096, "Error", "You must enter a room name!") Else If $roomname = "" Then MsgBox(4096, "Error", "You must enter a room name!") Else Send ($roomname"{Enter}") $bloop = 0 ; Exit the loop - ExitLoop would have been an alternative too :) EndIf EndIf WEnd $cloop = 1 While $cloop = 1 $roomdesc = InputBox("Room Name", "Please enter the room description") If @error = 1 Then MsgBox(4096, "Error", "You must enter a room description!") Else If $roomdesc = "" Then MsgBox(4096, "Error", "You must enter a room name!") Else Send ($roomdesc"{Enter}") $cloop = 0 ; Exit the loop - ExitLoop would have been an alternative too :) EndIf EndIf WEnd Send ("~{Enter}") I am sure this is sloppy but my problem is on sending the different variable $roomnum, $roomname, and $roomdesc I can only get the first letter to send from the variables. what am i doing wrong and how can I fix it? and this isn't fully compleated code I am testing it as i go along. Thanks in advance Walt Edited December 12, 2008 by waltv7
Andreik Posted December 12, 2008 Posted December 12, 2008 (edited) This line is wrong: Send ($roomnum"{Enter}") should be Send ($roomnum & "{Enter}") And all your send functions is wrong, use & to fix them. Edited December 12, 2008 by Andreik
waltv7 Posted December 12, 2008 Author Posted December 12, 2008 (edited) This line is wrong: Send ($roomnum"{Enter}") should be Send ($roomnum & "{Enter}") And all your send functions is wrong, use & to fix them. Ok updated the codeing and I don't get any errors but I also don't get any output. expandcollapse popup;Author Flix AKA Walt ; ;Script function is to automate the creation of world file for MUDS. ; ; Prompt the user to run the script - use a Yes/No prompt $answer = MsgBox(4, "MUD World Creator", "This program will create your world files for you. Run?") ; Check the user's answer to the prompt (see the help file for MsgBox return values) ; If "No" was clicked (7) then exit the script If $answer = 7 Then MsgBox(4096, "Thanks", "Bye!") Exit EndIf $answer2 = MsgBox(1, "File Check", "Open a new or existing world file in wordpad then click ok.") ;WinWaitActive("WordPad") $aloop = 1 While $aloop = 1 $roomnum = InputBox("Room Number", "Please enter the room #") If @error = 1 Then MsgBox(4096, "Error", "You must enter a room number!") Else If $roomnum = "" Then MsgBox(4096, "Error", "You must enter a room number!") Else Send ($roomnum & "{Enter}") $aloop = 0 ; Exit the loop - ExitLoop would have been an alternative too :) EndIf EndIf WEnd $bloop = 1 While $bloop = 1 $roomname = InputBox("Room Name", "Please enter the room name") If @error = 1 Then MsgBox(4096, "Error", "You must enter a room name!") Else If $roomname = "" Then MsgBox(4096, "Error", "You must enter a room name!") Else Send ($roomname & "{Enter}") $bloop = 0 ; Exit the loop - ExitLoop would have been an alternative too :) EndIf EndIf WEnd $cloop = 1 While $cloop = 1 $roomdesc = InputBox("Room Name", "Please enter the room description") If @error = 1 Then MsgBox(4096, "Error", "You must enter a room description!") Else If $roomdesc = "" Then MsgBox(4096, "Error", "You must enter a room name!") Else Send ($roomdesc & "{Enter}") $cloop = 0 ; Exit the loop - ExitLoop would have been an alternative too :) EndIf EndIf WEnd Send ("~{Enter}") Edited December 12, 2008 by waltv7
waltv7 Posted December 12, 2008 Author Posted December 12, 2008 What should do this script?At each input window it needs to output to a textfile what the user inputs. This will be used to automate makeing MUD room files. First input will take a # the user inputs, second would be the room name and third would be a room description output in a text file should look like this.1234room name hereusually a very long room description here~then more to continue after this output problem is solved.
Andreik Posted December 12, 2008 Posted December 12, 2008 At each input window it needs to output to a textfile what the user inputs. This will be used to automate makeing MUD room files. First input will take a # the user inputs, second would be the room name and third would be a room description output in a text file should look like this.1234room name hereusually a very long room description here~then more to continue after this output problem is solved.And why use Send() if you want to write a file? Check FileOpen(),FileWrite() and FileClose() in help file.
waltv7 Posted December 12, 2008 Author Posted December 12, 2008 And why use Send() if you want to write a file? Check FileOpen(),FileWrite() and FileClose() in help file.ok I'll check that outthanks
waltv7 Posted December 12, 2008 Author Posted December 12, 2008 ok I'll check that outthanksyour sugestion on the OpenFile(), WriteFile() worked great.Thanks a bunch!!!!!!Walt
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now