| Author |
Message |
|
Maniac
Lieutenant J.G.
Joined: Sun Mar 13, 2005 3:00 am Posts: 387 Location: USA
|
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
_________________ Find out just what any people will quietly submit to and you have the exact measure of the injustice and wrong which will be imposed on them. Frederick Douglas
|
| Wed Apr 20, 2005 2:04 am |
|
 |
|
Traitor
Lieutenant Commander
Joined: Thu Mar 21, 2002 3:00 am Posts: 890 Location: USA
|
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  arseUnex " "
# 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
_________________ http://tw-cabal.navhaz.com - THE TW info site
Man, I gotta quit showing up here...next thing you know i'll get dragged back in.
|
| Wed Apr 20, 2005 3:21 am |
|
 |
|
Maniac
Lieutenant J.G.
Joined: Sun Mar 13, 2005 3:00 am Posts: 387 Location: USA
|
Traitor
Thanks for that info
You're a gentleman and a scholar.
_________________ Find out just what any people will quietly submit to and you have the exact measure of the injustice and wrong which will be imposed on them. Frederick Douglas
|
| Wed Apr 20, 2005 9:29 am |
|
 |
|
Zarkahn
Lieutenant
Joined: Sat Nov 06, 2004 3:00 am Posts: 600 Location: USA
|
Traitor.. shame on u, only plug I seen was ur sig. line
Visit http://www.tw-cabal.com - THE TW info site!
_________________ Its not the Kill, Its the Thrill of the Chase
S: Min: 297 Max: 437 Average: 410 -- Just here to attack aliens
S: High/Low Removed Average: 421
|
| Wed Apr 20, 2005 10:52 am |
|
 |
|
Draconis
Lieutenant J.G.
Joined: Wed Oct 15, 2003 2:00 am Posts: 437 Location: USA
|
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
|
| Wed Apr 20, 2005 11:24 am |
|
 |
|
Draconis
Lieutenant J.G.
Joined: Wed Oct 15, 2003 2:00 am Posts: 437 Location: USA
|
On another note.
GetSector will let you know if u have explored it.
Jhereg
|
| Wed Apr 20, 2005 11:27 am |
|
 |
|
Psion
Ensign
Joined: Tue Jan 11, 2005 3:00 am Posts: 297 Location: USA
|
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.
_________________ --==[The Outfit]==--
Member of The Foundation
Hereby it is manifest, that during the time men live without a common power to keep them all in awe, they are in that condition which is called war; and such a war, as is of every man, against every man. For WAR, consisteth not in battle only, or the act of fighting; but in a tract of time, wherein the will to contend by battle is sufficiently known.
--Hobbes, Leviathan
|
| Wed Apr 20, 2005 11:48 am |
|
 |
|
Draconis
Lieutenant J.G.
Joined: Wed Oct 15, 2003 2:00 am Posts: 437 Location: USA
|
You are correct Psion. I personally never import corpies databases, as I like to have my own  . If I have to, i export mine, and merge all into another, to look at data.
Jhereg
|
| Wed Apr 20, 2005 2:30 pm |
|
 |
|
Traitor
Lieutenant Commander
Joined: Thu Mar 21, 2002 3:00 am Posts: 890 Location: USA
|
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  arseUnex " "
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.
_________________ http://tw-cabal.navhaz.com - THE TW info site
Man, I gotta quit showing up here...next thing you know i'll get dragged back in.
|
| Wed Apr 20, 2005 6:29 pm |
|
 |
|
Zarkahn
Lieutenant
Joined: Sat Nov 06, 2004 3:00 am Posts: 600 Location: USA
|
lol, Jh uses his own cause of his Bag of Many Probes.... everyone else probley uses his file...lol
_________________ Its not the Kill, Its the Thrill of the Chase
S: Min: 297 Max: 437 Average: 410 -- Just here to attack aliens
S: High/Low Removed Average: 421
|
| Thu Apr 28, 2005 12:45 pm |
|
 |
|