i need a small script
 

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

i need a small script

Started by Riouel, 13 December, 2003, 05:35:58

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Riouel

hi all

i need a script that pop up a new page for rules

this way all poeple who log will see it

thanx in advance

Riouel  8)

pHaTTy

Hi there,,

--mini onconect rules on request
--by phatty
--make a file in the scripts directory called rules.txt for your rules

Bot = "Wolf" 
RulesFile = "rules.txt"


function NewUserConnect(user)
	readfrom(RulesFile)
	while 1 do
		line = read("*a")
		if line == nil then
			break
		end
		user:SendData(Bot,line)
	readfrom()
	end
end

l8rr,,

-phatty
Resistance is futile!

turkiye


BlazeXxX

- Start Copying from here
- Scripted by BlazeX
- Requested By Riouel

Bot = "RulesBOT"
function Main()
frmHub:RegBot(Bot)
end

function NewUserConnected(curUser)
readfrom("rules.txt")
local message = ""
while 1 do
local line = read()
if (line == nil) then break else
message = message..line.."\r\n"
end
end
curUser:SendPM(Bot,message)
end
- Finish copying at this line

You need to have a text file called rules.txt in your scripts directory.. once u done that, restart ur scripts..

REMEBER: IT won't show the rules, if u are logged in as op ! so login as user, u will see it!

Cya!

c h i l l a

#4
just...  one thing I don't think its so great to have the hub read from disk everytime a user connects so I would do it like this actually

File = "File.txt"

function Main()
	rules = function ReadFile()
end

function NewUserConnected(curUser)
	curUser:SendData(rules)
end

function ReadFile()
	local handle = openfile("txt/"..File, "r")
	if handle then
		local contents = gsub(read(handle, "*a"),strchar(10), "\r\n")
		closefile (handle)
		return contents
	end
end

BlazeXxX

1 + 4 = 5
2 + 3 = 5

Does the same job, hehe.. kidding ;) will try that one and see how effective it is :D

Riouel

THANX BlazeXxX  ;)

I WORK LIKE I WANT

I REALLY APRECIATE IT

Riouel  :D

pHaTTy

QuoteOriginally posted by (uk-kingdom)pH?tt?
Hi there,,

--mini onconect rules on request
--by phatty
--make a file in the scripts directory called rules.txt for your rules

Bot = "Wolf" 
RulesFile = "rules.txt"


function NewUserConnect(user)
	readfrom(RulesFile)
	while 1 do
		line = read("*a")
		if line == nil then
			break
		end
		user:SendData(Bot,line)
	readfrom()
	end
end

l8rr,,

-phatty

oops sorry i made one tiny little mistake, my head was spinning that night lol


--mini onconect rules on request
--by phatty
--make a file in the scripts directory called rules.txt for your rules

Bot = "Wolf" 
RulesFile = "rules.txt"


function NewUserConnected(user)
	readfrom(RulesFile)
	while 1 do
		line = read("*a")
		if line == nil then
			break
		end
		user:SendData(Bot,line)
	readfrom()
	end
end

so it does work :P
Resistance is futile!

SMF spam blocked by CleanTalk