# # Patch name: AttyCursor # Patch version: 1 # Author's name: Atuarre Ti Kivikkii # Author's email: atuarre@gz.trekmush.org # Version of PennMUSH: 1.6.10-patch06 # Date patch made: June 23, 1997 # Author is willing to support (yes/no): yes # Patch format: diff -c # # # This is a contributed PennMUSH patch. Its use is subject to the # same restrictions found in PennMUSH's hdrs/copyrite.h file. # # No warranty is given for this patch. It is not necessarily going # to work on your system, with any version of PennMUSH other than # the one above, etc. # # If the author given above was willing to support the patch, you # should write to the author if you have any questions or problems. Do # *NOT* send email messages to Javelin or any PennMUSH mailing list about # this patch! # # Below this line is the author's description of the patch, # followed by the patch itself. If the patch is in context diff # format, you'll probably apply it by typing: patch < patchfile # in your top-level MUSH directory, unless instructed otherwise # below. # # This patch includes the CURSOR (aka ANSIP) function for PennMUSH, # by Atuarre. The following patch does not include .hlp files, # so here is a brief synopsis of what these patches do: # # CURSOR(,,) # ANSIP(,,) # # This function will return the VT100 ANSI codes to reposition the cursor # on the screen to and and will at that point return . # The function requires be an integer from 1 to 24, and # likewise from 1 to 80. Might not work real well with certain TinyFugue # settings, like, /visual on. It is known to work in raw emulation with # /visual off. ANSIP is installed at ats.trekmush.org 1701 if you wish to # experiement with it there as a guest before applying this patch. # *** /u3/trekmush/penn.virgin/hdrs/ansi.h Mon Dec 16 08:51:15 1996 --- ./hdrs/ansi.h Wed Jun 25 07:18:20 1997 *************** *** 52,57 #define ANSI_BCYAN "\x1B[46m" #define ANSI_BWHITE "\x1B[47m" #else #define BEEP_CHAR '\07' --- 52,64 ----- #define ANSI_BCYAN "\x1B[46m" #define ANSI_BWHITE "\x1B[47m" + #define ANSI_LOLITE "\x1B[2m" + #define ANSI_SCREEN_CLEAR "\x1B[2J" + #define ANSI_ITALIC "\x1B[3m" + #define ANSI_POS_1 "\x1B[" + #define ANSI_POS_2 ";" + #define ANSI_POS_3 "H" + #else #define BEEP_CHAR '\07' *************** *** 90,94 #define ANSI_BMAGENTA "\033[45m" #define ANSI_BCYAN "\033[46m" #define ANSI_BWHITE "\033[47m" #endif --- 97,108 ----- #define ANSI_BMAGENTA "\033[45m" #define ANSI_BCYAN "\033[46m" #define ANSI_BWHITE "\033[47m" + + #define ANSI_LOLITE "\033[2m" + #define ANSI_SCREEN_CLEAR "\033[2J" + #define ANSI_ITALIC "\033[3m" + #define ANSI_POS_1 "\033[" + #define ANSI_POS_2 ";" + #define ANSI_POS_3 "H" #endif *** /u3/trekmush/penn.virgin/hdrs/function.h Tue May 13 07:44:15 1997 --- ./hdrs/function.h Wed Jun 25 07:23:11 1997 *************** *** 280,285 FUNCTION_PROTO(fun_beep); /* funstr.c */ FUNCTION_PROTO(fun_ansi); /* funstr.c */ FUNCTION_PROTO(fun_ansi); /* funstr.c */ FUNCTION_PROTO(fun_stripansi); /* funstr.c */ FUNCTION_PROTO(fun_edit); /* funstr.c */ FUNCTION_PROTO(fun_left); /* funstr.c */ --- 280,286 ----- FUNCTION_PROTO(fun_beep); /* funstr.c */ FUNCTION_PROTO(fun_ansi); /* funstr.c */ FUNCTION_PROTO(fun_ansi); /* funstr.c */ + FUNCTION_PROTO(fun_ansip); /* funstr.c */ FUNCTION_PROTO(fun_stripansi); /* funstr.c */ FUNCTION_PROTO(fun_edit); /* funstr.c */ FUNCTION_PROTO(fun_left); /* funstr.c */ *** /u3/trekmush/penn.virgin/src/function.c Tue May 13 07:42:59 1997 --- ./src/function.c Wed Jun 25 07:23:04 1997 *************** *** 108,113 {"AND", fun_and, 2, INT_MAX, FN_REG}, {"ANDFLAGS", fun_andflags, 2, 2, FN_REG}, {"ANSI", fun_ansi, 2, -2, FN_REG}, {"APOSS", fun_aposs, 1, 1, FN_REG}, {"ART", fun_art, 1, 1, FN_REG}, {"ATRLOCK", fun_atrlock, 1, 2, FN_REG}, --- 108,114 ----- {"AND", fun_and, 2, INT_MAX, FN_REG}, {"ANDFLAGS", fun_andflags, 2, 2, FN_REG}, {"ANSI", fun_ansi, 2, -2, FN_REG}, + {"ANSIP", fun_ansip, 3, -3, FN_REG}, {"APOSS", fun_aposs, 1, 1, FN_REG}, {"ART", fun_art, 1, 1, FN_REG}, {"ATRLOCK", fun_atrlock, 1, 2, FN_REG}, *************** *** 133,138 #ifdef CREATION_TIMES {"CTIME", fun_ctime, 1, 1, FN_REG}, #endif #if (CHAT_SYSTEM >= 2) {"CWHO", fun_cwho, 1, 1, FN_REG}, #endif --- 134,140 ----- #ifdef CREATION_TIMES {"CTIME", fun_ctime, 1, 1, FN_REG}, #endif + {"CURSOR", fun_ansip, 3, -3, FN_REG}, #if (CHAT_SYSTEM >= 2) {"CWHO", fun_cwho, 1, 1, FN_REG}, #endif *** /u3/trekmush/penn.virgin/src/funstr.c Thu May 1 20:19:13 1997 --- ./src/funstr.c Wed Jun 25 07:22:02 1997 *************** *** 809,814 safe_str(args[1], buff, bp); safe_str(ANSI_NORMAL, buff, bp); } #else /* ARGSUSED */ FUNCTION(fun_ansi) --- 809,839 ----- safe_str(args[1], buff, bp); safe_str(ANSI_NORMAL, buff, bp); } + + /* ARGSUSED */ + FUNCTION(fun_ansip) + { + int row, col; + + if (!is_integer(args[0]) || !is_integer(args[1])) { + safe_str(e_int, buff, bp); + } else { + row = parse_integer(args[0]); + col = parse_integer(args[1]); + if (row < 1 || row > 24 || col < 1 || col > 80) { + safe_str("#-1 POSITION OUT OF RANGE", buff, bp); + } else { + safe_str(ANSI_POS_1, buff, bp); + safe_str(unparse_integer(row), buff, bp); + safe_str(ANSI_POS_2, buff, bp); + safe_str(unparse_integer(col), buff, bp); + safe_str(ANSI_POS_3, buff, bp); + safe_str(args[2], buff, bp); + } + } + return; + } + #else /* ARGSUSED */ FUNCTION(fun_ansi) *************** *** 812,817 #else /* ARGSUSED */ FUNCTION(fun_ansi) { safe_str("#-1 FUNCTION DISABLED", buff, bp); return; --- 837,849 ----- #else /* ARGSUSED */ FUNCTION(fun_ansi) + { + safe_str("#-1 FUNCTION DISABLED", buff, bp); + return; + } + + /* ARGSUSED */ + FUNCTION(fun_ansip) { safe_str("#-1 FUNCTION DISABLED", buff, bp); return;