Author Topic: HOW-TO : Write your own Bot = Lesson 2  (Read 11600 times)

0 Members and 1 Guest are viewing this topic.

Offline JueLz

  • Double Ace
  • *
  • Posts: 103
  • Karma: +8/-14
  • HT 500
Re: HOW-TO : Write your own Bot = Lesson 2
« Reply #25 on: 13 November, 2006, 14:48:45 »
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]                          =--

PtokaX forum

Re: HOW-TO : Write your own Bot = Lesson 2
« Reply #25 on: 13 November, 2006, 14:48:45 »

Offline TTB

  • Lord
  • ***
  • Posts: 436
  • Karma: +17/-1
Re: HOW-TO : Write your own Bot = Lesson 2
« Reply #26 on: 13 November, 2006, 15:09:49 »
Data Arrival is LUA4... The current PtokaX uses LUA 5.1...
TTB

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

Offline Naithif

  • Triple Ace
  • **
  • Posts: 199
  • Karma: +32/-13
Re: HOW-TO : Write your own Bot = Lesson 2
« Reply #27 on: 13 November, 2006, 15:14:36 »
Yip these posts are rather old :)
Try this

Code: [Select]
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

Offline achiever

  • Lord
  • ***
  • Posts: 260
  • Karma: +25/-22
Re: HOW-TO : Write your own Bot = Lesson 2
« Reply #28 on: 14 November, 2006, 08:25:39 »
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.

Offline Naithif

  • Triple Ace
  • **
  • Posts: 199
  • Karma: +32/-13
Re: HOW-TO : Write your own Bot = Lesson 2
« Reply #29 on: 14 November, 2006, 09:26:12 »
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

  • Guest
Re: HOW-TO : Write your own Bot = Lesson 2
« Reply #30 on: 14 November, 2006, 13:09:54 »
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... ;)

PtokaX forum

Re: HOW-TO : Write your own Bot = Lesson 2
« Reply #30 on: 14 November, 2006, 13:09:54 »