PtokaX forum

Archive => Archived 4.0 boards => Finished Lua 4 scripts => Topic started by: OpiumVolage on 10 October, 2003, 23:50:30

Title: Ask for a password to enter the hub.
Post by: OpiumVolage on 10 October, 2003, 23:50:30
tabValidate = {}

function Main()
frmHub:EnableFullData(1)
SetTimer(1000)
StartTimer()
end

function DataArrival(user, data)
if not user.bOperator then
if strfind(data, "^%$ValidateNick") then
user:SendData("$GetPass|")
tabValidate[user.sName] = Clock()
return
end
if tabValidate[user.sName] then
if strfind(data, "^$MyPass") then
local _, _, Pass = strfind(data, "%s+(%S+)%s*|")
if Pass == "PassWord" then
user:SendData("$LogedIn|")
return
end
user:SendData("$BadPass|")
user:Disconnect()
end
end
end
end

function OnTimer()
for id, value in tabValidate do
if (tabValidate[id] + 3) > Clock() then tabValidate[id] = nil end
end
end
Title:
Post by: RiPOFF on 20 October, 2003, 23:10:46
i tested this one time and it didnt seem to work
Title:
Post by: OpiumVolage on 21 October, 2003, 09:39:02
Could you explain what didn't work, you dc client isn't asking you for a password?
Title:
Post by: BlazeXxX on 21 October, 2003, 11:58:17
Hi OpiumVolage,
Does it work on IceCube versions as well ?
Title:
Post by: OpiumVolage on 21 October, 2003, 12:08:52
Expect the unneeded frmHub:EnableFullData(1) in code for IceCube, i think that yes.
Title:
Post by: BlazeXxX on 21 October, 2003, 12:10:50
OK thanks buddy ;) Will try that :)
Title:
Post by: RiPOFF on 21 October, 2003, 23:04:28
it kinda does, wait and ill explain
Title: Clock
Post by: BrokenBrick on 21 December, 2003, 00:48:15
I get the repated message that 'Clock is a nil value, perhaps because I am using TD4.  Can I just remove the clock function?
Title:
Post by: kepp on 11 January, 2004, 18:34:22
Try to change Clock() to lowercase letters only
Title:
Post by: Pinguin on 16 January, 2004, 18:00:29
It doesn't ask me for a password. What have I to do?

thx