View unanswered posts | View active topics It is currently Tue Apr 21, 2026 7:49 pm



Reply to topic  [ 13 posts ] 
 TWX Scripting- Send Special Keys 
Author Message
1st Sergeant
User avatar

Joined: Thu May 15, 2008 3:13 pm
Posts: 33
Unread post TWX Scripting- Send Special Keys
Following some of the scripting and various tutorials, I am curious on the TWX scripting. If you can have:

# At Command Prompt
send "sh"

And you see a scan, holo

Is there a way to emulate other keys, such as ALT or Shift?

_________________
Harkov

Silently exploring the galaxy one sector at a time.


Wed Feb 11, 2009 6:43 pm
Profile
Ambassador
User avatar

Joined: Mon Feb 09, 2004 3:00 am
Posts: 3141
Location: Kansas
Unread post Re: TWX Scripting- Send Special Keys
Harkov wrote:
Following some of the scripting and various tutorials, I am curious on the TWX scripting. If you can have:

# At Command Prompt
send "sh"

And you see a scan, holo

Is there a way to emulate other keys, such as ALT or Shift?


I have never sent an alt or shift key sequence. I believe it might be done similar to sending the backspace. I'm not sure what the use of keys might be other than to maybe use as a textouttrigger.

_________________
               / Promethius / Enigma / Wolfen /

"A man who has no skills can be taught, a man who has no honor has nothing."


Wed Feb 11, 2009 6:52 pm
Profile ICQ
Boo! inc.
User avatar

Joined: Sat Oct 09, 2004 2:00 am
Posts: 865
Location: USA
Unread post Re: TWX Scripting- Send Special Keys
Harkov wrote:
Following some of the scripting and various tutorials, I am curious on the TWX scripting. If you can have:

# At Command Prompt
send "sh"

And you see a scan, holo

Is there a way to emulate other keys, such as ALT or Shift?


Why would you want to do that?
I know you can't use those to run m()m commands if that is what you were thinking about. Not sure about hotkeys in swath or whatever..

_________________
“The object of war is not to die for your corp but to make the other bastard die for his.”

Boo! inc.


Wed Feb 11, 2009 7:05 pm
Profile
1st Sergeant
User avatar

Joined: Thu May 15, 2008 3:13 pm
Posts: 33
Unread post Re: TWX Scripting- Send Special Keys
Unfortunately I am unfamiliar with m()m commands.

I am not looking to use it, I was just curious from the script writers here if in fact it is available or an option. TWX uses * for Enter, REXX uses the ^M. I was making some notes and wanted to ask about the keys like ALT, Shift.

_________________
Harkov

Silently exploring the galaxy one sector at a time.


Wed Feb 11, 2009 7:27 pm
Profile
Veteran Op
User avatar

Joined: Thu Jun 02, 2005 2:00 am
Posts: 5558
Location: USA
Unread post Re: TWX Scripting- Send Special Keys
Sorta... Keep in mind that the server will filter out anything that it doesn't understand. Commands sent thru send are sent directly to the server and not parsed thru TWXproxy or your helper. So sending "alt" would do absolutely no good, the server doesn't understand alt and nothing on your end will ever parse it unless you're routing TWXproxy thru something else.

You can do something like:

send #8

For backspace. Or...

send #27

For an escape.

I don't know of any way to send modifier codes, like alt or ctrl, but you can basically send any of the things at:
http://www.asciitable.com/

For shift, uhm, yea, you can just do the capital letter.

Edit: You can also use directional keys, the exact code will depend on if your term program sends as a character or as an ansi sequence, but you can trigger on either. You can use a generic setTextOutTrigger to trap for keys, then echo that ord to the screen. Easy way to figure out what code a key is.

_________________
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
Image


Wed Feb 11, 2009 7:33 pm
Profile ICQ WWW
1st Sergeant
User avatar

Joined: Thu May 15, 2008 3:13 pm
Posts: 33
Unread post Re: TWX Scripting- Send Special Keys
You answered my next questions. Thank you all.

_________________
Harkov

Silently exploring the galaxy one sector at a time.


Wed Feb 11, 2009 8:25 pm
Profile
Boo! inc.
User avatar

Joined: Sat Oct 09, 2004 2:00 am
Posts: 865
Location: USA
Unread post Re: TWX Scripting- Send Special Keys
mob wrote:
Harkov wrote:
Following some of the scripting and various tutorials, I am curious on the TWX scripting. If you can have:

# At Command Prompt
send "sh"

And you see a scan, holo

Is there a way to emulate other keys, such as ALT or Shift?


Why would you want to do that?
I know you can't use those to run m()m commands if that is what you were thinking about. Not sure about hotkeys in swath or whatever..


ehh sorry couldn't be more help, that sounded kinda neg but didn't mean for it to be. I just know when I was learning I tried a couple things like that or wanted to then finding out it really didn't work that way:) No offense...

Good luck!!

_________________
“The object of war is not to die for your corp but to make the other bastard die for his.”

