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



Reply to topic  [ 4 posts ] 
 Using CIMM data in TWX scripts 
Author Message
Chief Warrant Officer
User avatar

Joined: Mon Mar 08, 2004 3:00 am
Posts: 193
Location: Canada
Unread post 
I'm trying to write a few scripts that will grab cim data, for example:

141 6040 100% - 2590 100% -21690 100%

now if I could get it to stop at each line, I could use getword to grab percentages, find amounts, get the sector # and save it to file to compare against the next cim. But I'm not sure what to use as a trigger, do I set it up so that every sector in game is a trigger? And then it check that the # is in the first word? It seems like it would be crazy to set up. Can anybody recomend a better way to do this?

_________________
A newb meets cit-killa early on day 4:

"1:31:39 AM P zyberi nice...almost had you
1:32:49 AM P zyberi ****ing bullshuit
1:32:56 AM P zyberi and you knwo it your Butt was grass
1:33:35 AM P zyberi you knockign me out set me back ****ign weeks with taht ****
1:34:27 AM P zyberi enjoy teh day you ****ign *****"


Mon Mar 21, 2005 10:40 am
Profile ICQ
Ensign

Joined: Tue Jan 11, 2005 3:00 am
Posts: 297
Location: USA
Unread post 
Well, like most scripting tasks, theres a number of ways you could go about it. They way I would do it is to have the script use a WaitFor ": " right after you enter CIM mode, that will halt execution and have the script waiting right at point where the next lines coming across the screen will be the info you are looking for, i.e. the port listings. Then set a TextLineTrigger to look for the % sign, since that is something that EVERY line you want will have, and finally a last trigger to detect when the CIM is over. So that snippet of code might look something like:

WaitFor ": "

:portlist
SetTextLineTrigger getport :getport "% "
SetTextLineTrigger done :done ": "
pause

:getport
killTrigger done
setVar $cline CURRENTLINE
##get port info from $cline here
goto :portlist

:done
killTrigger getport

Hope that helps, I left the part where you would actually get the port info pretty vague since I don't know what information you are looking for or how you plan on storing it. If I didnt make that clear enough or you have other questions, either reply here or drop me an ICQ at 211279673.

_________________
--==[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


Mon Mar 21, 2005 3:09 pm
Profile ICQ
Commander

Joined: Thu Feb 20, 2003 3:00 am
Posts: 1529
Location: USA
Unread post 
Why are you wanting to grab the raw data? TWX will record it for you then you can access it via PORT.PERCENTFUEL[sector], etc


Mon Mar 21, 2005 3:20 pm
Profile ICQ
Chief Warrant Officer
User avatar

Joined: Mon Mar 08, 2004 3:00 am
Posts: 193
Location: Canada
Unread post 
thank you both for your help.

_________________
A newb meets cit-killa early on day 4:

"1:31:39 AM P zyberi nice...almost had you
1:32:49 AM P zyberi ****ing bullshuit
1:32:56 AM P zyberi and you knwo it your Butt was grass
1:33:35 AM P zyberi you knockign me out set me back ****ign weeks with taht ****
1:34:27 AM P zyberi enjoy teh day you ****ign *****"


Mon Mar 21, 2005 4:30 pm
Profile ICQ
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: Bing [Bot] and 34 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.