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
I created a text field and now I would like to not have the background in white. I did not figure out yet how I can do this. Also the help program did not help. Does anybody know how this works? Thanks a lot. Many greetings!Oh.. all right, forget it. [More]
Hi Experts, For the Purchase Rebate Scenario, I have followed the following steps : 1. Create Rebate Arrangement 2. Create PO 3. Goods Receipt 4. Invoice verification using MIRO 5. Check Update of business volume T-code : MEB6 Update of business volu [More]
What is the maximum size of an XML attribute? I can't find this define in the OMG XML specification. Does the Oracle XML parser have a maximum size of an XML attribute? Do other XML parsers on the market have any limitation? ... we need to exchange X [More]
After I updated my 2GB Nano with Updater 2006-01-10 from my eMac running MacOS 10.3.9 and iTunes 6.0.2 using USB, it ran for a while, but then it got hung and I had to restore it. Since then, it is intermittently not showing up in iTunes or on the de [More]
I have scrapped off the white plastic covering in the adaptor for a t style plug in a MacBook White while trying to remove some metallic gunk. Is it still safe to [email protected]  ‎Thank you for using HP Support Forum. I have brought your issue to [More]
Hello, Approximately, 6 months ago, I took my iPhone 4 to an Apple store because I had dropped it. Completely smashed! I had to pay £180 and they gave me a new iPhone. Last week, the power button seemed to stop working. It doesnt click. It doesnt do [More]
hello, i want to upgrade my os 7 to os 10 on my bb 9700. can anyone tell me is it compatiable with this smartphone and do not affect the performance of phone.? Moreover what method should be adopted to upgrade OS?Sorry it is not compatible to upgrade [More]
Hi all, In Talent Management Development Plan standard portal view theres a section called "Obsolete" . In what conditions do development goals fall into that section? Thanks for the help.Dear Luke, Thank you for your reply. All those Services w [More]
Are there any log files created when you perform a device software update using the BB Desktop Manager? I've searched my PC for anything with the date of the upgrade but cannot find anything relating to this. Any ideas where these logs (if they actua [More]
I click on the Desktop Icon for my main email account, it does not do anything. No error messages, it fades as if it is going to open, then nothing. Please help... very important to access this email account pronto....How is that related to Firefox s [More]