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 have a toshiba sd 392 combo vcr/dvd player on the tv WITHOUT the multi-room dvr and I can't record any progams to the vcr. Should I be able to record one show while watching another? I have the vcr/dvd player set to channel 3 and i can program my s [More]
I'm looking for the best way to integrate a database with OSB resources. What I need is that for each new record into one table in a Database, triggering an execution of an OSB service, but I have the ability to use any component of the SOA Suite pro [More]
Hi! I am not able to find Windows 7 64 bit drivers for MSI GT628. Does anybody know where can I download it? I have pretty big problem with it. (It´s stucked very often and I have seen blue death for two times).    Thanks for all answers!Hi,         [More]
I have a page which displays all of my columns. My second column are numbers. If the 3rd column is filled in, the data on all of the columns will be displayed including the 2nd column on this page. If the 3rd column is not filled in yet, only the nex [More]
Hi, System DSCP no(HOST NAME) has got changed ,after that srever is not running up properly,can you plaese help me on this.We tried to change dscp no in cache and infra eventhough status is same. (dscp17512---changed to ---->new dscp no) Please find [More]
Hi Guru's, We are on ECC 6 IS Retail solution. Scenario is every night the data from stores(PLANT) is send back(via IDOC) in SAP and Billing document is created ( with conditions in it) We have created a pricing procedure for data from Stores. What h [More]
Hi Friends, I am working on Ale idoc scenario in which i need to create sales order from customer purchase order. for this i need to maintain ship-to-party number in advance. Customer is providing me with list of ship to party number, but i dont want [More]
I was lucky enough to find a factory sealed 1st gen iphone (16gb) on ebay earlier this week and I grabbed it before anyone else did. I was a previous owner of the same phone earlier this year before I sold it. Anyways while I was waiting to receive m [More]
hi this is ramireddyPlease see my replies to you in other posts. Also it would be nice to go back and either thank and reward the people who have spent time to answer to your questions, or let me know if you need more info, or if you understood the r [More]
I bought in 2014 the license for Photoshop Elements 12.0 WIN AOO License I (65,224,943). They failed, however, to find and download Photoshop Elements 12.0, nor can I apply the instructions published in Adobe "Silently install (deploy) Adobe Premiere [More]