View unanswered posts | View active topics It is currently Sat Apr 18, 2026 3:50 pm



Reply to topic  [ 6 posts ] 
 Calculator Script in Swath? 
Author Message
Staff Sergeant

Joined: Thu May 06, 2004 2:00 am
Posts: 19
Location: Canada
Unread post 
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


Fri May 28, 2004 2:23 pm
Profile
Ensign

Joined: Wed Feb 26, 2003 3:00 am
Posts: 277
Location: USA
Unread post 
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

_________________
Striding over the terrain, cutting down all who dare stand in the way using a bladed baseball bat, cometh TW55! And he gives a spectacular grunt:

"Hail the blood-letting! I lay waste to all I see until there is no more hope!!"


==================================================
" Just because I am paranoid doesn't mean they are not after me!!"
http://www.geocities.com/tradewarrior55/index.html
Tradewarrior55@yahoo.com


Fri May 28, 2004 2:46 pm
Profile YIM WWW
Lieutenant J.G.

Joined: Wed Oct 15, 2003 2:00 am
Posts: 437
Location: USA
Unread post 
Rammar had a cannon cacl for TWX awhile back. Check with him (or check Scripter's Tavern)


Fri May 28, 2004 4:37 pm
Profile ICQ YIM
Staff Sergeant

Joined: Thu May 06, 2004 2:00 am
Posts: 19
Location: Canada
Unread post 
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


Fri May 28, 2004 7:03 pm
Profile
Commander

Joined: Sun Feb 25, 2001 3:00 am
Posts: 1838
Location: Guam USA
Unread post 
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

_________________
TWGS V2 Vids World on Guam Port 2002
Telnet://vkworld.ddns.net:2002
Discord @ DiverDave#8374
Vid's World Discord

Founding Member -=[Team Kraaken]=- Ka Pla

Image
Winners of Gridwars 2010
MBN Fall Tournament 2011 winners Team Kraaken
Undisputed Champions of 2019 HHT Just for showing up!

The Oldist , Longist Running , Orginal Registered Owner of a TWGS server :
Vids World On Guam


Sat May 29, 2004 3:08 am
Profile WWW
Staff Sergeant

Joined: Thu May 06, 2004 2:00 am
Posts: 19
Location: Canada
Unread post 
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 :) . I prefer the 'rapier' method of calculating the exact amount of fighters to use in order to save fighters as I discover each planet's sector %


Sat May 29, 2004 3:28 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 6 posts ] 

Who is online

Users browsing this forum: No registered users and 16 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by wSTSoftware.