View unanswered posts | View active topics It is currently Sun Apr 19, 2026 7:11 pm



Reply to topic  [ 7 posts ] 
 Re-release of ShipScrubber (source) 
Author Message
Boo! inc.
User avatar

Joined: Sat Oct 09, 2004 2:00 am
Posts: 865
Location: USA
Unread post Re-release of ShipScrubber (source)
Due to enlightenment in another thread I thought for now on my public scripts will all be open source. I by no means think Im a master scriptor but this simple little thing might help others grasp a little start for themselves. Please as with anything if you use/edit the script just give credit or ask me. DEFINITLY if you improve it let me know maybe drop me a copy, seems fair 8)

Will be uploaded to grimy and Sing's site here in the next hour or so..
Thanks to all involved for your support and thanks EP..

-mob

EDIT: Only thing I added to it was comments at top..

_________________
“The object of war is not to die for your corp but to make the other bastard die for his.”

Boo! inc.


Wed Mar 18, 2009 7:19 am
Profile
Commander
User avatar

Joined: Tue Oct 07, 2003 2:00 am
Posts: 1134
Location: Augusta, GA
Unread post Re: Re-release of ShipScrubber (source)
Good work on making it .ts. I'll take a look at some point and see what constructive feedback I can give.

+EP+

_________________
Claim to Fame: only guy to ever crack the TW haggle algorithm, and fig/shield/hold price formula, twice.


Wed Mar 18, 2009 7:23 pm
Profile WWW
Boo! inc.
User avatar

Joined: Sat Oct 09, 2004 2:00 am
Posts: 865
Location: USA
Unread post Re: Re-release of ShipScrubber (source)
ElderProphet wrote:
Good work on making it .ts. I'll take a look at some point and see what constructive feedback I can give.

+EP+


I know your busy, so thank you EP. Its actually very simple....I think there are more lines for the quickstats then for my routines.

In the end I had a thought about it and there are some scripts out there I wish I could see how they did it, so why not my little thing. Anyways open source for the masses to enjoy:P

_________________
“The object of war is not to die for your corp but to make the other bastard die for his.”

Boo! inc.


Wed Mar 18, 2009 7:27 pm
Profile
Boo! inc.
User avatar

Joined: Sat Oct 09, 2004 2:00 am
Posts: 865
Location: USA
Unread post Re: Re-release of ShipScrubber (source)
Updated shipscrubber...

-Nothing major, added a port check before even checking for ships.
-Rearranged script and fixed my While/If routines (Thanks EP!).
-Added more comments for those who would like to examine for their use.

I know this isn't a really "elite" script, but I really encourage new scriptors to start with something that is useful and not overly complicated. I hope someone find this useful to learn from or in its actual use, as always if you have any questions post here or drop me a note on ICQ.

-mob

_________________
“The object of war is not to die for your corp but to make the other bastard die for his.”

Boo! inc.


Sun Mar 22, 2009 7:34 am
Profile
Boo! inc.
User avatar

Joined: Sat Oct 09, 2004 2:00 am
Posts: 865
Location: USA
Unread post Re: Re-release of ShipScrubber (source)
UPDATE: ShipScrubberv1.8 - OPEN SOURCE - Its not a real complicated script but if anyone can learn anything from it by all means please check it out. This script basically scrubs ALL OWNED ships at any class 0 port, then xports back into starting ship. Does not check for cash flow, also will not stop you from getting popped if not fedsafe. If you can make improvements please do, and let me know so maybe I can add it to a new release.

**Tip**
Use m()m ">moveship [sector]" to get your ships to specific sector. Run ShipScrubber v1.8 and return your ships home.

------

I didn't realize I never updated http://www.navhaz.com with the open source/updated version of shipscrubber. Sorry, has been updated to any of you who care.

-mob

_________________
“The object of war is not to die for your corp but to make the other bastard die for his.”

Boo! inc.


