| www.ClassicTW.com https://mail.black-squirrel.com/ |
|
| Could someone help me with a couple of problems? https://mail.black-squirrel.com/viewtopic.php?f=15&t=13118 |
Page 1 of 1 |
| Author: | Maniac [ Wed Apr 20, 2005 2:04 am ] |
| Post subject: | |
Howdy I am currently having trouble grabbing the CKU (Unexplored) data in twx using twxproxy. I am having problems grabbing the currentline after the "You have NOT explored the following sectors:" IIRC there is an empty line after this line. If I use a wait for/on I can't capture the start of the data because of the empty line. Could/Should I set up 9 text triggers i.e 1-9 to get the first line that contains the sector #'s I need? I would like to be able to gather the sectors to a file and use them with another grid script. Any assistance would be appreciated. Thanks |
|
| Author: | Traitor [ Wed Apr 20, 2005 3:21 am ] |
| Post subject: | |
Try waiting for the double spaces. Like the following. It creates an array, called $UnexploredSectors. Unexplored sectors are marked with a 1. explored sectors are marked with a 0. :makeArrayUnex setarray $UnexploredSectors SECTORS send "cku" waitfor "sectors:" settexttrigger parseUnexDone :parseUnexDone "Computer" :getUnexArray setvar $wordnum 1 settextlinetrigger ParseUnex # The line above is waiting on 2 spaces. EIS formatting makes it # look like there is only one, but it's two. pause :parseUnex while ($wordnum <= 11) getword CURRENTLINE $unexSec $wordNum if ($unexsec = 0) goto :getUnexarray end setvar $UnexploredSectors[$unexSec] 1 add $wordnum 1 end goto :getUnexArray :parseUnexDone killtrigger parseUnex send "q" I more or less ripped it out of my old probe script. And, while looking it over, I figured out a better way of doing it. But this does work. edited to match corrected script posted below |
|
| Author: | Maniac [ Wed Apr 20, 2005 9:29 am ] |
| Post subject: | |
Traitor Thanks for that info You're a gentleman and a scholar. |
|
| Author: | Zarkahn [ Wed Apr 20, 2005 10:52 am ] |
| Post subject: | |
Traitor.. shame on u, only plug I seen was ur sig. line Visit http://www.tw-cabal.com - THE TW info site! |
|
| Author: | Draconis [ Wed Apr 20, 2005 11:24 am ] |
| Post subject: | |
SetTextLineTrigger TriggerName :Function Don't enter the third parameter, than it will grab each line. Check each line for first Word being a number, if not don't use. If computer, end. Jhereg |
|
| Author: | Draconis [ Wed Apr 20, 2005 11:27 am ] |
| Post subject: | |
On another note. GetSector will let you know if u have explored it. Jhereg |
|
| Author: | Psion [ Wed Apr 20, 2005 11:48 am ] |
| Post subject: | |
Two things J, one - yes thats how I would do it, with a blank line. Easier, IMHO. Two - GetSector can get confused if you have imported a corpie's TWX file. Any sector that they have explored, it will you treat as if you had explored it as well and it is just blocked now. If it is important for whatever reason to have a list of all sectors unexplored by that particular player, then grabbing then from the CKU is pry best. |
|
| Author: | Draconis [ Wed Apr 20, 2005 2:30 pm ] |
| Post subject: | |
You are correct Psion. I personally never import corpies databases, as I like to have my own Jhereg |
|
| Author: | Traitor [ Wed Apr 20, 2005 6:29 pm ] |
| Post subject: | |
Nope, not my best work there. Found a slight error too, trigger name mismatch while trying to clean it up. (though it still worked..heh) Back when I first started writing twx, I used numbers for trigger names cause I didn't know any better. Switched to using names a long time ago. Anyway, here is a more up to date version that works the way it's supposed too. Only 22 lines when all is said and done. And remember, the trigger ParseUnex is looking for 2 spaces, not 1. The stupid forum reformats things and kills extra spaces and tabs. :makeArrayUnex setarray $UnexploredSectors SECTORS send "cku" waitfor "sectors:" settexttrigger parseUnexDone :parseUnexDone "Computer" :getUnexArray setvar $wordnum 1 settextlinetrigger ParseUnex pause :parseUnex while ($wordnum <= 11) getword CURRENTLINE $unexSec $wordNum if ($unexsec = 0) goto :getUnexarray end setvar $UnexploredSectors[$unexSec] 1 add $wordnum 1 end goto :getUnexArray :parseUnexDone killtrigger parseUnex send "q" And Jher, The other way is more code I think. |
|
| Author: | Zarkahn [ Thu Apr 28, 2005 12:45 pm ] |
| Post subject: | |
lol, Jh uses his own cause of his Bag of Many Probes.... everyone else probley uses his file...lol |
|
| Page 1 of 1 | All times are UTC - 5 hours |
| Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |
|