| Author |
Message |
|
LoneStar
Commander
Joined: Fri Jun 09, 2006 2:00 am Posts: 1402 Location: Canada
|
Hello Sing.
Thanks for making your simple pgridder avail on Grimy's. While studying the code I noticed the saveme call (Line 112):
send "'" & $current_sector & "=saveme*"
unless I'm mistaken, the save sector needs to be padded with leading Zero's.
for the benifit of others here's what should preceede the savme call:
Code: if ($current_sector < 10) setVar $save_sector "0000" & $current_sector elseif ($current_sector < 100) setVar $save_sector "000" & $current_sector elseif ($current_sector < 1000) setVar $save_sector "00" & $current_sector elseif ($current_sector < 10000) setVar $save_sector "0" & $current_sector else setVar $save_sector $current_sector end
send "'" & $save_sector & "=saveme*" send "'pickup " & $current_sector & " ::*"
_________________ ---------------------------- -= QUANTUM Computing 101: 15 = 3 x 5 ... 48% of the time.
|
| Thu Dec 14, 2006 3:36 pm |
|
 |
|
Vid Kid
Commander
Joined: Sun Feb 25, 2001 3:00 am Posts: 1838 Location: Guam USA
|
You may try this instead :
# Vid Kid/CareTaker
# this is to pad for saveme
GetInput $maintarget " What Sector ?"
SetVar $killtarget $maintarget
GetLength $maintarget $tmp3
SetVar $tmp1 "0"
SetVar $tmp "1"
SetVar $temp (5 - $tmp3)
IF ($temp = "0")
Goto :end
End
While ($tmp <= $temp)
MergeText $tmp1 $maintarget $maintarget
Add $tmp 1
End
Subtract $tmp "1"
Echo ANSI_11 "* " $temp " - " $tmp3 " - " $maintarget
:end
Halt
change things as needed , this was pulled from one of my scripts , so variables wont match yours but are easly changable.
enjoy
p.s. as a side note , ck_saveme will work with or without the leading zero's
its oz's scripts that require them if memory servers me right.
_________________ 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
 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
|
| Thu Dec 14, 2006 8:35 pm |
|
 |
|
Singularity
Veteran Op
Joined: Thu Jun 02, 2005 2:00 am Posts: 5558 Location: USA
|
You don't have to pad it w/ 0s. It'll work either way.
No idea if Oz's works w/ or w/o, but since you can't use a twarp saveme w/ a planet gridder that's a bit moot. My saveme works fine w/o it and I know CK's does as well since people use it all the time.
_________________ May the unholy fires of corbomite ignite deep within the depths of your soul...
1. TWGS server @ twgs.navhaz.com 2. The NavHaz Junction - Tradewars 2002 Scripts, Resources and Downloads 3. Open IRC chat @ irc.freenode.net:6667 #twchan 4. Parrothead wrote: Jesus wouldn't Subspace Crawl.
*** SG memorial donations via paypal to: dpocky68@booinc.com
|
| Thu Dec 14, 2006 10:54 pm |
|
 |
|
ElderProphet
Commander
Joined: Tue Oct 07, 2003 2:00 am Posts: 1134 Location: Augusta, GA
|
Cool, a scripting session. Regardless of what Sing says, I just wanted to post the above routines using a while loop.
setVar $save_sector $current_sector
getLength $save_sector $length
while ($length < 5)
setVar $save_sector "0" & $save_sector
getLength $save_sector $length
end
send "'" & $save_sector & "=saveme*"
send "'pickup " & $current_sector & " ::*"
+EP+
_________________ Claim to Fame: only guy to ever crack the TW haggle algorithm, and fig/shield/hold price formula, twice.
|
| Fri Dec 15, 2006 1:15 am |
|
 |
