1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178
|
:macro Convers
echo
echo Convers server LinPac %V
echo Login %C at %T
echo
if %(exist STN_NICKNAME) = 1
echo Czesc %STN_NICKNAME, witam na konferencji!
else
echo Czesc %N, witam na konferencji!
endif
echo Napisz /H aby otrzymac pomoc
echo
;;*********************** INICIALIZACE ************************
set CONVERS "LP_CONVERS" ;;For recognition channels in convers
set LOGTIME %T ;;Login time
set CALL %C ;;Callsign
if "%N" = "%U" ;;Get user's name
set NAME "???"
else
set NAME "%N"
endif
set LAST "%<"
set OUT1 ""
set OUT2 ""
set OUT3 ""
set OUT4 ""
set OUT5 ""
set OUT6 ""
set OUT7 ""
set OUT8 ""
set MSG1 ""
set MSG2 ""
set MSG3 ""
set MSG4 ""
set MSG5 ""
set MSG6 ""
set MSG7 ""
set MSG8 ""
set LAST "*** Podlaczyl sie o %T ***"
conv @SENDALL
label MAIN
flush
;;**** CHECK MESSAGES FROM OTHER CHANNELS ****
set i 1
label TESTOUT
if "%OUT%i" <> "" ;;Comething to send ?
echo <%C@%i> ;; YES - print callsign
echo %OUT%i ;; print message
set OUT%i "" ;; clear buffer
flush
endif
if "%MSG%i" <> "" ;;The same for personal messages
echo *%C@%i*
echo %MSG%i
set MSG%i ""
flush
endif
set i %[%i+1]
if (%i <= 8) goto TESTOUT ;;Repeat for all channels
set LAST "%<" ;;Some new entry ?
if ("%LAST" = "") goto MAIN
;;SOME USER ENTRY
if ("%(strleft 1 "%LAST")" = "/") goto COMMAND ;;Begins with slash - it's command
conv @SENDALL ;;Not a command - send to all as text
goto MAIN
;;**** SEND THE STRING TO ALL STATIONS ****
label SENDALL
set I 1
label SENDING
if "%CONVERS@%I" = "LP_CONVERS" ;;If the channel is in conference
if %I <> %K ;; (and it's not our channel)
set@%I OUT%K "%LAST" ;;Send the text
endif
endif
set I %[%I+1]
if (%I <= 8) goto SENDING
return
;; **** COMMAND RECOGNITION ****
label COMMAND
set CMD "%(Upcase %LAST)"
if (%CMD = /Q) goto KONEC
if (%CMD = /H) goto HELP
if (%CMD = /W) goto WHO
if (%CMD = /U) goto WHO
if (%(strleft 4 "%CMD") = "/MSG") goto MSGS
echo *** Nieznana komenda.
goto MAIN
;; ************************ COMMAND /H **************************
label HELP
echo *** Dostepne komendy
echo /H - pomoc
echo /MSG <znak> - wyslij informacje do wskazanego zanku
echo /Q - wyjscie
echo /W lub /U - lista users
echo ***
goto MAIN
;; ************************ COMMAND /MSG *************************
label MSGS
;; REMOVE '/MSG'
set I %(strpos " " "%LAST")
if (%I = 0) goto MSGERROR
set I %[%(strlen %LAST) - %I - 1]
set LAST "%(strr %I "%LAST")"
;; SPLIT THE MESSAGE AND CALLSIGN
set I %(strpos " " "%LAST")
if (%I = 0) goto MSGERROR
set MSGC "%(strleft %I "%LAST")"
set MSGC "%(upcase "%MSGC")"
set I %[%(strlen "%LAST") - %I - 1]
set LAST "%(strr %I %LAST)"
;; FIND THE CALLSIGN
set FND 0
set I 1
label CMSGS
if %CALL@%I = %MSGC
set@%I MSG%K "%LAST"
set FND 1
endif
set I %[%I+1]
if (%I < 9) goto CMSGS
if %FND = 0
echo *** Nie ma zadnego uzytkownika na konferencji
endif
unset MSGC FND
goto MAIN
;; Chyba pri MSGS
label MSGERROR
echo *** Musisz podac znak i tresc informacji
goto MAIN
; ************************ COMMAND /W **********************
label WHO
echo *** Lista users:
set I 1
label CWHO
if "%CONVERS@%I" = "LP_CONVERS"
echo %CALL@%I - %NAME@%I - podlaczony od %LOGTIME@%I
endif
set I %[%I+1]
if (%I < 9) goto CWHO
echo ***
goto MAIN
; ************************ LOGOUT ***********************
label KONEC
set LAST "*** Rozlaczyl sie o %T ***"
echo Logout o %T.
if %(exist STN_NICKNAME) = 1
echo Do zobaczenia, %STN_NICKNAME !
else
echo Do zobaczenia, %N !
endif
conv @SENDALL
unset CONVERS LOGTIME CALL NAME I CMD
unset OUT1 OUT2 OUT3 OUT4 OUT5 OUT6 OUT7 OUT8
unset MSG1 MSG2 MSG3 MSG4 MSG5 MSG6 MSG7 MSG8
|