Sitemap

Amicuk Programming Answers

Script Refinement

-0001-11-30   Views:0

Advertisement

I have made a script: Begin- display dialog "Enter Chance 1" default answer "" set chanceOne to text returned of result display dialog "Enter Chance 2" default answer "" set chanceTwo to text returned of result disp

I have made a script:
Begin-
display dialog "Enter Chance 1" default answer ""
set chanceOne to text returned of result
display dialog "Enter Chance 2" default answer ""
set chanceTwo to text returned of result
display dialog "Enter Chance 3" default answer ""
set chanceThree to text returned of result
display dialog "Enter Chance 4" default answer ""
set chanceFour to text returned of result
set betOne to random number 3824
set betTwo to random number 3824
set betThree to random number 3824
set betFour to random number 3824
set winOne to (chanceOne) * (betOne)
set winTwo to (chanceTwo) * (betTwo)
set winThree to (chanceThree) * (betThree)
set winFour to (chanceFour) * (betFour)
repeat until betOne + betTwo + betThree + betFour is less than winOne and betOne + betTwo + betThree + betFour is less than winTwo and betOne + betTwo + betThree + betFour is less than winThree and betOne + betTwo + betThree + betFour is less than winFour
set betOne to random number 3824
set betTwo to random number 3824
set betThree to random number 3824
set betFour to random number 3824
set winOne to (chanceOne) * (betOne)
set winTwo to (chanceTwo) * (betTwo)
set winThree to (chanceThree) * (betThree)
set winFour to (chanceFour) * (betFour)
end repeat
display dialog "Bet 1= " & betOne & "
Bet 2= " & betTwo & "
Bet 3= " & betThree & "
Bet 4= " & betFour & ""
-END
I am wondering if/how I can get the largest amount from each win if I only win one of the four.
(note: one of the chances is always 2 and the others are 5 or more)
20" iMac G5 Original 1 GB Ram, 1.8 GHz   Mac OS X (10.4.3)  
20" iMac G5 Original 1 GB Ram, 1.8 GHz   Mac OS X (10.4.3)  

The replay answer
Advertisement
As mentioned above javascript and java are 2 different thigns. How ever after looking at your code I would have to guess that you missed a '{' or '}' some where in you actual code. Other than some minor html syntax errors I realy didn't see anything wrong with the code above. But since you didn't post the actual code it hard to say if fixing the few minor errors would make any diff. I'm going with missed curly braces.
Ron_W

Go to See the other 4 answers

Script Refinement

Category:DefaultRelease time:-0001-11-30Views:130

I have made a script: Begin- display dialog "Enter Chance 1" default answer "" set chanceOne to text returned of result display dialog "Enter Chance 2" default answer "" set chanceTwo to text returned of result disp[More]

Refining JS script to control a pop up window

Category:DefaultRelease time:2015-10-11Views:130