|
Singularity
Veteran Op
Joined: Thu Jun 02, 2005 2:00 am Posts: 5558 Location: USA
|
Well, here's the thing...
Why waste the CPU cycles doing that when it's absolutely unneccessary in any form? If you're using a saveme that is so horribly inflexible as to break when it misses a 0... it's time to write a new one.
And don't use the pickup line, you don't need it if you're using a half-modern version of saveme. Save your poor corpies the added scroll.
Incase the name didn't... uhm, tip people off. I called it "simple" pgridder, not... "complex example of code that does stuff that's not really needed but looks pretty if you're a programmer" pgridder  .
_________________ May the unholy fires of corbomite ignite deep within the depths of your soul...
1. TWGS server @ twgs.navhaz.com 2. The NavHaz Junction - Tradewars 2002 Scripts, Resources and Downloads 3. Open IRC chat @ irc.freenode.net:6667 #twchan 4. Parrothead wrote: Jesus wouldn't Subspace Crawl.
*** SG memorial donations via paypal to: dpocky68@booinc.com
|
| Fri Dec 15, 2006 1:02 pm |
|
 |
|
River Rat
Chief Warrant Officer
Joined: Sat Feb 24, 2001 3:00 am Posts: 145
|
Singularity wrote: Well, here's the thing...
And don't use the pickup line, you don't need it if you're using a half-modern version of saveme. Save your poor corpies the added scroll.
If you happen to use the rev's saveme it reqires the pickup
_________________ twgs.alienbase.net www.alienbase.net
|
| Fri Dec 15, 2006 1:55 pm |
|
 |
|
LoneStar
Commander
Joined: Fri Jun 09, 2006 2:00 am Posts: 1402 Location: Canada
|
Singularity wrote: Why waste the CPU cycles doing that when it's absolutely unneccessary in any form? If you're using a saveme that is so horribly inflexible as to break when it misses a 0... it's time to write a new one. Incase the name didn't... uhm, tip people off. I called it "simple" pgridder, not... "complex example of code that does stuff that's not really needed but looks pretty if you're a programmer" pgridder  .
For some reason I've never gotten ck's to work w/o the leading zeros --I see now was probably due to fatfingeritis.
Ya; it's a simple pgridder --on the surface.. but there sure is some hidden complexity in it (ie landing safely using the backspace char (Pound-8, which you hinted at in your macro tutorial .
Anyway, thanks again for posting it. Maybe oneday I'll be brave enough to post something uncompiled.
_________________ ---------------------------- -= QUANTUM Computing 101: 15 = 3 x 5 ... 48% of the time.
|
| Fri Dec 15, 2006 2:57 pm |
|
 |
|
LoneStar
Commander
Joined: Fri Jun 09, 2006 2:00 am Posts: 1402 Location: Canada
|
ElderProphet wrote: setVar $save_sector $current_sector getLength $save_sector $length while ($length < 5) setVar $save_sector "0" & $save_sector getLength $save_sector $length end send "'" & $save_sector & "=saveme*" send "'pickup " & $current_sector & " ::*"
Hey, you forgot the: Add $length 1 ...lol j/k.
I've often wondered the efficiency of Script cmd (function calls), for example how C/C++ equates ++A down to INC AX (increment accumilator register)... not only that but also how GOSUB, Array Memory Allocation, are handled (better to keep Subroutines close or even inline, or, shrink Static Array(s) when done with them)
can't wait to test these things out with Timer function in the new twx version!
_________________ ---------------------------- -= QUANTUM Computing 101: 15 = 3 x 5 ... 48% of the time.
|
| Fri Dec 15, 2006 3:20 pm |
|
 |
|
Silence
Commander
Joined: Tue Mar 26, 2002 3:00 am Posts: 1416 Location: Canada
|
River Rat wrote: If you happen to use the rev's saveme it reqires the pickup
Like he said, when was the last time Rev updated his saveme?
|
| Fri Dec 15, 2006 8:36 pm |
|
 |
|
Vid Kid
Commander
Joined: Sun Feb 25, 2001 3:00 am Posts: 1838 Location: Guam USA
|
I hope I'm not mistaken , but I believe SupG's script out ther also requires the pickup ..
but for compatibilty reasons this padding was added and pickup left in to many of the attack and save scripts.
As far as a saveme for a pgridder .. there isnt any reason another corpie couldn't do a twarp-bwarp save if your podded ..
But thats just me.
Great examples guys.
_________________ 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
 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 Dec 16, 2006 1:09 am |
|
 |
|