PtokaX forum

Archive => Archived 5.0 boards => Request for scripts => Topic started by: [UK]Maccy-LPL on 08 June, 2005, 01:19:33

Title: Request - slot checker plus
Post by: [UK]Maccy-LPL on 08 June, 2005, 01:19:33
Can any brainbox help with a script that will check the number of hubs with the number of slots open and make sure that one extra slot is open compared to the number of hubs. i.e  4 hubs needs 5 slots open etc. I have set minslots to 2 with no maximum.
Maccy
Title:
Post by: Madman on 08 June, 2005, 01:41:46
Quick work before bedtime...
I think it's what you wanted... =)

-- SlotCheker
-- Made by Madman
-- Requested by [UK]Maccy-LPL

Bot = "SlotChecker"

function NewUserConnected(curUser)
if curUser.iHubs >= curUser.iSlots then -- If more hubs then slots, or hubs = slots
curUser:SendData(Bot, "You are in " ..curUser.iHubs.. " for that you need to open " ..(curUser.iHubs+1).. " slots") -- Tell user to open more slots
curUser:Disconnect() -- Disconnect
end
end

function MyINFOArrival(curUser, data)
if curUser.bConnected then -- If user connected
if not curUser.bOperator then -- If not op
if curUser.iHubs >= curUser.iSlots then -- If more hubs then slots, or hubs = slots
curUser:SendData(Bot, "You are in " ..curUser.iHubs.. " for that you need to open " ..(curUser.iHubs+1).. " slots")
curUser:Disconnect()
end
end
end
end
Title:
Post by: [UK]Maccy-LPL on 09 June, 2005, 12:47:33
Many thanks Madman, thats exactly what I wanted. I did have a try myself but got caught by the variables in the attempt !

Much appreciated
Title:
Post by: Madman on 09 June, 2005, 14:18:18
np =)