PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: NemeziS on 23 September, 2004, 17:48:12

Title: NickAbuse !me messages..
Post by: NemeziS on 23 September, 2004, 17:48:12
Hello!

I'm using this NickAbuse script.
function DataArrival(user, data)

if strsub(data,1,1) == "<" then

data=strsub(data,1,strlen(data)-1)

s,e,cmd,Name,rsn = strfind(data,"%b<>%s+(%S+)%s+(%S+)%s+(.*)")

if user.iProfile == 0 then



if (cmd=="+say") or (cmd=="!say") or (cmd=="?say") then

SendToAll(Name, rsn) return 1



elseif (cmd=="+saypm") or (cmd=="!saypm") or (cmd=="?saypm") then

s,e,cmd,to,from,msg = strfind(data,"%b<>%s+(%S+)%s+(%S+)%s+(%S+)%s+(.*)")

SendPmToNick(to,from,msg) return 1

end

end

end

end


I also wanted to make messages like !me from selected user.
Example: I'm writing !sayme Puma lol lol lol
then in main appears

[19:47] * Puma  lol lol lol

What lines should I add to my script to enable this function?
Title:
Post by: BottledHate on 24 September, 2004, 00:30:14
function DataArrival(user, data)
   if strsub(data,1,1) == "<" then
      data=strsub(data,1,strlen(data)-1)
      s,e,cmd,Name,rsn = strfind(data,"%b<>%s+(%S+)%s+(%S+)%s+(.*)")
      if user.iProfile == 0 then
         if (cmd=="+say") or (cmd=="!say") or (cmd=="?say") then
            SendToAll(Name, rsn) return 1
         elseif (cmd=="+saypm") or (cmd=="!saypm") or (cmd=="?saypm") then
            s,e,cmd,to,from,msg = strfind(data,"%b<>%s+(%S+)%s+(%S+)%s+(%S+)%s+(.*)")
            SendPmToNick(to,from,msg) return 1
         elseif cmd =="!sayme" or cmd == "+sayme" or cmd == "?sayme" then
            if not user.bOperator then return end --//remove this line if you want non ops to use the command.
            Name = Name or ""
            rsn = rsn or ""
            SendToAll("* "..Name.." "..rsn)
            return 1
         end
      end
   end
end


:D

-BH
Title:
Post by: D-J Valhala on 24 September, 2004, 00:37:47
hehehehehehehe cool script i love it LoL  :D
Title:
Post by: NemeziS on 24 September, 2004, 14:27:07
Thanx! :)