View unanswered posts | View active topics It is currently Wed Apr 29, 2026 8:41 am



Reply to topic  [ 13 posts ] 
 CURRENTANSILINE 
Author Message
Commander
User avatar

Joined: Fri Jun 09, 2006 2:00 am
Posts: 1402
Location: Canada
Unread post 
I was wondering if someone coudl help me with a little mystery..

I'm trying to use CURRENTANSILINE, which I set to a Var.. and strip away "X[0m" ('X' being the escape control char: 01Bh).

The problem I'm experiencing is, that there appears to be a hidden 0Ah 0Dh (carriage return, Line Feed), at the end of the CURRENTANSILINE which I cannot seem to strip away.. tried to Strip #13 and #16

Any help would be much appreciated!



Lone

_________________
----------------------------
-= QUANTUM Computing 101: 15 = 3 x 5 ... 48% of the time.


Sat Oct 14, 2006 4:21 pm
Profile ICQ YIM
Veteran Op
User avatar

Joined: Thu Jun 02, 2005 2:00 am
Posts: 5558
Location: USA
Unread post 
Why not just use CURRENTLINE instead? :) It's all stripped and ready to go.

_________________
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
Image


Sat Oct 14, 2006 4:33 pm
Profile ICQ WWW
Commander
User avatar

Joined: Fri Jun 09, 2006 2:00 am
Posts: 1402
Location: Canada
Unread post 
quote:Originally posted by Singularity

Why not just use CURRENTLINE instead? :) It's all stripped and ready to go.


Short answer: Spoof Proofing

Not So Short: I have a temporary file created, for speed, populated with ANSI text, so reading a line from the file and parsing data -hence spoof proofing- nets me a string with a "*" appended..

_________________
----------------------------
-= QUANTUM Computing 101: 15 = 3 x 5 ... 48% of the time.


Sat Oct 14, 2006 4:46 pm
Profile ICQ YIM
Veteran Op
User avatar

Joined: Thu Jun 02, 2005 2:00 am
Posts: 5558
Location: USA
Unread post 
I'm saying you can spoof proof w/ currentansiline and then use currentline after you've done the spoof checking. Do the spoof proofing when you write to the file and then just write currentline instead.

_________________
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
Image


Sat Oct 14, 2006 5:15 pm
Profile ICQ WWW
Commander
User avatar

Joined: Fri Jun 09, 2006 2:00 am
Posts: 1402
Location: Canada
Unread post 
quote:Originally posted by Singularity

I'm saying you can spoof proof w/ currentansiline and then use currentline after you've done the spoof checking. Do the spoof proofing when you write to the file and then just write currentline instead.

I can try that, but imagine doing that while doing a holo-scan and saving it to file.. there'd be soo many If's And's Or Buts

Although, I think I've found the solution: I used getLength on the string which equals one more than it should (indicating the hidden control char).. so if I could only figure out how to get Chars 1 to 10, leaving the invisible 11th... the VB equiv: Left(str, 10)

_________________
----------------------------
-= QUANTUM Computing 101: 15 = 3 x 5 ... 48% of the time.


Sat Oct 14, 2006 5:32 pm
Profile ICQ YIM
Veteran Op
User avatar

Joined: Thu Jun 02, 2005 2:00 am
Posts: 5558
Location: USA
Unread post 
You don't really need to do that for a holoscan. send sh*, set your getline and just make sure the first word isn't "F", "R" or "P". You can always just use a cuttext to do what you're wanting tho.

_________________
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
Image


Sat Oct 14, 2006 6:38 pm
Profile ICQ WWW
Captain
User avatar

Joined: Sat Jun 18, 2005 2:00 am
Posts: 2214
Location: USA
Unread post 
Just to toss out a few thoughts on this, not sure how well any will actually work.

What about a stripText $variable “#42” or stripText $variable #42 (this one might just error out) or stripText $variable “*”

Or what about:
getLength CURRENTANSILINE $variableGL
cutText $variableFileWrite 1 $variableGL-1 (…or –2 or –3?)

…Or perhaps even after you verify it is not a spoof just

WRITE CURRENTLINE to your file for each pass?


I haven’t actually messed with CURRENTANSILINE as of yet, so these ideas are just theoretical at this point.

_________________
Your reliance upon subjective IRM's, subjugates you through utter omission, obfuscation, and distortion of fact!
Don't mess with me, I will 26 U.S.C. § 7212(a) your IRS!


Sat Oct 14, 2006 8:07 pm
Profile ICQ WWW
Commander
User avatar

