View unanswered posts | View active topics It is currently Sat Apr 18, 2026 4:40 am



Reply to topic  [ 6 posts ] 
 2 ship colo script problem 
Author Message
Ambassador
User avatar

Joined: Wed Nov 12, 2008 8:57 am
Posts: 3554
Location: Long Beach, CA
Unread post 2 ship colo script problem
This started as a simple macro to do 2 ship coloing in an unlimited. I added an edited version of one of prom's menus. The macro idea came from Xanos, and built up from there. I still plan to add a status window instead of the send "' Planet " $coloPlanet " product trips left: " index number "*" "" after each cycle. And some error checking for the variables and a navhaz check.

I am having a problem with this script. It works but in the equipment cycle, I am getting 9 extra trips and I cannot figure out why. I added the full script as an attachment.
Attachment:
___colomac.zip [1.28 KiB]
Downloaded 530 times


Code:
#This variable is for the planet to be colo'ed:  $coloPlanet
#This variable is for the ship you are in:  $ship1
#This variable is for the 2nd ship: $ship2
#This variable is for the sector outside fedspace: $sector1
#This variable is for the fed space sector (must be 3-7): $sector2
#This variable is for the number of trips to be dropped in fuel: $trips_f
#This variable is for the number of trips to be dropped in organics: $trips_o
#This variable is for the number of trips to be dropped in equipment: $trips_e

# Set the user input variable
setVar $i_coloPlanet 0
setVar $i_ship1 0
setVar $i_ship2 0
setVar $i_sector1 0
setVar $i_sector2 0
setVar $i_trips_f 0
setVar $i_trips_o 0
setVar $i_trips_e 0

# Load the script variables
loadVar $coloPlanet
loadVar $ship1
loadVar $ship2
loadVar $sector1
loadVar $sector2
loadVar $trips_f
loadVar $trips_o
loadVar $trips_e


#Removed the menu - see the attachment

#start the script run.
:beginWindow
#emply the holds of both ships
send " q j y"
send " x " $ship2 "**"
send " j y *"
send " x " $ship1 "**"
send "l " $coloPlanet " *"

#Fuel grab working fine, removed.
#uses $trips_f for the number of trips and $n as the index

#Organics grab working fine, removed.
#uses $trips_o for the number of trips and $i as the index

#Equ grab - here is the problem, I am getting 9 extra trips here
setvar $r 0
setvar $r $trips_e
while ($r>0)
   send "q w n " $ship2 " * " $sector2 " * 1 * l 1 * * * x * " $ship2 " * * l 1 * * * w n " $ship1 " * " $sector2 " * " $sector1 " * z a 999 * f 1 * c d * l " $coloPlanet " * s * l 3 * q x " $ship1 " * *l " $coloPlanet " * s * l 3 **"
   subtract $r 1
   send "' Planet " $coloPlanet " equipment trips left: " $r "*"
end
send "*"
halt

_________________
Helix
Do I really look like a guy with a plan? You know what I am? I'm a dog chasing cars.
Lest we forget
I had to ask myself WWSGD?


Mon Apr 09, 2012 7:58 pm
Profile WWW
Gameop

Joined: Mon Jan 15, 2007 2:41 am
Posts: 342
Unread post Re: 2 ship colo script problem
One thing I suggest is to build you macro in increments. This is a modified version of lonestars 2 ship mow colonizer.

