PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: Shurlock on 06 June, 2004, 04:56:53

Title: Consider OP's in slot check
Post by: Shurlock on 06 June, 2004, 04:56:53
I would very much appreciate the help of an expert on creating the following:

Should a new (even non-registered) user log on, I would like to consider that he/she will not be checked on the number of slots for those hubs in which he/she is OP.
After all, it would be like asking the busdriver if he has 'a ticket'.    :(

IF.... the user is also an OP, then the number of slots for the OP-hubs should be subtracted from the 'usual' number of slots.

I believe this could be a very 'honest' script. Not taking into account that some user might take the effort to open his own 3 hubs (fakes) just to eliminate the slot count.

Thanks in advance experts!  (Nah.... I mean it!!)
Title:
Post by: nErBoS on 06 June, 2004, 13:25:32
Hi,

I understood you don?t want to check the OPs from the other HUBs. You want to subtrate slot per hub right ????

Best regards, nErBoS
Title:
Post by: bastya_elvtars on 06 June, 2004, 13:55:35
I am interested in this too...
Title:
Post by: Shurlock on 06 June, 2004, 14:16:46
QuoteOriginally posted by nErBoS
Hi,

I understood you don?t want to check the OPs from the other HUBs. You want to subtrate slot per hub right ????

Best regards, nErBoS

Yes nErBoS, that's the idea.
'Outside' OP's should be granted the freedom to roam other hubs without having to open extra slots for the hub(s) they themselves are checking.

All other checks should remain normal of course.
Title:
Post by: Corayzon on 06 June, 2004, 14:31:33
makes sense to me =]
Title:
Post by: nErBoS on 06 June, 2004, 16:01:12
Hi,

Try this...

--Requested by Shurlock
--Made by nErBoS

sBot = "Slot Checker"

slotperhub = 1 --Slot that the user Must have per Hub

function Main()
frmHub:RegBot(sBot)
end

function NewUserConnected(user)
local s,e,unreg,reg,op = strfind(user.sMyInfoString, "H:(%x+)/(%x+)/(%x+)")
local s,e,slot = strfind(user.sMyInfoString, "S:(%x+)")
if (unreg ~= nil and reg ~= nil and op ~= nil and tonumber(unreg) ~= nil and tonumber(reg) ~= nil) then
local iHave = tonumber(unreg) + tonumber(reg)
if (slot < iHave*slotperhub) then
user:SendData(sBot, "You are in "..iHave.." Hubs, you must have "..slotperhub.." slots open per Hub.")
user:Disconnect()
end
end
end

Best regards, nErBoS
Title:
Post by: Shurlock on 06 June, 2004, 20:54:03
Thanks for a quick response nErBoS, but....

Am I right in believing that - using the 'and' statement - all 3 sorts of user  (Unreg, Reg and OP) must be other than nil before the script will work?
Title:
Post by: nErBoS on 06 June, 2004, 22:18:07
Hi,

Yes. Clients that don't have H:x/x/x on their tag will not be check by the script.

Best regards, nErBoS