| www.ClassicTW.com https://mail.black-squirrel.com/ |
|
| dny_simple_pgridder https://mail.black-squirrel.com/viewtopic.php?f=15&t=18225 |
Page 1 of 1 |
| Author: | LoneStar [ Thu Dec 14, 2006 3:36 pm ] |
| Post subject: | |
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 & " ::*" |
|
| Author: | Vid Kid [ Thu Dec 14, 2006 8:35 pm ] |
| Post subject: | |
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. |
|
| Author: | Singularity [ Thu Dec 14, 2006 10:54 pm ] |
| Post subject: | |
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. |
|
| Author: | ElderProphet [ Fri Dec 15, 2006 1:15 am ] |
| Post subject: | |
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+ |
|
| Author: | Singularity [ Fri Dec 15, 2006 1:02 pm ] |
| Post subject: | |
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 |
|
| Author: | River Rat [ Fri Dec 15, 2006 1:55 pm ] |
| Post subject: | |
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 |
|
| Author: | LoneStar [ Fri Dec 15, 2006 2:57 pm ] |
| Post subject: | |
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. |
|
| Author: | LoneStar [ Fri Dec 15, 2006 3:20 pm ] |
| Post subject: | |
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! |
|
| Author: | Silence [ Fri Dec 15, 2006 8:36 pm ] |
| Post subject: | |
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? |
|
| Author: | Vid Kid [ Sat Dec 16, 2006 1:09 am ] |
| Post subject: | |
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. |
|
| Page 1 of 1 | All times are UTC - 5 hours |
| Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |
|