Speak in name of bot
 

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

Speak in name of bot

Started by Leun, 19 September, 2005, 19:07:08

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Leun

I wanne try change this script , into a script were user can speak in name of bot.
So I thought I get this script, remove the users and script is finnished.


So if a user typed      !bot asdfa
then in main: asdfa

But I do something wrong...
Can someone help me.

This is what I got:
-- pm-to by ??????Hawk??????
-- simple pm to bot 
-- 28-01-2005
--## Converted in LUA 5 by 6Marilyn6Manson6 at 06/05/2005
-- Command   !bot     


bot = "PM-to"
function Main()
	frmHub:RegBot(bot)
end

function ChatArrival(user, data)
	
		data = string.sub(data, 1, (string.len(data)-1))
		local s,e,command,msg = string.find(data, "%b<>%s+(%S+)%s*(.*)")
			if command == "!bot"  then 
				if msg ~= nil then
					user:SendData(Bot, ""..bot.." "..msg)
					return 1
				else
					user.SendData(bot,"Command is !bot [user] [text]")
					return 1
				end 
       			end
	end
 

Madman

-- pm-to by ?˜”??•Hawk•??”˜?
-- simple pm to bot 
-- 28-01-2005
--## Converted in LUA 5 by 6Marilyn6Manson6 at 06/05/2005
-- Command   !bot     

bot = "PM-to"
function Main()
	frmHub:RegBot(bot)
end

function ChatArrival(user, data)
	data = string.sub(data, 1, (string.len(data)-1))
	local s,e,command,msg = string.find(data, "%b<>%s+(%S+)%s*(.*)")
	if command == "!bot" then 
		if msg ~= nil then
			user:SendData(bot, msg)
			return 1
		else
			user:SendData(bot,"Command is !bot [text]")
			return 1
		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

Leun

Thnx Madman,

That was easier as I thought  :D
Next time I will look better.

SMF spam blocked by CleanTalk