www.ClassicTW.com
https://mail.black-squirrel.com/

LSDShopper v1.01
https://mail.black-squirrel.com/viewtopic.php?f=15&t=18275
Page 1 of 1

Author:  LoneStar [ Thu Dec 21, 2006 8:38 am ]
Post subject: 

Please Note Bug Fix:
Unfortunately, the initial version of LSDShopper v1.0, doesn't correctly detect presence of a Sector Fig before heading off to Dock and MACRO returning to starting sector.
I apologize for this seemingly obvious bug, and any inconvenience it may have caused. Fortunately I was able to catch it in time --hopefully.  As an aside.. the safety feature built in did work properly, that is, when I fused and ended back at Dock the macro did Land and redock safely.
Please find the Fixed Version (v1.01): Grimy Trader
Thank You
 

Author:  RexxCrow [ Thu Dec 21, 2006 9:11 am ]
Post subject: 

Hey LoneStar I sent you a PM, just letting you know cause I don't think these forums alert you to PM's... yet. I just found out I had a PM sitting in my box back from the 11th after I send my PM to you.

Author:  LoneStar [ Thu Dec 21, 2006 4:13 pm ]
Post subject: 

RexxCrow wrote:
Hey LoneStar I sent you a PM, just letting you know cause I don't think these forums alert you to PM's... yet. I just found out I had a PM sitting in my box back from the 11th after I send my PM to you.

Howdy.
Sent a reply; fyi.

Author:  LoneStar [ Fri Dec 22, 2006 5:44 pm ]
Post subject: 

Interesting 'glitch' discovered. snippet of my code/routine used to obtain a ship's PassWord:
Code:
:GetPassWord
send "co"
setTextTrigger PLine Line "tell it to.  Your last password was : "
pause
Line
killAllTriggers
getWordPos CURRENTLINE $pos ": "
if ($pos <> 0)
  cutText CURRENTLINE $pass ($pos + 1) 999
  if (($pass <> " ") AND ($pass <> ""))
    send $pass
  end
end
send "*"
setTextTrigger MakeCorp  :MakeCorp "Should this be a (C)orporate ship or (P)ersonal ship? "
setTextTrigger NotAnOption :NotAnOption "Computer command [TL="
pause
:MakeCorp
  killAllTriggers
  send "C"
:NotAnOption
  killAllTriggers
  send " Q "
  return

The 'glitch' is that an empty space (" "), gets pre-appended to the variable $pass. This is a problem because when the password is reset it becomes: " " & $pass  
I'm not sure why this is. I think it has something to do with the reverse text ANSI associated with the Game output at that juncture.
Needless to say, there's yet another update on Grimy's.

 

Author:  Cerne [ Fri Dec 22, 2006 7:25 pm ]
Post subject: 

Thanks. Why would people use ship passwords in this day and age?

Cernnunos

Author:  LoneStar [ Fri Dec 22, 2006 7:47 pm ]
Post subject: 

Cernnunos wrote:
Thanks. Why would people use ship passwords in this day and age?

Cernnunos

Don't rightly know. But it's one eventuality that I tried to accomidate --like sending this string of text from the citadel:
send " C  V  0*  Y  N" & $START_SECTOR & "* V  0*  Y  N" & STARDOCK & "*  U  Y  Q  Q  DS  N  L  1* S  N  L  2*  S  N  L  3*  T  N  L  2*  T  N  L  3*  T  N  T  1*  *  Q ** "
or checking to see if the STARDOCK variable is valid, etc etc.. 
 
 

Author:  ElderProphet [ Sat Dec 23, 2006 2:04 am ]
Post subject: 

You need to do ($pos + 2). $pos is the colon, so $pos + 1 is the space.

If you get stuck on something like that, you can always hit me up. 4 eyes are better than 2.

+EP+

Author:  LoneStar [ Sat Dec 23, 2006 2:10 am ]
Post subject: 

ElderProphet wrote:
You need to do ($pos + 2). $pos is the colon, so $pos + 1 is the space.

If you get stuck on something like that, you can always hit me up. 4 eyes are better than 2.

+EP+

Tried that. you get an error to the effect that you cannot cut past the end of a line (when a p/w is blank).  And, if a p/w isn't blank, then you still get the " " preappended..  it's crazy, but true.
I didn't post the fix.. but it's simply a test for a " " at the front of a string that's longer than 1 char, and simply removes the offending " " ... works like a charm (fingers crossed, knocking on wood, salt thrown over both shoulders).
 

Author:  ElderProphet [ Sun Dec 24, 2006 11:22 pm ]
Post subject: 

If the data you are hunting is at the end of a line, and there's a chance it will be missing, then you should do a test like this:
setVar $currentLine CURRENTLINE & "@@"

Be sure to use something that won't occur in the game, and append it to the end of the line. Then, assuming the text you are looking for only appears once, you can use getText, like this:
getText $currentLine $pass ": " "@@"

Alternately, you could get the length of the line and use it to compare with the $pos variable. I never use cutText like you did, putting in 999 as the length. I find it wiser to do something like this:
getLength CURRENTLINE $length
getWordPos CURRENTLINE $pos ": "
add $pos 2
if ($length > $pos)
     cutText CURRENTLINE $pass $pos ($length - $pos)
     send $pass
end
send "*"

Anyway, either approach should work. Let me know if you give them a try.

+EP+

Author:  LoneStar [ Mon Dec 25, 2006 8:15 am ]
Post subject: 

ElderProphet wrote:
If the data you are hunting is at the end of a line, and there's a chance it will be missing, then you should do a test like this:
setVar $currentLine CURRENTLINE & "@@"

Be sure to use something that won't occur in the game, and append it to the end of the line. Then, assuming the text you are looking for only appears once, you can use getText, like this:
getText $currentLine $pass ": " "@@"

Alternately, you could get the length of the line and use it to compare with the $pos variable. I never use cutText like you did, putting in 999 as the length. I find it wiser to do something like this:
getLength CURRENTLINE $length
getWordPos CURRENTLINE $pos ": "
add $pos 2
if ($length > $pos)
     cutText CURRENTLINE $pass $pos ($length - $pos)
     send $pass
end
send "*"

Anyway, either approach should work. Let me know if you give them a try.
+EP+

Hey EP,
The getText method worked nicely. I used two #27's at the end just to be sure the 'text' is unique.
With respect to the 999, I got that from the help scripting help-file. But I'm inclined to agree and avoid using 999, from now on.
Thanks very much for the assistance.
Lone
 

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/