| www.ClassicTW.com http://classictw.com/ |
|
| As usual, I am stumped. http://classictw.com/viewtopic.php?f=15&t=31650 |
Page 1 of 1 |
| Author: | Grey Gamer [ Mon Jun 06, 2011 5:20 pm ] |
| Post subject: | As usual, I am stumped. |
Hey guys, it has been a while. I hope that you have been doing well. For a while there I was just trying to maintain my game and make a few small advancements. Finally, though, I have a stable and usually fast Internet connection and time to use it, which is making a huge difference. I finally decided to write a script that I have wanted for a while. I kept procrastinating because it would be big, at least for me, and I figured that it would take a long time. I finally decided to write a small part of it that would still be useful, but once I had done that, each additional step seemed easy. End result: I have literally spent all day on it and it does not work. I will throw in a "goto" before and a "halt" after each part of my code and I have found some problems, but right now I am really confused. Basically, I have a series of checks, which either continue to the next part or skip to the end. Somehow it is skipping to the second-to-last segment, skips the last, and goes to the end. I have checked my labels, and the only way to get to that part is through a bunch of "echo"s that do not echo. At least I had not been crashing TWX Proxy, but it gave me an error message and now it suddenly says "Script compilation error: Access violation at address 00000000. Read of address 00000000" and the script does not load, but I just used another. Well, now is a good time to go to bed. |
|
| Author: | Singularity [ Mon Jun 06, 2011 5:52 pm ] |
| Post subject: | Re: As usual, I am stumped. |
Sounds like you have a flow control problem and it's causing you to jump around too much, the compiler is getting lost. It may also be a charset problem, but that's less likely. You can either post the code and we can take a look, or you can ICQ a scripter and someone can review it and find your error. |
|
| Author: | Grey Gamer [ Tue Jun 07, 2011 2:07 am ] |
| Post subject: | Re: As usual, I am stumped. |
I wish that I had just thought to hit [Ctrl] + z so see what change I had just made, I did not have any idea, and having spent all day on it, it was disheartening. It turned out that the error was something along the lines of: echo "I am scripting without a license!"* So, fixing that made a big difference, it started running again, but I do not have any idea how many other errors I have. Right now I am trying to make my own version of proMassCitBuilder. I just prefer writing my own scripts. That will get me podded some day. My original idea would do a corporate and then personal planet list, writing the sectors of populated planets in a file, although I guess that an array would make more sense. I figured that it would be a difficult project for me. I already had a simple script that would pull a load of fighters off of a planet. I decided that I would start out having it automatically land, determine how many loads of fighters to pull, and get to it. As I mentioned, once I got started I started integrating everything, without making sure that one part worked before another. This seemed to be working: # Warp to the next sector, engaging Transwarp if necessary send "*yqzn" waitFor "Warping to" setVar $getSector CURRENTLINE getWord $getSector $sector 4 setTextTrigger one :express "enough Fuel Ore" waitFor "Sector :" # try to fill up on sector fighters send "f" waitFor "Fighters, leaving" setVar $sectorFighters CURRENTLINE stripText $sectorFighters "," getWord $sectorFighters $fighters 10 send $fighters "*co" :getPlanet killTrigger one send "l" # Get planet number setTextTrigger zero :planet "> Planet" setTextTrigger half :terminate "<Q to abort> ?" pause halt :planet killTrigger half killTrigger eleven setVar $getPlanet CURRENTLINE stripText $getPlanet "<" stripText $getPlanet ">" getWord $getPlanet $planet 1 send $planet "*" :finished echo "finished" killAllTriggers # Check for additional planets # echo "$planet: " $planet "*" send "ql" waitFor $planet waitFor "Owned by:" setTextTrigger ten :planet "> Planet" setTextTrigger eleven :terminate "<Q to abort> ?" pause :terminate send "q*" halt It would land on each planet in a sector, blast off, and halt. When I had it check the citadels it did that properly, but would endlessly land on the second planet. You simply type in the sector number and start the script, it moves to the sector or triggers a "You are already in that sector!" and does its thing. Each of my planets is named "Planet," so in the beginning of the script it sees: <Preparing ship to land on planet surface> <Atmospheric maneuvering system engaged> Registry# and Planet Name Citadel RLvl Fighters QCanRLvl Cl ------------------------------------------------------------------------------ < 374> Planet Level 6 0% 5T 0% H Owned by: Empire [1] < 379> Planet Level 3 0% 422T 0% H Owned by: Grey Gamer < 387> Planet Level 3 0% 460T 0% H Owned by: Grey Gamer < 388> Planet Level 3 0% 457T 0% H Owned by: Empire [1] < 389> Planet Level 6 0% 505T 0% H Owned by: Empire [1] Land on which planet <Q to abort> ? watches for "> Planet" and grabs the preceding number, which is 374. At the end it waits for 374, then "Owned by," and then watches for "> Planet" to see if there is another planet, and lands on 379, but instead of grabbing 387 the next time around, it maintains 379. Can anyone give me some help besides telling me to write shorter messages? |
|
| Author: | Singularity [ Tue Jun 07, 2011 6:07 am ] |
| Post subject: | Re: As usual, I am stumped. |
Yeh, undo is nice. You're going to need a way to keep track of the current planet you're visiting. Something maybe like this... (oh, and try the code tags, they rock). Code: # Warp to the next sector, engaging Transwarp if necessary send "*yqzn" waitFor "Warping to" setVar $getSector CURRENTLINE getWord $getSector $sector 4 waitFor "Sector :" # try to fill up on sector fighters send "f" waitFor "Fighters, leaving" setVar $sectorFighters CURRENTLINE stripText $sectorFighters "," getWord $sectorFighters $fighters 10 send $fighters "*co" setVar $planet_idx 0 :getPlanet setVar $current_planet 0 add $planet_idx 1 send "l" :setPlanetListTriggers killTrigger zero killTrigger half setTextLineTrigger zero :planet "> Planet" setTextLineTrigger half :terminate "<Q to abort> ?" pause :terminate killTrigger zero killTrigger half send "q*" halt :zero killTrigger zero killTrigger half add $current_planet 1 if ($current_planet < $planet_idx) goto :setPlanetListTriggers end setVar $getPlanet CURRENTLINE stripText $getPlanet "<" stripText $getPlanet ">" getWord $getPlanet $planet 1 send $planet "*" waitFor "Planet command (?=help)" # whatever goes here # Next planet send "q" waitFor "Command [TL=" goto :getPlanet That's just off the top of my head, so it might not compile. But you get the idea. |
|
| Author: | Grey Gamer [ Tue Jun 07, 2011 12:01 pm ] |
| Post subject: | Re: As usual, I am stumped. |
Thanks! It does not actually do anything yet, but it works perfectly! |
|
| Author: | Crosby [ Tue Jun 07, 2011 4:03 pm ] |
| Post subject: | Re: As usual, I am stumped. |
Grey, if you want some scripts that don't do anything...I've a bunch for ya! Are you modding an existing script or from scratch? |
|
| Author: | Grey Gamer [ Tue Jun 07, 2011 5:32 pm ] |
| Post subject: | Re: As usual, I am stumped. |
Crosby, this is all scratch! I originally included most of the features that I wanted, but when the basic script did not work I focused on that, and I wanted to make things as easy as possible for whichever kind soul would hopefully help me. |
|
| Author: | Grey Gamer [ Sat Sep 17, 2011 12:49 am ] |
| Post subject: | Re: As usual, I am stumped. |
Singularity, I want you to know that I have used my planetary maintenance script with your code tags almost every day since you told me how to use them. I have read of players placing walls of fighters around FedSpace and the major trade lanes (is that the term?). I did that, but only after my planets with Class VI citadels were fully stocked. For some reason I never integrated that with your nearest port trader (which I have also used almost every day--where would I be without you?). I gave up on MCIC and just created my own ports. I guess that I could continue placing those throughout the galaxy, but I hate waiting for a CIM, so I decided to blow up all of the ports that I do not use and replace them when I can. I loaded my planetary maintenance script and started removing the parts that I would not need. I do not have any idea why I would have saved it, but my editor would not have, and I do not have a backup anywhere. Now I get to make it work all over again! I happened to look at another script that I started. All that I did was save a copy of my planetary trader with a different name. Why didn't I do that?! |
|
| Page 1 of 1 | All times are UTC - 5 hours |
| Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |
|