| Author |
Message |
|
Zentock
Lieutenant J.G.
Joined: Mon Sep 22, 2003 2:00 am Posts: 486 Location: USA
|
I need a script twx or zoc, that will echo text files to the terminal. why because i want to beable to launch the files to the screen so that while i am doing things i can quickly call up my data files or planet charts. or ship files. what i am really needing it for is as im building games i want to clik a few times get the text i need echoed and keep on going.
i have not seen anything like this.
i have asked 2 scripters to send me there ideas, now i want the community to.
i know that as soon as this script hits the topic other sysops will be wanting it also
so thank you in advance from all of us.
_________________ C.E.O. Corp Noble House Sysop - Zentock's Realm TWGS Co-Sysop - Vulcans Forge TWGS
Admin. Vulcans Forge Forums Vulcans Forge TeamSpeak
|
| Wed Dec 13, 2006 7:27 pm |
|
 |
|
Promethius
Ambassador
Joined: Mon Feb 09, 2004 3:00 am Posts: 3141 Location: Kansas
|
I would probably use a TWX window with scrolling, up and down as necessary, to display the files rather than an output to the telnet client screen. This would keep the screen cleaner and allow the window to remain thile you work for referance.
The file read would depend on how the data is to be provided, static files or T-Edit. It sounds like static files. If the names are consistent in the manner of GAMENAME & "ships.txt" then a menu access would work, otherwise you would have to remember and enter the file name for each. A consistent file naming would make the script fairly simple.
_________________
/ Promethius / Enigma / Wolfen /
"A man who has no skills can be taught, a man who has no honor has nothing."
|
| Wed Dec 13, 2006 8:03 pm |
|
 |
|
maidenariana
Gameop
Joined: Mon Aug 25, 2003 2:00 am Posts: 233 Location: USA
|
Zentock,
Please post an order of events for me so I can better understand what you are looking for. As in the way you currently do it and the way you would like to do it.
Thanks.
_________________ twgs: telnet: reviving this in Sep 2019 web: http://www.roguegalaxy.com
|
| Wed Dec 13, 2006 8:17 pm |
|
 |
|
Singularity
Veteran Op
Joined: Thu Jun 02, 2005 2:00 am Posts: 5558 Location: USA
|
Well, 2.02 doesn't handle windows very well... and doesn't offer scrolling, IIRC. So you're pretty much stuck w/ the main window.
This should work...
Code: setVar $line_idx 1 setVar $file "filename.txt" fileExists $exists $file if ($exists = 0) echo "**File doesn't exist!*" halt end echo "*"
:read_file_line read $file $file_line $line_idx if ($file_line = EOF) OR ($file_line = "EOF") goto :end_of_file end echo ANSI_9 & $file_line & "*" add $line_idx 1 goto :read_file_line
:end_of_file
Mod as needed depending on how you want to get the file name.
_________________ May the unholy fires of corbomite ignite deep within the depths of your soul...
1. TWGS server @ twgs.navhaz.com 2. The NavHaz Junction - Tradewars 2002 Scripts, Resources and Downloads 3. Open IRC chat @ irc.freenode.net:6667 #twchan 4. Parrothead wrote: Jesus wouldn't Subspace Crawl.
*** SG memorial donations via paypal to: dpocky68@booinc.com
|
| Wed Dec 13, 2006 11:18 pm |
|
 |
|
Promethius
Ambassador
Joined: Mon Feb 09, 2004 3:00 am Posts: 3141 Location: Kansas
|
True on 2.02 not handling windows and scrolling. In 2.03 and 2.04 you have to write your own scrolling routines similar to the way I "scroll" in my ship analysis script. Basically read the entire file into an array and then using setTextOutTrigger +/- your way through the array to give a scrolling effect in the window.
A very rough idea of what I did is below and not the complet code. This is just to show the basic idea and probably has errors in it since I am not using my actual script code:
Code: # read the file into an array gosub :readFile
:beginScroll # space between : p to get ride of the smiley # get the trigger keys to make the window work setTextOutTrigger plus : plus "+" setTextOutTrigger minus :minus "-" setTextOutTrigger tilde :tilde "~" pause
: plus add $scroll 1 # maxLines is the number of lines in the file that was read if ($scroll > $maxLines) setVar $scroll 1 end goto : display :minus subtract $scroll 1 if ($scroll = 0) setVar $scroll $maxLines end goto : display :tilde halt
# display the window and handle the number of lines : display # space to eliminate a smiley like
_________________
/ Promethius / Enigma / Wolfen /
"A man who has no skills can be taught, a man who has no honor has nothing."
|
| Thu Dec 14, 2006 2:12 am |
|
 |
