Development Section > HOW-TO's

HOW-TO : Write your own Bot = Lesson 3

(1/14) > >>

pHaTTy:
Lesson 3 ;)
Blocking the inbuilt functions,
Blocking the functions is using the data arrival as the data is arriving
example

function DataArrival(user,data)
   if (strfind(data, "$Kick")) then
   return 1
   end
end


the above will block kick, but remember it will on block the inbuilt right click
blocking a scripted kick is alot different, anyways, try and stop ban by yourself ;)
hint, it can be accomplished by blocking !ban


Start Learning now.......;)
Ok i have wrote a little task, i am gonna write a script then brake it so it doesnt work...
Then i want you to try fix it and post back, i will make it simple(only newbies please) ;)


--- Code: ---Bot = Keiko

Main()
frmHub:RegBotName()
end

function NewUserConnected()
SendToAll ("A User has connected)
end

function OpConnected()
sendtoall("A Op has entered")
end

function Data Arrival(CurUser,data)
if strsub(data, 1, 1) == "

raz:
first mistake is u don't have a version. e.g. version = "0.2 by ".

Main()
frmHub:RegBotName()
end

the second is dat u can't start a script wid main u need 2 have function in front of it. e.g. functionMain(), and u can't have reg bot name because that won't know the name of the bot. so u will have 2 take "Name" off and put "bot" in brackets.e.g.


function Main()
frmHub:RegBot(Bot)
end

pHaTTy:
yep thats it ur getting there, now for the rest, keep going :) wd

there is 2 more mistakes ;)

Skrollster:
A realy good example, i think i'll have to write a lesson later on, then it get more complex ( then i get my comp up and running that is, i guess it has got quite complex by then)

:)

pHaTTy:
hehehe :o)

Navigation

[0] Message Index

[#] Next page

Go to full version