| www.ClassicTW.com https://mail.black-squirrel.com/ |
|
| Calculator Script in Swath? https://mail.black-squirrel.com/viewtopic.php?f=15&t=13034 |
Page 1 of 1 |
| Author: | Ryu_Khan [ Fri May 28, 2004 2:23 pm ] |
| Post subject: | |
Is it possible to write a calculator script in Swath, specifically a script to calculate quasar damage? I currently have ATTAC installed solely for the purpose of using its Quasar calculator, but thought it would be much easier to use a Swath script. I use the Swath/Twx combo, and have written a few TWX scripts but realize that 2.02 doesn't support decimal calculations and so I can't use a TWX script for Quasar prediction. Thanks, Ryu Khan *disclaimer I have zero knowledge of Java or Swath scripting, but am willing to learn |
|
| Author: | Tradewarrior55 [ Fri May 28, 2004 2:46 pm ] |
| Post subject: | |
ok I have no help in the scripting part, but here is an alternative till you get what you need. http://geocities.com/videotees/CanCalc.xls Thanx to vid kid |
|
| Author: | Draconis [ Fri May 28, 2004 4:37 pm ] |
| Post subject: | |
Rammar had a cannon cacl for TWX awhile back. Check with him (or check Scripter's Tavern) |
|
| Author: | Ryu_Khan [ Fri May 28, 2004 7:03 pm ] |
| Post subject: | |
Thanks for the replies. Vid's spreadsheet doesn't do what I want (or maybe it does - I've never used spreadsheets before and couldn't make it do what I want). I ICQ'ed RammaR but he wasn't around (no qcannon script on scripterstavern.com). I started to think that there were mathematical workarounds to TWX's lack of decimals, and decided to just sit down and write the thing myself. It'll be good experience too, since I've only written a couple of TWX scripts and am a scripting newb. Here's what I've got so far: quote:getinput $blast1 "How much damage did the first blast do?" getinput $blast2 "How much damage did the second blast do?" #calculate QCannon Sector % setVar $2ndblast $blast2 #multiply one value by 1000 in order to work around the lack of #decimals in TWX multiply $2ndblast 1000 divide $2ndblast $blast1 setvar $x $2ndblast #Calculate the Sector % from x IF ($x < 5) setVar $q% 100 goto :qpercent Else if ($x >= 5) and ($x < 15) setVar $q% 99 goto :qpercent Elseif ($x >= 15) and ($x < 25) setVar $q% 98 goto :qpercent Elseif ($x >= 25) and ($x < 35) setVar $q% 97 goto :qpercent It should work, just gotta sit down and type out the rest of it. edit: fixed code typo |
|
| Author: | Vid Kid [ Sat May 29, 2004 3:08 am ] |
| Post subject: | |
If your looking to set cannons , that spreadsheet will do the trick. But if your mothing and want to calc what the settings are when your invading , then you will need another script. I'm not sure which script it was .. I never found it to be of much use . When I invade and get blasted , I go get another ship and continue .. why would I care what they were set at , I'm planning on taking them anyways , not set them or write a book on what they were when I came in ..lol I think the script name was cannonperc.ts , was written for twx 1.09 but can be ran in twx 2.02 Hope that helps |
|
| Author: | Ryu_Khan [ Sat May 29, 2004 3:28 am ] |
| Post subject: | |
Yeah I was looking for one that helps with mothing. No problem though, I wrote a Quasar calculator script earlier today. As a general TWX scripting question, would there have been an easier way of calculating $q% ie like with an array? I'm pretty new at this so I'm not sure. Vid, your method of conquering sounds like the 'sledgehammer' method |
|
| Page 1 of 1 | All times are UTC - 5 hours |
| Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |
|