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 Folks! I apologize for my English writting is not my mother tongue. Well, I hope to able to explain my problem. I have a Server of sockets made in Java and a Flash client (it's a simple Chat real-time). Everything goes great when my server is acti [More]
My touchscreen was not working so I tried different steps to fix it and still nothing. So I did a System Recovery and still nothing..So then I did a System Restore to completly wipe everything out back to factory settings...and after I did it I tried [More]
A couple of years ago, I purchased a high-end HP desktop specifically for working with Premiere Pro CS 5.5.  My local computer store who has helped me with my computer is in awe of my machine -- powerful processors, massive storage, etc.  Yet, there [More]
I have two external hardrives. One I use for time machine, and the other I just copy and paste my computer's hardrive. I like to have a couple back up locations. The problem: Lately when I try the copy and paste operation it gets started then inevita [More]
I downloaded Skype and was not asked for a Skype ID or password. Now I cannot sign in. How do I get an ID and password?Hi, You need to register a name Registering a name is not part of the download process. 8:14 PM      Monday; January 23, 2012 Pleas [More]
On my MacBook Pro having iWeb open and idling with my relatively simple site would cause my CPU usage to hover between 35% and 50%. Pretty disconcerting since I have a 2.66 i7 model and 8 gigs of RAM. Some pages on my blog have a decent amount of tex [More]
Hi there, unfortunately faced a couple of not critical but annoying problems. First of all it is an SLI trouble. Every time I switch off my PC and then try to switch it on there is no video output - the monitor just stays black while PC normally boot [More]
Dear forum members, Greetings from lands far away :-) I am in the market for a laptop, "specifically" for scientific computing - data processing, running numerical models, coding and visualization (Python, openGL, Tcl/Tk, Vis5d). I have decided [More]
My home phone messages are forwarded to my .Mac email account, but show up as an attachment in WAV format. When I click on the attachment to play the recorded phone message I get an alert saying "This movie could not be played". I need to be abl [More]
Is there any difference in Group Space and Space? Most of the webcenter spaces tutorials show an option of creating a "Group Space", however when I login to WC Spaces as an admin I never see an option to "Create a Group Space" . All I [More]