UserInfo LUA 4 PT
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

UserInfo LUA 4 PT

Started by SilvaO, 15 July, 2005, 12:16:33

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

SilvaO

Comandos para o UserInfo

+userinfo ou +whois

QuoteBot = "UserInfo"
function Main()
frmHub:RegBot(Bot)
end
function DataArrival(user, data)
if( strsub(data, 1, 1) == "<" ) then
-- remove end pipe
data=strsub(data,1,strlen(data)-1)
-- parse the command
s,e,cmd = strfind( data, "%b<>%s+(%S+)" )
if (user.bOperator) then
if (cmd=="+userinfo" or cmd=="+whois" ) then
UserInfo(user, data)
return 1
end
end
end
end
function GetArgML(data)
s,e,cmd,arg = strfind(data, "%b<>%s+(%S+)%s+(%S+)%s*")
return arg
end
function UserInfo(user, data)
who=GetArgML(data)
local usr = GetItemByName(who)
user:SendPM(Bot, "Esta ? a informa??o do user: "..who.." |")
-- now whe know the user lets extract the info
-- ip of the user
user:SendPM(Bot, "ip: "..usr.sIP.." |")
-- client type and version
if (strfind(usr.sMyInfoString,"_,b, dcgui = strfind(usr.sMyInfoString,"V:0.(%x+.%x+)")
user:SendPM(Bot, "Vers?o de DCgui : 0."..dcgui.." |")
elseif (strfind(usr.sMyInfoString,"<+")) then
if strfind(usr.sMyInfoString,"clienttype = "oDC"
elseif strfind(usr.sMyInfoString,"V:0.%x+%a") then
clienttype = "czdc++"
elseif strfind(usr.sMyInfoString,"L:") or strfind(usr.sMyInfoString,"B:") then
clienttype = "bcdc++"
else
clienttype = "dc++"
end
_,b, dcver = strfind(usr.sMyInfoString,"V:0.(%x+)")
user:SendPM(Bot, clienttype.." client |")
user:SendPM(Bot, "vers?o: 0."..dcver.." |")
else
user:SendPM(Bot, "Cliente NMDC est? a esconder a tag...")
end
-- active or pasive
if strfind(usr.sMyInfoString,"M:A") then
mode = "active"
user:SendPM(Bot, mode.." mode |")
elseif strfind(usr.sMyInfoString,"M:P") then
mode = "pasive"
user:SendPM(Bot, mode.." mode |")
end
-- hub info
_,b, guest = strfind(usr.sMyInfoString,"H:(%x+)/")
if guest == nil then
_,b, hubs = strfind(usr.sMyInfoString,"H:(%x+)")
if hubs ~= nil then
user:SendPM(Bot, hubs.." - hub(s) |")
end
else
_,b, regged = strfind(usr.sMyInfoString,"H:%x+/(%x+)/")
_,b, opped = strfind(usr.sMyInfoString,"H:%x+/%x+/(%x+)")
if regged ~= nil then
user:SendPM(Bot, guest.." - hub(s) como user regular |")
user:SendPM(Bot, regged.." - hub(s) como user registado |")
user:SendPM(Bot, opped.." - hub(s) como operator |")
end
end
-- slot info
_,b, slots = strfind(usr.sMyInfoString,"S:(%x+)")
if slots ~= nil then
user:SendPM(Bot, slots.." - n? slot(s) abertas |")
end
-- bandwidth upload limiter
if strfind(usr.sMyInfoString,"L:") or strfind(usr.sMyInfoString,"B:") then
_,b, limiter = strfind(usr.sMyInfoString,"B:(%x+)")
if limiter == nil then
_,b, limiter = strfind(usr.sMyInfoString,"L:(%x+)")
if limiter == nil then
_,b, limiter = strfind(usr.sMyInfoString,"U:(%x+)")
if limiter == nil or limiter == "*" then
limiter = "not limited"
end
end
end
if tonumber(limiter) ~= nil then
if strlen(limiter) > 4 then
limiter = limiter / 1024
end
user:SendPM(Bot, "upload limitado a: "..limiter.." Kb/s |")
end
--user:SendPM(Bot, "Velocidade de upload limiteda: "..limiter.." Kb/s |")
end
-- bandwidth download limiter
_,b, dlimiter = strfind(usr.sMyInfoString,"D:(%x+)")
if dlimiter ~= nil then
user:SendPM(Bot, "downloads limitados: "..dlimiter.." Kb/s |")
end
end
 

SMF spam blocked by CleanTalk