So, dank Buebchens Informationen die ich so nebenbei bekommen habe, habe ich das Script umbenannt, angepasst, in der monitor.xml eingebunden und auch schon getestet. Auf den Hintergrund mit dem Clientfilter war ich nicht gekommen und nicht hält ja bekanntlich länger wie das beste Provisorium.
Also hier mein Schript zum versenden von Emails mit blat:
Code:
-- SocketFilter.lua
--
-- Filter f?r den SocketServer - wird pro aktiven Client aufgerufen
--
-- Globales Array "arg" enth?lt die Daten vom Auswertermodul
--
-- Zus?tzliche Werte im Array:
--
-- client_authenticated: 0/1 (1=angemeldet)
-- client_ip: IP-Adresse des Clients
-- client_loginname: Anmeldename
-- client_type: fms32, crusader, monitord
--
-- R?ckgabewert: 0 = an Client senden, 1= nicht an Client senden, alle anderen = an Client senden
--
local toShowFMS = {"11111111", "22222222"} ;
local toShowPOCSAG = {"1111111", "2222222"} ;
local toShowZVEI = {"99000", "99001"} ;
local sperrliste = {"1292587", "1308795"};
local versandliste = {"1291234", "1297777", "1298888", "1295555"};
-- Liste Namentlich {LG Musterdorf, GWG Musterdorf, Wehrführer, Alarmdrucker}
function myfilterFMS32()
for index,testwert in pairs(toShowFMS) do
if (testwert==arg["ric"]) then
return 0
end
end
return 1 ;
end
function myfilterCRUSADER()
for index,testwert in pairs(sperrliste) do
if (testwert==arg["ric"]) then
return 1
end
end
print(arg["text"])
return 0 ;
end
function myfilterMONITORD()
-- ZVEI
if(arg["typ"] == "zvei") then
for index,testwert in pairs(toShowZVEI) do
if(testwert == arg["zvei"]) then
return 0
end
end
end
-- FMS
if(arg["typ"] == "fms") then
for index,testwert in pairs(toShowFMS) do
if(testwert == arg["fmskennung"]) then
return 0
end
end
end
-- POCSAG
if(arg["typ"] == "pocsag") then
for index,testwert in pairs(toShowPOCSAG) do
if(testwert == arg["ric"]) then
return 0
end
end
end
-- default: anzeige unterdruecken
return 1;
end
function pluginFilter()
local dummyValue=1 ;
if(arg["typ"] == "pocsag") then
for index,testwert in pairs(versandliste) do
if (testwert == arg["ric"]) then
toexecute = "start c:\\programme\\blat262\\full\\blat.exe ";
toexecute = toexecute .. "-to email@gmx.de -u [Benutzername] -pw [Passwort] -subject ";
toexecute = toexecute .. arg["ric"] ;
toexecute = toexecute .. " -body \"" ;
toexecute = toexecute .. arg["text"] ;
toexecute = toexecute .. " ||Subric: " ;
toexecute = toexecute .. arg["sub"] ;
toexecute = toexecute .. " |Alarmdatum: " ;
toexecute = toexecute .. arg["datum"] ;
toexecute = toexecute .. " |Alarmzeit: " ;
toexecute = toexecute .. arg["uhrzeit"] ;
toexecute = toexecute .. "\"" ;
print(toexecute);
os.execute(toexecute);
end
end
end
-- wird f?r jedes Telegramm (pocsag, fms, zvei) aufgerufen
if (arg["client_type"]=="fms32") then
return 0; -- delete this line to enable and uncomment the next one!
-- return myfilterFMS32() ;
end
if (arg["client_type"]=="crusader") then
-- nix
return myfilterCRUSADER() ;
end
if (arg["client_type"]=="monitord") then
return 0; -- delete this line to enable and uncomment the next one!
-- return myfilterMONITORD() ;
end
-- default: alles anzeigen; ?ndern auf "1" um nichts anzuzeigen!
return 0;
end
Minicient ist wie der Name schon sagt ein kleiner Client der sich mit monitor verbinden kann und eingehende Meldungen in einer schmalen Zeile an der Bildschirmoberkante anzeigt. Benötige ich jetzt dank Buebchens Hinweis nicht mehr.
Gruß
Reissdorf