PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: exlepra on 07 November, 2004, 15:27:37

Title: Simple max slot checker by conn type
Post by: exlepra on 07 November, 2004, 15:27:37
Hi, Im looking for a simple script for max slot check. Yes max and not min :-)  cos I perefer speed in my hub and not a lot of .5k downloads.

I mean like DSL max 4 slots, Cable max 8 slots, LAN max 30 slots (but I might not need the lan part cos max slots in hubsoft is already set to 30.

hub: 0.3.3.0 build 15.25

Hubsoft takes care of hub slot ratio already.

Thanks in advance


Title:
Post by: exlepra on 08 November, 2004, 10:23:46
Thank you,  it is working properly, just had to change:

if (tonumber(slots)< tonumber(Slot)) then

to

if (tonumber(slots)<= tonumber(Slot)) then

One last thing, how the user who opens more slots after succesfull entry can be kicked automatically?
Title:
Post by: bastya_elvtars on 08 November, 2004, 11:12:16
QuoteOriginally posted by exlepra
One last thing, how the user who opens more slots after succesfull entry can be kicked automatically?

it is starting with:

function DataArrival(user,data) -- fired when data arrives 2 ptokax
if strsub(data, 1, 7) == "$MyINFO" then -- if starts with
if user.sMyInfoString and strlen (user.sMyInfoString) > (strlen(user.sName)+13) then -- see if user is still online and its a proper myinfo (TD4)
-- etc.
Title:
Post by: exlepra on 10 November, 2004, 15:36:12
Thanks Mutor, it seems to be working properly.
Small change in the lan connection type:

["LAN(T1)"] =
["LAN(T3)"] =