Jump to content

Passing parameters


Casandra Kumsung
 Share

You are about to reply to a thread that has been inactive for 4938 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

In a dos bat file you can run the bat file with parameters. ie "clean.bat 2 34 48 "

I need to be able to change parameters ie /23  23 49 48

23 being a number used like a time

49  another number being used in the script

and 48 another number being used else where

Is this possible?  I could not find any examples of how to do this.

There is a  way with one command but means a lot of if then elses!

 

Link to comment
Share on other sites

other than hard coding the parameters you want to run with, you would need some method to import run parameters for a script. the common methods are via notecard reads (script reads the notecard at startup or on demand), or via a command interface (listen/chat being the most popular, you would send a command with your parametrs after it, other like dialog, http, etc are also possible), and then the script would parse those out.

Link to comment
Share on other sites

If all of your parameters are numeric, you could use an llDialog and make a menu that looks like a 10-button numeric keypad.  if you have multiple parameters to set, you could have 2 levels of llDialog:  One to select which parameter that you want to set, followed by the numeric keypad to input the actual parameter.

Link to comment
Share on other sites

If you're going to be using th same parameter values over and over again, then I think it's cleanest to put them on a notecard that you read in and parse each time you run the script.  You're less likely to make typing errors if you only have to record the values one time.  If the numbers are likely to change from one time to another, I'd suggest entering them as a single string with a llTextBox and then parsing them in the listen event.  It's a bit more straightforward than using llDialog .

Link to comment
Share on other sites

If you have just a few parameters, you can assign variables to hold the information and then call those variables when you need to. If there are more than  few paramaters, you can store them in a list. In either case, you can dynamically change your data-- unlike a notecard, which can only be read.

 

 

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4938 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...