PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: ??iV@???fK?? on 19 October, 2003, 09:59:37

Title: userhistory script
Post by: ??iV@???fK?? on 19 October, 2003, 09:59:37
Hi folks.

I am running ptokax 0.3.2.6 t4.
Its running good only i want a script who gives info about users who have been online but arent anymore.
At the moment i only got command userinfo when they are in the hub.
So i hope someone can help me with userhistory.

THNKS IN ADVANCE.
Title:
Post by: pHaTTy on 19 October, 2003, 10:07:00
Only way you cud do that is my storing the data on entering connections/users
Title:
Post by: pHaTTy on 19 October, 2003, 10:16:13
here is a little unfinished one i have quickly wrote



--KeikoLastSettingBot by Phatty
--v1.00

Bot = "Keiko"

function NewUserConnected(user)
if (strfind(user.sMyInfoString," _,b, dcgui = strfind(user.sMyInfoString,"V:0.(%x+.%x+)")
elseif (strfind(user.sMyInfoString,"<+")) then
if strfind(user.sMyInfoString," clienttype = "oDC"
elseif strfind(user.sMyInfoString,"V:0.%x+%a") then
clienttype = "czdc++"
elseif strfind(user.sMyInfoString,"L:") or strfind(user.sMyInfoString,"B:") then
clienttype = "bcdc++"
else
clienttype = "dc++"
end
_,b, dcver = strfind(user.sMyInfoString,"V:0.(%x+)")
end

if strfind(user.sMyInfoString,"M:A") then
mode = "active"
else
mode = "pasive"
end


appendto(user.sName..".txt")
write("At "..date("%d").."/"..date("%m").."-"..date("%Y").." "..date("%T").." "..user.sName.." enters the Hub with IP: "..user.sIP.." with client version "..user.iVersion.." and type: "..clienttype.." and was in mode: "..mode..".\r\n")
writeto()
user.sName(Bot,"You have been logged for server safety")
end



l8rr,,

-phatty
Title:
Post by: MrZ on 19 October, 2003, 10:20:16
Hia:))

This have been ansvered b4 :)) but il do it once again.

I use "logger-v.2.58" from C H I L L E R.. Its just Gooood

http://chiller3000.tripod.com/p-scripts/ (http://chiller3000.tripod.com/p-scripts/)  



Z ya
Title:
Post by: pHaTTy on 19 October, 2003, 10:25:34
hmmm damn logger does that :( lol

oh well


--KeikoLastSettingBot by Phatty
--v1.00

Bot = "Keiko"

mcmd = "#"

function NewUserConnected(user)
if (strfind(user.sMyInfoString," _,b, dcgui = strfind(user.sMyInfoString,"V:0.(%x+.%x+)")
elseif (strfind(user.sMyInfoString,"<+")) then
if strfind(user.sMyInfoString," clienttype = "oDC"
elseif strfind(user.sMyInfoString,"V:0.%x+%a") then
clienttype = "czdc++"
elseif strfind(user.sMyInfoString,"L:") or strfind(user.sMyInfoString,"B:") then
clienttype = "bcdc++"
else
clienttype = "dc++"
end
_,b, dcver = strfind(user.sMyInfoString,"V:0.(%x+)")
end

if strfind(user.sMyInfoString,"M:A") then
mode = "active"
else
mode = "pasive"
end


appendto(user.sName..".txt")
write("At "..date("%d").."/"..date("%m").."-"..date("%Y").." "..date("%T").." "..user.sName.." enters the Hub with IP: "..user.sIP.." with client version "..user.iVersion.." and type: "..clienttype.." and was in mode: "..mode..".\r\n")
writeto()
user.sName(Bot,"You have been logged for server safety")
end

function WhileRead(user,str)
while 1 do
line = read()
if line == nil then break end
user:SendPM(Bot,line)
end
readfrom()
end

function DataArrival(user,data)
if strsub(data, 1, 1) == "<" then
data=strsub(data,1,strlen(data)-1)
s,e,cmd,str = strfind(data,"%b<>%s+(%S+)%s+(%S+)")

if cmd == mcmd.."check" then
if user.bOperator then
readfrom(str..".txt")
if str == nil then
user:SendData(Bot,"There has been no such user here")
return 1
else
WhileRead(user,str)
return 1
end
end
end
end
end


lol

-phatty
Title:
Post by: ??iV@???fK?? on 19 October, 2003, 10:50:07
Thanks for the advice i will try both scripts!!!
Title:
Post by: ??iV@???fK?? on 19 October, 2003, 11:03:29
Oke i have read "logger-v.2.58" from C H I L L E R script.
My problem is that all the commands have to be with ! in front cause my securityscript wont allow other scripts to use prefix +.
Can i just change the ini files where the commands are in or do i have to do more changings.

Also all kick and ban commands writen in the script are diffrent then my commands!!!
Could i simply change them???
Title:
Post by: Alexei on 19 October, 2003, 11:36:17
Well..as far as i can tell.. its easy to change...

If there is nowhere Prefix == "!" line then all commands must be in that format -- cmd == "!view"so just change ! to whatever u want to...

I might've wrote it hard to understand... just ask for better explanation and i will... try.. ;)
Title:
Post by: ??iV@???fK?? on 19 October, 2003, 11:47:30
Oke i changed prefix and commands now i get pm from bot saying users arent logged????
Is that good or shouldt that be else way??
Title:
Post by: Alexei on 19 October, 2003, 12:29:28
could be both  8o
Title:
Post by: ??iV@???fK?? on 19 October, 2003, 13:03:59
Damn script wont work it logs users but when i try !userinfo on a users wich is logged but not in hub anymore .
Then there wont happen a thing
Title:
Post by: Alexei on 19 October, 2003, 14:40:32
I cant do anything without seeing WHAT u've changed there...You might've done smth wrong....
Title:
Post by: c h i l l a on 19 October, 2003, 19:01:23
just one thing.

if you use !userinfo as command the the ptokax command will be disabled.

and you can't change the  ban function in the script cause it has non ;).
it only checks the ban commands from ptokax so that nobody can kick somebody who is in the same or higher ranke then oneself. and logs attemps and successfull ban's.
Title:
Post by: ??iV@???fK?? on 19 October, 2003, 20:11:54
So chilla.

If i understand it right i dont have to change a thing to get it work??

If i dont change for example +userinfo into !userinfo
then the + command wont work cause my securityscript wont let me use oher +commands then listed in security script