PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: Tw?sT?d-d?v on 01 January, 2005, 18:48:14

Title: can some1 help plz!!!
Post by: Tw?sT?d-d?v on 01 January, 2005, 18:48:14
hi all,i was wandering if some1 coult alter this script 4 me, i would like it so that any messages that r sent can be saved into a txt folder


-----------------------------
-- PM - Spy - Bot
-----------------------------
-- Commands:
--
-- #spy - Add user to Spy - List
-- #rem - Del user from Spy - List
--
-- Set BotName
BotName = "jay"

-- Set HubOwner / The one going to spy
SpyName = "(uk)jay"

iSpy = {}

function DataArrival(sUser,sData)
   if strsub(sData, 1, 1) == "<" then
      local _,_,cmd,arg = strfind(sData, "%b<>%s+(%S+)%s*(.*)%|")
      if cmd == "#spy" and sUser.sName == SpyName then
         local _,_,nick = strfind(arg, "(%S+)")
         if nick then
            if GetItemByName(nick) then
               sUser:SendData(BotName, "User "..GetItemByName(nick).sName.." is added to Spy-List")
               iSpy[GetItemByName(nick).sName] = 1
            end
         end
         return 1
      elseif cmd == "#rem" and sUser.sName == SpyName then
         local _,_,nick = strfind(arg, "(%S+)")
         if nick then
            if iSpy[nick] then
               sUser:SendData(BotName, "User "..nick.." is deleted to Spy-List")
               iSpy[nick] = nil
            end
         end
         return 1
      end
   elseif strsub(sData, 1, 4) == "$To:" then
      local s,e,WhoTo,From,Msg = strfind(sData,"%$To:%s+(%S+)%s+From:%s+(%S+)%s+%$%b<>%s+(.*)%|")
      if iSpy[From] then
         SendPmToNick(SpyName, BotName, "From: "..From.." > "..Msg)
      end
   end
end
Title:
Post by: bastya_elvtars on 01 January, 2005, 19:57:34
separate files by usernames or what?
Title:
Post by: Tw?sT?d-d?v on 01 January, 2005, 20:18:55
opps  sorry(still got hangover)  yes plz m8 by username
Title:
Post by: bastya_elvtars on 02 January, 2005, 01:25:06
QuoteOriginally posted by (uk)jay
opps  sorry(still got hangover)  yes plz m8 by username

i agree with Mutor, and by username its not recommended as some usernames contain chars that make Windows filesystems mad.

If you use another way, it will crash Ptokax in 5 mins due to RAM usage.

PMSpying={

[(uk)jay]={"hi","can you gimme slot?"},

}

this kills PtokaX
Title:
Post by: Tw?sT?d-d?v on 02 January, 2005, 13:06:51
yes i totaly understand about PRIVATE, but my girlfriend as just recived an abusive pm from a user , all because she was d/l from him........   so all i was thinking of was a way to monitor somethin like this :)
Title:
Post by: bastya_elvtars on 02 January, 2005, 15:23:09
bad word scanner in PM? hmmmm... good
Title:
Post by: ??????Hawk?????? on 02 January, 2005, 15:23:44
why not just ban the user......

???????????????????????????

what are you going to do if you see an abbusive pm ???

Most  All-In  Scripts have a way of filtering bad words and acting in a way you choose  either by.

replacing the bad words for something less abbousive or disconnecting the user.

Save your b/w and  delete the script   leave pm's as Private..
Title:
Post by: Tw?sT?d-d?v on 02 January, 2005, 15:40:25
ok, advice taken and bot deleted, it was just an idea anyway.thx 4 the advice :)))

bad word scanner in pm!!!     is there such a script??
Title:
Post by: ??????Hawk?????? on 02 January, 2005, 15:47:57
hi m8  ...  

this is Possibly one of the best  stand alone ones ive Seen

Plops Word Replacer (http://www.plop.nl/ptokaxbots/Plop/word_replacer_1.1p.lua)
Title:
Post by: Tw?sT?d-d?v on 02 January, 2005, 15:57:06
hi, thx for that and thx again for all your advice :)))