PtokaX forum

Archive => Archived 5.0 boards => Finished Scripts => Topic started by: badtrip on 19 September, 2005, 22:19:22

Title: nead a script
Post by: badtrip on 19 September, 2005, 22:19:22
hello,


i nead a script to save users and ip?s from the hub


it?s like this -> run !savedbase   and  the script
save all the users nicks and ip?s from the hub

tks
Title:
Post by: Psycho_Chihuahua on 19 September, 2005, 22:29:08
I think the IPLog has been made already --> try the (//./images/style/top_suche.gif) (http://board.univ-angers.fr/search.php) Button
Title:
Post by: badtrip on 20 September, 2005, 22:58:41
-- IPLogBot by Cane
-- Small edit by Loop

botName="iplog"
onoff = 1

txt = ("iplog.txt")

function Main()
--frmHub:RegBot(botName)
end

function NewUserConnected(curUser)
if onoff then
appendto(txt)
if curUser.iProfile == -1 then
profile = "User"
else
profile = GetProfileName(curUser.iProfile)
end
write("At "..date("%d").."/"..date("%m").."-"..date("%Y").." "..date("%T").." "..profile.." "..curUser.sName.." enters the Hub with IP: "..curUser.sIP..".\r\n")
writeto()
end
end

function OpConnected(curUser)
if onoff then
appendto(txt)
write("At "..date("%d").."/"..date("%m").."-"..date("%Y").." "..date("%T").." "..GetProfileName(curUser.iProfile).." "..curUser.sName.." enters the Hub with IP: "..curUser.sIP..".\r\n")
writeto()
end
end

function DataArrival(user,data)

if strsub(data, 1, 1) ~= "$" and strfind(data, "%> %#") then
cmd = strsub(data, strfind(data, "%> %#")+2, -2)

if user.bOperator then

if (cmd=="#showiplog") then
doiplog(user,data)
return 1

elseif (cmd=="#deliplog") then
dodeliplog(user)
return 1

elseif (cmd=="#logon") then
onoff = 1
user:SendData(botName,"Iplog is set to on")
return 1

elseif (cmd=="#logoff") then
onoff = nil
user:SendData(botName,"Iplog is set to off")
return 1



--helpfile in pm
elseif (cmd=="#iphelp") then
SendPmToNick(user.sName,botName," Ip log help!")
SendPmToNick(user.sName,botName,"")
SendPmToNick(user.sName,botName,"#showiplog - shows the ip log in pm")
SendPmToNick(user.sName,botName,"#deliplog - deletes the ip log")
SendPmToNick(user.sName,botName,"#logon - command to set the log on")
SendPmToNick(user.sName,botName,"#logoff - command to set the log off")
SendPmToNick(user.sName,botName,"#iphelp - this help-file in pm")
SendPmToNick(user.sName,botName,"")
SendPmToNick(user.sName,botName," end!")
return 1

end
end
end
end


function doiplog(user,data)
readfrom(txt)
local message = ""
while 1 do
local line = read()
if line == nil then break
else
message = message..line.."\r\n"
end
end
user:SendPM(botName,message)
end




function dodeliplog(user)
writeto(txt)
write("")
writeto()
user:SendData(botName,"Log is del!.")
end


this iplog is in lua4 but a need a iplog to save ip?s and nick in a txt file ....

help me plz
Title: Hi Bad
Post by: MDFP on 20 September, 2005, 23:10:13
Have you Tryed Robocop?
dont needs separate logs



(http://img296.imageshack.us/img296/4725/gatomaluco5pg.jpg)
Title:
Post by: badtrip on 25 September, 2005, 22:19:13
Taks My Master  Mutor   :))  :))