/* AHP-Rexx-Test
   Von Jens Köhler, DG2ACB @ DK0MAV
*/

options results

if index(show(p),"rexx_AHP") = 0 then do	/* Checken, ob der ARexx-Port */
  say "AHP ist nicht aktiv, oder"               /* von AHP aktiv ist. */
  say "AHP hat keinen ARexx-Port geöffnet."
  exit	/* ...und tschüß! */
end

address "rexx_AHP"		/* Alle Befehle an AHP schicken. */

"Port 2"			/* RTP ist TNC-Port 2. */

antwort=result
say "AHP antwortet wie folgt:"
say antwort

"call"				/* Welches Call ist auf Port 2 eingeloggt? */

say result

"call_ssid"			/* Hat es auch ein SSID? */
say result
"rtp"				/* Welcher RTP wird gerade benutzt? */
say result

"findcall dg2ace"		/* Suche nach dg2ace */
rtp=result
if rtp~=0 then do		/* 0 = nicht gefunden. */
  "port "||rtp			/* Gehe auf Port, wo DG2ACE ist. */
  "name"			/* Finde den Namen von DG2ACE heraus. */
  port_name=result
  "send Hallo "||port_name||"!"	/* Begrüßen, das gehört sich so. */
  "send Hier kommt die Clip-Liste:"
  "remote //clips"		/* Remote-Befehl auslösen. */

end
else do
  "name"
  port_name=result
  "send Hallo "||port_name||"!"
end

/* "command :r dh0:Texte/Humor/Mutter_Anna" */

exit