After much frustration... I have a working popup window to display small images. The script thanks to WEB DESIGN GARAGE by Marc Campbell is simple enough, he has me paste this in the body: <script language="JavaScript">   function doPopup([More]

Looking for a more universal scripting language than AppleScript or Automator

Category:DefaultRelease time:2015-10-11Views:130

I want to learn a cross-platform/web scripting language to automate tasks, write scripts and with the potential to create programs and web apps. I am looking for something that: - is not a program with a GUI like Automator, iKey, Quickeys, Maestro...[More]

UsVARIABLE_NOT_FOUND error while playback the script in Oracle load testing

Category:DefaultRelease time:2015-10-11Views:130

Hi, I'm using Oracle® Application Testing Suite Release 12.2.0.1. I have recorded a simple script doing some login and logout steps. When i playback the same script. I'm getting the below error. Summary of the error : Variable "web.jscript.http101841[More]

Scheduling an Apple Script [eyeTV DVB Update] more...

Category:DefaultRelease time:-0001-11-30Views:130

Like many other eyeTV Users, I have opted out of the iceTV [Australia] annual subscription, and am using the DVB Program Guide. But eyeTV does not support scheduled updates of the DVB Guide, only subscription services [annoying]. Recently ctzsnooze p[More]

Character Strings in Sap Script

Category:DefaultRelease time:-0001-11-30Views:130

Hi, how to create character strings in Sap Script? thanks, fractalHi, Defining Character Formats Character formats in forms determine how text is formatted within paragraphs. They are a refined form of text layout. 1. Choose Goto  Character strings.[More]

Arch User Script Repository?

Category:DefaultRelease time:-0001-11-30Views:130

As I was browsing through the sticky, which is full of useful stuff, I found searching this ever longer and more disorganized thread for a script for a particular purpose difficult. Wouldn't it be great to have an organized repository for these contr[More]

Help with a script for elder friend

Category:DefaultRelease time:-0001-11-30Views:130

First off, with apologies, I am not a script familar person at all.  I have an elderly friend who is switching to Mac for the first time.  I wanted a way to close all open programs, with a prompt to save any open files and then run a Time Machine bac[More]

Filter/refine sharepoint search result

Category:DefaultRelease time:-0001-11-30Views:130

Hi All, I have the following scenario. I'm working on Sharepoint online 2013. I need to filter Search based on a dropdown list in the page. I want the search webpart to read value from dropdown , add it to the url and filter results based on it . Thi[More]

Script to unmount or eject disk images

Category:DefaultRelease time:-0001-11-30Views:130

Is there a way to unmount disk images wiuth an automator or applescript? I have such a script to eject all disks, but this won't unmount disk images. I would like something that unmounts everything, except of course the startup disk etc.Andrew Gara w[More]

I want to write a script or Automator workflow/app that emails a random shortcut of the day to three recipients. The source is from an Excel spreadsheet. One column is the shortcut, and the second column is the definition. Anyone have experience?

Category:DefaultRelease time:-0001-11-30Views:130

I want to write a script or Automator workflow/app that automatically emails a random shortcut of the day to three recipients. The source is from an Excel spreadsheet. One column is the shortcut, and the second column is the definition. Anyone have s[More]

Hot
hi i have facing a problem that i want to pass the value of a variable that i had calculate in a procedure like SELECT nvl(BASIC_PAY,0) INTO v_basic FROM EMP WHERE EMP_ID=P_EMP_ID; so i want to send the variable value v_basic as a parameter through f [More]
My iPod shuffle died and is unresponsive. The Apple support online is pretty useless. All searches lead to the same reset procedure, but my shuffle is unresponsive whether I charge it, plug it into my mac or do the normal reset. Also, I don't live an [More]
I am trying to sync my ipod nano to my windows laptop. I previously synced it to a different laptop but the music didnt sync to the ipod. The previous laptop is old so I figured a newer laptop would be more sufficient. While on the new laptop it is t [More]
Hi, I am getting this error when I am trying to validate the mapping Source table is QMI " VLD-1002: Mapping object QMI is not bound to a repository object. All objects in a mapping must be bound to objects in the Design Repository. Unbound objects i [More]
Earthlink WebMail has no process to export mail to .Mac Mail or any other email service. I'd like to import one of the six folders in my Earthlink email to .Mac Mail. I launched Apple's "Mail Help" and opened "Importing email into Mail" [More]
My wife has an iphone and hotmail email. I upgraded to the premium hotmail and now have POP3 and it all works great. the issue I have is that she has 500 emails in her hotmail account and the iphone displays the first 50 not the most recent 50. How d [More]
I can't seem to get a link from a dataTable to work with a specific id. Example: <h:dataTable columnClasses="list-column-center,list-column-center, list-column-center, list-column-center" headerClass="list-header" rowClasses="l [More]
In the latest version of Music for iPad (and I guess iPhone), there is no longer a link to access the audiobooks I've downloaded from iTunes over the years. I've searched in iBooks and other equally obscure IOS Apps, but they remain stubbornly disapp [More]
Trying to transfer files from a DVD to a documents app on my iPAD.  Instructions say to find the iPAD  in the list in iTunes, click on "Apps" in the iPAD menu bar, then file sharing.  I don't see an iPAD icon in iTunes - what am I missing?  Than [More]
Hi, I am using following code to display a drop down in jsp. <logic:present name="ALLBRANDS" scope="request">      <html:select property="selBrand" styleId="brandBox" >           <html:options collect [More]