--[[ etc_userlogininfo by pulsar v0.1 - Sendet eine basic Userinfo beim Einloggen an den User v0.2 - Multilanguage Support v0.3 - Hinzugefügt: Levelnummer - Hinzugefügt: Client Version v0.4 - Hinzugefügt: Client Mode - Hinzugefügt: Client SSL Check v0.5 - Hinzugefügt: Hubname + Version v0.6 - Hinzugefügt: Hubname + Version (Toggle on/off) - Hinzugefügt: Registriert von, Registriert am - Hinzugefügt: Users Online, Users Max. - Hinzugefügt: Min. Slots, Max. Slots ]]-- -------------- --[SETTINGS]-- -------------- --> Scriptname local scriptname = "etc_userlogininfo" local scriptversion = "0.6" --> Trennlinie --> Separator local line = "=====================================" --> An wen soll die Userinfo gesendet werden? (JA=true/NEIN=false) --> who can get an userlogin info? (YES=true/NO=false) local permissions = { [ 10 ] = true, --> GUEST [ 20 ] = true, --> REG [ 30 ] = true, --> VIP [ 40 ] = true, --> SVIP [ 50 ] = true, --> SERVER [ 60 ] = true, --> OPERATOR [ 70 ] = true, --> SUPERVISOR [ 80 ] = true, --> ADMIN [ 100 ] = true, --> HUBOWNER } --> Anzeige der Hubversion? (JA=true/NEIN=false) --> Toggle Hubversion on/off (ON=true/OFF=false) local show_hubversion = true ---------- --[CODE]-- ---------- local scriptlang = cfg.get "language" local lang, err = cfg.loadlanguage(scriptlang, scriptname); lang = lang or { }; err = err and hub.debug(err) local msg_nick = lang.msg_nick or " Dein Nick:\t" local msg_ip = lang.msg_ip or " Deine IP:\t" local msg_level = lang.msg_level or " Dein Level:\t" local msg_client = lang.msg_client or " Client Version:\t" local msg_clientmode = lang.msg_clientmode or " Client Modus:\t" local msg_clientssl = lang.msg_clientssl or " Client SSL:\t" local client_mode_a = lang.client_mode_a or "M:A ( aktiv )" local client_mode_p = lang.client_mode_p or "M:P ( passiv )" local client_ssl_n = lang.client_ssl_n or "NEIN ( bitte aktivieren! )" local client_ssl_y = lang.client_ssl_y or "JA" local msg_reg_by = lang.msg_reg_by or " Registriert von:\t" local msg_reg_date = lang.msg_reg_date or " Registriert am:\t" local msg_user_on = lang.msg_user_on or " Users Online:\t" local msg_user_max = lang.msg_user_max or " Users Max.:\t" local msg_slots_min = lang.msg_slots_min or " Slots (min):\t" local msg_slots_max = lang.msg_slots_max or " Slots (max):\t" local server_version = lang.server_version or " Hubversion:\t" --> import table constants from "core/const.lua" local const_file = "core/const.lua" local const_tbl = util.loadtable(const_file) or {} local PROGRAM_NAME local VERSION local const_PROGRAM = const_tbl["PROGRAM_NAME"] local const_VERSION = const_tbl["VERSION"] local PROGRAM_VERSION = const_PROGRAM.." "..const_VERSION hub.setlistener( "onLogin", {}, function( user ) local hub_getbot = hub.getbot() --> user nick, ip ,level local user_nick = user:nick() local user_firstnick = user:firstnick() local user_ip = user:ip() local user_level = user:level() local level = cfg.get( "levels" )[ user:level() ] or "Unreg" local levelnr = user:level() --> client version, mode, ssl local clientv = hub.escapefrom( user:version() ) or "" local checkmode = function() local mode if user:hasfeature( "TCP4" ) then mode = client_mode_a else mode = client_mode_p end return mode end local user_ssl = tostring( user:ssl() ) local checkssl = function() local ssl = client_ssl_n if user_ssl then ssl = client_ssl_y end return ssl end --> registered by, on local by = user_nick local target local _, regnicks, regcids = hub.getregusers() local _, usersids = hub.getusers() if not ( ( by == "sid" or by == "nick" or by == "cid" ) and id ) then local usercid, usernick = user:cid(), user:firstnick() target = regnicks[ usernick ] or regcids.TIGR[ usercid ] else target = ( by == "nick" and regnicks[ id ] ) or ( by == "cid" and regcids.TIGR[ id ] ) or ( by == "sid" and ( usersids[ id ] and usersids[ id ].profile and usersids[ id ]:profile() ) ) end local reg_by = target.by or "Luadch" local reg_date = target.date or "" --> users online, max local max_users = cfg.get "max_users" or "" local usercount = function() local users, _, _ = hub.getusers() local count = 0 for key, value in pairs( users ) do count = count + 1 end return count end --> min slots, max slots local min_slots = cfg.get "min_slots" or "" local max_slots = cfg.get "max_slots" or "" --> msg without hubversion local msg = "\n\n".. "\t\t\t"..line.."\n".. "\t\t\t"..msg_nick..user_firstnick.."\n".. "\t\t\t"..msg_ip..user_ip.."\n".. "\t\t\t"..msg_level..levelnr.." [ "..level.." ]\n\n".. "\t\t\t"..msg_client..clientv.."\n".. "\t\t\t"..msg_clientmode..checkmode().."\n".. "\t\t\t"..msg_clientssl..checkssl().."\n\n".. "\t\t\t"..msg_reg_by..reg_by.."\n".. "\t\t\t"..msg_reg_date..reg_date.."\n\n".. "\t\t\t"..msg_user_on..usercount().."\n".. "\t\t\t"..msg_user_max..max_users.."\n\n".. "\t\t\t"..msg_slots_min..min_slots.."\n".. "\t\t\t"..msg_slots_max..max_slots.."\n".. "\t\t\t"..line.."\n".. "\t\t\t"..server_version..PROGRAM_VERSION.."\n".. "\t\t\t"..line.."\n" --> msg with hubversion local msg2 = "\n\n".. "\t\t\t"..line.."\n".. "\t\t\t"..msg_nick..user_firstnick.."\n".. "\t\t\t"..msg_ip..user_ip.."\n".. "\t\t\t"..msg_level..levelnr.." [ "..level.." ]\n\n".. "\t\t\t"..msg_client..clientv.."\n".. "\t\t\t"..msg_clientmode..checkmode().."\n".. "\t\t\t"..msg_clientssl..checkssl().."\n\n".. "\t\t\t"..msg_reg_by..reg_by.."\n".. "\t\t\t"..msg_reg_date..reg_date.."\n\n".. "\t\t\t"..msg_user_on..usercount().."\n".. "\t\t\t"..msg_user_max..max_users.."\n\n".. "\t\t\t"..msg_slots_min..min_slots.."\n".. "\t\t\t"..msg_slots_max..max_slots.."\n".. "\t\t\t"..line.."\n" if user:isregged( user_nick ) then if permissions[ user_level ] then if show_hubversion then user:reply( msg, hub_getbot ) else user:reply( msg2, hub_getbot ) end return nil end end end ) hub.debug( "** Loaded "..scriptname.." "..scriptversion.." **" ) --------- --[END]-- ---------