View unanswered posts | View active topics It is currently Thu Mar 28, 2024 3:16 am



Reply to topic  [ 6 posts ] 
 Working with charCodes in Scripts 
Author Message
Ensign

Joined: Wed Nov 06, 2002 3:00 am
Posts: 268
Unread post Working with charCodes in Scripts
I know that you can use character codes in TWX scripts like in triggers, I am using #11 to trip a trigger in a script now when I press Ctrl + k. What I am wondering is if there is any way to pass character codes back and forth between scripts?

If that were possible, you could use that to communicate between scripts and even call and kill scripts automatically between scripts. I have tried send #11, send #12, things like that and it doesn't work. Can anyone think of something that would work?


Tue Nov 18, 2014 3:15 pm
Profile
Commander

Joined: Sun Feb 25, 2001 3:00 am
Posts: 1837
Location: Guam USA
Unread post Re: Working with charCodes in Scripts
SteveH_66 wrote:
I know that you can use character codes in TWX scripts like in triggers, I am using #11 to trip a trigger in a script now when I press Ctrl + k. What I am wondering is if there is any way to pass character codes back and forth between scripts?

If that were possible, you could use that to communicate between scripts and even call and kill scripts automatically between scripts. I have tried send #11, send #12, things like that and it doesn't work. Can anyone think of something that would work?


I'm not going to type a lot on the subject but look into the commands

processIn
processOut

These will lead you in the direction your after.

Vid

_________________
TWGS V2 Vids World on Guam Port 2002
Telnet://vkworld.ddns.net:2002
Discord @ DiverDave#8374
Vid's World Discord

Founding Member -=[Team Kraaken]=- Ka Pla

Image
Winners of Gridwars 2010
MBN Fall Tournament 2011 winners Team Kraaken
Undisputed Champions of 2019 HHT Just for showing up!

The Oldist , Longist Running , Orginal Registered Owner of a TWGS server :
Vids World On Guam


Wed Nov 19, 2014 8:03 am
Profile WWW
Chief Warrant Officer
User avatar

Joined: Sat Feb 27, 2016 1:01 am
Posts: 193
Location: Molon Labe
Unread post Re: Working with charCodes in Scripts
Where is there a list of these available character codes for use by TWXProxy?

I keep seeing use of whatever they are as triggers in scripts such as #145 & #8, #145, etc. I have searched but cannot find anything referencing what these actually represent or how to apply them, e.g., ASCII, character codes, or keyboard codes.

ETA:

I believe this is what I was looking for (the decimal codes): http://www.asciitable.com/

_________________
The object of life is not to be on the side of the majority, but to escape finding one’s self in the ranks of the insane.” — Marcus Aurelius

TWX Proxy Reference Online


Sat Mar 05, 2016 4:26 am
Profile ICQ
Chief Warrant Officer

Joined: Sun Mar 06, 2011 12:22 am
Posts: 183
Unread post Re: Working with charCodes in Scripts
When I was a teenager I bought a giant book called "The QuickBasic Bible." It was a thousand pages and I held onto it for years just because it had an ASCII table on the inside back cover.

You don't think I could have just photocopied that one page, do you? :D

_________________
Photons away!


Mon Aug 01, 2022 6:59 pm
Profile
Ambassador
User avatar

Joined: Wed Apr 20, 2011 1:19 pm
Posts: 2559
Location: Oklahoma City, OK 73170 US
Unread post Re: Working with charCodes in Scripts
Adept wrote:
Where is there a list of these available character codes for use by TWXProxy?

I keep seeing use of whatever they are as triggers in scripts such as #145 & #8, #145, etc. I have searched but cannot find anything referencing what these actually represent or how to apply them, e.g., ASCII, character codes, or keyboard codes.

ETA:

I believe this is what I was looking for (the decimal codes): http://www.asciitable.com/

Correct those are ascii characters, and characters > 127 are Code Page 437 drawing characters, also called IBM Extended Ascii although IBM never endorsed the name.

Ascii Codes < 32 are not printable (i.e. 8 = backspace)

You willl see Zedbot use:

Code:
        Send #145
        WaitOn #145 & #8


#145 is a "non-printer" or "Invisible" character. TWGS will echo it followed by a #8 (backspace). You would have to ask JP why TWGS/TW2002 does this, as I have no idea.

The end result is that if tou send a long macro:

Code:
        Send "l j" #8 #8 $z_planet "* * c x q * " #145
        WaitOn #145 & #8


The script will not continue until your macro finishes.

_________________
Regards,
Micro

Website: http://www.microblaster.net
TWGS2.20b/TW3.34: telnet://twgs.microblaster.net:2002

ICQ is Dead Jim! Join us on Discord:
https://discord.gg/zvEbArscMN


Tue Aug 02, 2022 12:45 am
Profile ICQ YIM WWW
Ambassador
User avatar

Joined: Wed Apr 20, 2011 1:19 pm
Posts: 2559
Location: Oklahoma City, OK 73170 US
Unread post Re: Working with charCodes in Scripts
SteveH_66 wrote:
I know that you can use character codes in TWX scripts like in triggers, I am using #11 to trip a trigger in a script now when I press Ctrl + k. What I am wondering is if there is any way to pass character codes back and forth between scripts?

If that were possible, you could use that to communicate between scripts and even call and kill scripts automatically between scripts. I have tried send #11, send #12, things like that and it doesn't work. Can anyone think of something that would work?


Ascii characters < 32 are called control characters #10 is LF, #13 is CR, and you need both of those to start a new line.

If you send control characters #11, send #12 to TWGS/TW2002 it will ignore them and not echo them. This is how a server should correctly handle this.

There are a commands in TWX for interscript communication. Here is an excerpt from Zedbot:

Code:
# In Z-Bot Version Command
:INTCOM_VER
        SetVar $Z_Lib~message $scripttitle & " v" & $version & "*"
        SetVar $Z_Lib~messageto $sender
        SetVar $Z_Lib~messagemode "R"
        Gosub :MSGBRIDGE

        PROCESSIN 1 "[Z]VERSION[Z]"
        Return

# In other scripts i.e. ComsGuard:
        SetTextTrigger      ver :VERSION "[Z]VERSION[Z]"


PROCESSIN sends a line of text, as if it came from the server, but it not actually sent or echoed.

The end result is that all Zedbot daemons that are running will report their version immediately after Zedbot does.

Zedbot uses a lot of these, including to shudown daemons cleanly.

_________________
Regards,
Micro

Website: http://www.microblaster.net
TWGS2.20b/TW3.34: telnet://twgs.microblaster.net:2002

ICQ is Dead Jim! Join us on Discord:
https://discord.gg/zvEbArscMN


Tue Aug 02, 2022 1:08 am
Profile ICQ YIM WWW
Display posts from previous:  Sort by  
Reply to topic   [ 6 posts ] 

Who is online

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