|
|
Register •
FAQ
• Search • Login
|
|
Page 1 of 1
|
[ 4 posts ] |
|
Using CIMM data in TWX scripts
| Author |
Message |
|
Gemini
Chief Warrant Officer
Joined: Mon Mar 08, 2004 3:00 am Posts: 193 Location: Canada
|
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 |
|
 |
|
Psion
Ensign
Joined: Tue Jan 11, 2005 3:00 am Posts: 297 Location: USA
|
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 |
|
 |
|
Harley Nuss
Commander
Joined: Thu Feb 20, 2003 3:00 am Posts: 1529 Location: USA
|
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 |
|
 |
|
Gemini
Chief Warrant Officer
Joined: Mon Mar 08, 2004 3:00 am Posts: 193 Location: Canada
|
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 |
|
 |
|
|
Page 1 of 1
|
[ 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
|
|