-------------------------------------------------------------------------------- -- !report user script By Skrollster 19-June 2003 botname = "Reporter" -- don't use spaces function Main() frmHub:RegBot(botname) end function DataArrival(user, data) if(strsub(data, 1, 4) == "_To:") then data=strsub(data,1,strlen(data)-1) s,e,whoTo = strfind(data,"_To:%s+(%S+)") if (whoTo == botname) then s,e,cmd = strfind(data,"%b<>%s+(%S+)") commands(user, data, cmd) end elseif (strsub(data, 1, 1) == "<") then data=strsub(data,1,strlen(data)-1) s,e,cmd = strfind(data,"%b<>%s+(%S+)") commands(user, data, cmd) end end function commands(user, data, cmd) if strsub(cmd, 1, 1 ) == "?" or strsub(cmd, 1, 1 ) == "" then cmd = strlower(strsub(cmd,2,strlen(cmd))) if cmd == "report" then s,e,faker,reason = strfind(data,"%b<>%s+%S+%s+(%S+)%s+(.*)") if GetItemByName(faker) then reported = GetItemByName(faker) local f = appendto("report.txt") write(date("%c") .. "<" .. user.sName .. "> has reported: " .. faker .. " the reason was: " .. reason .. " The users InfoString was; " .. reported.sMyInfoString .. " his version was: " .. reported.iVersion .. "\r\n") closefile(f) else user:SendData(botname, "the user you have reported isn't online, check spelling") end end end end --------------------------------------------------------------------------------