while ($i <= $Trips)
setVar $trip_macro " w n " & $ship2 & "* "
setVar $trip_macro ($trip_macro & $twarp_macro)
if ($quikstats~PLANET_SCANNER = "Yes")
setVar $trip_macro ($trip_macro & " l 1* * * ")
else
setVar $trip_macro ($trip_macro & " l * * ")
end
setVar $trip_macro ($trip_macro & "x " & $ship2 & "* * ")
if ($ship2_PScan)
setVar $trip_macro ($trip_macro & " l 1* * * ")
else
setVar $trip_macro ($trip_macro & " l * * ")
end
setVar $trip_macro ($trip_macro & " w n " & $ship1 & "* ")
setVar $trip_macro ($trip_macro & $mow_from)
setVar $trip_macro ($trip_macro & " l z" & #8 & $planet & "* * J s n l " & $Product_Cat & "* j q * x " & $ship1 & "* * l z" & #8 & $planet & "* * J s n l " & $Product_carCat & "* j q ")
add $i 1
end

_________________
Where Chaos Reigns TW Server
chaos-twgs.com:23


Mon Apr 09, 2012 9:28 pm
Profile ICQ
Gameop

Joined: Mon Jan 15, 2007 2:41 am
Posts: 342
Unread post Re: 2 ship colo script problem
The macro actually has a lot more spaces but the forum deletes them. Look in LS's pack.. It is lsect script. I don't see the error with what you posted but I am not seeing straight right now. Little tired. Will look at the source tomorrow.

If you build your macro in increments it is easier to troubleshoot.

_________________
Where Chaos Reigns TW Server
chaos-twgs.com:23


Mon Apr 09, 2012 9:30 pm
Profile ICQ
Veteran Op
User avatar

Joined: Sat Dec 29, 2007 5:06 pm
Posts: 2059
Location: Oklahoma
Unread post Re: 2 ship colo script problem
Bounty Hunter if you use the "Code Option" it will keep all formatting, I ran into this a lot until I noticed how others were posting code. Hope this helps.

_________________
T0yman (Permanently Retired since 2012)
Proverbs 17:28 <-- Don't know it, most should it would stop a lot of the discussions on here.


Mon Apr 09, 2012 9:58 pm
Profile ICQ YIM WWW
Gameop
User avatar

Joined: Tue Nov 19, 2002 3:00 am
Posts: 1050
Location: USA
Unread post Re: 2 ship colo script problem
Helix wrote:
This started as a simple macro to do 2 ship coloing in an unlimited. I added an edited version of one of prom's menus. The macro idea came from Xanos, and built up from there. I still plan to add a status window instead of the send "' Planet " $coloPlanet " product trips left: " index number "*" "" after each cycle. And some error checking for the variables and a navhaz check.

I am having a problem with this script. It works but in the equipment cycle, I am getting 9 extra trips and I cannot figure out why. I added the full script as an attachment.



When in doubt Echo it out.

Helix,
I took a brief look at your code it looks solid, it's actually the same across f,o,e so it's likely not coming from the mac itself but from the index. Hard to believe since its a direct result of your Echo menu. However my recommendation is to add some Echo flag's to help track down the issue.

i.e.
Echo e_trips_index
*some code you think is causing the issue*
Echo e_trips_index


I'm sure your already doing this but without running your code its really hard to diagnose what is causing you the issue. Your code looks solid but it's likely something easy. For me adding Echo flags is a best practice and I highly recommend it.

Hope that helps

_________________
Dark Dominion TWGS
Telnet://twgs.darkworlds.org:23
ICQ#31380757, -=English 101 pwns me=-
"This one claims to have been playing since 1993 and didn't know upgrading a port would raise his alignment."


Sat Apr 14, 2012 10:31 am
Profile ICQ
Ambassador
User avatar

Joined: Wed Nov 12, 2008 8:57 am
Posts: 3554
Location: Long Beach, CA
Unread post Re: 2 ship colo script problem
Kaus wrote:
Helix wrote:
This started as a simple macro to do 2 ship coloing in an unlimited. I added an edited version of one of prom's menus. The macro idea came from Xanos, and built up from there. I still plan to add a status window instead of the send "' Planet " $coloPlanet " product trips left: " index number "*" "" after each cycle. And some error checking for the variables and a navhaz check.

I am having a problem with this script. It works but in the equipment cycle, I am getting 9 extra trips and I cannot figure out why. I added the full script as an attachment.



When in doubt Echo it out.

Helix,
I took a brief look at your code it looks solid, it's actually the same across f,o,e so it's likely not coming from the mac itself but from the index. Hard to believe since its a direct result of your Echo menu. However my recommendation is to add some Echo flag's to help track down the issue.

i.e.
Echo e_trips_index
*some code you think is causing the issue*
Echo e_trips_index


I'm sure your already doing this but without running your code its really hard to diagnose what is causing you the issue. Your code looks solid but it's likely something easy. For me adding Echo flags is a best practice and I highly recommend it.

Hope that helps

What I ended up doing was copying the macro from the organics drop to the equipment drop and changing the the drop category in the macro and everything is working now. I agree its something to do with the index.

H

_________________
Helix
Do I really look like a guy with a plan? You know what I am? I'm a dog chasing cars.
Lest we forget
I had to ask myself WWSGD?


Sat Apr 14, 2012 11:25 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 6 posts ] 

Who is online

Users browsing this forum: No registered users and 12 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.