Fri Dec 18, 2009 10:17 pm
Profile
Gunnery Sergeant
User avatar

Joined: Mon Mar 12, 2007 3:40 am
Posts: 25
Location: North American Union
Unread post Re: Re-release of ShipScrubber (source)
Couple pointers:

-Try starting with a call to quickstats first thing. CurrentSector isn't always accurate.
-Consider starting from the Port prompt instead of Command Prompt.
-Check if person is Fed Safe.
-Check to see if a ship is already in Tow.
-Check to make sure there's enough turns
-do a check with every xport to make sure you're still in the starting sector
-If not 'safe' you can a list of ships at Dock by going to 'SellShips' and then do a rapid xport-scrub
-Script should check to see if the respective port exist... though porting at a blown port will technically scrub a ship. heh
-Do a cash on hand check.
-Related to having enough cash on hand. if you remove the right space(s) from your macro strings you can detect if a limp has actually been removed, then reconcile number of ships -vs- scrubbed.

Just my $0.02
Code:
gosub :quikstats
if ($current_prompt <> "Command")
  echo "***Must Start From Command Prompt!!!***"
  halt
end

#If you don't make it past this point, please don't ever run this script again! : )
if ($CURRENT_SECTOR <> STARDOCK) AND ($CURRENT_SECTOR <> 1) AND (PORT.CLASS[$CURRENT_SECTOR] <> 0)
  echo "***..Maybe you should retire..***"
  echo "***..You MUST be at a class0 or stardock to scrub..***"
  HALT
end

setVar $count 0
###this line isn't needed working with small dynamic arrays wont impact performance
#setarray $ships SECTOR.SHIPCOUNT[$CURRENT_SECTOR]

#Added an an extra w incase u still have ship in tow (OOoopps!)
killalltriggers
send "wwn*"
waiton "----------------------------------------------"

settextlinetrigger noships  :noships "You do not own any other ships in this sector!"
settextlinetrigger ship   :ship " " & $CURRENT_SECTOR & " "
settextlinetrigger done  :done "Choose which ship to tow (Q=Quit)"
pause

#common, why run this script if you have no ships??
:noships
killalltriggers
echo "**No Ships...**"
if ($CURRENT_SECTOR = STARDOCK)
  send "p s g y g q q q * *"
end
if (($CURRENT_SECTOR = 1) OR (PORT.CLASS[$CURRENT_SECTOR] = 0))
  send "p t y q *"
end
halt

#Adding ships to array
:ship
killtrigger noships
getword currentline $line 1
isnumber $test $line
if ($test)
add $count 1
setvar $ships[$count] $line
end
setTextlinetrigger ship   :ship " " & $CURRENT_SECTOR & " "
pause

#Finished processing
:done
killalltriggers
setvar $string ""
if ($CURRENT_SECTOR = STARDOCK)
   while ($count > 0)
      setvar $string ($string & "x   " & $ships[$count] & "*   *   p s g y g q q  ")
      subtract $count 1
   end
  setvar $string ($string & "x   " & $SHIP_NUMBER & "*    *    p s g y g q q  ")
elseif (($CURRENT_SECTOR = 1) OR (PORT.CLASS[$CURRENT_SECTOR] = 0))
   while ($count > 0)
      setvar $string ($string & "x    " & $ships[$count] & "*    *    p t y q  ")
      subtract $count 1
   end
   setvar $string ($string & "x    " & $SHIP_NUMBER & "*    *    p t y q  ")
end
send $string
halt


Sat Dec 19, 2009 7:09 am
Profile
Boo! inc.
User avatar

Joined: Sat Oct 09, 2004 2:00 am
Posts: 865
Location: USA
Unread post Re: Re-release of ShipScrubber (source)
Thank you Decker for your feedback. I will take a look and see what will be worth updating!

_________________
“The object of war is not to die for your corp but to make the other bastard die for his.”

Boo! inc.


Sat Dec 19, 2009 7:29 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 7 posts ] 

Who is online

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