Joined: Fri Jun 09, 2006 2:00 am
Posts: 1402
Location: Canada
Unread post 
Actually I found the problem. I can't believe I had to use Windows Calculator to discover this.. but it seems I'm a little rusty in converting HEX to DEC .. the two 'hidden' 0Ah and 0Dh (aka carriage return, line feed), are in fact decimal 10 and 13, respectively --not 13 and 16 I initally thought. It's been a long, long time since I've dealt with the base-16 numbering system.. so that's my excuse for not remembering '0Ah' comes after '09h' ...lol

Thanks Sing and RexxCrow for your help. And with my little project, spoof proofin while scanning to file is just not feasible. Far too much data to process (the holo-scan was just a 'for instance'.)


Thanks again;

Lone


[Edit to show the 'fix']

......stripText $temp #10
......stripText $temp #13

_________________
----------------------------
-= QUANTUM Computing 101: 15 = 3 x 5 ... 48% of the time.


Sat Oct 14, 2006 8:32 pm
Profile ICQ YIM
Gameop
User avatar

Joined: Tue Nov 19, 2002 3:00 am
Posts: 1050
Location: USA
Unread post 
would

:Check
Settextlinetrigger :Check2 Check "Word"
Pause
:Check2
Getword CURRENTLINE $Spoofproof 1
If ($spoofproof = "F") Or ($spoofproof = "P")or ($spoofproof = "R")
Getword CURRENTLINE $FU 2
Send "="
Send $Fu & "y" & "FU Spoofer*"
Killalltriggers
Goto :Check
End

Be abit excessive or something along those lines for spoof proofing?

_________________
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 Oct 14, 2006 10:32 pm
Profile ICQ
Veteran Op
User avatar

Joined: Thu Jun 02, 2005 2:00 am
Posts: 5558
Location: USA
Unread post 
lol. Might be a problem tho if they flood you, you'll end up flooding them. So they shut off private hails and flood the crap out of you till you drop or lag.

I usually just ignore spoofs and reset the triggers. Nice and quiet, low resource committment.

_________________
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
Image


Sun Oct 15, 2006 12:13 am
Profile ICQ WWW
Commander
User avatar

Joined: Fri Jun 09, 2006 2:00 am
Posts: 1402
Location: Canada
Unread post 
quote:Originally posted by Kaus

would

:Check
Settextlinetrigger :Check2 Check "Word"
Pause
:Check2
Getword CURRENTLINE $Spoofproof 1
If ($spoofproof = "F") Or ($spoofproof = "P")or ($spoofproof = "R")
Getword CURRENTLINE $FU 2
Send "="
Send $Fu & "y" & "FU Spoofer*"
Killalltriggers
Goto :Check
End

Be abit excessive or something along those lines for spoof proofing?


:Check
setTextlineTrigger Check :Check2 "Word"
Pause
:Check2
KillTrigger Check
getWord CURRENTLINE $Spoofproof 1
if (($Spoofproof = "F") OR ($Spoofproof = "P")OR ($Spoofproof = "R"))
getWord CURRENTLINE $FU 2
send "=" & $Fu & "*
setTextTrigger partial :partial "Do you mean"
setTextLineTrigger match :match "Secure comm-link established, Captain."
setTextLineTrigger nomatch :nomatch "Unknown Trader!"
pause
killAllTriggers
:nomatch
killAllTriggers
halt
:partial
killAllTriggers
send "y"
:match
killAllTriggers
waitfor "Type private message [<ENTER>"
send "FU Spoofer**"
goto :Check
end

Sing's right, it's always better to ignore spoof attempts, that way the competition doesn't know that they're having an effect.

_________________
----------------------------
-= QUANTUM Computing 101: 15 = 3 x 5 ... 48% of the time.


Sun Oct 15, 2006 1:57 am
Profile ICQ YIM
Commander
User avatar

Joined: Tue Oct 07, 2003 2:00 am
Posts: 1134
Location: Augusta, GA
Unread post 
Generally speaking, you want to avoid file I/O when possible. Writing to and reading from an array is much faster. Easier too once you follow arrays.

I have an ansi utility script that has been of major help for problems like this. I'll try to dust it off and post it on Grimy. It displays all the strange char codes as #8 or whatever, along with any normal text and symbols in a TWX window. It's output is copy/paste compatible with TWX, making all things dealing with CURRENTANSILINE simpler. If you don't see it on Grimy in a few days, bug me.

+EP+

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


Sun Oct 15, 2006 5:00 am
Profile WWW
Commander
User avatar

Joined: Tue Oct 07, 2003 2:00 am
Posts: 1134
Location: Augusta, GA
Unread post 
I've uploaded this ASCII parsing script to http://www.grimytrader.com for your enjoyment.

+EP+

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


Thu Oct 19, 2006 4:27 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 13 posts ] 

Who is online

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