I got the easy parts of the conversion, but its the logic portion I have no idea what to do...
DCH script
Code: Select all
BotName = "RedirectLogger"
function DataArrival(curUser, data)
if( strsub(data, 1, 12) == "$ForceMove" ) then
local function send( client )
client:privateMessage( totalmsg, BotName )
end
local name = client:getNick()
local ip = client:getIp()
if not name then name = "(unknown)" end
if not ip then ip = "(unknown)" end
totalmsg = ""..name.." from "..ip.." was Redirected because "..reason..""
dchpp.foreach( send )
end
endPtokax Script
Code: Select all
-- Redirect Logger
-- A little script for logging the redirect-action in hub.
-- Who (with IP-number) is redirecting who, and where to.
-- Can be used to reveal unhonest OP's.
-- Redirect Logger-Script by VidFamne ( 11.04.2003 )
botname="RedirectLog"
file = "RedirectLog.txt"
function Main()
--frmHub:RegBot(botname)
end
function DataArrival(curUser, sData)
if ( strsub(sData, 1, 12) == "$OpForceMove" ) then
s,e,name = strfind(sData,"$Who:([^$]+)")
s,e,where = strfind(sData,"$Where:([^$]+)")
Time = date()
appendto(file)
write(Time, "\t" ..curUser.sName.." with IP; "..curUser.sIP.." has redirect "..name.." to: "..where.." \r\n")
writeto()
end
end