HOW-TO : Write your own Bot = Lesson 2 - Page 2
 

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

HOW-TO : Write your own Bot = Lesson 2

Started by pHaTTy, 12 October, 2003, 15:51:45

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

JueLz

The data arrival isnt working

Posted on: 13 November 2006, 13:45:07
Is it because i am using the last ptokax?
I am owner of the MzDistortion? Empire
the addy to my hub is mzdistortion.no-ip.org
____________________________________________
--=                        [HT 500]                          =--

TTB

Data Arrival is LUA4... The current PtokaX uses LUA 5.1...
TTB

(? ?.??.-> Admin @ Surfnet hubs <-.??.???)

Naithif

Yip these posts are rather old :)
Try this

function ChatArrival(user, data)
	local s,e,cmd = string.find(data, "%b<>%s+(%S+)(%S+)")
	if cmd == "!command" then

	--*define here what you want to happen when someone types the command, or filter it*

	end
end


Of course !command can be changed to anything  ;)
This example should be only for a command (!command), no extensions after it, if you want to know it, just ask

achiever

hi,

how do show a text file's data on some command input?

and plzz all lord scripters hold it a bit n give the newbe's time to lean n understand :P

thks,

achiever
thks,
achiever.

Naithif

Hi

Use PtokaX's inbuilt text file support, or if you need to do other things with that, you can find it in lesson 4 (as I remember)

Cheers

Herodes

Quote from: achiever on 14 November, 2006, 08:25:39
and plzz all lord scripters hold it a bit n give the newbe's time to lean n understand :P
Generally you strike the steel while it hot. In any case you can always read through the forums, threads posts as many times you want, to get the meaning and follow through... ;)

SMF spam blocked by CleanTalk