|
LoneStar
Commander
Joined: Fri Jun 09, 2006 2:00 am Posts: 1402 Location: Canada
|
People more capable than me are probably workign on this. but it seems that the best soltution to a lack of a 'Dir()' function is to store file-names (with path), in a text file and build a Menu from that Text file, and have the contents of those files echoed at the terminal window like Zentock detailed.
Heck, you can even build in a [Pause] for those really long file, and even display ANSI stuff..
_________________ ---------------------------- -= QUANTUM Computing 101: 15 = 3 x 5 ... 48% of the time.
|
| Thu Dec 14, 2006 3:02 am |
|
 |
|
Zentock
Lieutenant J.G.
Joined: Mon Sep 22, 2003 2:00 am Posts: 486 Location: USA
|
What im haveing to do now is have multiple ConText tabs open in addition to zoc and twx, i use twx for logins and the few scripts i have for editing planets and ships.
i am haveing to ( alt/tab ) alot to keep referencing my files and this is gettiing old fast.
i use zoc because of its scroll buffer and back bar. i want to skip context and just echo to the screen the data i need.
if i get the script i really want i will use user buttons to select the files i want, instead of my mouse.
I run twx 2.02 i do not want a message window, like i said i
can scroll around as needed or just recall up the file.
( i use an optic cordless mouse with a wheel so scrolling is a breeze). what also would work is a mouse run script that will work like the script enabler in twx or zoc. ie
1- click the script folder a dialog box opens,
2- clik the type of script the first dialog box is replaced by a second one.
3- click the specific script, decide to open it or run it and go.
this is a long way to do it but as the path is there for this i didnt think it would be hard. i am hopeing all i need to do is create a txt folder in twx/or zoc and populate its with my twars txt files instead of keeping them in my documents folder or in the root of context.
what is hard is the echo aspect of this, as when called on im not in a game and the fed comms or subspace comms dont send to the screen. After this is accomplished i am sure lots of sysops and players will find this a usefull tool.
_________________ C.E.O. Corp Noble House Sysop - Zentock's Realm TWGS Co-Sysop - Vulcans Forge TWGS
Admin. Vulcans Forge Forums Vulcans Forge TeamSpeak
|
| Thu Dec 14, 2006 3:46 am |
|
 |
|
LoneStar
Commander
Joined: Fri Jun 09, 2006 2:00 am Posts: 1402 Location: Canada
|
Maybe I'm missing something, but the Echo aspect is easy-peasy. you can get the list of filenames into a Text file with one DOS cmd:
DIR /B >FileList.txt ..or to append files to an existing FileList.txt: DIR /B >>FileList.txt
have a script load up FileList.txt contents and build a menu from it. You don't need to be connected to run a script of this nature --just need any Dbase loaded. Volla.
_________________ ---------------------------- -= QUANTUM Computing 101: 15 = 3 x 5 ... 48% of the time.
|
| Thu Dec 14, 2006 4:46 am |
|
 |
|
Zentock
Lieutenant J.G.
Joined: Mon Sep 22, 2003 2:00 am Posts: 486 Location: USA
|
try to echo a txt file to your twx/zoc screen lonestar,
then get back with me about it.
lets talk absolutes, not abstracts.
_________________ C.E.O. Corp Noble House Sysop - Zentock's Realm TWGS Co-Sysop - Vulcans Forge TWGS
Admin. Vulcans Forge Forums Vulcans Forge TeamSpeak
|
| Thu Dec 14, 2006 7:08 am |
|
 |
|
Singularity
Veteran Op
Joined: Thu Jun 02, 2005 2:00 am Posts: 5558 Location: USA
|
Can't do dialog boxes in TWX. Can't read the scripts folder either.
But it sounds like you want more of a menu system than a file printer?
Instead you could easily just use
setVar $file GAMENAME & "-data.txt"
Then put a gamename-data.txt (where gamename is the name of the game as defined in twx) file, click the script and voila. You could do that with my little script above, would take... eh, 10 seconds to setup?
I just posted a block of code that will do the echo. That's the easy part. You don't need to be online for this to work.
Code: setVar $line_idx 1 setVar $file GAMENAME & "-data.txt" fileExists $exists $file if ($exists = 0) write $file "Put data here." echo "**File doesn't exist so I created a dummy file.*" halt end echo "*"
:read_file_line read $file $file_line $line_idx if ($file_line = EOF) OR ($file_line = "EOF") goto :end_of_file end echo ANSI_9 & $file_line & "*" add $line_idx 1 goto :read_file_line
:end_of_file
Now it creates the file if it doesn't exist so you don't even have to remember the naming convention, just go to your twx proxy directory, find the file and put whatever you want inside of it and hit save.
There is no way to send a DOS command via twx proxy. There is no way to get the contents of any random directory.
The only thing close is TWX_LISTDIRECTORY. Which is a menu option that lists what's in your script directory, even tho there's no way to send that to a file or trigger on it.
If all you want is to spit out data from a file to your screen then why make this any harder than it has to be?
_________________ May the unholy fires of corbomite ignite deep within the depths of your soul...
1. TWGS server @ twgs.navhaz.com 2. The NavHaz Junction - Tradewars 2002 Scripts, Resources and Downloads 3. Open IRC chat @ irc.freenode.net:6667 #twchan 4. Parrothead wrote: Jesus wouldn't Subspace Crawl.
*** SG memorial donations via paypal to: dpocky68@booinc.com
|
| Thu Dec 14, 2006 8:11 am |
|
 |
