Convert lua 5
 

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

Convert lua 5

Started by ?[-?Genius?-]?, 11 January, 2007, 13:48:37

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

?[-?Genius?-]?

HI

I need help plz

plz convert this script for ptokax 0.3.5.2

--=[ Nome dos Bots ]=-

BotName = "??ec?rit?-??t?"

	--=[ Comandos ]=-

Files = {
["!regras"] = "SD/regras.txt",
["!rules"] = "SD/regras.txt",
["!regras2"] = "SD/regras2.txt",
}

	--=[ C?digo ]=-

function ChatArrival(user, data)
	s,e,msg = string.find(data, "%b<> ([ -z]*)")
	for key, value in Files do
		if( string.find( string.lower(msg), key) ) then
			txtToShow, x = string.gsub(value, "%b[]", user.sName)
			SendToAll(BotName, teste)
			Show(user, TheFile)
			SendToAll(BotName, teste)
			return 1
		end
	end
end

function Show(user, TheFile)
	local file = io.input(txtToShow)
	local line = io.read("*a")
		msg = msg.."\r\n"..line.."\r\n"
	user:SendPM(BotName, msg)
	file:read()
	file:close()
end

Herodes

You don't need a conversion on this script. Just enable the textfile support.
HINT: Examine the GUI of PtokaX search around, you'll find it ;)

?[-?Genius?-]?


jay-dee

--convert to LUA 5.1

--=[ Nome dos Bots ]=-

BotName = "??ec?rit?-??t?"

	--=[ Comandos ]=-

Files = {
["!regras"] = "SD/regras.txt",
["!rules"] = "SD/regras.txt",
["!regras2"] = "SD/regras2.txt",
}

	--=[ C?digo ]=-

function ChatArrival(user, data)
	s,e,msg = string.find(data, "%b<> ([ -z]*)")
	for key, value in pairs(Files) do
		if( string.find( string.lower(msg), key) ) then
			txtToShow, x = string.gsub(value, "%b[]", user.sName)
			SendToAll(BotName, teste)
			Show(user, TheFile)
			SendToAll(BotName, teste)
			return 1
		end
	end
end

function Show(user, TheFile)
	local file = io.input(txtToShow)
	local line = io.read("*a")
		msg = msg.."\r\n"..line.."\r\n"
	user:SendPM(BotName, msg)
	file:read()
	file:close()
end
"i was born house- i will die house"

SMF spam blocked by CleanTalk