Request - slot checker plus
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

Request - slot checker plus

Started by [UK]Maccy-LPL, 08 June, 2005, 01:19:33

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

[UK]Maccy-LPL

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
Estne volumen in toga, an solum tibi libet me videre?  
 GayMacUk DC http://macdrew.no-ip.org

Madman

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
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

[UK]Maccy-LPL

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
Estne volumen in toga, an solum tibi libet me videre?  
 GayMacUk DC http://macdrew.no-ip.org

Madman

We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

SMF spam blocked by CleanTalk