|
LoneStar
Commander
Joined: Fri Jun 09, 2006 2:00 am Posts: 1402 Location: Canada
|
Zentock wrote: try to echo a txt file to your twx/zoc screen lonestar, then get back with me about it.
lets talk absolutes, not abstracts.
You wanted absolute...
Code: setVar $file "C:\test.txt" fileExists $YesNo $file if ($YesNo) setVar $lineptr 1 echo "***" echo ANSI_14 & "---------- HOLY COW THIS IS EASY ------------------*" :andagain read $file $newline $lineptr if ($newline <> "EOF") if ($newline = "") echo "*" else echo ANSI_7 & $newline end add $lineptr 1 goto :andagain end echo "*" echo ANSI_14 & "---------- HOLY COW THAT IS EASY ------------------" echo "***" else echo "***" echo ANSI_14 & "File Not Found: " & ANSI_15 & $file echo "**" end
If you'd like more absolutes let me know ..matter of fact, I'd be more than happy to make this little project for you, cause it could also be used to load and execute scripts (something I've thougth of doing for a long time).
_________________ ---------------------------- -= QUANTUM Computing 101: 15 = 3 x 5 ... 48% of the time.
|
| Thu Dec 14, 2006 8:21 am |
|
 |
|
LoneStar
Commander
Joined: Fri Jun 09, 2006 2:00 am Posts: 1402 Location: Canada
|
Singularity wrote: There is no way to send a DOS command via twx proxy. There is no way to get the contents of any random directory.
The only thing close is TWX_LISTDIRECTORY. Which is a menu option that lists what's in your script directory, even tho there's no way to send that to a file or trigger on it.
The DOS cmd suggestion was a quick and easy way to populate a Text file with a few dozen filenames in less than a second upon which a script could use that List to generate a Menu, and even SubMenus.
_________________ ---------------------------- -= QUANTUM Computing 101: 15 = 3 x 5 ... 48% of the time.
|
| Thu Dec 14, 2006 8:33 am |
|
 |
|
Zentock
Lieutenant J.G.
Joined: Mon Sep 22, 2003 2:00 am Posts: 486 Location: USA
|
Go for it Lonestar.
and i will suggest changes as you make them.
1- eliminate the need to type a files extension to get it to echo
2- set it up so that it accepts wildcards
3- dont end the script on file not found
have it ask if im done, also with file not found responses have it ask if i spelled the file correctly then if i say i did end the script.
_________________ C.E.O. Corp Noble House Sysop - Zentock's Realm TWGS Co-Sysop - Vulcans Forge TWGS
Admin. Vulcans Forge Forums Vulcans Forge TeamSpeak
|
| Thu Dec 14, 2006 9:19 am |
|
 |
|
LoneStar
Commander
Joined: Fri Jun 09, 2006 2:00 am Posts: 1402 Location: Canada
|
Zentock wrote: Go for it Lonestar. and i will suggest changes as you make them.
1- eliminate the need to type a files extension to get it to echo 2- set it up so that it accepts wildcards 3- dont end the script on file not found
Right. So, you *don't* want a Menu of Files to select from, i.e.:
Yodel Lay He Whooo A) How to get 75k a day for Free!! B) Why You should not reset your IG from the Computer C) Are you Instlalling a T-Pad or CBY'n? D) Macro's for Dyslexics E) Yadda, Yadda, Yadda
you would rather type in the name of the file?? I thought the point of this exercise was to save key strokes?
and finally.. Why in the world do you need to use wildcards?
Please enlighten me
_________________ ---------------------------- -= QUANTUM Computing 101: 15 = 3 x 5 ... 48% of the time.
|
| Thu Dec 14, 2006 9:40 am |
|
 |
|
Zentock
Lieutenant J.G.
Joined: Mon Sep 22, 2003 2:00 am Posts: 486 Location: USA
|
ok the goal is to have it have more then 1 way to access
the echo. some people type,( i do not),some use mice, ( i do ).
wildcards for the typers,
ship
battle*
star*
cruise*
planet
*m &nbs p;
*c
*f
*g
the menu idea will be great thats why i asked for it
but i have asked for both ways, and i hope you now are
enlightened enough to make the script instead of continuing
to snipe at me.
_________________ C.E.O. Corp Noble House Sysop - Zentock's Realm TWGS Co-Sysop - Vulcans Forge TWGS
Admin. Vulcans Forge Forums Vulcans Forge TeamSpeak
|
| Thu Dec 14, 2006 12:01 pm |
|
 |
|