| www.ClassicTW.com https://mail.black-squirrel.com/ |
|
| CURRENTANSILINE https://mail.black-squirrel.com/viewtopic.php?f=15&t=17909 |
Page 1 of 1 |
| Author: | LoneStar [ Sat Oct 14, 2006 4:21 pm ] |
| Post subject: | |
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 |
|
| Author: | Singularity [ Sat Oct 14, 2006 4:33 pm ] |
| Post subject: | |
Why not just use CURRENTLINE instead? |
|
| Author: | LoneStar [ Sat Oct 14, 2006 4:46 pm ] |
| Post subject: | |
quote:Originally posted by Singularity Why not just use CURRENTLINE instead? 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.. |
|
| Author: | Singularity [ Sat Oct 14, 2006 5:15 pm ] |
| Post subject: | |
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. |
|
| Author: | LoneStar [ Sat Oct 14, 2006 5:32 pm ] |
| Post subject: | |
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) |
|
| Author: | Singularity [ Sat Oct 14, 2006 6:38 pm ] |
| Post subject: | |
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. |
|
| Author: | RexxCrow [ Sat Oct 14, 2006 8:07 pm ] |
| Post subject: | |
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. |
|
| Author: | LoneStar [ Sat Oct 14, 2006 8:32 pm ] |
| Post subject: | |
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 |
|
| Author: | Kaus [ Sat Oct 14, 2006 10:32 pm ] |
| Post subject: | |
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? |
|
| Author: | Singularity [ Sun Oct 15, 2006 12:13 am ] |
| Post subject: | |
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. |
|
| Author: | LoneStar [ Sun Oct 15, 2006 1:57 am ] |
| Post subject: | |
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. |
|
| Author: | ElderProphet [ Sun Oct 15, 2006 5:00 am ] |
| Post subject: | |
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+ |
|
| Author: | ElderProphet [ Thu Oct 19, 2006 4:27 am ] |
| Post subject: | |
I've uploaded this ASCII parsing script to http://www.grimytrader.com for your enjoyment. +EP+ |
|
| Page 1 of 1 | All times are UTC - 5 hours |
| Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |
|