Boo! inc.


Wed Feb 11, 2009 8:57 pm
Profile
Veteran Op
User avatar

Joined: Thu Jun 02, 2005 2:00 am
Posts: 5558
Location: USA
Unread post Re: TWX Scripting- Send Special Keys
If you need to "meta script" by loading multiple scripts or macros, there's various ways to do it. A small swath zoc script works pretty well, I have a few of those. Also a program called "Autohotkey" ... it's freeware, and you can assign any keys you want into a macro.

_________________
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
Image


Wed Feb 11, 2009 8:59 pm
Profile ICQ WWW
1st Sergeant
User avatar

Joined: Thu May 15, 2008 3:13 pm
Posts: 33
Unread post Re: TWX Scripting- Send Special Keys
mob wrote:
mob wrote:
Harkov wrote:
Following some of the scripting and various tutorials, I am curious on the TWX scripting. If you can have:

# At Command Prompt
send "sh"

And you see a scan, holo

Is there a way to emulate other keys, such as ALT or Shift?


Why would you want to do that?
I know you can't use those to run m()m commands if that is what you were thinking about. Not sure about hotkeys in swath or whatever..


ehh sorry couldn't be more help, that sounded kinda neg but didn't mean for it to be. I just know when I was learning I tried a couple things like that or wanted to then finding out it really didn't work that way:) No offense...

Good luck!!


Mob, I never found your response negative in any way, so no worries. You asked a legit question.

Singularity wrote:
If you need to "meta script" by loading multiple scripts or macros, there's various ways to do it. A small swath zoc script works pretty well, I have a few of those. Also a program called "Autohotkey" ... it's freeware, and you can assign any keys you want into a macro.


Do you have a swath zoc script you could send me so I could take a look at it?

_________________
Harkov

Silently exploring the galaxy one sector at a time.


Wed Feb 11, 2009 9:27 pm
Profile
Veteran Op
User avatar

Joined: Thu Jun 02, 2005 2:00 am
Posts: 5558
Location: USA
Unread post Re: TWX Scripting- Send Special Keys
Code:
/* A simple selection menu script for simplifying hotkeys */
/* Comment out the signal lines and the script will end after */
/* click on a choice. */

Top:
what=zocrequestlist("Select?","Exit-Enter Callsaveme|Dumb Reloader|IG Motha|Cancel")

if what=0 then do
    call zocsend "$ssc:/games/tradewars/twxproxy/scripts/dny_exit-callsaveme.ts^M"
    exit
    /* signal Top; */
end
else if what=1 then do
    call zocsend "$ssc:/games/tradewars/twxproxy/scripts/dny_dumb_reloader.ts^M"
    exit
    /* signal Top; */
end
else if what=2 then do
    call zocsend "$ssc:/games/tradewars/twxproxy/scripts/dny_ig_motha.ts^M"
    exit
    /* signal Top; */
end
else if what=3 then
exit


A simple sub-menu script. You can assign something like this to a swath hotkey and get a sub-menu. You could zocsend pretty much anything, and since stuff from the helper goes thru TWXproxy (provided you have it set that way) then you can also script different settings as a single hotkey.

Also good for doing a mombot macro command or pretty much whatever. I think swath also supports zocwait, so you can code in a simple series of waitFors to wait for the scripts to load or exit before calling another.

_________________
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
Image


Wed Feb 11, 2009 10:08 pm
Profile ICQ WWW
1st Sergeant
User avatar

Joined: Thu May 15, 2008 3:13 pm
Posts: 33
Unread post Re: TWX Scripting- Send Special Keys
Thanks for the time and insight. It all helps.

_________________
Harkov

Silently exploring the galaxy one sector at a time.


Wed Feb 11, 2009 10:52 pm
Profile
Commander
User avatar

Joined: Fri Jun 09, 2006 2:00 am
Posts: 1401
Location: Canada
Unread post Re: TWX Scripting- Send Special Keys
Code:
setTextouttrigger      text   :text
pause
:text
getOutText $character
getCharCode $character $charCode
echo "**Character "&$character&", CharCode "&$charCode&"**"


Run the above code snippet and press CTRL-F and you should see something like Image Which means you can use the Control key in place of the ALT key.

Hope this helps

_________________
----------------------------
-= QUANTUM Computing 101: 15 = 3 x 5 ... 48% of the time.


Thu Feb 12, 2009 7:07 am
Profile ICQ YIM
Veteran Op
User avatar

Joined: Thu Jun 02, 2005 2:00 am
Posts: 5558
Location: USA
Unread post Re: TWX Scripting- Send Special Keys
Yeh, some keys will have control codes, but not all of them will. That's because these keys use to have other functions back in the days of yore.

Control-C, for instance, used to be "break" ... a way to tell a program to let you out.

_________________
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
Image


Thu Feb 12, 2009 7:21 pm
Profile ICQ WWW
Display posts from previous:  Sort by  
Reply to topic   [ 13 posts ] 

Who is online

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