View unanswered posts | View active topics It is currently Fri Apr 24, 2026 8:37 am



Reply to topic  [ 10 posts ] 
 Could someone help me with a couple of problems? 
Author Message
Lieutenant J.G.
User avatar

Joined: Sun Mar 13, 2005 3:00 am
Posts: 387
Location: USA
Unread post 
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
Profile ICQ
Lieutenant Commander
User avatar

Joined: Thu Mar 21, 2002 3:00 am
Posts: 890
Location: USA
Unread post 
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 :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

_________________
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
Profile WWW
Lieutenant J.G.
User avatar

Joined: Sun Mar 13, 2005 3:00 am
Posts: 387
Location: USA
Unread post 
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
Profile ICQ
Lieutenant

Joined: Sat Nov 06, 2004 3:00 am
Posts: 600
Location: USA
Unread post 
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
Profile ICQ WWW
Lieutenant J.G.

Joined: Wed Oct 15, 2003 2:00 am
Posts: 437
Location: USA
Unread post 
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
Profile ICQ YIM
Lieutenant J.G.

Joined: Wed Oct 15, 2003 2:00 am
Posts: 437
Location: USA
Unread post 
On another note.
GetSector will let you know if u have explored it.

Jhereg


Wed Apr 20, 2005 11:27 am
Profile ICQ YIM
Ensign

Joined: Tue Jan 11, 2005 3:00 am
Posts: 297
Location: USA
Unread post 
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
Profile ICQ
Lieutenant J.G.

Joined: Wed Oct 15, 2003 2:00 am
Posts: 437
Location: USA
Unread post 
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
Profile ICQ YIM
Lieutenant Commander
User avatar

Joined: Thu Mar 21, 2002 3:00 am
Posts: 890
Location: USA
Unread post 
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 :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.

_________________
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
Profile WWW
Lieutenant

Joined: Sat Nov 06, 2004 3:00 am
Posts: 600
Location: USA
Unread post 
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
Profile ICQ WWW
Display posts from previous:  Sort by  
Reply to topic   [ 10 posts ] 

Who is online

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