www.ClassicTW.com
https://www.classictw.com/

Planet Data Script
https://www.classictw.com/viewtopic.php?f=15&t=35523
Page 1 of 1

Author:  tex. [ Wed May 15, 2019 12:07 am ]
Post subject:  Planet Data Script

So I just wrote a bunch of stuff about this and it got erased.....So short version....I need to add the column for "Corporate or Personal" Planet. I can't get it to loop right and right now it does pull both, but I can't get the field to display correctly in the columns and rows of the output file. Appreciate any help.

Hmmmm…….I can't add a file......help......heres the code...but can i get file upload access too?

[code]

setVar $version "Planet Data 1.0"
setVar $autoGenFile GAMENAME & "_Planet_Data.txt"
getword currentLine $prompt 1
if ($prompt <> "Planet") and ($prompt <> "Citadel")
echo ANSI_12 "**!!! You must start from the planet's surface, well I could change that, but we are starting from planet on this one !!!"
halt
end
:autoGen
delete $autoGenFile
setVar $useList ""
if ($prompt = "Citadel")
send "q"
end
send "*"
waitFor "Planet #"
getword currentline $agPnum 2
stripText $agPnum "#"
send "cxlqcyq"
waitfor "=================================================="

setVar $header "Sector ^ Planet # ^ Planet Name ^ Class ^ Type ^ Citadel Level ^ Shields ^ Total Pop ^ Daily Fuel Production ^ Daily Org ^ Daily Equipment ^ Total Fuel ^ Total Org ^ Total Equip ^ Total Figs ^ Credits"
write $autoGenFile " " & $header



:getAutoGenList
settextLineTrigger autoG :autoG " Class "
setTextLineTrigger agDone :agDone "<Computer deactivated>"
pause
:autoG
settextLineTrigger autoG :autoG " Class "




#getwordPos CURRENTLINE $pos "Level 6"

getword currentline $ag 1
cuttext currentline $ag2 11 4
cuttext currentline $ag3 16 24
cuttext currentline $ag4 47 1
cuttext currentline $ag5 50 18
cuttext currentline $ag66 67 11
striptext $ag2 " "
striptext $ag3 " "
striptext $ag4 " "
striptext $ag5 " "
replaceText $ag66 "No Citadel" "0"
replaceText $ag66 "Level " ""

#what it is missing....corporate or personal planet add to the string below..... $Owner & " ^ " &

setVar $line1 $ag & " ^ " & $ag2 & " ^ " & $ag3 & " ^ " & $ag4 & " ^ " & $ag5 & " ^ " & $ag66 & " ^ "
setTextTrigger autoG2 :autoG2 " ("
pause
:autoG2
getword currentline $ag6 1
getword currentline $ag7 2
getword currentline $ag8 3
getword currentline $ag9 4
getword currentline $ag10 5
getword currentline $ag11 6
getword currentline $ag12 7
getword currentline $ag13 8
getword currentline $ag14 9
getword currentline $ag15 10
replaceText $ag6 "T" ",000"
replaceText $ag7 "(" ""
replaceText $ag7 ")" ""
replaceText $ag7 "M" ",000"
replaceText $ag7 "T" ",000"
replaceText $ag8 "T" ",000"
replaceText $ag8 "M" ",000,000"
replaceText $ag9 "T" ",000"
replaceText $ag9 "M" ",000,000"
replaceText $ag10 "T" ",000"
replaceText $ag10 "M" ",000,000"
replaceText $ag11 "T" ",000"
replaceText $ag11 "M" ",000,000"
replaceText $ag12 "T" ",000"
replaceText $ag12 "M" ",000,000"
replaceText $ag13 "T" ",000"
replaceText $ag13 "M" ",000,000"
replaceText $ag14 "T" ",000"
replaceText $ag14 "M" ",000,000"
replaceText $ag15 "T" ",000"
replaceText $ag15 "M" ",000,000"
replaceText $ag15 "B" ",000,000,000"
replaceText $ag15 "." ","

write $autoGenFile " " & $line1 & $ag6 & " ^ " & $ag7 & " ^ " & $ag8 & " ^ " & $ag9 & " ^ " & $ag10 & " ^ " & $ag11 & " ^ " & $ag12 & " ^ " & $ag13 & " ^ " & $ag14 & " ^ " & $ag15
pause
:agDone
send "q " #8 $agPnum "c"
setVar $prompt "Citadel"
waitfor "Planet command"
echo ANSI_12 "**Planet_Data" & ansi_11 & $autoGenFile "**"
killtrigger autoG
halt

[/code]

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/