problem with lua script

Asked by Vladimir

So i wrote a small script which blocking multi connect ..so only 1nick = 1 ip

local Exc ={ -- таблица исключений.
 ["[INT]district"] = true,
 ["nick"] = true,
}

function ValidateNickArrival(tUser)
 if not Exc[tUser.sNick] then
  for _,v in pairs(Core.GetOnlineUsers()) do
   if v.sIP==tUser.sIP then
    Core.SendToUser(tUser,"1NICK-1IP")
    Core.Disconnect(tUser)
   end
  end
 end
end
NewUserConnected=ValidateNickArrival
UserConnected=ValidateNickArrival
RegConnected=ValidateNickArrival
OpConnected=ValidateNickArrival

when i open the second dc client... hub all time write me 1NICK-1IP (it's ok) . BUT when a close my first client ...the second client not connected ....and wrote me 1NICK-1IP ... 1NICK-1IP ...where is my mistake ??? how to enter =)

Question information

Language:
English Edit question
Status:
Answered
For:
ADCH++-PtokaX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Vladimir (ludoed66) said :
#1

so and what about real working anti advertizing script (scanning pm and main chat)

Revision history for this message
Launchpad Janitor (janitor) said :
#2

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
poy (poy) said :
#3
Revision history for this message
poy (poy) said :
#4

is that the whole script? i can't see where the Exc table is managed (entries added / removed from it).

regarding chat anti-advertizing, you have 2 choices: the regexp chat filter provided by ADCH++ scripts (+banmsgre command) or finding a suitable PtokaX script (<http://board.ptokax.ch/> is a good place for that).

Can you help with this problem?

Provide an answer of your own, or ask Vladimir for more information if necessary.

To post a message you must log in.