MSFN Forum: A script to skip line and write to one line - MSFN Forum

Jump to content



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

A script to skip line and write to one line Rate Topic: -----

#1 User is offline   makaveli07 

  • Group: Members
  • Posts: 8
  • Joined: 02-January 08

Posted 03 January 2008 - 06:34 PM

Hey guys,

Does anyone have a script that can skip like a random number of lines, then write a value from the inputbox command to a specific word...

I just want to be able to put like a 1 - 7 from an inputbox after the extremeserver part.

Ex:

'Skip the line below
SLGOrchardSite.properties - Properties file for the SLGOrchardSite database

'skip the line below
driver = com.mysql.jdbc.Driver

'Change the extremeserver part of this line
dbConnection = jdbc:mysql://extremeserver:3306/

'Skip the line below
database = ClusterDB

Thanks if anyone can help


#2 User is offline   Yzöwl 

  • Wise Owl
  • Group: Super Moderator
  • Posts: 4,117
  • Joined: 13-October 04
  • OS:Windows 7 x64

Posted 03 January 2008 - 11:20 PM

Please try to explain your problem a little more clearly, I don't understand enough to even take an educated guess at something for you.

#3 User is offline   makaveli07 

  • Group: Members
  • Posts: 8
  • Joined: 02-January 08

Posted 04 January 2008 - 12:06 PM

i want to be able to have inputbox, so the user can put a number value from 1 -7 and that value with get inserted right after the word extremeserver.

After they input the value it will save the file with the changes..

Does that help?

#4 User is offline   Yzöwl 

  • Wise Owl
  • Group: Super Moderator
  • Posts: 4,117
  • Joined: 13-October 04
  • OS:Windows 7 x64

Posted 04 January 2008 - 01:23 PM

The bit about random number of lines through me off the scent. So all you want is to replace extremeserver with extremeservern where n is an integer from 1-7(incl) and chosen by user input.

#5 User is offline   makaveli07 

  • Group: Members
  • Posts: 8
  • Joined: 02-January 08

Posted 04 January 2008 - 02:19 PM

exactly... sorry about the confusion... :wacko:

#6 User is offline   gunsmokingman 

  • MSFN Addict
  • Group: Super Moderator
  • Posts: 1,991
  • Joined: 02-August 03
  • OS:none specified
  • Country: Country Flag

Posted 04 January 2008 - 05:14 PM

Some thing like this maybe
Save as ServerNumber.hta

Quote

 <!--
 Created By Gunsmokingman  Friday, January 04, 2008
 -->
 <HTML><HEAD>
 <TITLE>Server Number</TITLE>
 <HTA:APPLICATION ID='ServerNumber'
  Scroll='No'			 
  SCROLLFLAT ='No'		
  SingleInstance='Yes'
  SysMenu='Yes'
  ShowInTaskBar='No'
  MaximizeButton='No'
  MinimizeButton='No'	 
  Border='Thin'
  BORDERSTYLE ='complex'  
  INNERBORDER ='Yes'
  Caption='Yes'  
  WindowState='Normal'
  APPLICATIONNAME='Server Number' 
  Icon='%SystemRoot%\explorer.exe'>
 <STYLE Type="text/css">
   Body
   {
	Font-Size:9.05pt;
	Font-Weight:Bold;
	Font-Family:Arial,Tahoma,Comic Sans MS,Segoe Ui;
	Color:#001254;
	BackGround-Color:Transparent;
	Filter:progid:DXImageTransform.Microsoft.Gradient
	(StartColorStr='#fdf7f1',endColorStr='#d1cbc5');
	Margin-Top:1;
	Margin-Bottom:1;
	Margin-Left:4;
	Margin-Right:4;
	Padding-Top:1;
	Padding-Bottom:1;
	Padding-Left:4;
	Padding-Right:4;
	Text-Align:Center;
	Vertical-Align:Top;
	Border-Top:2px Solid #cbc7c3;
	Border-Bottom:3px Solid #a6a29e;
	Border-Left:2px Solid #bcb8b4;
	Border-Right:3px Solid #b2aeaa;
   }
  Select.Bx1
   {
	Font-Size:7.95pt;
	Font-Weight:Bold;
	Font-Family:Arial,Tahoma,Comic Sans MS,Segoe Ui;
   }
  .Sel1
   {
	BackGround:#D9D9D9;
	Color:#3A3A3A;
   }
  .Sel2
   {
	BackGround:#E9E9E9;
	Color:#235779;
   }
  BUTTON
   {
	Cursor:Hand;
	Font-Size:8.05pt;
	Font-Weight:Bold;
	Font-Family:Arial,Tahoma,Comic Sans MS,Segoe Ui;
	Color:#002264;
	Filter:progid:DXImageTransform.Microsoft.Gradient
	(StartColorSTR='#bbddff',endColorSTR='#224488');
	Padding-Top:1;
	Padding-Bottom:2;
	Margin-Left:2pt;
	Margin-Right:2pt;
	Border-Top:2px TransParent;
	Border-Bottom:3px TransParent;
	Border-Left:2px TransParent;
	Border-Right:3px TransParent;
   }
  .B1
   {
	Color:#005353;
	Filter:progid:DXImageTransform.Microsoft.Gradient
	(StartColorSTR='#bbddff',endColorSTR='#228844');
   }
 </STYLE>
  <script LANGUAGE='JScript'>
  window.resizeTo (225,139), window.moveTo (195,175);
  </SCRIPT>
  <script Language="VBScript">
   Function ComputerNumberSelect()
	For i = 0 to (ComputerNumber.Options.Length - 1)
	 If (ComputerNumber.Options(i).Selected) Then
	  If ComputerNumber.Options(i).Value = "Computer Number" Then
	   Exit For
		Exit Function
		Else 
		 alert("extremeserver" & ComputerNumber.Options(i).Value)
	   End If  
	 End If 
	Next
   Exit Function
   End Function
  </SCRIPT>
 </HEAD><BODY Scroll='No'>Select Your Server Number
  <SELECT size='4.55' name='ComputerNumber' style='width:131pt;' Class='Bx1' 
  OnChange='ComputerNumberSelect()'>
   <OPTION Value='Computer Number' Class='Sel1'> Select Server Number</OPTION>
   <OPTION Value='1' Class='Sel2'>  001</OPTION>
   <OPTION Value='2' Class='Sel1'>  002</OPTION>
   <OPTION Value='3' Class='Sel2'>  003</OPTION>
   <OPTION Value='4' Class='Sel1'>  004</OPTION>
   <OPTION Value='5' Class='Sel2'>  005</OPTION>
   <OPTION Value='6' Class='Sel1'>  006</OPTION>
   <OPTION Value='7' Class='Sel2'>  007</OPTION>
  </SELECT>
 <DIV Style='Margin-Top:3pt;'>
  <BUTTON ID='Btn01'
   OnMouseOver='this.className="B1"'
   OnMouseOut='this.className=""'
   Onclick='window.close()'
   Style='Width:45pt;Height:13pt;'>Close</BUTTON>
 </DIV>
 </BODY></HTML>


Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy